<?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>Getting my head around BLE multi-central with S120</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14402/getting-my-head-around-ble-multi-central-with-s120</link><description>I&amp;#39;ve been trying to get my head around using a BLE central and making connections so I&amp;#39;ve loaded up the multi-central example to figure out just how everything works. I turned on the App Trace Log to try to get a feel for what&amp;#39;s happening behind the scenes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Jun 2016 17:00:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14402/getting-my-head-around-ble-multi-central-with-s120" /><item><title>RE: Getting my head around BLE multi-central with S120</title><link>https://devzone.nordicsemi.com/thread/55006?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2016 17:00:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bc15091-c1f6-4fee-a1f0-6cff17a4965f</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Without diving too deep into the various modules, which I personally do not have the best insight of, I can offer you a general explanation of how the SoftDevice handle this.&lt;/p&gt;
&lt;p&gt;When you connect to a peer, you are given an event that tells you:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The identity of the device you connected to, either with address or IRK.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The connection handle assigned to that connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To follow the Bluetooth Specification, you are required to remember a few things between connections for devices you are bonded to. These are things like encryption keys, identity resolving keys and the states of CCCDs (Client Characteristic Configuration Descriptors). So after connecting to a device, you need to look up in some internal database to figure out if this is a previously bonded device. If it is, you have to restore the CCCD states and make sure that you will be encrypting using the keys previously exchanged (instead of pairing anew). The Device Manager(/Peer Manager) module is responsible for these specific tasks. If you never bond with any device, you can safely remove this module. It is only example code, so you can also implement it yourself if you want something simpler.&lt;/p&gt;
&lt;p&gt;Additionally, the security level of your connection defaults to &amp;quot;open&amp;quot; when connecting. If one of the links are encrypted, this is signaled through the &lt;code&gt;BLE_GAP_CONN_SEC_UPDATE&lt;/code&gt; event. The DM module also keeps track of these things for you.&lt;/p&gt;
&lt;p&gt;After connection, you usually want to do a discovery of the peer. Find the interesting services, enable notifications/indications, or read sensor values. This is usually done in steps, where you discover the services, then the characteristics within that service, and finally the descriptors of those characteristics. You are allowed to cache this information (if you&amp;#39;re bonded), so luckily you do not have to do it a lot. But it&amp;#39;s still quite hard to wrap your head around sometimes, which is why the [DB module](&lt;a href="http://Client"&gt;http://Client&lt;/a&gt; Characteristic Configuration Descriptors) is created to do this for you. It is not for creating your own DB, but to discover the peer DB.&lt;/p&gt;
&lt;p&gt;So the answer to your question is that the connection information is given to you in the form of events, which you may pull at your own leisure. The event is bound to each connection by the use of connection handles, and you are required to remember what the events tell you - because there are few states you can actually extract after the fact.&lt;/p&gt;
&lt;p&gt;A lot of this is covered in the &lt;a href="http://infocenter.nordicsemi.com/pdf/S120_SDS_v2.1.pdf"&gt;SDS&lt;/a&gt; (PDF Warning), but knowing some Bluetooth basics are required to understand the various modules.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>