hcitool lescan은 Bluetooth 버전 5에서 작동하지 않습니다.

Dec 16 2020

Bluetooth v5.X 하드웨어 hcitool에서 실행할 수없는 것으로 나타났습니다 lescan. 실행 sudo hcitool lescan하면 다음 오류가 발생 Set scan parameters failed: Input/output error합니다..

커뮤니티는 bluetoothctl대신 사용할 것을 제안 하지만 (예 : 여기 ) 가능한 장치 스캔에 gatttool의존 hcitool합니다. gatttool많은 앱에서 유용한 백엔드 역할을 하지만 위에서 언급 한 입력 / 출력 오류를 해결하기위한 솔루션은 아직 제공되지 않습니다. 누구든지 위의 오류를 해결하는 방법을 알고 있습니까?

Windows 10에서 BLE의 전체 기능을 테스트했지만 Ubuntu에서는 지금까지 실패했습니다. 내 노트북에는 다음과 같은 블루투스 하드웨어가 있습니다.

$ hciconfig -a
hci0:   Type: Primary  Bus: USB
    BD Address: 4C:1D:96:30:83:6E  ACL MTU: 1021:4  SCO MTU: 96:6
    UP RUNNING 
    RX bytes:8099 acl:34 sco:0 events:591 errors:0
    TX bytes:11990 acl:34 sco:0 commands:452 errors:0
    Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH SNIFF 
    Link mode: SLAVE ACCEPT 
    Name: 'xxxx'
    Class: 0x0c010c
    Service Classes: Rendering, Capturing
    Device Class: Computer, Laptop
    HCI Version: 5.1 (0xa)  Revision: 0x100
    LMP Version: 5.1 (0xa)  Subversion: 0x100
    Manufacturer: Intel Corp. (2)

bluez v5.53과 함께 Ubuntu 20.04가 있습니다.

답변

ukBaz Jan 01 2021 at 18:26

gatttool과 hcitool은 모두 2017 년에 더 이상 사용되지 않습니다 .

D-Bus API 는 다음 위치에 문서화되어 있습니다.https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc

다음과 같은 예가 있습니다. https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test.