예제 #1
0
        /// <summary>
        /// Transmits the IR Code synchronously (blocking)
        /// </summary>
        public static void Transmit(string irCode, 
            UsbUirt.CodeFormat codeFormat,
            int repeatCount,
            TimeSpan inactivityWaitTime)
        {
            init();

            if (inactivityWaitTime == null)
            {
                inactivityWaitTime = TimeSpan.Zero;
            }

            _controller.Transmit(irCode, codeFormat, repeatCount, inactivityWaitTime);
        }
예제 #2
0
        public static void TransmitAsync(string irCode, UsbUirt.CodeFormat codeFormat, int repeatCount, TimeSpan inactivityWaitTime)
        {
            _controller.TransmitCompleted += new UsbUirt.Controller.TransmitCompletedEventHandler(Uirt_TransmitCompleted);

            try
            {
                init();

                if (inactivityWaitTime == null)
                {
                    inactivityWaitTime = TimeSpan.Zero;
                }

                _controller.Transmit(irCode, codeFormat, repeatCount, inactivityWaitTime);
            }
            catch
            {
                throw;
            }
            finally
            {
                _controller.TransmitCompleted -= new UsbUirt.Controller.TransmitCompletedEventHandler(Uirt_TransmitCompleted);
            }
        }
예제 #3
0
 //private static void Uirt_Received(object sender, UsbUirt.ReceivedEventArgs e)
 //{
 //}
 private static void Uirt_TransmitCompleted(object sender, UsbUirt.TransmitCompletedEventArgs e)
 {
 }