<?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>Is there an API that I can query the bluetooth connection status?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73395/is-there-an-api-that-i-can-query-the-bluetooth-connection-status</link><description>I&amp;#39;m using sdk 15.3.0 and s132. Is there an API that I can query the bluetooth connection status? What method can I use to find out if a connection is currently available or not? my goal is don&amp;#39;t to do disconnect if the connection is not already there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Mar 2021 12:38:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73395/is-there-an-api-that-i-can-query-the-bluetooth-connection-status" /><item><title>RE: Is there an API that I can query the bluetooth connection status?</title><link>https://devzone.nordicsemi.com/thread/302583?ContentTypeID=1</link><pubDate>Tue, 30 Mar 2021 12:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dac264b0-0f1a-4eeb-9050-eaea9b402d8b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The application is responsible for keeping track of the connection status. The easiest way to do this is probably by keeping a global flag such as &amp;#39;m_conn_handle&amp;#39; in ble_app_hrs example. Another option is to use the SDK &lt;span class="item"&gt;&lt;a class="" title="Connection state" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_ble_conn_state.html?cp=7_1_3_2_5"&gt;Connection state&lt;/a&gt;&lt;span class=""&gt; module. It has the &lt;a title="ble_conn_state_status" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__ble__conn__state__functions.html?cp=7_1_6_2_9_0_14#ga1418eef02b2d40ce5a52fd6d79b30d72"&gt;ble_conn_state_status&lt;/a&gt;() function to query the connection state for a given connection handle.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>