在基于Linux的开发板与蓝牙TPMS(轮胎压力测量传感器)设备之间建立射频通讯时遇到麻烦
使用以下步骤配对到TPMS
#bluetoothctl
power on
agent KeyboardOnly
scan on
pair 00:07:80:CA:C1:C9
Attempting to pair with 00:07:80:CA:C1:C9
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device 00:07:80:CA:C1:C9 Connected: yes
[CHG] Device 00:07:80:CA:C1:C9 Modalias: bluetooth:v0047pF000d0300
[CHG] Device 00:07:80:CA:C1:C9 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 00:07:80:CA:C1:C9 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:07:80:CA:C1:C9 ServicesResolved: yes
[CHG] Device 00:07:80:CA:C1:C9 Paired: yes
Pairing successful
[TPR_542454]# trust 00:07:80:CA:C1:C9
Changing 00:07:80:CA:C1:C9 trust succeeded
[CHG] Device 00:07:80:CA:C1:C9 ServicesResolved: no
[CHG] Device 00:07:80:CA:C1:C9 Connected: no
RFCOMM连接在以下命令中引发权限问题
rfcomm connect 0 00:07:80:CA:C1:C9 1
Can't connect RFCOMM socket: Permission denied
上面的rfcomm命令的hcidump添加在下面
< HCI Command: Create Connection (0x01|0x0005) plen 13
bdaddr 00:07:80:CA:C1:C9 ptype 0xcc18 rswitch 0x01 clkoffset 0x2b76 (valid)
Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: PIN Code Request (0x16) plen 6
bdaddr 00:07:80:CA:C1:C9
< HCI Command: PIN Code Request Negative Reply (0x01|0x000e) plen 6
bdaddr 00:07:80:CA:C1:C9
> HCI Event: Command Complete (0x0e) plen 10
PIN Code Request Negative Reply (0x01|0x000e) ncmd 1
status 0x00 bdaddr 00:07:80:CA:C1:C9
> HCI Event: Connect Complete (0x03) plen 11
status 0x18 handle 12 bdaddr 00:07:80:CA:C1:C9 type ACL encrypt 0x00
Error: Pairing Not Allowed
Can't connect RFCOMM socket: Permission denied
从上面的hcidump中,任何人都可以提供有关配对过程中已经进行身份验证时为何要求输入PIN码的信息。
谢谢