<?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>BLE Connection Sequence</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3337/ble-connection-sequence</link><description>I have modified the Multisim example code slightly, and I am using it to make some demo code for myself. I installed the Nordic Bluetooth sniffer, and everything seems to be working OK (I can connected, disconnect, read and write data). I&amp;#39;m new to Bletooth</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Aug 2014 22:32:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3337/ble-connection-sequence" /><item><title>RE: BLE Connection Sequence</title><link>https://devzone.nordicsemi.com/thread/12157?ContentTypeID=1</link><pubDate>Fri, 01 Aug 2014 22:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fadf6d9-1429-4989-9b28-ad5d09a24e37</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;I did not look at the log, but I can tell you this from the general flow of BLE traffic.&lt;/p&gt;
&lt;p&gt;When you do a characteristic discovery, you ask for all the characteristics in a certain range. This range should be from the the service start handle +1 to the handle of the next service, but in some cases the end handle is 0xFFFF because there are no following services. You might also just be interested in every characteristic regardless of the services, and it makes sense to just put 0xFFFF then as well.&lt;/p&gt;
&lt;p&gt;Since the response has limited space, you will not always get all the characteristics back in a single query. So you take the characteristics you just discovered, pick the last one, and send a new request, starting right after it - but with the same end handle. You repeat this until you get the error &amp;quot;Attribute handle not found&amp;quot;, which means there are nothing left to discover in that range you specified, and you are done! This is completely normal.&lt;/p&gt;
&lt;p&gt;The insuficcient authentication error means that the attribute value is protected by security, e.g. by using the macro BLE_GAP_CONN_MODE_SET_ENC_NO_MITM(). When you receive such an error, you should initiate security, pair or bond, then &lt;strong&gt;retry&lt;/strong&gt; the request. This is done automatically by iOS and Android usually.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>