<?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>checking if connection is bonded in multiperipheral device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45508/checking-if-connection-is-bonded-in-multiperipheral-device</link><description>Module: 
 ilumi H52 BLE module (nRF52832) 
 
 
 SDK: 
 nRF5_SDK_15.3.0_59ac345 
 
 
 Softdevice: 
 132_nrf52_6.1.1_softdevice.hex 
 
 
 Compiler: 
 gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-4) 
 
 
 
 I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 27 Apr 2019 17:13:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45508/checking-if-connection-is-bonded-in-multiperipheral-device" /><item><title>RE: checking if connection is bonded in multiperipheral device</title><link>https://devzone.nordicsemi.com/thread/184167?ContentTypeID=1</link><pubDate>Sat, 27 Apr 2019 17:13:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9f7ec99-9cd0-4941-b350-dae3cb605e83</guid><dc:creator>lee-marc</dc:creator><description>&lt;p&gt;Meanwhile I found the mistake (misunderstanding) in my firmware. I mixed the address (i) and the value of the array m_qwr[i].conn_handle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: checking if connection is bonded in multiperipheral device</title><link>https://devzone.nordicsemi.com/thread/179221?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 12:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b23e041b-460a-4272-ae4d-c30f83d55a2e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not following exactly how you organize the connection handles. Essentially you just need to store them somehow for later use. The connection handle does not change for the duration of a connection, so as long as there has not been any disconnect it will stay the same and represent the same peer. (I do not see any reason for mixing with the QWR module, it could be kept separate.)&lt;/p&gt;
&lt;p&gt;I suggest something like the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When a device connections the applications gets a BLE_GAP_EVT_CONNECTED event, which includes the connection handle.&lt;/li&gt;
&lt;li&gt;Store the connection handle somewhere and start a single shot app timer with 10 seconds timeout.&lt;/li&gt;
&lt;li&gt;If the connection is terminated before the timer expires, stop the app timer so that nothing more happens.&lt;/li&gt;
&lt;li&gt;When the timeout occurs, check if the connection handle represents a bonded device using&amp;nbsp;pm_peer_id_get().&lt;/li&gt;
&lt;li&gt;If not bonded, disconnect by calling&amp;nbsp;sd_ble_gap_disconnect().&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The above method is a bit simplistic as it does not handle a second connection within the 10 second before checking if it has bonded so it needs a bit expansion to be complete, but it demonstrates how it can be done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>