GATT issue, possible bluez bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

A bit of background, I write a linux desktop/mobile app called
Amazfish which interfaces with several watches over BLE using their
GATT services.  To do this, I use the bluez dbus api (technically a
thin wrapper around it I wrote called qble
https://github.com/piggz/qble)

All has been good so far, I support several generations of
Huami/Amazfit watches, as well as the open source Pinetime and
Bangle.js.  For the Amazfit watches, i have implementations for older
devies such as the Bip, and newer ones such as the GTS.

Much of the reverse engineering comes from the Android Gadget Bridge
project, which supports many more devices.

My community of users donated to buy me a newer device called a GTR2,
which, according to the GB devs uses the same protocol as the slightly
older GTS, and the packet captures I have from Android would support
this.

But this is where my trouble starts with Bluez, my existing
implementation doesnt work at all.  Normally, after a connection, I
would wait for the ServicesResolved signal, which happens pretty fast
on all other devices, but on the GTR2, it takes about 30 seconds, by
which time, the watch has disconnected. (i get a disconnected signal
immediately after the ServicesResolved signal)

To rule out my code, I have tried several things:
Gatttool
With gattool, i can connect, get the services, enable a notification,
write a value and get the expected results seemingly fine

Python-gatt (using the bluez dbus api)
Im unable to iterate the services, like my app, it takes 30 seconds to
get the signal and then swiftly disconnects

Gattlib (https://github.com/labapart/gattlib)
Gattlib is interesting as it appears to have "borrowed" much of its
code directly from bluez.  When built against the system bluez, if the
version is > 5.42, it will use the dbus api.  When I do this, again im
unable to list services on the watch.  However, if I edit the build to
force it to use its internal gatt implementation, which appears to be
the same one used by gatttool, then, it IS able to interrogate the
watch.

I have attached 3 files
1. test python program which should print services, and associated btmon
2. btmon output while using gatttool
3. btmon output running gattlib discover example

Note, other than discovery, I havnt been able to get gattlib to
read/write/notify!

It seems as though I may be triggering a bug in the bluez dbus api?
Can anyone suggest anything?


Regards

Adam
gattlib discover.c
https://github.com/labapart/gattlib/blob/master/examples/discover/discover.c


----------

output:
piggz@adam-laptop ~/projects/gattlib (master) $ sudo ./examples/discover/discover F8:C3:D1:B0:5A:3A
10 services
gattlib_discover: service[0] start_handle:01 end_handle:04 uuid:0x1801
gattlib_discover: service[1] start_handle:14 end_handle:18 uuid:0x1800
gattlib_discover: service[2] start_handle:28 end_handle:35 uuid:0x180a
gattlib_discover: service[3] start_handle:38 end_handle:3d uuid:00001530-0000-3512-2118-0009af100700
gattlib_discover: service[4] start_handle:40 end_handle:6d uuid:0xfee0
gattlib_discover: service[5] start_handle:70 end_handle:81 uuid:0xfee1
gattlib_discover: service[6] start_handle:84 end_handle:89 uuid:0x180d
gattlib_discover: service[7] start_handle:8c end_handle:91 uuid:0x1811
gattlib_discover: service[8] start_handle:94 end_handle:96 uuid:0x1802
gattlib_discover: service[9] start_handle:99 end_handle:9c uuid:0x3802
gattlib_discover: characteristic[0] properties:22 value_handle:0003 uuid:0x2a05
gattlib_discover: characteristic[1] properties:02 value_handle:0016 uuid:0x2a00
gattlib_discover: characteristic[2] properties:02 value_handle:0018 uuid:0x2a01
gattlib_discover: characteristic[3] properties:02 value_handle:002a uuid:0x2a25
gattlib_discover: characteristic[4] properties:02 value_handle:002c uuid:0x2a27
gattlib_discover: characteristic[5] properties:02 value_handle:002e uuid:0x2a28
gattlib_discover: characteristic[6] properties:02 value_handle:0030 uuid:0x2a23
gattlib_discover: characteristic[7] properties:02 value_handle:0032 uuid:0x2a50
gattlib_discover: characteristic[8] properties:14 value_handle:0034 uuid:00000014-0000-3512-2118-0009af100700
gattlib_discover: characteristic[9] properties:18 value_handle:003a uuid:00001531-0000-3512-2118-0009af100700
gattlib_discover: characteristic[10] properties:04 value_handle:003d uuid:00001532-0000-3512-2118-0009af100700
gattlib_discover: characteristic[11] properties:1a value_handle:0042 uuid:0x2a2b
gattlib_discover: characteristic[12] properties:1a value_handle:0045 uuid:0x2a04
gattlib_discover: characteristic[13] properties:14 value_handle:0048 uuid:00000001-0000-3512-2118-0009af100700
gattlib_discover: characteristic[14] properties:10 value_handle:004b uuid:00000002-0000-3512-2118-0009af100700
gattlib_discover: characteristic[15] properties:14 value_handle:004e uuid:00000003-0000-3512-2118-0009af100700
gattlib_discover: characteristic[16] properties:14 value_handle:0051 uuid:00000004-0000-3512-2118-0009af100700
gattlib_discover: characteristic[17] properties:10 value_handle:0054 uuid:00000005-0000-3512-2118-0009af100700
gattlib_discover: characteristic[18] properties:12 value_handle:0057 uuid:00000006-0000-3512-2118-0009af100700
gattlib_discover: characteristic[19] properties:12 value_handle:005a uuid:00000007-0000-3512-2118-0009af100700
gattlib_discover: characteristic[20] properties:10 value_handle:0060 uuid:00000010-0000-3512-2118-0009af100700
gattlib_discover: characteristic[21] properties:08 value_handle:0063 uuid:0000000e-0000-3512-2118-0009af100700
gattlib_discover: characteristic[22] properties:16 value_handle:0066 uuid:00000020-0000-3512-2118-0009af100700
gattlib_discover: characteristic[23] properties:14 value_handle:0069 uuid:00000016-0000-3512-2118-0009af100700
gattlib_discover: characteristic[24] properties:14 value_handle:006c uuid:00000017-0000-3512-2118-0009af100700
gattlib_discover: characteristic[25] properties:16 value_handle:0072 uuid:00000009-0000-3512-2118-0009af100700
gattlib_discover: characteristic[26] properties:08 value_handle:0075 uuid:0xfedd
gattlib_discover: characteristic[27] properties:02 value_handle:0077 uuid:0xfede
gattlib_discover: characteristic[28] properties:02 value_handle:0079 uuid:0xfedf
gattlib_discover: characteristic[29] properties:0a value_handle:007b uuid:0xfed0
gattlib_discover: characteristic[30] properties:0a value_handle:007d uuid:0xfed1
gattlib_discover: characteristic[31] properties:02 value_handle:007f uuid:0xfed2
gattlib_discover: characteristic[32] properties:0a value_handle:0081 uuid:0xfed3
gattlib_discover: characteristic[33] properties:10 value_handle:0086 uuid:0x2a37
gattlib_discover: characteristic[34] properties:0a value_handle:0089 uuid:0x2a39
gattlib_discover: characteristic[35] properties:0a value_handle:008e uuid:0x2a46
gattlib_discover: characteristic[36] properties:1a value_handle:0090 uuid:0x2a44
gattlib_discover: characteristic[37] properties:04 value_handle:0096 uuid:0x2a06
gattlib_discover: characteristic[38] properties:1a value_handle:009b uuid:0x4a02








----------

btmon:

< HCI Command: LE Add Device To Accept List (0x08|0x0011) plen 7                                                                                                                                                                                    #207 [hci0] 111.684794
        Address type: Public (0x00)
        Address: F8:C3:D1:B0:5A:3A (OUI F8-C3-D1)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #208 [hci0] 111.800366
      LE Add Device To Accept List (0x08|0x0011) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                                                                                                                                                                          #209 [hci0] 111.800384
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 60.000 msec (0x0060)
        Own address type: Public (0x00)
        Filter policy: Ignore not in accept list (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #210 [hci0] 111.801365
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                              #211 [hci0] 111.801377
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #212 [hci0] 111.802364
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                              #213 [hci0] 113.723139
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #214 [hci0] 113.756371
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
< HCI Command: LE Remove Device From Accept List (0x08|0x0012) plen 7                                                                                                                                                                               #215 [hci0] 117.831302
        Address type: Public (0x00)
        Address: F8:C3:D1:B0:5A:3A (OUI F8-C3-D1)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #216 [hci0] 117.948340
      LE Remove Device From Accept List (0x08|0x0012) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                                                                                                                                                                          #217 [hci0] 117.948363
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 60.000 msec (0x0060)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #218 [hci0] 117.949368
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                              #219 [hci0] 117.949382
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #220 [hci0] 117.950332
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 40                                                                                                                                                                                                           #221 [hci0] 118.022405
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scannable undirected - ADV_SCAN_IND (0x02)
        Address type: Random (0x01)
        Address: 7F:3C:D2:B3:09:11 (Resolvable)
        Data length: 28
        16-bit Service UUIDs (complete): 1 entry
          Apple, Inc. (0xfd6f)
        Service Data (UUID 0xfd6f): 4bda7c38be6ebf735d15505b40b4c287e709a5ff
        RSSI: -80 dBm (0xb0)
> HCI Event: LE Meta Event (0x3e) plen 43                                                                                                                                                                                                           #222 [hci0] 118.025362
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: F8:C3:D1:B0:5A:3A (Static)
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
        RSSI: -62 dBm (0xc2)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                              #223 [hci0] 118.025376
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                         #224 [hci0] 118.079341
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25                                                                                                                                                                                           #225 [hci0] 118.079376
        Scan interval: 60.000 msec (0x0060)
        Scan window: 60.000 msec (0x0060)
        Filter policy: Accept list is not used (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Own address type: Public (0x00)
        Min connection interval: 30.00 msec (0x0018)
        Max connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                           #226 [hci0] 118.080333
      LE Create Connection (0x08|0x000d) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19                                                                                                                                                                                                           #227 [hci0] 118.881352
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 3585
        Role: Central (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Central clock accuracy: 0x00
@ MGMT Event: Device Connected (0x000b) plen 44                                                                                                                                                                                                 {0x0001} [hci0] 118.881406
        LE Address: F8:C3:D1:B0:5A:3A (Static)
        Flags: 0x00000008
          Connection Locally Initiated
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2                                                                                                                                                                                    #228 [hci0] 118.881463
        Handle: 3585
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                           #229 [hci0] 118.882340
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                                                                                                                                                                                           #230 [hci0] 118.912376
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 3585
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #231 [hci0] 118.912633
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #232 [hci0] 118.963347
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                        #233 [hci0] 119.060680
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                        #234 [hci0] 119.060775
      ATT: Error Response (0x01) len 4
        Exchange MTU Request (0x02)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #235 [hci0] 119.061659
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0002
        Value: 220300052a
        Handle: 0x0015
        Value: 021600002a
        Handle: 0x0017
        Value: 021800012a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #236 [hci0] 119.061746
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0018-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #237 [hci0] 119.111346
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #238 [hci0] 119.112339
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #239 [hci0] 119.210785
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0029
        Value: 022a00252a
        Handle: 0x002b
        Value: 022c00272a
        Handle: 0x002d
        Value: 022e00282a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #240 [hci0] 119.210886
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002e-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #241 [hci0] 119.261348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 20                                                                                                                                                                                                       #242 [hci0] 119.310713
      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x002f
        Value: 023000232a
        Handle: 0x0031
        Value: 023200502a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #243 [hci0] 119.310805
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0032-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #244 [hci0] 119.361348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #245 [hci0] 119.410793
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0033
        Value: 143400000710af090018211235000014000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #246 [hci0] 119.410890
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0034-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #247 [hci0] 119.461348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #248 [hci0] 119.510772
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0039
        Value: 183a00000710af090018211235000031150000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #249 [hci0] 119.510865
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x003a-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #250 [hci0] 119.561377
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #251 [hci0] 119.610790
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x003c
        Value: 043d00000710af090018211235000032150000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #252 [hci0] 119.610881
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x003d-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #253 [hci0] 119.661340
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 20                                                                                                                                                                                                       #254 [hci0] 119.710713
      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x0041
        Value: 1a42002b2a
        Handle: 0x0044
        Value: 1a4500042a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #255 [hci0] 119.710804
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0045-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #256 [hci0] 119.761347
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #257 [hci0] 119.810793
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0047
        Value: 144800000710af090018211235000001000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #258 [hci0] 119.810887
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0048-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #259 [hci0] 119.861348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #260 [hci0] 119.910792
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x004a
        Value: 104b00000710af090018211235000002000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #261 [hci0] 119.910911
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x004b-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #262 [hci0] 119.961347
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #263 [hci0] 120.010792
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x004d
        Value: 144e00000710af090018211235000003000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #264 [hci0] 120.010917
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x004e-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #265 [hci0] 120.061343
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #266 [hci0] 120.160896
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0050
        Value: 145100000710af090018211235000004000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #267 [hci0] 120.160989
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0051-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #268 [hci0] 120.211350
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #269 [hci0] 120.260796
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0053
        Value: 105400000710af090018211235000005000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #270 [hci0] 120.260925
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0054-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #271 [hci0] 120.311348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #272 [hci0] 120.360824
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0056
        Value: 125700000710af090018211235000006000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #273 [hci0] 120.360918
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0057-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #274 [hci0] 120.411380
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #275 [hci0] 120.460833
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0059
        Value: 125a00000710af090018211235000007000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #276 [hci0] 120.460926
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x005a-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #277 [hci0] 120.511344
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #278 [hci0] 120.560798
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x005f
        Value: 106000000710af090018211235000010000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #279 [hci0] 120.560894
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0060-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #280 [hci0] 120.611349
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #281 [hci0] 120.660797
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0062
        Value: 086300000710af09001821123500000e000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #282 [hci0] 120.660893
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0063-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #283 [hci0] 120.711349
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #284 [hci0] 120.760796
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0065
        Value: 166600000710af090018211235000020000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #285 [hci0] 120.760888
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0066-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #286 [hci0] 120.811349
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #287 [hci0] 120.860791
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0068
        Value: 146900000710af090018211235000016000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #288 [hci0] 120.860884
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0069-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #289 [hci0] 120.911350
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #290 [hci0] 120.960798
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x006b
        Value: 146c00000710af090018211235000017000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #291 [hci0] 120.960899
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x006c-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #292 [hci0] 121.011352
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #293 [hci0] 121.060793
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0071
        Value: 167200000710af090018211235000009000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #294 [hci0] 121.060886
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0072-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #295 [hci0] 121.111344
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #296 [hci0] 121.160790
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0074
        Value: 087500ddfe
        Handle: 0x0076
        Value: 027700defe
        Handle: 0x0078
        Value: 027900dffe
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #297 [hci0] 121.160875
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0079-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #298 [hci0] 121.211345
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #299 [hci0] 121.260791
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x007a
        Value: 0a7b00d0fe
        Handle: 0x007c
        Value: 0a7d00d1fe
        Handle: 0x007e
        Value: 027f00d2fe
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #300 [hci0] 121.260883
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x007f-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #301 [hci0] 121.311349
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #302 [hci0] 121.360790
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0080
        Value: 0a8100d3fe
        Handle: 0x0085
        Value: 108600372a
        Handle: 0x0088
        Value: 0a8900392a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #303 [hci0] 121.360891
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0089-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #304 [hci0] 121.411350
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #305 [hci0] 121.460797
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x008d
        Value: 0a8e00462a
        Handle: 0x008f
        Value: 1a9000442a
        Handle: 0x0095
        Value: 049600062a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #306 [hci0] 121.460903
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0096-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #307 [hci0] 121.511346
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 13                                                                                                                                                                                                       #308 [hci0] 121.560658
      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x009a
        Value: 1a9b00024a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #309 [hci0] 121.560749
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x009b-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #310 [hci0] 121.611348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 9                                                                                                                                                                                                        #311 [hci0] 121.660634
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x009b
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #312 [hci0] 121.660812
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #313 [hci0] 121.711393
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 24                                                                                                                                                                                                       #314 [hci0] 121.760804
      ATT: Read By Group Type Response (0x11) len 19
        Attribute data length: 6
        Attribute group list: 3 entries
        Handle range: 0x0001-0x0004
        UUID: Generic Attribute Profile (0x1801)
        Handle range: 0x0014-0x0018
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0028-0x0035
        UUID: Device Information (0x180a)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #315 [hci0] 121.760902
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0036-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #316 [hci0] 121.811403
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 26                                                                                                                                                                                                       #317 [hci0] 121.860793
      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute group list: 1 entry
        Handle range: 0x0038-0x003d
        UUID: Vendor specific (00001530-0000-3512-2118-0009af100700)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #318 [hci0] 121.860910
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x003e-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #319 [hci0] 121.911395
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 24                                                                                                                                                                                                       #320 [hci0] 121.960794
      ATT: Read By Group Type Response (0x11) len 19
        Attribute data length: 6
        Attribute group list: 3 entries
        Handle range: 0x0040-0x006d
        UUID: Anhui Huami Information Technology Co., Ltd.  (0xfee0)
        Handle range: 0x0070-0x0081
        UUID: Anhui Huami Information Technology Co., Ltd.  (0xfee1)
        Handle range: 0x0084-0x0089
        UUID: Heart Rate (0x180d)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #321 [hci0] 121.960913
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x008a-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #322 [hci0] 122.011378
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 24                                                                                                                                                                                                       #323 [hci0] 122.060795
      ATT: Read By Group Type Response (0x11) len 19
        Attribute data length: 6
        Attribute group list: 3 entries
        Handle range: 0x008c-0x0091
        UUID: Alert Notification Service (0x1811)
        Handle range: 0x0094-0x0096
        UUID: Immediate Alert (0x1802)
        Handle range: 0x0099-0x009c
        UUID: Unknown (0x3802)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #324 [hci0] 122.060899
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x009d-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #325 [hci0] 122.111381
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 9                                                                                                                                                                                                        #326 [hci0] 122.160633
      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x009d
        Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #327 [hci0] 122.160913
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                        #328 [hci0] 122.210782
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                        #329 [hci0] 122.210862
      ATT: Error Response (0x01) len 4
        Exchange MTU Request (0x02)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #330 [hci0] 122.211372
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #331 [hci0] 122.260895
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0002
        Value: 220300052a
        Handle: 0x0015
        Value: 021600002a
        Handle: 0x0017
        Value: 021800012a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #332 [hci0] 122.261001
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0018-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #333 [hci0] 122.261342
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #334 [hci0] 122.311380
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #335 [hci0] 122.360952
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0029
        Value: 022a00252a
        Handle: 0x002b
        Value: 022c00272a
        Handle: 0x002d
        Value: 022e00282a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #336 [hci0] 122.361053
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x002e-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #337 [hci0] 122.411382
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 20                                                                                                                                                                                                       #338 [hci0] 122.460774
      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x002f
        Value: 023000232a
        Handle: 0x0031
        Value: 023200502a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #339 [hci0] 122.460895
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0032-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #340 [hci0] 122.511381
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #341 [hci0] 122.560827
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0033
        Value: 143400000710af090018211235000014000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #342 [hci0] 122.560928
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0034-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #343 [hci0] 122.611381
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #344 [hci0] 122.660834
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0039
        Value: 183a00000710af090018211235000031150000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #345 [hci0] 122.660927
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x003a-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #346 [hci0] 122.711350
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #347 [hci0] 122.760848
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x003c
        Value: 043d00000710af090018211235000032150000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #348 [hci0] 122.760936
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x003d-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #349 [hci0] 122.811381
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 20                                                                                                                                                                                                       #350 [hci0] 122.860779
      ATT: Read By Type Response (0x09) len 15
        Attribute data length: 7
        Attribute data list: 2 entries
        Handle: 0x0041
        Value: 1a42002b2a
        Handle: 0x0044
        Value: 1a4500042a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #351 [hci0] 122.860877
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0045-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #352 [hci0] 122.911375
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #353 [hci0] 122.960844
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0047
        Value: 144800000710af090018211235000001000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #354 [hci0] 122.960934
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0048-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #355 [hci0] 123.011382
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #356 [hci0] 123.060795
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x004a
        Value: 104b00000710af090018211235000002000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #357 [hci0] 123.060895
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x004b-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #358 [hci0] 123.111387
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #359 [hci0] 123.160835
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x004d
        Value: 144e00000710af090018211235000003000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #360 [hci0] 123.160938
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x004e-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #361 [hci0] 123.211378
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #362 [hci0] 123.260810
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0050
        Value: 145100000710af090018211235000004000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #363 [hci0] 123.260889
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0051-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #364 [hci0] 123.311382
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #365 [hci0] 123.360838
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0053
        Value: 105400000710af090018211235000005000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #366 [hci0] 123.360938
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0054-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #367 [hci0] 123.411385
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #368 [hci0] 123.460829
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0056
        Value: 125700000710af090018211235000006000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #369 [hci0] 123.460923
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0057-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #370 [hci0] 123.511380
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #371 [hci0] 123.560829
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0059
        Value: 125a00000710af090018211235000007000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #372 [hci0] 123.560925
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x005a-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #373 [hci0] 123.611381
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #374 [hci0] 123.660854
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x005f
        Value: 106000000710af090018211235000010000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #375 [hci0] 123.660934
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0060-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #376 [hci0] 123.711388
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #377 [hci0] 123.760829
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0062
        Value: 086300000710af09001821123500000e000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #378 [hci0] 123.760911
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0063-0xffff
        Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                       #379 [hci0] 123.761692
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                        #380 [hci0] 123.761740
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #381 [hci0] 123.811385
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #382 [hci0] 123.812379
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #383 [hci0] 123.860852
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0065
        Value: 166600000710af090018211235000020000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #384 [hci0] 123.860932
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0066-0xffff
        Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                       #385 [hci0] 123.861687
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Device Name (0x2a00)
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                        #386 [hci0] 123.861752
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #387 [hci0] 123.911384
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #388 [hci0] 123.912343
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #389 [hci0] 123.960854
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0068
        Value: 146900000710af090018211235000016000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #390 [hci0] 123.960950
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0069-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #391 [hci0] 124.013382
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #392 [hci0] 124.060873
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x006b
        Value: 146c00000710af090018211235000017000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #393 [hci0] 124.060971
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x006c-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #394 [hci0] 124.111377
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #395 [hci0] 124.160860
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0071
        Value: 167200000710af090018211235000009000000
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #396 [hci0] 124.160957
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0072-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #397 [hci0] 124.211377
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #398 [hci0] 124.260821
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0074
        Value: 087500ddfe
        Handle: 0x0076
        Value: 027700defe
        Handle: 0x0078
        Value: 027900dffe
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #399 [hci0] 124.260916
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0079-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #400 [hci0] 124.311420
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #401 [hci0] 124.360821
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x007a
        Value: 0a7b00d0fe
        Handle: 0x007c
        Value: 0a7d00d1fe
        Handle: 0x007e
        Value: 027f00d2fe
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #402 [hci0] 124.360934
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x007f-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #403 [hci0] 124.411402
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #404 [hci0] 124.460863
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x0080
        Value: 0a8100d3fe
        Handle: 0x0085
        Value: 108600372a
        Handle: 0x0088
        Value: 0a8900392a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #405 [hci0] 124.460976
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0089-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #406 [hci0] 124.511388
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                       #407 [hci0] 124.560871
      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 7
        Attribute data list: 3 entries
        Handle: 0x008d
        Value: 0a8e00462a
        Handle: 0x008f
        Value: 1a9000442a
        Handle: 0x0095
        Value: 049600062a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #408 [hci0] 124.560968
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0096-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #409 [hci0] 124.611385
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 13                                                                                                                                                                                                       #410 [hci0] 124.660686
      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x009a
        Value: 1a9b00024a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11                                                                                                                                                                                                       #411 [hci0] 124.660766
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x009b-0xffff
        Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                              #412 [hci0] 124.711348
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 9                                                                                                                                                                                                        #413 [hci0] 124.760660
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x009b
        Error: Attribute Not Found (0x0a)
< HCI Command: Disconnect (0x01|0x0006) plen 3                                                                                                                                                                                                      #414 [hci0] 126.787214
        Handle: 3585
        Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                           #415 [hci0] 126.788397
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                                                                                      #416 [hci0] 126.811366
        Status: Success (0x00)
        Handle: 3585
        Reason: Connection Terminated By Local Host (0x16)
@ MGMT Event: Device Disconnected (0x000c) plen 8                                                                                                                                                                                               {0x0001} [hci0] 126.811405
        LE Address: F8:C3:D1:B0:5A:3A (Static)
        Reason: Connection terminated by local host (0x02)




gatttool

[F8:C3:D1:B0:5A:3A][LE]> connect
Attempting to connect to F8:C3:D1:B0:5A:3A
Connection successful
[F8:C3:D1:B0:5A:3A][LE]> char-write-req 0x0072 0100
Error: Characteristic Write Request failed: Attribute can't be written
[F8:C3:D1:B0:5A:3A][LE]> char-write-req 0x0073 0100
Characteristic value was written successfully
[F8:C3:D1:B0:5A:3A][LE]> char-write-cmd 0x0072 0100
Notification handle = 0x0072 value: 10 01 81 01 18 63 c2 cc e5 d1 59 41 3b ed 92 c4 b1 63 c2 79
[F8:C3:D1:B0:5A:3A][LE]>


----------

btmon:

piggz@adam-laptop ~ $ sudo btmon
Bluetooth monitor ver 5.63
= Note: Linux version 5.16.14-1-default (x86_64)                                                                                                                                                                                                                  0.393864
= Note: Bluetooth subsystem version 2.22                                                                                                                                                                                                                          0.393868
= New Index: DC:53:60:51:00:C6 (Primary,USB,hci0)                                                                                                                                                                                                          [hci0] 0.393869
= Open Index: DC:53:60:51:00:C6                                                                                                                                                                                                                            [hci0] 0.393869
= Index Info: DC:53:60:51:00:C6 (Intel Corp.)                                                                                                                                                                                                              [hci0] 0.393870
@ MGMT Open: bluetoothd (privileged) version 1.21                                                                                                                                                                                                        {0x0001} 0.393871
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                                                                                                                                                                              #1 [hci0] 7.719999
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 60.000 msec (0x0060)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #2 [hci0] 7.836024
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                                  #3 [hci0] 7.836096
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #4 [hci0] 7.836936
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 29                                                                                                                                                                                                               #5 [hci0] 7.958973
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: 40:73:4D:6C:3A:23 (Resolvable)
        Data length: 17
        Flags: 0x1a
          LE General Discoverable Mode
          Simultaneous LE and BR/EDR (Controller)
          Simultaneous LE and BR/EDR (Host)
        TX power: 12 dBm
        Company: Apple, Inc. (76)
          Type: Unknown (16)
          Data: 5e1c951fd8
        RSSI: -86 dBm (0xaa)
> HCI Event: LE Meta Event (0x3e) plen 40                                                                                                                                                                                                               #6 [hci0] 7.981212
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scannable undirected - ADV_SCAN_IND (0x02)
        Address type: Random (0x01)
        Address: 7E:51:8A:D0:C1:B6 (Resolvable)
        Data length: 28
        16-bit Service UUIDs (complete): 1 entry
          Apple, Inc. (0xfd6f)
        Service Data (UUID 0xfd6f): 95ae67f112c003bfbc586e9f08b0ecefc93da25b
        RSSI: -84 dBm (0xac)
> HCI Event: LE Meta Event (0x3e) plen 43                                                                                                                                                                                                               #7 [hci0] 8.603059
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: F8:C3:D1:B0:5A:3A (Static)
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
        RSSI: -53 dBm (0xcb)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                                  #8 [hci0] 8.603162
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #9 [hci0] 8.610021
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25                                                                                                                                                                                              #10 [hci0] 8.610082
        Scan interval: 60.000 msec (0x0060)
        Scan window: 60.000 msec (0x0060)
        Filter policy: Accept list is not used (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Own address type: Public (0x00)
        Min connection interval: 30.00 msec (0x0018)
        Max connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                              #11 [hci0] 8.610948
      LE Create Connection (0x08|0x000d) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19                                                                                                                                                                                                              #12 [hci0] 9.455186
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 3585
        Role: Central (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Central clock accuracy: 0x00
@ MGMT Event: Device Connected (0x000b) plen 44                                                                                                                                                                                                   {0x0001} [hci0] 9.455262
        LE Address: F8:C3:D1:B0:5A:3A (Static)
        Flags: 0x00000008
          Connection Locally Initiated
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2                                                                                                                                                                                       #13 [hci0] 9.455478
        Handle: 3585
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                              #14 [hci0] 9.456955
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                                                                                                                                                                                              #15 [hci0] 9.504966
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 3585
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                           #16 [hci0] 9.652964
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                           #17 [hci0] 9.653250
      ATT: Error Response (0x01) len 4
        Exchange MTU Request (0x02)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #18 [hci0] 9.704002
        Num handles: 1
        Handle: 3585
        Count: 1
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #19 [hci0] 12.045092
      ATT: Write Request (0x12) len 4
        Handle: 0x0072
          Data: 0100
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #20 [hci0] 12.054194
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 9                                                                                                                                                                                                          #21 [hci0] 12.102965
      ATT: Error Response (0x01) len 4
        Write Request (0x12)
        Handle: 0x0072
        Error: Write Not Permitted (0x03)
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                          #22 [hci0] 12.652941
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #23 [hci0] 12.653313
      ATT: Error Response (0x01) len 4
        Exchange MTU Request (0x02)
        Handle: 0x0000
        Error: Request Not Supported (0x06)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #24 [hci0] 12.704047
        Num handles: 1
        Handle: 3585
        Count: 1
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #25 [hci0] 15.609948
      ATT: Write Request (0x12) len 4
        Handle: 0x0073
          Data: 0100
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #26 [hci0] 15.754180
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 5                                                                                                                                                                                                          #27 [hci0] 15.803128
      ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #28 [hci0] 21.310170
      ATT: Write Command (0x52) len 4
        Handle: 0x0072
          Data: 0100
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #29 [hci0] 21.454029
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 27                                                                                                                                                                                                         #30 [hci0] 21.503149
      ATT: Handle Value Notification (0x1b) len 22
        Handle: 0x0072
          Data: 100181011863c2cce5d159413bed92c4b163c279



test.py:
import gatt

manager = gatt.DeviceManager(adapter_name='hci0')

class AnyDevice(gatt.Device):
    def connect_succeeded(self):
        super().connect_succeeded()
        print("[%s] Connected" % (self.mac_address))

    def connect_failed(self, error):
        super().connect_failed(error)
        print("[%s] Connection failed: %s" % (self.mac_address, str(error)))

    def disconnect_succeeded(self):
        super().disconnect_succeeded()
        print("[%s] Disconnected" % (self.mac_address))

    def services_resolved(self):
        super().services_resolved()

        print("[%s] Resolved services" % (self.mac_address))
        for service in self.services:
            print("[%s]  Service [%s]" % (self.mac_address, service.uuid))
            for characteristic in service.characteristics:
                print("[%s]    Characteristic [%s]" % (self.mac_address, characteristic.uuid))


device = AnyDevice(mac_address='F8:C3:D1:B0:5A:3A', manager=manager)
device.connect()

manager.run()



----------

output:

piggz@adam-laptop ~ $ python3 test.py
[F8:C3:D1:B0:5A:3A] Connected
[F8:C3:D1:B0:5A:3A] Resolved services
[F8:C3:D1:B0:5A:3A] Disconnected


----------

btmon:

piggz@adam-laptop ~ $ sudo btmon
Bluetooth monitor ver 5.63
= Note: Linux version 5.16.14-1-default (x86_64)                                                                                                                                                                                                                  0.241046
= Note: Bluetooth subsystem version 2.22                                                                                                                                                                                                                          0.241054
= New Index: DC:53:60:51:00:C6 (Primary,USB,hci0)                                                                                                                                                                                                          [hci0] 0.241057
= Open Index: DC:53:60:51:00:C6                                                                                                                                                                                                                            [hci0] 0.241058
= Index Info: DC:53:60:51:00:C6 (Intel Corp.)                                                                                                                                                                                                              [hci0] 0.241060
@ MGMT Open: bluetoothd (privileged) version 1.21                                                                                                                                                                                                        {0x0001} 0.241063
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                                                                                                                                                                                              #1 [hci0] 6.417520
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 60.000 msec (0x0060)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #2 [hci0] 6.532227
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                                  #3 [hci0] 6.532295
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #4 [hci0] 6.533227
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 29                                                                                                                                                                                                               #5 [hci0] 6.578283
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: 53:61:83:76:FA:7E (Resolvable)
        Data length: 17
        Flags: 0x1a
          LE General Discoverable Mode
          Simultaneous LE and BR/EDR (Controller)
          Simultaneous LE and BR/EDR (Host)
        TX power: 12 dBm
        Company: Apple, Inc. (76)
          Type: Unknown (16)
          Data: 5e1ccb63cd
        RSSI: -83 dBm (0xad)
> HCI Event: LE Meta Event (0x3e) plen 40                                                                                                                                                                                                               #6 [hci0] 6.676444
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Scannable undirected - ADV_SCAN_IND (0x02)
        Address type: Random (0x01)
        Address: 7E:51:8A:D0:C1:B6 (Resolvable)
        Data length: 28
        16-bit Service UUIDs (complete): 1 entry
          Apple, Inc. (0xfd6f)
        Service Data (UUID 0xfd6f): 95ae67f112c003bfbc586e9f08b0ecefc93da25b
        RSSI: -82 dBm (0xae)
> HCI Event: LE Meta Event (0x3e) plen 43                                                                                                                                                                                                               #7 [hci0] 7.350358
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: F8:C3:D1:B0:5A:3A (Static)
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
        RSSI: -50 dBm (0xce)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                                                                                                                                                                                  #8 [hci0] 7.350541
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                             #9 [hci0] 7.362341
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25                                                                                                                                                                                              #10 [hci0] 7.362426
        Scan interval: 60.000 msec (0x0060)
        Scan window: 60.000 msec (0x0060)
        Filter policy: Accept list is not used (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Own address type: Public (0x00)
        Min connection interval: 30.00 msec (0x0018)
        Max connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                              #11 [hci0] 7.363236
      LE Create Connection (0x08|0x000d) ncmd 2
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19                                                                                                                                                                                                              #12 [hci0] 8.204341
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 3585
        Role: Central (0x00)
        Peer address type: Random (0x01)
        Peer address: F8:C3:D1:B0:5A:3A (Static)
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0 (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Central clock accuracy: 0x00
@ MGMT Event: Device Connected (0x000b) plen 44                                                                                                                                                                                                   {0x0001} [hci0] 8.204472
        LE Address: F8:C3:D1:B0:5A:3A (Static)
        Flags: 0x00000008
          Connection Locally Initiated
        Data length: 31
        Flags: 0x02
          LE General Discoverable Mode
        Company: Anhui Huami Information Technology Co., Ltd. (343)
          Data: 02ffffffffffffffffffffffffffffffff03f8c3d1b05a3a
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2                                                                                                                                                                                       #13 [hci0] 8.204678
        Handle: 3585
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                              #14 [hci0] 8.205238
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                                                                                                                                                                                              #15 [hci0] 8.253255
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 3585
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
< HCI Command: LE Start Encryption (0x08|0x0019) plen 28                                                                                                                                                                                               #16 [hci0] 8.253353
        Handle: 3585
        Random number: 0x4466d17a4fe0a6d4
        Encrypted diversifier: 0xdc96
        Long term key: 86f2f8d5c8b54af78af65be71cd95bc0
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                              #17 [hci0] 8.254231
      LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4                                                                                                                                                                                                           #18 [hci0] 8.651338
        Status: Success (0x00)
        Handle: 3585
        Encryption: Enabled with AES-CCM (0x01)
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                           #19 [hci0] 8.652170
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                           #20 [hci0] 8.701333
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                           #21 [hci0] 8.701495
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 517
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #22 [hci0] 8.703243
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #23 [hci0] 8.753241
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                           #24 [hci0] 8.801367
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 252
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                           #25 [hci0] 8.801870
      ATT: Read Request (0x0a) len 2
        Handle: 0x0032
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #26 [hci0] 8.851301
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 12                                                                                                                                                                                                          #27 [hci0] 8.901345
      ATT: Read Response (0x0b) len 7
        Value: 01570140000101
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                           #28 [hci0] 8.901729
      ATT: Read Request (0x0a) len 2
        Handle: 0x0016
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #29 [hci0] 8.951330
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 19                                                                                                                                                                                                          #30 [hci0] 9.001361
      ATT: Read Response (0x0b) len 14
        Value: 416d617a66697420475452203200
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                           #31 [hci0] 9.001924
      ATT: Read Request (0x0a) len 2
        Handle: 0x0018
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                 #32 [hci0] 9.051250
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 7                                                                                                                                                                                                          #33 [hci0] 11.451362
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 247
< ACL Data TX: Handle 3585 flags 0x00 dlen 7                                                                                                                                                                                                          #34 [hci0] 11.451706
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 247
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #35 [hci0] 11.501261
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #36 [hci0] 12.151262
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 3585 flags 0x00 dlen 27                                                                                                                                                                                                         #37 [hci0] 12.151451
< ACL Data TX: Handle 3585 flags 0x01 dlen 27                                                                                                                                                                                                         #38 [hci0] 12.151459
< ACL Data TX: Handle 3585 flags 0x01 dlen 8                                                                                                                                                                                                          #39 [hci0] 12.151463
      ATT: Read By Type Response (0x09) len 57
        Attribute data length: 7
        Attribute data list: 8 entries
        Handle: 0x0002
        Value: 020300002a
        Handle: 0x0004
        Value: 020500012a
        Handle: 0x0006
        Value: 020700a62a
        Handle: 0x0009
        Value: 200a00052a
        Handle: 0x000c
        Value: 0a0d00292b
        Handle: 0x000e
        Value: 020f002a2b
        Handle: 0x0010
        Value: 0211003a2b
        Handle: 0x0013
        Value: 021400502a
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #40 [hci0] 12.201251
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #41 [hci0] 12.202245
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #42 [hci0] 12.203244
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #43 [hci0] 12.251317
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0014-0xffff
        Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #44 [hci0] 12.251461
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0014
        Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #45 [hci0] 12.301261
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #46 [hci0] 12.351334
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Device Name (0x2a00)
< ACL Data TX: Handle 3585 flags 0x00 dlen 18                                                                                                                                                                                                         #47 [hci0] 12.351789
      ATT: Read By Type Response (0x09) len 13
        Attribute data length: 12
        Attribute data list: 1 entry
        Handle: 0x0003
        Value: 426c75655a20352e3633
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #48 [hci0] 12.402287
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #49 [hci0] 22.139829
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 3585 flags 0x00 dlen 27                                                                                                                                                                                                         #50 [hci0] 22.140307
< ACL Data TX: Handle 3585 flags 0x01 dlen 27                                                                                                                                                                                                         #51 [hci0] 22.140358
< ACL Data TX: Handle 3585 flags 0x01 dlen 8                                                                                                                                                                                                          #52 [hci0] 22.140373
      ATT: Read By Type Response (0x09) len 57
        Attribute data length: 7
        Attribute data list: 8 entries
        Handle: 0x0002
        Value: 020300002a
        Handle: 0x0004
        Value: 020500012a
        Handle: 0x0006
        Value: 020700a62a
        Handle: 0x0009
        Value: 200a00052a
        Handle: 0x000c
        Value: 0a0d00292b
        Handle: 0x000e
        Value: 020f002a2b
        Handle: 0x0010
        Value: 0211003a2b
        Handle: 0x0013
        Value: 021400502a
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #53 [hci0] 22.152368
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #54 [hci0] 22.153363
        Num handles: 1
        Handle: 3585
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #55 [hci0] 22.154390
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #56 [hci0] 22.201638
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0014-0xffff
        Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 3585 flags 0x00 dlen 9                                                                                                                                                                                                          #57 [hci0] 22.202063
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0014
        Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #58 [hci0] 22.252332
        Num handles: 1
        Handle: 3585
        Count: 1
> ACL Data RX: Handle 3585 flags 0x02 dlen 11                                                                                                                                                                                                         #59 [hci0] 22.301618
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Device Name (0x2a00)
< ACL Data TX: Handle 3585 flags 0x00 dlen 18                                                                                                                                                                                                         #60 [hci0] 22.302244
      ATT: Read By Type Response (0x09) len 13
        Attribute data length: 12
        Attribute data list: 1 entry
        Handle: 0x0003
        Value: 426c75655a20352e3633
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                                                                #61 [hci0] 22.352516
        Num handles: 1
        Handle: 3585
        Count: 1
< HCI Command: Disconnect (0x01|0x0006) plen 3                                                                                                                                                                                                        #62 [hci0] 41.023381
        Handle: 3585
        Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                                             #63 [hci0] 41.141417
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                                                                                        #64 [hci0] 41.152597
        Status: Success (0x00)
        Handle: 3585
        Reason: Connection Terminated By Local Host (0x16)
@ MGMT Event: Device Disconnected (0x000c) plen 8                                                                                                                                                                                                {0x0001} [hci0] 41.152660
        LE Address: F8:C3:D1:B0:5A:3A (Static)
        Reason: Connection terminated by local host (0x02)




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux