UWP Bluetooth APIとIndicateに問題がある場合、私は疑問に思っていました。 私がdocumentationを正しく理解するならば、UWPは受け取ったIndicateパッケージのAcknowledgementを処理します。 しかし何らかの理由で、サンプルコードはnotifysでは動作しますが、notでは動作しません。私はMyoリストバンドでこれを試しています。 私はnotify特性を介して通知を受け取ることができますが、通知特性を介して通知を受け取ることはできません。残念ながら、私は指示を使用する必要があります。 BLEはUWP GATTクライアントを示します
は、私はこれにサンプルコードを少し変更しましたが、動作していないその:GattCommunicationStatus status = await selectedCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
GattClientCharacteristicConfigurationDescriptorValue.Indicate);
if(status == GattCommunicationStatus.Success)
{
// Server has been informed of clients interest.
}
をし、ハンドラは同じまま:
characteristic.ValueChanged += Characteristic_ValueChanged;
// ...
void Characteristic_ValueChanged(GattCharacteristic sender,
GattValueChangedEventArgs args)
{
// An Indicate or Notify reported that the value has changed.
var reader = DataReader.FromBuffer(args.CharacteristicValue)
// Parse the data however required.
}
すべてのアイデアは、私が間違っているのでしょうか?デバイスが接続され、正しくプログラムされていれば、通知を送信します。任意の助けを事前に
おかげ
マルセル
うん、それを忘れてしまった。ありがとう – Marcel