Wednesday, May 18, 2016

[RR Bluetooth] gatttool - What HCI Commands are Sent by gatttool (3) characteristics

characteristics [start hnd [end hnd [UUID]]]   Characteristics Discovery

It follows 4.6 CHARACTERISTIC DISCOVERY at Bluetooth Specification Core 4.2

"There are two sub-procedures that can be used for characteristic discovery: Discover All Characteristics of a Service and Discover Characteristics by UUID."

Discover All Characteristics of a Service: 用來查已知service handle範圍内, 
Attribute Handle for the characteristic declaration
Attribute Value for the Characteristic Properties
Characteristic Value Handle
Characteristic UUID

[34:B1:F7:D5:59:64][LE]> characteristics 2 3 handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb

Read By Type Request

it actually sends "Read by Type Request" with UUID 0x2803 (<<Characteristic>>)

< ACL Data TX: Handle 70 flags 0x00 dlen 11                   [hci0] 713.100301
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0002-0x0003
        Attribute type: Characteristic (0x2803)

< 02 46 00 0B 00 07 00 04 00 08 02 00 03 00 03 28 

> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 713.265526
        Num handles: 1
        Handle: 70
        Count: 1

> 04 13 05 01 46 00 01 00 

Read By Type Response


> ACL Data RX: Handle 70 flags 0x02 dlen 13                   [hci0] 713.328138
      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x0002
        Value: 020300002a
The Attribute Data List (handle and value pair(s))


> 02 46 20 0D 00 09 00 04 00 09 07 02 00 02 03 00 00 2A 

No comments:

Post a Comment