/// <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); }
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); }
/// <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> /// <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); }
/// <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); }
public bool TryGroupCommand(InsteonControllerGroupCommands command, byte group, byte data) { return(Network.Controller.TryGroupCommand(command, group, data)); }
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> /// <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; }