Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static byte[] GetCode(this RequestCommandsCode code)
 {
     return(new byte[] { });
 }
Exemplo n.º 3
0
 public abstract Task <uint> SendCommandAsync(RequestCommandsCode command);