首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QBluetooth BLE广告不适用于ubuntu (BlueZ)

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

Stack Overflow用户
提问于 2020-10-30 10:47:31
回答 1查看 663关注 0票数 1

我今天试着用Qt为一项BluetoothLE服务做广告。我从测试蓝牙低能心率服务器实例开始,它在我的安卓手机上运行得很好。不过,在我的Ubuntu18.04笔记本电脑上,我无法让它工作。

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

代码语言:javascript
复制
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

有人知道这些错误信息是什么意思吗?

谢谢你帮忙!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-29 17:22:36

当我试图在Intel设备上使用https://github.com/nymea/nymea-networkmanager时,也遇到了类似的问题。每当它试图发出蓝牙LE命令时,我都会通过btmon看到‘命令不允许’。

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

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

这里有更多的细节,https://github.com/nymea/nymea-networkmanager/issues/46

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64606869

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档