Ejemplo n.º 1
0
        public async Task SendData(CommandBytes data)
        {
            data.CommandCounter = (byte)_counter;
            var buffer = data.GetCommandBytes().AsBuffer();
            // TODO: needs to be updated to current UWP10 api usage
            GattCommunicationStatus status = await Characteristic.WriteValueAsync(buffer, GattWriteOption.WriteWithoutResponse);

            _counter++;
            Log.Instance.LogCommandToDrone(typeof(Channel) + "", data.GetCommandBytes());
        }
Ejemplo n.º 2
0
        public async Task SendData(Guid service, Guid characteristicGuid, CommandBytes data)
        {
            var characteristicList = Characteristics[service.ToString()];
            var firstOrDefault     = characteristicList.FirstOrDefault(c => c.Uuid == characteristicGuid);

            var buffer = data.GetCommandBytes().AsBuffer();
            var status = await firstOrDefault.WriteValueAsync(buffer, GattWriteOption.WriteWithoutResponse);

            Debug.WriteLine(status.ToString());
        }
Ejemplo n.º 3
0
 public Command(Channel channel, CommandBytes commandBytes)
 {
     this.commandBytes = commandBytes;
     this.channel      = channel;
 }
Ejemplo n.º 4
0
 public async Task SendEmergencyCommand(CommandBytes command)
 {
     await EmergencyChannel.SendData(command);
 }
Ejemplo n.º 5
0
 public async Task SendSimpleCommand(CommandBytes command)
 {
     await SimpleChannel.SendData(command);
 }