CommandStatus OnControl(ControlRelayOutputBlock command, ushort index, bool execute)
{
if (index == 0)
{
switch (command.code)
{
case (ControlCode.LATCH_ON):
if(execute) this.QueueOperation(true);
return CommandStatus.SUCCESS;
case (ControlCode.LATCH_OFF):
if (execute) this.QueueOperation(false);
return CommandStatus.SUCCESS;
default:
return CommandStatus.NOT_SUPPORTED;
}
}
else
{
return CommandStatus.NOT_SUPPORTED;
}
}