>我正在尝试使用外部USB适配器在ubuntu上执行" hcitool lescan",但没有得到BLE扫描结果,我收到此错误
设置扫描参数失败:输入/输出错误
我的BT适配器是ebay的无品牌适配器,带有CSR收音机 DMESG在插入加密狗时会告诉以下内容
[14841.127898] usb 3-1: New USB device found, idVendor=0a12, idProduct=0001
[14841.127902] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[14841.127904] usb 3-1: Product: CSR8510 A10'''
lsusb says:
Bus 003 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
I'm on Ubuntu 18.04.03 with bluez version 5.50 and a 4.15.0.72 kernel
hciconfig -a gives this:
hci0: Type: Primary Bus: USB
BD Address: 00:1A:7D:DA:71:10 ACL MTU: 640:4 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:1059 acl:0 sco:0 events:68 errors:0
TX bytes:4856 acl:0 sco:0 commands:59 errors:0
Features: 0xff 0xff 0x8f 0xfa 0x9b 0xff 0x59 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'm4'
Class: 0x0005a0
Service Classes: Unspecified
Device Class: Peripheral, Pointing device/(reserved)
HCI Version: 4.0 (0x6) Revision: 0x3120
LMP Version: 4.0 (0x6) Subversion: 0x22bb
Manufacturer: Cambridge Silicon Radio (10)
HCI version 0x6 tells this is BT 4.0 so I expect this to support low energy
and when running btmon while doing the hcitool lescan I get:
@ RAW Open: hcitool (privileged) version 2.22 {0x0003} [hci0] 4.241634
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7 #1 [hci0] 4.241692
Type: Active (0x01)
Interval: 10.000 msec (0x0010)
Window: 10.000 msec (0x0010)
Own address type: Public (0x00)
Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #2 [hci0] 4.244446
LE Set Scan Parameters (0x08|0x000b) ncmd 1
Status: Unknown HCI Command (0x01)
@ RAW Close: hcitool
Anyone a suggestion to get this working?
提一下 - 您可以使用以下命令请求加密狗的本地支持功能:
sudo hcitool -i hci0 cmd 0x4 0x3
< HCI Command: ogf 0x04, ocf 0x0003, plen 0
> HCI Event: 0x0e plen 12
01 03 10 00 FF FF 8F FA 9B FF 59 87
您也可以手动解析上面hciconfig -a
命令的输出,因为如果您仔细观察,这已经为您提供了相同的结果:
Features: 0xff 0xff 0x8f 0xfa 0x9b 0xff 0x59 0x87
根据蓝牙核心规范,您的字节 4 (0x9b( 映射到:
Byte Bit
32 EV4 packets 4 0
33 EV5 packets 4 1
34 Reserved for future use 4 2
35 AFH capable Peripheral 4 3
36 AFH classification Peripheral 4 4
37 BR/EDR Not Supported 4 5
38 LE Supported (Controller) 4 6
39 3-slot Enhanced Data Rate ACL packets 4 7
。其中位 6 被清除,表示您的控制器不支持 LE。