gpt4 book ai didi

uwp - 不断收到 BLE UWP Unreachable 错误

转载 作者:行者123 更新时间:2023-12-05 07:40:17 26 4
gpt4 key购买 nike

我一直在尝试使用 UWP 枚举和连接到 BLE 设备。我的 BLE 服务器是运行 Windows IOT 的 Raspberry Pi。
我在笔记本电脑上运行 BLE 客户端。但是,当我尝试枚举 Raspberry Pi 上的服务时,我通常会遇到无法访问的错误。在下面的代码中,serviceResult.Status 通常是无法访问的。 Raspberry PI 就放在我的笔记本电脑旁边。

        device = await BluetoothLEDevice.FromBluetoothAddressAsync(bleDeviceAddress);
GattDeviceServicesResult serviceResult = await device.GetGattServicesForUuidAsync(guid);
if (serviceResult.Status == GattCommunicationStatus.Success)

最佳答案

尝试未缓存模式:

GattDeviceServicesResult serviceResult = await bleDevice.GetGattServicesForUuidAsync(guid, BluetoothCacheMode.Uncached);

关于uwp - 不断收到 BLE UWP Unreachable 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46309195/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com