<?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>How can i know all connected handles?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18857/how-can-i-know-all-connected-handles</link><description>Hi. I&amp;#39;m using SDK12.2.0, S130 ver2.0.1, nRF51822AC as central.
After connection, if i use &amp;quot;ble_conn_state_n_centrals&amp;quot; function, i can get the number of connected peripherals.
Is there any function to know all connection handle values for connected peripherals</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Jan 2017 00:00:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18857/how-can-i-know-all-connected-handles" /><item><title>RE: How can i know all connected handles?</title><link>https://devzone.nordicsemi.com/thread/72826?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 00:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7beaa24-9cac-42f7-9871-1fe9b4be2922</guid><dc:creator>roger.k</dc:creator><description>&lt;p&gt;Thanks a lot. Very helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i know all connected handles?</title><link>https://devzone.nordicsemi.com/thread/72825?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 09:34:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb25722-96fc-40d8-beac-2865a0f366a3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, with the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/group__ble__conn__state__functions.html?resultof=%22%62%6c%65%5f%63%6f%6e%6e%5f%73%74%61%74%65%5f%63%6f%6e%6e%5f%68%61%6e%64%6c%65%73%22%20"&gt;ble_conn_state&lt;/a&gt; module you can use the function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/group__ble__conn__state__functions.html#ga58253fdf436c3d3b240e8325de864968"&gt;ble_conn_state_central_handles()&lt;/a&gt; to get a list of all connection handles where the local device is the central.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sdk_mapped_flags_key_list_t conn_central_handles = ble_conn_state_central_handles();

//You can iterate through the list of connection handles:
for (uint32_t i = 0; i &amp;lt; conn_central_handles.len; i++)
{
		uint16_t conn_handle = conn_central_handles.flag_keys[i];
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note: Make sure that &lt;code&gt;sdk_mapped_flags.c&lt;/code&gt; is added to your project, and that ble events are dispatched to the ble_conn_state module( add &lt;code&gt;ble_conn_state_on_ble_evt(p_ble_evt);&lt;/code&gt; to &lt;code&gt;ble_evt_dispatch()&lt;/code&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>