<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>What exactly does the &amp;quot;Handle&amp;quot;s indicate, and how are they identified?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70952/what-exactly-does-the-handle-s-indicate-and-how-are-they-identified</link><description>I&amp;#39;m still learning BLE development so I apologize if this is a basic question. 
 Here is a screenshot of a recent capture I did with the nRF52-DK. The bluetooth sniffer is following a connection between a Garmin Vivosmart (fitness device) and an Android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Jan 2021 17:36:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70952/what-exactly-does-the-handle-s-indicate-and-how-are-they-identified" /><item><title>RE: What exactly does the "Handle"s indicate, and how are they identified?</title><link>https://devzone.nordicsemi.com/thread/292047?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 17:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73b5623a-1541-4bde-b075-c125707e66e9</guid><dc:creator>tjhasan</dc:creator><description>&lt;p&gt;Thank you very much for the thorough explanation!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What exactly does the "Handle"s indicate, and how are they identified?</title><link>https://devzone.nordicsemi.com/thread/291991?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 12:41:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e5f6cf5-3cdd-47bc-8151-5375a164e265</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This handle is also known as ATT handle. All entries in the Generic Attribute Profile (GATT) are stored using the Attribute Protocol (ATT), which is a table where each row has a handle, a UUID, permissions, and a value. The start of the table may for instance look something like this (some of the fields omitted (set to &amp;quot;-&amp;quot;) for simplicity):&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Handle&lt;/td&gt;
&lt;td&gt;UUID&lt;/td&gt;
&lt;td&gt;Permissions&lt;/td&gt;
&lt;td&gt;Attribute value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0001&lt;/td&gt;
&lt;td&gt;0x2800 (Service)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;0x180D (Heart Rate)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0002&lt;/td&gt;
&lt;td&gt;0x2803 (Characteristic)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;0x2A37 (Heart Rate Measurement)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0003&lt;/td&gt;
&lt;td&gt;0x2A37 (Heart Rate Measurement)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;- (what you see as &amp;quot;value&amp;quot; for the Heart Rate Measurement Characteristic)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0004&lt;/td&gt;
&lt;td&gt;0x2902 (CCCD)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0005&lt;/td&gt;
&lt;td&gt;0x2800 (Service)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;0x180F (Battery Service)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0006&lt;/td&gt;
&lt;td&gt;0x2803 (Characteristic)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;0x2A19 (Battery Level)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0007&lt;/td&gt;
&lt;td&gt;0x2A19 (Battery Level)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;- (what you see as &amp;quot;value&amp;quot; for the Battery Level Characteristic)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x0008&lt;/td&gt;
&lt;td&gt;0x2902 (CCCD)&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This describes two services; Heart Rate and Battery, each with one charactersitic. Things like enabling notifications is done through writing to the Client Characteristic Configuration Descriptor (CCCD). Writing to (or reading from) the Heart Rate Measurement Characteristic value uses to &amp;quot;Attribute value&amp;quot; of handle 0x0003. Enabling notifications uses handle 0x0004. Etc.&lt;/p&gt;
&lt;p&gt;The handles are assigned by the GATT server, and do not change while the device is powered. After having connected to a device, one of the first steps is usually to do a database discovery, which is essentially reading the ATT table. The information about handles, and what handle corresponds to what service, characteristic, etc, is something which is integrated in the Bluetooth Low Energy protocol, and something which a GATT client needs in order to communicate with the GATT server. There are procedures, handled by the BLE stack, for communicating this information.&lt;/p&gt;
&lt;p&gt;Please note that if you make a device, which is supposed to communicate with other devices, you should not rely on the ATT table of the other device always being the same. Rather you should do service discovery, looking for the services / characteristics that you are interested in, and use the handles of those services / characteristics as reported by the device. Even if the handle layout of one particular series of devices from one producer has always been the same, there is no guarantee that the next generation of devices, or the next production series of a given device, will have the same layout.&lt;/p&gt;
&lt;p&gt;For a more thorough understanding of how this all works you can have a look at &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;Bluetooth low energy Characteristics, a beginner&amp;#39;s tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>