首页 > 解决方案 > MacOs BLE“不支持的描述符”

问题描述

我正在使用 macOS Big Sur 11.1 的 Mac mini 上使用 Qt 5.15.2 clang 64bit 为 MacO 开发应用程序。

我正在尝试运行心率服务器示例(示例页面的链接),但我遇到了一些问题。当我使用调试器运行应用程序时,我得到以下应用程序输出:

2021-07-22 16:22:03.774769+0200 heartrate-server[43797:13434312] [qt.bluetooth.osx] unsupported descriptor "{00002902-0000-1000-8000-00805f9b34fb}"
2021-07-22 16:22:03.775480+0200 heartrate-server[43797:13434385] [CoreBluetooth] WARNING: <CBPeripheralManager: 0x100a17a80> has no restore identifier but the delegate implements the peripheralManager:willRestoreState: method. Restoring will not be supported
2021-07-22 16:22:04.831350+0200 heartrate-server[43797:13434385] [CoreBluetooth] API MISUSE: <CBPeripheralManager: 0x100a17a80> can only accept this command while in the powered on state

我应该怎么做才能修复不受支持的描述符错误?我应该怎么做才能删除“只能在开机状态下接受此命令”?我发现这第二句话的问题是我正在调用startAdvertising to early,我应该等待powered状态实际上是on,但我目前没有找到等待这个状态的方法。有人有想法吗?

Ps:我在Info.plist文件中设置了“Privacy - Bluetooth Always Usage Description”。

提前致谢。

标签: macosqtbluetooth-lowenergy

解决方案


推荐阅读