Home Running a single HCI command at a time
Reply: 0

Running a single HCI command at a time

TheMeaningfulEngineer
1#
TheMeaningfulEngineer Published in 2017-12-07 12:46:46Z

I'm debugging a bluetooth issue for which I need to be able to run one HCI command at a time.

Using bluetoothctl for connecting to a device is an action that consist of multiple HCI commands:

### Output from btmon after executing 
### connect E0:88:72:C4:49:C2
### in bluetoothctl

< HCI Command: LE Add Device To White List (0x08|0x0011) plen 7                 #90 [hci0] 96.881551
        Address type: Random (0x01)
        Address: E0:88:72:C4:49:C2 (Static)
> HCI Event: Command Complete (0x0e) plen 4                                     #91 [hci0] 96.883727
      LE Add Device To White List (0x08|0x0011) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                      #92 [hci0] 96.883799
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 30.000 msec (0x0030)
        Own address type: Public (0x00)
        Filter policy: Ignore not in white list (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                     #93 [hci0] 96.885720
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                          #94 [hci0] 96.885763
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)

Checking the bluez d-bus services also show that it doesn't offer an option of sending actual HCI commands:

$ busctl introspect org.bluez /org/bluez/hci0/dev_E0_88_72_C4_49_C2
    NAME                                TYPE      SIGNATURE RESULT/VALUE                             FLAGS
    [[0;1;39morg.bluez.Device1                  [[0m interface -         -                                        -
    .CancelPairing                      method    -         -                                        -
    .Connect                            method    -         -                                        -
    .ConnectProfile                     method    s         -                                        -
    .Disconnect                         method    -         -                                        -
    .DisconnectProfile                  method    s         -                                        -
    .Pair                               method    -         -                                        -
    .Adapter                            property  o         "/org/bluez/hci0"                        emits-change
    .Address                            property  s         "E0:88:72:C4:49:C2"                      emits-change
    .AdvertisingFlags                   property  ay        1 6                                      emits-change
    .Alias                              property  s         "Nuimo"                                  emits-change writable
    .Appearance                         property  q         384                                      emits-change
    .Blocked                            property  b         false                                    emits-change writable
    .Class                              property  u         -                                        emits-change
    .Connected                          property  b         false                                    emits-change
    .Icon                               property  s         -                                        emits-change
    .LegacyPairing                      property  b         false                                    emits-change
    .ManufacturerData                   property  a{qv}     -                                        emits-change
    .Modalias                           property  s         -                                        emits-change
    .Name                               property  s         "Nuimo"                                  emits-change
    .Paired                             property  b         false                                    emits-change
    .RSSI                               property  n         -                                        emits-change
    .ServiceData                        property  a{sv}     -                                        emits-change
    .ServicesResolved                   property  b         false                                    emits-change
    .Trusted                            property  b         false                                    emits-change writable
    .TxPower                            property  n         -                                        emits-change
    .UUIDs                              property  as        2 "0000180f-0000-1000-8000-00805f9b34... emits-change
    [[0;1;39morg.freedesktop.DBus.Introspectable[[0m interface -         -                                        -
    .Introspect                         method    -         s                                        -
    [[0;1;39morg.freedesktop.DBus.Properties    [[0m interface -         -                                        -
    .Get                                method    ss        v                                        -
    .GetAll                             method    s         a{sv}                                    -
    .Set                                method    ssv       -                                         -
    .PropertiesChanged                  signal    sa{sv}as  -                                        -

What I'm trying to do is send each HCI command separately. Looking for ideas on how to achieve this?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.346613 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO