Beispiel #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());
        }
Beispiel #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());
        }
Beispiel #3
0
 public Command(Channel channel, CommandBytes commandBytes)
 {
     this.commandBytes = commandBytes;
     this.channel      = channel;
 }
Beispiel #4
0
 public async Task SendEmergencyCommand(CommandBytes command)
 {
     await EmergencyChannel.SendData(command);
 }
Beispiel #5
0
 public async Task SendSimpleCommand(CommandBytes command)
 {
     await SimpleChannel.SendData(command);
 }