public async Task <bool> ControlRelay(int deviceNumber, int itemCount, int relayNumber, RelayStatus relayStatus) { var sendCommand = new ControlRelayStatusCommand(deviceNumber, relayNumber, relayStatus, itemCount); var tlAutoDeviceSerialPortAsync = new TLAutoDeviceSerialPortAsync <bool>(this, sendCommand, null); await tlAutoDeviceSerialPortAsync.InvokeAsync(); return(true); }
public virtual async Task <bool> ControlRelay(int deviceNumber, int itemCount, int relayNumber, RelayStatus relayStatus) { var sendCommand = new ControlRelayStatusCommand(deviceNumber, relayNumber, relayStatus, itemCount, _hasControlRelayResultStatus); var tlAutoDeviceSerialPortAsync = new TLAutoDeviceSerialPortAsync <bool>(TLAutoDeviceSerialPort, sendCommand, null); var result = await tlAutoDeviceSerialPortAsync.InvokeAsync(); if (_hasControlRelayResultStatus) { return(result); } return(true); }