Пример #1
0
 /// <summary>
 /// Sends an INSTEON group broadcast command to the controller.
 /// </summary>
 /// <param name="command">Specifies the INSTEON controller group command to be invoked.</param>
 /// <param name="group">Specifies the group number for the command.</param>
 /// <param name="value">A parameter value required by some group commands.</param>
 /// <remarks>
 /// This method does not throw an exception.
 /// This is a non-blocking method that sends an INSTEON message to the target device and returns immediately.
 /// A <see cref="InsteonDevice.DeviceStatusChanged">DeviceStatusChanged</see> event will be invoked for each INSTEON device linked within the specified group that responds to the command.
 /// </remarks>
 public bool TryGroupCommand(InsteonControllerGroupCommands command, byte group, byte value)
 {
     byte cmd = (byte)command;
     byte[] message = { 0x61, group, cmd, value };
     Log.WriteLine("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
     return network.Messenger.TrySend(message) == EchoStatus.ACK;
 }
Пример #2
0
 /// <summary>
 /// Sends an INSTEON group broadcast command to the controller.
 /// </summary>
 /// <remarks>
 /// This is a non-blocking method that sends an INSTEON message to the target device and returns immediately.
 /// A <see cref="InsteonDevice.DeviceStatusChanged">DeviceStatusChanged</see> event will be invoked for each INSTEON device linked within the specified group that responds to the command.
 /// </remarks>
 /// <param name="command">Specifies the INSTEON controller group command to be invoked.</param>
 /// <param name="group">Specifies the group number for the command.</param>
 /// <param name="value">A parameter value required by some group commands.</param>
 public void GroupCommand(InsteonControllerGroupCommands command, byte group, byte value)
 {
     byte cmd = (byte)command;
     byte[] message = { 0x61, group, cmd, value };
     Log.WriteLine("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
     network.Messenger.Send(message);
 }
        /// <summary>
        /// Sends an INSTEON group broadcast command to the controller.
        /// </summary>
        /// <param name="command">Specifies the INSTEON controller group command to be invoked.</param>
        /// <param name="group">Specifies the group number for the command.</param>
        /// <param name="value">A parameter value required by some group commands.</param>
        /// <remarks>
        /// This method does not throw an exception.
        /// This is a non-blocking method that sends an INSTEON message to the target device and returns immediately.
        /// A <see cref="InsteonDevice.DeviceStatusChanged">DeviceStatusChanged</see> event will be invoked for each INSTEON device linked within the specified group that responds to the command.
        /// </remarks>
        public bool TryGroupCommand(InsteonControllerGroupCommands command, byte group, byte value)
        {
            byte cmd = (byte)command;

            byte[] message = { 0x61, group, cmd, value };
            Log.WriteLine("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
            return(network.Messenger.TrySend(message) == EchoStatus.ACK);
        }
        /// <summary>
        /// Sends an INSTEON group broadcast command to the controller.
        /// </summary>
        /// <remarks>
        /// This is a non-blocking method that sends an INSTEON message to the target device and returns immediately.
        /// A <see cref="InsteonDevice.DeviceStatusChanged">DeviceStatusChanged</see> event will be invoked for each INSTEON device linked within the specified group that responds to the command.
        /// </remarks>
        /// <param name="command">Specifies the INSTEON controller group command to be invoked.</param>
        /// <param name="group">Specifies the group number for the command.</param>
        /// <param name="value">A parameter value required by some group commands.</param>
        public void GroupCommand(InsteonControllerGroupCommands command, byte group, byte value)
        {
            byte cmd = (byte)command;

            byte[] message = { 0x61, group, cmd, value };
            Log.WriteLine("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
            network.Messenger.Send(message);
        }
Пример #5
0
        private byte[] CreateGroupMessage(InsteonControllerGroupCommands command, byte group, byte value)
        {
            var cmd = (byte)command;

            byte[] message = { (byte)InsteonModemSerialCommand.SendAllLinkCommand, group, cmd, value };
            logger.DebugFormat("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
            return(message);
        }
 private byte[] CreateGroupMessage(InsteonControllerGroupCommands command, byte group, byte value)
 {
     var cmd = (byte)command;
     byte[] message = { (byte)InsteonModemSerialCommand.SendAllLinkCommand, group, cmd, value };
     logger.DebugFormat("Controller {0} GroupCommand(command:{1}, group:{2:X2}, value:{3:X2})", Address.ToString(), command.ToString(), group, value);
     return message;
 }