<?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 to disable Bluetooth ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9940/how-to-disable-bluetooth</link><description>Hello, 
 I&amp;#39;m looking to disable the Bluetooth in the ledButtonDemo,.
In the led_write_handler, I&amp;#39;ve replaced the code by : 
 if(led_state == 0)
{
sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
sd_ble_gap_adv_stop</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Oct 2015 09:40:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9940/how-to-disable-bluetooth" /><item><title>RE: How to disable Bluetooth ?</title><link>https://devzone.nordicsemi.com/thread/36880?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2015 09:40:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9afb169-0e2c-4ea8-8542-71808f11d9ed</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;After you have called sd_ble_gap_disconnect() you will get the BLE_GAP_EVT_DISCONNECTED event when you are actually disconnected. Have a look at &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/group___b_l_e___g_a_p___c_o_n_n___m_s_c.html?cp=2_7_2_1_0_2_1_0_1"&gt;this&lt;/a&gt; MSC. You can just remove advertising_start() and there will be noe Bluetooth activity on the radio.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable Bluetooth ?</title><link>https://devzone.nordicsemi.com/thread/36879?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2015 16:33:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26f66cd4-63f9-4b45-a746-7c5e0a8e9059</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;Ok, I&amp;#39;ll test to add APP_ERROR_CHECK, and I will tell you if it changes something !&lt;/p&gt;
&lt;p&gt;In on_ble_evt(), and particularly in the case BLE_GAP_EVT_DISCONNECTED, there &amp;quot;advertising_start();&amp;quot;, so do I have to delete this line ?&lt;/p&gt;
&lt;p&gt;So, to disable Bluetooth, I have to call this line :
on_ble_evt(BLE_GAP_EVT_DISCONNECTED);  ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable Bluetooth ?</title><link>https://devzone.nordicsemi.com/thread/36878?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2015 13:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92f68c5b-54d8-4f5f-a1a2-60a2c948e275</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure exactly what is happening here, but you shouldn&amp;#39;t do NRF_RADIO-&amp;gt;TASKS_DISABLE=1; as seen from the comment of Ole Bauck in the linked question.&lt;/p&gt;
&lt;p&gt;There is also no point in stopping advertising if you aren&amp;#39;t advertising.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m guessing that either an error is returned somewhere and because of that you get a reset. It seems you are not using APP_ERROR_CHECK() so that may not be the reason.&lt;/p&gt;
&lt;p&gt;Are you getting the BLE_GAP_EVT_DISCONNECTED event? Maybe you have an advertising_start(); in on_ble_evt()?&lt;/p&gt;
&lt;p&gt;If you are a peripheral, the radio is &amp;quot;disabled&amp;quot; or not used, as long as you are not in a connection and you are not advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>