Bluetoothctl设置密码 [英] Bluetoothctl set passkey

查看:455
本文介绍了Bluetoothctl设置密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行Raspbian内核4.1.15和Bluez版本5.23的Raspberry Pi 2.

I have a Raspberry Pi 2 running Raspbian kernel 4.1.15 and Bluez version 5.23.

我希望能够将设备(例如Android手机)连接到rapsberry,该设备应该接受连接而无需用户交互.

I want to be able to connect a device (like an Android phone) to the rapsberry which should accept the connection without user interaction.

使用bluetoothct,我可以使该设备可发现,将其与另一台设备配对,但是我还没有找到设置与bluetooth-agent类似的引脚的方法

With bluetoothct I can make the device discoverable, pair it with another device, but I haven't found the way to set a pin like with bluetooth-agent

bluetooth-agent PIN

Bluetooth-agent在我的系统上不再可用,有什么办法可以通过bluetoothctl做到这一点?

Bluetooth-agent is no more available on my system, is there a way I can do that with bluetoothctl?

推荐答案

多亏了kaylum,这才是可行的方法:

Here is what works thanks to 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

然后我通过电话将树莓与手机配对.

Then I pair the raspberry with my phone from the phone.

[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

这篇关于Bluetoothctl设置密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆