hcitoollescanはBluetoothバージョン5では機能しません

Dec 16 2020

Bluetoothv5.Xハードウェアhcitoolで実行できないことが判明しましたlescan。実行sudo hcitool lescanすると、次のエラーが発生しますSet scan parameters failed: Input/output error

コミュニティはbluetoothctl代わりに(たとえばここで)使用することを提案していますが、bleデバイスのスキャンにgatttool依存しhcitoolています。ながら、gatttool多くのアプリケーションにBLEのバックエンドとして機能するが、まだ解決策は、上述した入力/出力エラーを解決するために提供されていません。上記のエラーを解決する方法を知っている人はいますか?

Windows 10でBLEの全機能をテストしましたが、Ubuntuではこれまで失敗しました。私のラップトップには次のBluetoothハードウェアがあります。

$ 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)

私はbluezv5.53を搭載したUbuntu20.04を持っています。

回答

ukBaz Jan 01 2021 at 18:26

gatttoolとhcitoolはどちらも2017年に廃止されました。

D-BusAPIは次の場所に記載されています。https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc

そして、次の例があります。 https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test。