<?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 reinitialize advertising ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27350/how-to-reinitialize-advertising</link><description>Hello, I use nrf51822 , sdk 8.0.0, s110 
 I defined advertise interval and timeout 
 #define APP_ADV_INTERVAL 320 
#define APP_ADV_TIMEOUT_IN_SECONDS 3 
 
 Also, I write advertising init function at below; 
 static void advertising_init(void)
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Nov 2017 12:49:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27350/how-to-reinitialize-advertising" /><item><title>RE: How to reinitialize advertising ?</title><link>https://devzone.nordicsemi.com/thread/108017?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2017 12:49:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e15bb3d6-da76-4ee1-a6e0-6719ed9d16d2</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi Purgoufr!&lt;/p&gt;
&lt;p&gt;If the interval is set to 1 second and the timeout is set to 180 seconds, the device will advertise every second for 180 seconds, and then timeout (i.e stop advertising).&lt;/p&gt;
&lt;p&gt;In most of the BLE peripheral examples, the SDK is set up to advertise for 180s and then stop until button 1 is pressed.&lt;br /&gt;
You can disable this timeout by setting the &lt;code&gt;APP_ADV_TIMEOUT_IN_SECONDS&lt;/code&gt; to 0. This will make your device advertise until told not to.&lt;br /&gt;
You can start/stop advertising by using the &lt;code&gt;sd_ble_gap_adv_stop()&lt;/code&gt; / &lt;code&gt;sd_ble_gap_adv_start()&lt;/code&gt; functions.&lt;/p&gt;
&lt;p&gt;You should be able to change the code to stop/start advertising on another event, i.e using a timer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;
Joakim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>