开发板启动蓝牙A2DP Sink服务,以及配置为可被搜索发现状态:
hciconfig hci0 up
/usr/libexec/bluetooth/bluetoothd --compat -n &
hciconfig hci0 piscan
hciconfig hci0 name "gcx_test"
hciconfig hci0 down
hciconfig hci0 up
bluealsa --profile=a2dp-sink &
bluealsa-aplay --profile-a2dp 00:00:00:00:00:00 &
上述配置完后,手机等设备搜索到并发起连接申请时,需要执行如下命令:
bluetoothctl
然后进入该命令的交互环境下按提示输入YES允许连接及相关服务,但这样不便于自动接受,于是查了资料,执行如下命令:
bluetoothctl agent NoInputNoOutput
按网上解释为:
bluetoothctl agent NoInputNoOutput:设置配对能力级为无输入无输出,设置成该agent后经典蓝牙配对时设备无需输入配对码,手机上点击确定即可完成配对。
但实测仍一样,最后查到执行如下命令可实现自动接受配对请求:
bt
订阅专栏 解锁全文
6553



被折叠的 条评论
为什么被折叠?



