[英]The UWP app does not work in “BluetoothCacheMode.Uncached” mode, it only works in “BluetoothCacheMode.Cached” mode, why?
[英]“await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached);” does not return anything
這行代碼不返回任何結果
GattReadResult result = await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached);
我已經通過這種方法找到了服務
GattDeviceServicesResult result = await bluetoothLeDevice.GetGattServicesForUuidAsync(new Guid("00001805-0000-1000-8000-00805F9B34FB"),BluetoothCacheMode.Cached);
並以此為特色
var result = await attributeInfoDisp.service.GetCharacteristicsForUuidAsync(new Guid("00002A2B-0000-1000-8000-00805F9B34FB"), BluetoothCacheMode.Cached);
和描述符
var result = await selectedCharacteristic.GetDescriptorsForUuidAsync(new Guid("00002902-0000-1000-8000-00805F9B34FB"), BluetoothCacheMode.Cached);
但是當我嘗試使用閱讀特征時
GattReadResult result = await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached);
我得到空結果
如何閱讀特征? 請幫忙
您的特征可讀嗎? 由於某種原因,它也可能無法與BluetoothCacheMode.Uncached一起使用。 嘗試使用BluetoothCacheMode.Cached。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.