public override async Task <uint> SendCommandAsync(RequestCommandsCode command) { uint sentMessageSize = 0; if (State != ConnectionState.Connected) { return(sentMessageSize); } if (writer != null) { writer.WriteBytes(command.GetCode()); await writer.StoreAsync(); //if ((command != RequestCommandsCode.TOVIVO) && (command != RequestCommandsCode.CONFIRMA_COMMAND)) //{ // Console.WriteLine("Data Sender: " + command + " Código: " + BitConverter.ToString(command.GetCode())); //} } else { OnExceptionOccuredEvent(this, new Communication.ErroEventArgs(DeviceErrorEnum.COMMUNICATION_PROBLEMS), null); Console.WriteLine("Communication error on sending command: " + command); } return(sentMessageSize); }
public static byte[] GetCode(this RequestCommandsCode code) { return(new byte[] { }); }
public abstract Task <uint> SendCommandAsync(RequestCommandsCode command);