我正在尝试使用此API: https://www.linumiz.com/bluetooth-connectdevice-without-scanning/ 把两个覆盆子皮连接起来。我将此程序用作服务器,例如:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect 适配器已通电“打开”
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect
适配器已通电“打开”
然后,在客户端:
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect B8:27:EB:9F:91:A7 适配器已通电“打开”无法获得结果: gdbus.error:org.freedesktop.dbus.error.unknownmethod:方法 “connectdevice”,接口上有签名“a sv” “org.bluez.adapter1”不存在
pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect B8:27:EB:9F:91:A7
适配器已通电“打开”无法获得结果: gdbus.error:org.freedesktop.dbus.error.unknownmethod:方法 “connectdevice”,接口上有签名“a sv” “org.bluez.adapter1”不存在
但我不理解这个错误。我做得对吗?如果没有,我该怎么办?
如本文所述,ConnectDevice是Bluez5.49中引入的新适配器API。参考发行说明 here 了解更多详细信息。
这个API仍然标记为实验性的,所以您需要在实验模式下运行bluetouth守护进程,即在启动bluetouth时通过传递“-e”作为额外参数。
所以你需要,