QBluetooth BLE 广告不适用于 ubuntu (BlueZ)

QBluetooth BLE advertising does not work on ubuntu (BlueZ)

我今天尝试宣传使用 Qt 的 BluetoothLE 服务。我从测试 Bluetooth Low Energy Heart Rate Server Example 开始,它在我的 Android phone 上工作得很好。但是在我的 Ubuntu 18.04 笔记本电脑上,我无法让它工作。

当我以 root 身份 运行 示例时,出现错误 qt.bluetooth.bluez: received advertising error。 启用调试消息后,我得到了这个日志:

qt.bluetooth: Using BlueZ kernel ATT interface
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Starting to advertise
qt.bluetooth.bluez: sending command; ogf: 8 ocf: 7
qt.bluetooth.bluez: command sent successfully
qt.bluetooth.bluez: HCI event triggered, type: e
qt.bluetooth.bluez: command 7 failed with status 12
qt.bluetooth.bluez: reading power level failed, leaving it out of the advertising data
qt.bluetooth.bluez: advertising parameters: "000800080000000000000000000700"
qt.bluetooth.bluez: advertising data: "18020106100948656172745261746553657276657203030d1800000000000000"
qt.bluetooth.bluez: scan response data: "15100948656172745261746553657276657203030d1800000000000000000000"
qt.bluetooth.bluez: sending command; ogf: 8 ocf: 10
qt.bluetooth.bluez: command sent successfully
qt.bluetooth.bluez: HCI event triggered, type: e
qt.bluetooth.bluez: command 10 failed with status 12
qt.bluetooth.bluez: Advertising disable failed, ignoring
qt.bluetooth.bluez: sending command; ogf: 8 ocf: 6
qt.bluetooth.bluez: command sent successfully
qt.bluetooth.bluez: HCI event triggered, type: e
qt.bluetooth.bluez: command 6 failed with status 12
qt.bluetooth.bluez: received advertising error

有人知道所有这些错误消息是什么意思吗?
感谢您的帮助!

我 运行 在英特尔 NUC 设备上尝试使用 https://github.com/nymea/nymea-networkmanager 时遇到了类似的问题。每当它尝试发出蓝牙 LE 命令时,我都会通过 btmon 看到 'command disallowed'。

发出 hcitool cmd 0x03 0x000 会重置设备并让它开始广告,但很快就会再次崩溃。似乎在 4.19 内核中引入了很多蓝牙更改,并导致 LE 系统调用出现问题。

我能够通过使用带有 4.15 内核的旧 Ubuntu 版本来让它工作。

此处有更多详细信息 https://github.com/nymea/nymea-networkmanager/issues/46