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

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

            Controller.Send(cmd);
        }
Example #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);
        }
Example #5
0
 ///////////////////////////////////////////////////////////////////////
 protected abstract void SendCommand(InsteonCommand cmd);