<?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 advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3471/stop-advertising</link><description>Hi
how to power off the ble after one advertising event ? i.e i want to stop advertising after one advertising event!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 01:08:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3471/stop-advertising" /><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/204878?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 01:08:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa0f7c74-a4fb-4f81-ba61-421d770a17e3</guid><dc:creator>Vasiliy Baryshnikov</dc:creator><description>&lt;p&gt;In SDK 15, if you are using a template derived project, you should use the following statement with the parameter to stop advertising:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sd_ble_gap_adv_stop(m_advertising.adv_handle);&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12567?ContentTypeID=1</link><pubDate>Wed, 20 Aug 2014 04:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:690fa112-ee95-4af0-905b-1a10364490d1</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;sorry for the way i posted the code nikitha ! i will try and reply asap.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12566?ContentTypeID=1</link><pubDate>Tue, 19 Aug 2014 11:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c923a5d7-1fc2-40f8-954e-ab905dd70408</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Post the code on pastebin.com or something, it&amp;#39;s just a mess without formatting in comments. I see you calling app_timer_start and then immediately sd_ble_gap_adv_stop. It&amp;#39;s wrong, you need to call sd_ble_gap_adv_stop in the timer timeout handler. app_timer_start function is just starting the timer and don&amp;#39;t wait until the timer will expire.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12565?ContentTypeID=1</link><pubDate>Tue, 19 Aug 2014 05:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49cf30ca-7d7f-454b-aa4f-c412facdffed</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;The timer init is the default from the api.
am using the battery timer for my use&lt;/p&gt;
&lt;p&gt;int main(void)
{
// Initialize
//leds_init();
timers_init();
gpiote_init();
buttons_init();
ble_stack_init();
bond_manager_init();
gap_params_init();
advertising_init(BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE);
services_init();
conn_params_init();
sec_params_init();&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Start execution
advertising_start();

// Enter main loop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;// nrf_delay_us(5000);
app_timer_start(m_battery_timer_id, BATTERY_LEVEL_MEAS_INTERVAL, NULL);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_ble_gap_adv_stop();
//system_off_mode_enter();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12564?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 14:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91ed7e2d-2cdb-401f-8e0e-4db63f2df41f</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;I think you do something wrong with timer init. Show me the test code that you&amp;#39;re using. Or just show timer init part, and parts where you start advertising, where you stop advertising and main loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12563?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 10:23:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ce5f523-b8d7-4b6d-a8a4-10aa5d34ed4b</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;hi
I was capturing the current waveform through daQ .when i used apptimer_start() there is no advertising channels ..but when i used nrf_delay_us i can see the advertising channels clearly.but the problem is when i call sd_ble_gap_adv_stop the sleep current doesnt go to zero it forms a steady current of 4.3 mA. so i tried with system_off_mode_enter().And there is some sleep current of 4.3mA in between two advertisng events !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12562?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 10:17:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f19f3210-a5ae-4937-bd3c-98c1459dd387</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Yes, I&amp;#39;m talking about app timer. How did you test that there was no advertising? You tried to receive them with central scanning for peripheral? Maybe central just missed this packets? Try to test your current consimption with oscilloscope and see if the advertising packets being sent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12561?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 08:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:057ade74-b03f-43ff-9e70-29c157c3673d</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;I tried but with timer i couldnt get a single advertising event .(the timer yu mention is app_timer_start() rite??).when i tried with software delay the sleep current between each advertising is nearly 4 mA !!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12560?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 08:08:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c8606fd-4258-4b89-a4c7-7be7aa4a44f0</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;You mean 3 advertising events? How about to set timer for 3.5*(advertising interval), start timer after sd_ble_gap_adv_start and after the timer expires you call sd_ble_gap_adv_stop?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12559?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2014 07:31:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e01883c0-fbae-4336-b5e6-6d3fbd327cba</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;how to do three advertising and stop ?? i tried with loop iterations but its not working !!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12558?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 07:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f0e693d-a774-4e01-8686-88143c2cb3d4</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Got it !! Thankyou :) !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12557?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 06:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09c00411-597a-4d8d-8942-edb98111f2cc</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;In your case if you use nrf_delay_us(4000) the actual delay can be more then 4ms because nrf_delay_us() can be interrupted and interrupt handling may take a few more ms to your delay. But with timer it will be exactly 4ms because timer operation won&amp;#39;t be interrupted. You can read this &lt;a href="http://electronics.stackexchange.com/questions/103606/software-delay-vs-hardware-timers"&gt;electronics.stackexchange.com/.../software-delay-vs-hardware-timers&lt;/a&gt; or google for more info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12556?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 04:31:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ec5d8f0-c3f3-4ac4-9251-2dc2a0e1cf84</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Thankyu ! wats the difference in using delay_us &amp;amp; timers ?? which one is efficient &amp;amp; why ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12555?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 15:23:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:598f6f56-4f63-49f8-b567-ea5441677345</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;You can do it with nrf_delay for test purpose.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12554?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 14:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6aebcf8-6e08-4146-96b0-b3d5ad46d592</guid><dc:creator>hrg</dc:creator><description>&lt;p&gt;Thankyou guys ! i tried with advertising start den some delay of 4 ms (using nrf_delay_us()) den power off (sleep ) !.now i can see the current waveform with one advertising !
now i have to try whether master control panel can detect my device or not !!&lt;/p&gt;
&lt;p&gt;note: is it right using nrf_delay instead of setting a timer ????&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12553?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 13:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b7bedff-bd10-4fc7-94f1-56917d4736c8</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;It will work only with advertising interval &amp;gt; 1 second because minimum advertising timeout value is 1 second.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12552?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 13:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5d31dde-8b3a-4be7-98fb-63526ec80cc7</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Why not set the advertising timeout to a value less than your advertising interval. Then when the stack returns the BLE_GAP_EVT_TIMEOUT event with a source of BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT you can then do your power off work.&lt;/p&gt;
&lt;p&gt;It is possible that sd_ble_gap_adv_start may check to ensure that the timeout is longer than the interval and return an error in which case this won&amp;#39;t work. Otherwise I think it is a simple solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stop advertising</title><link>https://devzone.nordicsemi.com/thread/12551?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2014 13:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b1ec859-270d-41db-9a67-64ec66f0941a</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Don&amp;#39;t know if it will work, but try this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If first advertising event is generated with advertising interval delay after sd_ble_gap_adv_start  call then try to call sd_ble_gap_adv_stop after calling sd_ble_gap_adv_start and waiting for 3/2*(advertising interval) with timer.&lt;/li&gt;
&lt;li&gt;If first advertising event is generated right after sd_ble_gap_adv_start call ther wait for 1/2*(advertising interval) with timer and call sd_ble_gap_adv_stop.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>