确认 bluetooth.conf 已放置在/etc/dbus-1/system.d 目录下,启动 bluez 进程: bluetoothd
-n -d;对于 Bluez 5.xx, 可以添加-C 参数,提供 deprecated command line interfaces,如 sdptool
browse local。
如果 bluetoothd 启动失败,出现以下 log:
D-Bus setup failed: Connection ":1.12" is not allowed to own the service "org.bluez" due to
security policies in the configuration file
则可能是 D-Bus 权限问题,可以在 /etc/dbus-1/system.d/bluetooth.conf 中添加
<policy user="root">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface=&#