<?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 is the point of connection handles?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41946/what-is-the-point-of-connection-handles</link><description>I notice that for everything related to a BLE connection in the nRF code, there is a &amp;quot;connection handle&amp;quot;. Usually, the handle is zero. When is the connection handle NOT zero? I ask because my code looks messier if I have to keep an array of connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Dec 2018 14:51:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41946/what-is-the-point-of-connection-handles" /><item><title>RE: What is the point of connection handles?</title><link>https://devzone.nordicsemi.com/thread/163207?ContentTypeID=1</link><pubDate>Fri, 28 Dec 2018 14:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a4acd5e-278a-4529-a59b-3a16be231820</guid><dc:creator>Simon</dc:creator><description>[quote user=""]A peripheral stops advertising upon connection, so it can never have more than one connection, right?&amp;nbsp;[/quote]
&lt;p&gt;This is not correct, a peripheral can maintain up to 20 link simultaneously. Take a look at the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/ble_sdk_app_multiperipheral"&gt;BLE Multiperipheral Application&lt;/a&gt;&amp;nbsp;example,&amp;nbsp;which shows how a peripheral can connect to 4 centrals. This application uses the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_ble_conn_state"&gt;Connection state Library&lt;/a&gt;&amp;nbsp;to keep track of the states for the differenc connections. It is also possible to use the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_ble_link_ctx_manager"&gt;BLE Link Context Manager&lt;/a&gt;&amp;nbsp;on top of that library, and enables you to associate link-related data to a given connection handle. All in all, connection handles are quite useful, since you can&amp;nbsp;keep control and differentiate between the connections.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user=""]When is&amp;nbsp;the connection handle NOT zero?[/quote]
&lt;p&gt;The connection handle is not zero if it is initalized but not associated with a connected device, then it is assigned&amp;nbsp;the value 0xFFFF. Otherwise, if you are working with a multilink application, for example the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/ble_sdk_app_multiperipheral"&gt;BLE Multiperipheral Application&lt;/a&gt;, all the connection handles except for the first will have a non-zero value. E.g. if you are connected to four different central devices, their connection handles will be assigned the values 0x0, 0x1, 0x2 and 0x3 respectively.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the point of connection handles?</title><link>https://devzone.nordicsemi.com/thread/163186?ContentTypeID=1</link><pubDate>Fri, 28 Dec 2018 10:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16f752a1-0d70-46a4-945d-b76ed867da6c</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Currently,&amp;nbsp;a huge portion of the support team are on christmas vacation, and we might not be able to answer you in the closest future. In the first week of 2019 most of the staff will we back and you can&amp;nbsp;expect an answer then.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>