<?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>Disabling advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13153/disabling-advertising</link><description>Hello everyone 
 I&amp;#39;m trying to disable advertising but it doesn&amp;#39;t work in some cases, I don&amp;#39;t really know why. Here is my pretty simple piece of code: 
 /* Disconnect and then disable advertising */ 
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Jan 2017 07:53:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13153/disabling-advertising" /><item><title>RE: Disabling advertising</title><link>https://devzone.nordicsemi.com/thread/50137?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 07:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0ae7d60-73c8-4d6a-9e9e-d107e4ab1522</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I think this is well explained &lt;a href="https://devzone.nordicsemi.com/question/80959/check-if-currently-advertising/"&gt;here&lt;/a&gt;. If not, I think you should add a new question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling advertising</title><link>https://devzone.nordicsemi.com/thread/50138?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 00:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60aa7518-a47d-4a69-9ad6-87d03674b54f</guid><dc:creator>sam wagner</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;How do we find out if the device is actually advertising or not?
I am currently facing a situation where where sd_ble_gap_adv_stop() is returning NRF_ERROR_INVALID_STATE for me.&lt;/p&gt;
&lt;p&gt;Thanks,
Sam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling advertising</title><link>https://devzone.nordicsemi.com/thread/50136?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 10:41:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10cc6c85-56c4-4622-8a6b-79782d4e0f11</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Firstly, are you actually advertising when you call sd_ble_gap_adv_stop()? If not, I believe it will return NRF_ERROR_INVALID_STATE and APP_ERROR_CHECK() will cause a reset.&lt;/p&gt;
&lt;p&gt;Secondly, I believe this is because when the BLE_GAP_EVT_DISCONNECTED event is sent to ble_advertising_on_ble_evt() ble_advertising_start() will be called.&lt;/p&gt;
&lt;p&gt;This event will come when the link is actually disconnected, not when you call sd_ble_gap_disconnect().&lt;/p&gt;
&lt;p&gt;So you can either modify the advertising library, or maybe handle it in ble_evt_dispatch().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling advertising</title><link>https://devzone.nordicsemi.com/thread/50135?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 16:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:073e46c2-0086-4d57-9993-2fd8e2eae84f</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;I  think when you connect , the ADV already stopped and will not start again until you excute the function to srat adv.&lt;/p&gt;
&lt;p&gt;So i guess , you problem is the timer you manage..When you connect , stop the timer reponsible of the lunching ADV and then check if you have the same problem,, if not, that means it comes from the timer management&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>