<?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 BT in ncs2.1.2?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93896/how-to-disable-bt-in-ncs2-1-2</link><description>Hi Nordic, 
 I add a switch to let user can manual control BT on or off. 
 But when I tring to set bt off, I got error 134. 
 Here is part of my code. I turn on BT and scan first. 
 
 Then if switch off turn it off. 
 
 But got fail like this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Nov 2022 01:32:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93896/how-to-disable-bt-in-ncs2-1-2" /><item><title>RE: How to disable BT in ncs2.1.2?</title><link>https://devzone.nordicsemi.com/thread/395889?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2022 01:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0bf6b98-27a2-40a7-a238-4ff77891656d</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;Thanks, Edvin.&lt;/p&gt;
&lt;p&gt;I just want reduce the current consumption, and as you say stopping scanning is good enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable BT in ncs2.1.2?</title><link>https://devzone.nordicsemi.com/thread/395828?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 14:51:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a30ff6-cf3a-4da2-b34f-35fa3a39dad7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;That is correct. I don&amp;#39;t remember the details, but I believe that up until recently, there was no API for bt_disable() in Zephyr, and hence we don&amp;#39;t have it either. But it looks like it was added now, but unfortunately, we have not implemented it on our side yet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So depending on why you want to use bt_disable(), I guess the answer to whether &amp;quot;all you have to do is just stop scanning&amp;quot; is either yes or no.&lt;/p&gt;
&lt;p&gt;If this is to stop receiving advertising reports (and stop connecting to devices) the answer is yes. If you want to reduce the current consumption, the answer is also yes. You can&amp;#39;t (yet) use bt_disable(), but if you stop advertising, scanning and disconnect all connections you were currently in, then the current consumption should be as it was before you enabled Bluetooth using bt_enable().&lt;/p&gt;
&lt;p&gt;If, however, the reason you want to disable the Bluetooth stack is to free up the radio in order to use it for other things, it is a bit more complicated. If that is the case, perhaps you can tell me what you want to do, and we can look into it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disable BT in ncs2.1.2?</title><link>https://devzone.nordicsemi.com/thread/395731?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 10:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a95db30-881b-49aa-aeb9-472821384cc8</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;I think the reason bt_bt_disable is just because ncs does not support this api, right?&lt;/p&gt;
&lt;p&gt;So all I have to do just stop scan?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>