設置 | 登錄 | 註冊

目前共有2篇帖子。

交叉編譯bluez藍牙協議棧(安裝到板子上的/opt/bluez目錄)

4樓 巨大八爪鱼 2025-7-1 16:07

加載藍牙驅動模塊:insmod ~/test/modules/aic_btusb.ko


添加messagebus用戶和組:

(系統用戶,且不可登錄。-S表示編號從100開始)

addgroup -S messagebus

adduser -G messagebus -SDH messagebus


啟動dbus-daemon進程:

rm /opt/bluez/var/run/dbus/pid

/opt/bluez/bin/dbus-daemon --system


複製配置文件:cp ~/bluetooth/dbus-1/system.d/bluetooth.conf /opt/bluez/share/dbus-1/system.d/

(不複製的話無法啟動bluetoothd後台進程,會報D-Bus setup failed: Connection ":1.0" is not allowed to own the service "org.bluez" due to security policies in the configuration file的錯誤)


啟動bluetoothd後台進程:LD_LIBRARY_PATH=/opt/bluez/lib /opt/bluez/libexec/bluetooth/bluetoothd &

打開藍牙:LD_LIBRARY_PATH=/opt/bluez/lib /opt/bluez/bin/bluetoothctl power on

掃描藍牙設備:LD_LIBRARY_PATH=/opt/bluez/lib /opt/bluez/bin/bluetoothctl scan on

巨大八爪鱼 2025-7-1 17:18
還有一個LD_LIBRARY_PATH=/opt/bluez/lib /opt/bluez/bin/bluetoothctl devices命令可以查看已掃描到的藍牙設備。

內容轉換:

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張
©2010-2025 Purasbar Ver3.0 [手機版] [桌面版]
除非另有聲明,本站採用知識共享署名-相同方式共享 3.0 Unported許可協議進行許可。