我有一个Raspberry Pi 2运行Raspbian内核4.1.15和Bluez版本5.23.
我希望能够将设备(如Android手机)连接到rapsberry,rapsberry应接受连接而无需用户交互.
使用bluetoothct我可以让设备被发现,与其他设备配对,但我还没有找到像蓝牙代理一样设置引脚的方法
bluetooth-agent PIN
蓝牙代理在我的系统上不再可用,有没有办法用bluetoothctl做到这一点?
这是感谢kaylum的作用:
$bluetoothctl [bluetooth]# power on Changing power on succeeded [bluetooth]# discoverable on Changing discoverable on succeeded [bluetooth]# pairable on Changing pairable on succeeded [bluetooth]# agent NoInputNoOutput Agent registered [bluetooth]# default-agent Default agent request successful
然后我用手机将覆盆子和手机配对.
[NEW] Device XX:XX:XX:XX:XX:XX nameofthedevice [CHG] Device XX:XX:XX:XX:XX:XX UUIDS: --UUIDS-- [CHG] Device XX:XX:XX:XX:XX:XX Paired: yes
我刚才有同样的问题.如果您在agent
看到可用代理列表后再按两次选项卡; KeyboardOnly
没有通知工作正常:
[bluetooth]# agent on # accidentally used wrong agent Agent registered [bluetooth]# agent DisplayOnly DisplayYesNo KeyboardDisplay KeyboardOnly NoInputNoOutput off on [bluetooth]# agent KeyboardOnly Agent is already registered # can't use two agents at one [bluetooth]# agent off # unregister agent Agent unregistered [bluetooth]# agent KeyboardOnly # register proper agent Agent registered [bluetooth]# pair XX:XX:XX:04:F5:7C Attempting to pair with XX:XX:XX:04:F5:7C [CHG] Device XX:XX:XX:04:F5:7C Connected: yes Request passkey [agent] Enter passkey (number in 0-999999): 722504 [MoarBacon]# pair XX:XX:XX:04:F5:7C Attempting to pair with XX:XX:XX:04:F5:7C [CHG] Device XX:XX:XX:04:F5:7C Paired: yes Pairing successful