为什么LE设备在HCI上自动连接?

时间:2017-06-14 09:49:21

标签: bluetooth bluetooth-lowenergy bluez hci

每当我点击hciconfig hci0 up noscan,几秒后跟hcitool con,我的LE设备就会自动连接。

> hciconfig hci0
hci0:   Type: BR/EDR  Bus: USB
    BD Address: YY:YY:YY:YY:YY:YY  ACL MTU: 310:10  SCO MTU: 64:8
    DOWN
    RX bytes:494922 acl:12605 sco:0 events:8429 errors:0
    TX bytes:63543 acl:917 sco:0 commands:3692 errors:0
> hciconfig hci0 up

... (wait a few seconds)

> hcitool con
Connections:
    < LE XX:XX:XX:XX:XX:XX handle 70 state 1 lm MASTER AUTH ENCRYPT

我最初认为只有白名单中的设备会自动连接,但只有在输入以下命令后才能确定设备不在白名单中。

> hcitool lewlrm XX:XX:XX:XX:XX:XX
Can't remove from white list: Input/output error(5)

问题:

为什么我的设备在不在白名单中时会自动连接?

环境:

内核版本:Linux 4.11.1
Bluez版本:5.37

1 个答案:

答案 0 :(得分:0)

我的解决方案是将bluetoothctl用于disconnectremove

> bluetoothctl
[bluetooth] > disconnect XX:XX:XX:XX:XX:XX
[bluetooth] > remove XX:XX:XX:XX:XX:XX