Bluetoothctl 设置密码 [英] Bluetoothctl set passkey

查看:22
本文介绍了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 那样设置 pin 的方法

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天全站免登陆