/// <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);
        }
Пример #3
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);
        }
        /// <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>
        /// <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)
        {
            if (command == InsteonControllerGroupCommands.StopDimming)
            {
                return(false);
            }
            byte value = 0;

            if (command == InsteonControllerGroupCommands.On)
            {
                value = 0xFF;
            }
            return(TryGroupCommand(command, group, value));
        }
        /// <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>
        public void GroupCommand(InsteonControllerGroupCommands command, byte group)
        {
            if (command == InsteonControllerGroupCommands.StopDimming)
            {
                throw new ArgumentNullException();
            }
            byte value = 0;

            if (command == InsteonControllerGroupCommands.On)
            {
                value = 0xFF;
            }
            GroupCommand(command, group, value);
        }
Пример #6
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;
 }
Пример #7
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>
 /// <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)
 {
     if (command == InsteonControllerGroupCommands.StopDimming)
         return false;
     byte value = 0;
     if (command == InsteonControllerGroupCommands.On)
         value = 0xFF;
     return TryGroupCommand(command, group, value);
 }
Пример #8
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);
 }
Пример #9
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>
 public void GroupCommand(InsteonControllerGroupCommands command, byte group)
 {
     if (command == InsteonControllerGroupCommands.StopDimming)
         throw new ArgumentNullException();
     byte value = 0;
     if (command == InsteonControllerGroupCommands.On)
         value = 0xFF;
     GroupCommand(command, group, value);
 }
Пример #10
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)
 {
     network.Messenger.Send(CreateGroupMessage(command, group, value));
 }
Пример #11
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)
 {
     return(network.Messenger.TrySend(CreateGroupMessage(command, group, value)) == EchoStatus.ACK);
 }
Пример #12
0
 public bool TryGroupCommand(InsteonControllerGroupCommands command, byte group, byte data)
 {
     return(Network.Controller.TryGroupCommand(command, group, data));
 }
Пример #13
0
 private bool TryParseGroupCommand(string idText, out InsteonControllerGroupCommands command)
 {
     return(Enum.TryParse(idText, out command));
 }
 /// <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)
 {
     network.Messenger.Send(CreateGroupMessage(command, group, value));
 }
 /// <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)
 {
     return network.Messenger.TrySend(CreateGroupMessage(command, group, value)) == EchoStatus.ACK;
 }
 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;
 }