<?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>Periodic Stop Advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60465/periodic-stop-advertising</link><description>Hi All, 
 How I can implement period advertising? For example, start advertising, stop after 10 sec and restart it after 10 sec? 
 Thanks!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Apr 2020 14:45:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60465/periodic-stop-advertising" /><item><title>RE: Periodic Stop Advertising</title><link>https://devzone.nordicsemi.com/thread/245881?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 14:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb227c36-b20b-4c00-b724-e70a4ddbd717</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;There are a couple of ways you could go about doing this. The easiest is probably to set up a timer, and have the device start and stop based on the events generated by the timer.&lt;br /&gt;I recommend familiarizing yourself with the APP_TIMER library and its usage by reading &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_timer.html"&gt;this infocenter page&lt;/a&gt;. If you have previous experience working with embedded timers, you could also see&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52833%2Ftimer.html"&gt;TIMER peripheral driver&lt;/a&gt; directly.&lt;br /&gt;&lt;br /&gt;If you would like to see this usage demonstrated, you could take a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_hrs.html"&gt;Heart Rate example&lt;/a&gt;.&lt;br /&gt;In this example, multiple timers are set up to trigger tasks at different intervals. For example, the BATTERY_LEVEL_MEAS_INTERVAL is set to 2000 ms, and in timer_init() the timer is initialized and connected to the battery_level_meas_timeout_handler() which then is called every 2. seconds.&lt;/p&gt;
[quote user=""]For example, start advertising, stop after 10 sec and restart it after 10 sec?&amp;nbsp;[/quote]
&lt;p&gt;You could for example&amp;nbsp;set up a timer to trigger every 20th second - starting advertising - and then you could have the advertising time out after 10 seconds.&lt;br /&gt;&lt;br /&gt;Is this what you were looking for?&lt;br /&gt;Please let me know if something is still unclear, or if you have some more questions.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>