<?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>stop Ble advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15608/stop-ble-advertising</link><description>I want to stop advertising for 8 hours
but when I use 
 sd_ble_gap_adv_stop();
 sd_ble_gap_connect_cancel();
 
 It starts advertising after 1 or 2 secends again.
I think SoftDevice start that but how I stop or start that manually without SD management</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Aug 2016 15:36:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15608/stop-ble-advertising" /><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59540?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 15:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a580d84-fe4e-4f60-8f2d-884f0d47b5b6</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;&lt;code&gt;sd_app_evt_wait()&lt;/code&gt; will allow code in event handlers/interrupt (which includes app_timer) to run. You should add &lt;code&gt;sd_app_evt_wait()&lt;/code&gt; in the while loop in main to make the device go to system on sleep mode between events and save power.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59539?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 11:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b56b090-6879-4931-a322-145653bbcdac</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;I know that And I use it, but
I want to use this functions&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_ble_gap_disconnect()
sd_ble_gap_adv_stop();
sd_app_evt_wait();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;for putting my ble on low power and I use an app timer for scanning pins.&lt;/p&gt;
&lt;p&gt;and I want to start advertising every 8 hours for 10 minutes.
you think this plan is good and&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_app_evt_wait(); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;doesn&amp;#39;t stop app timer and wait for that events?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59537?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 11:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4bb4d76-052f-4d77-90c2-63080d6ca5e7</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can setup regular tasks using app_timer, take a look at &lt;a href="https://devzone.nordicsemi.com/tutorials/19/"&gt;this&lt;/a&gt; tutorial.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59543?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 10:54:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72556954-62c4-4466-8471-0a53a324278d</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;thank you so much. but I want to scan IO pin every 20ms, and I want to run only this function not BLE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59541?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 10:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7475f81c-cdac-411f-b77f-995ec7c1381a</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;thanks. but how I can put BLE in very low Energy mode and just scanning some IO every 20ms and start BLE  after 8 hours for 10 min advertising for send data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59538?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 09:39:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c53abf1-6601-4930-aee6-ca21b20e1432</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You are sure you are not running into an error condition and reset? See &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this&lt;/a&gt;. &lt;code&gt;sd_ble_gap_connect_cancel()&lt;/code&gt; is used during &lt;strong&gt;connection establishment&lt;/strong&gt;, you should rather use &lt;code&gt;sd_ble_gap_disconnect()&lt;/code&gt;. Also the order is wrong, this is the correct way to do it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Disconnect&lt;/li&gt;
&lt;li&gt;Wait for disconnect event (BLE_GAP_EVT_DISCONNECTED)&lt;/li&gt;
&lt;li&gt;Stop advertising (the advertising module will start advertising on disconnect, see ble_advertising_on_ble_evt(..) function. Alternatively you can avoid start advertising).&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop Ble advertising</title><link>https://devzone.nordicsemi.com/thread/59542?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 08:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f714048b-0092-45e0-b242-40840d944840</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;the best shot you can take is use the WDT.&lt;/p&gt;
&lt;p&gt;Here is an example, which wakesup after 60min&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint16_t wdt_time = 3600; //3600 s = 60 min = 1 hr

     void wdt_init(void)
    {
    	NRF_WDT-&amp;gt;CONFIG = (WDT_CONFIG_HALT_Pause &amp;lt;&amp;lt; WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run &amp;lt;&amp;lt; WDT_CONFIG_SLEEP_Pos);   //Configure Watchdog. a) Pause watchdog while the CPU is halted by the debugger.  b) Keep the watchdog running while the CPU is sleeping.
    	NRF_WDT-&amp;gt;CRV = wdt_time*32768;             //wdt_time in s
    	NRF_WDT-&amp;gt;RREN |= WDT_RREN_RR0_Msk;  //Enable reload register 0
    	NRF_WDT-&amp;gt;TASKS_START = 1;           //Start the Watchdog timer
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So fater all your prozessing all you do is put the peripheral into sleep or system off. After 60 min the watchdog will fire and reset(!!!) the device, meaning you will lose all RAM data.&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>