簡體   English   中英

QBluetooth BLE 廣告在 ubuntu (BlueZ) 上不起作用

[英]QBluetooth BLE advertising does not work on ubuntu (BlueZ)

我今天嘗試使用 Qt 來宣傳 BluetoothLE 服務。 我首先測試了低功耗藍牙心率服務器示例,它在我的 Android 手機上運行良好。 但是,在我的 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 看到“禁止命令”。

發出hcitool cmd 0x03 0x000會重置設備並讓它開始做廣告,但它很快就會再次崩潰。 似乎在 4.19 內核中引入了許多藍牙更改,並導致 LE 系統調用出現問題。

我能夠通過使用帶有 4.15 內核的舊版 Ubuntu 來讓它工作。

更多細節在這里https://github.com/nymea/nymea-networkmanager/issues/46

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM