public async void SendData(Command command) { try { var bytes = _commandParser.ToBytes(command); _dataWriter.WriteBytes(bytes); uint result = await _dataWriter.StoreAsync(); await _dataWriter.FlushAsync(); } catch (Exception) { } }
private void _commandBuffer_OnCommandAssembled(Command cmd) { CommandReceived(this, new CommandEventArgs(cmd)); }
public byte[] ToBytes(Command command) { return ToBytes(command.Name, command.Data); }