예제 #1
0
        ///////////////////////////////////////////////////////////////////////
        private void SendCommand_Async(InsteonCommand command)
        {
            _logger.Debug("queueing {0}", command);

            ThreadPool.QueueUserWorkItem(delegate {
                SendCommand_Sync(command);
            });
        }
예제 #2
0
 ///////////////////////////////////////////////////////////////////////
 public void Send(InsteonCommand command)
 {
     if (Settings.Default.SendAsync) {
         SendCommand_Async(command);
     } else {
         SendCommand_Sync(command);
     }
 }
예제 #3
0
        ///////////////////////////////////////////////////////////////////////
        private void SendDeviceCommand(InsteonCommand.Command action, int level)
        {
            var cmd = new InsteonCommand {
                Address = Address,
                Action = action,
                Level = level
            };

            Controller.Send(cmd);
        }
예제 #4
0
        ///////////////////////////////////////////////////////////////////////
        private void SendCommand_Sync(InsteonCommand command)
        {
            _logger.Info("send: {0}", command);

            _swatch.Clock(delegate {
                SendCommand(command);
            });

            _logger.Debug("{0} sent in {1} ms", command, _swatch.ElapsedMilliseconds);
        }
예제 #5
0
 ///////////////////////////////////////////////////////////////////////
 protected abstract void SendCommand(InsteonCommand cmd);