<?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 turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39928/how-to-turn-off-and-on-ble-service-dynamically</link><description>My application uses a NRF52 (SD132, SDK 15.0.0), very simple circuit and needs to be extremely low current consumption. I measured the current in conditions of BLE on and BLE off. To turn on BLE, I use the following code: 
 ble_stack_init(); gap_params_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 26 Sep 2020 06:18:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39928/how-to-turn-off-and-on-ble-service-dynamically" /><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/271625?ContentTypeID=1</link><pubDate>Sat, 26 Sep 2020 06:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a86cced4-d37f-4e93-bd98-1db080a2bc37</guid><dc:creator>Aryawesly</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it[stopping advertising or disconnecting the link] possible to do it wirelessly using nRF UART/some other application?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TIA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/155238?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 01:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b368bbdd-1ef3-49f9-80b2-aec2ef39799a</guid><dc:creator>dimtai</dc:creator><description>&lt;p&gt;Problem solved. Thanks again.&lt;/p&gt;
&lt;p&gt;Best regards, Dimtai 10/31/18&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/155005?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 08:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf46e5b7-2e9e-424d-8d66-e9604f697181</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You should be able to call&amp;nbsp;&lt;code&gt;ble_advertising_start(BLE_ADV_MODE_IDLE);&lt;/code&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;code&gt;sd_ble_gap_adv_stop();&lt;/code&gt;&lt;span&gt;&amp;nbsp;to stop advertising.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is possible to write to flash after enable softdevice, but then you typically need to use the FDS or fstorage.&amp;nbsp;This module&amp;nbsp;is typically already included by the peer manager if you are supporting bonding, so then you need to refer to documentation and/or find examples here in devzone on usage of FDS or fstorage.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/154974?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 02:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c99d46e-0890-4096-824d-14933d595e0d</guid><dc:creator>dimtai</dc:creator><description>&lt;p&gt;Many thanks Ken.&lt;/p&gt;
&lt;p&gt;Yes the current would drop to only a few uA if ble_advertising_start() is off. Your suggestion of disconnection sounds like a good solution. But I searched API and could not find ble_advertising_stop() command or something like that.&amp;nbsp; Any hints?&lt;/p&gt;
&lt;p&gt;Another related issue is writing to flash. I can write to chip flash successfully before ble services start (ble_stack_init() in my code). However, I can never write the flash after ble services are on. I heard people saying that ble needs to be stopped in order to write flash. I guess the same principle applies here. am I right?&lt;/p&gt;
&lt;p&gt;Best regards, Dimtai 10/30/2018&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/154877?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 13:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:128ab29a-2105-4b70-8ade-cbd586c564d5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If I understand you correctly, then you are saying that if you comment out:&amp;nbsp;&lt;br /&gt;//&amp;nbsp;&lt;span&gt;advertising_start(erase_bonds);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then the current consumption is about 4uA, that should be the case.&amp;nbsp;Otherwise I suspect you have some peripherals enabled or logging enabled in some way.&lt;/p&gt;
&lt;p&gt;The current consumption when you advertise depends on the advertisement interval and you can try to get some current consumption estimations here:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/power/"&gt;https://devzone.nordicsemi.com/power/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is of course possible to disable the softdevice, but it should not be necessary. Instead you simply stop advertising or disconnect the link when you have transferred whatever you wanted to transfer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to turn off and on BLE service dynamically</title><link>https://devzone.nordicsemi.com/thread/154818?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 09:40:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fa7e076-840e-4e85-b55c-393e7b61b762</guid><dc:creator>Luk3</dc:creator><description>&lt;p&gt;Maybe using Timeslot API will be helpful?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/setting-up-the-timeslot-api"&gt;devzone.nordicsemi.com/.../setting-up-the-timeslot-api&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>