<?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>manually disconnect paired smart device using interrupt.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72408/manually-disconnect-paired-smart-device-using-interrupt</link><description>Currently, I am using the ble_app_cts_c example and I want to disconnect the connected device. 
 I want to know how can I check the condition for any connected device? 
 and how can I disconnect it manually using the button interupt? 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Mar 2021 13:33:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72408/manually-disconnect-paired-smart-device-using-interrupt" /><item><title>RE: manually disconnect paired smart device using interrupt.</title><link>https://devzone.nordicsemi.com/thread/298104?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 13:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51485867-130d-4417-ad70-f8fe49169e55</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]I want to know how can I check&amp;nbsp;the condition for any connected device?[/quote]
&lt;p&gt;The SoftDevice will pass the&amp;nbsp;&lt;em&gt;BLE_GAP_EVT_CONNECTED&lt;/em&gt; and&amp;nbsp;&lt;em&gt;BLE_GAP_EVT_DISCONNECTED&lt;/em&gt;&amp;nbsp;events to the &lt;em&gt;ble_evt_handler&lt;/em&gt; function when the device is connected or disconnected. The default behavior of the&amp;nbsp;&lt;em&gt;ble_evt_handler&lt;/em&gt; is then to update the&amp;nbsp;&lt;em&gt;m_cur_conn_handle&lt;/em&gt; with the connection handle, or to reset it to&amp;nbsp;BLE_CONN_HANDLE_INVALID if the event is disconnection.&lt;br /&gt;So, your application logic can use this variable to determine whether it is currently in a connection or not.&lt;/p&gt;
[quote user=""]and how can I disconnect it manually using the button interupt?[/quote]
&lt;p&gt;You may manually force a disconnect by calling &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v7.2.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga4031d0e4034c6f5900ad6d35b763fb0d"&gt;the&amp;nbsp;&lt;em&gt;sd_ble_gap_disconnect&lt;/em&gt; function.&lt;/a&gt;&amp;nbsp;Disconnection by button press is already implemented in the &lt;em&gt;ble_app_cts_c&lt;/em&gt; example. You can see how this is implemented in the&amp;nbsp;&lt;em&gt;bsp_event_handler&lt;/em&gt;&amp;#39;s&amp;nbsp;BSP_EVENT_DISCONNECT event handling.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>