<?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 the advertising S130</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19041/stop-the-advertising-s130</link><description>I try to stop the advertising by using ble_advertising_start(BLE_ADV_MODE_IDLE) when the advertising is ongoing. It fails. 
 Please tell me how to stop advertising when the advertise is on going. I don&amp;#39;t want to use advertising timeout because for my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Jan 2017 10:36:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19041/stop-the-advertising-s130" /><item><title>RE: stop the advertising S130</title><link>https://devzone.nordicsemi.com/thread/73611?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 10:36:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8de75318-543f-455d-8b25-88374eaa5222</guid><dc:creator>J.M.</dc:creator><description>&lt;pre&gt;&lt;code&gt;errorcode = sd_ble_gap_adv_stop();
APP_ERROR_CHECK(errorcode);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: stop the advertising S130</title><link>https://devzone.nordicsemi.com/thread/73610?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 04:21:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae70326d-1ecd-4e88-a9e1-e260cbf04b40</guid><dc:creator>Fiske</dc:creator><description>&lt;p&gt;I have use below code, and the program is hanged at
err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                 if(m_conn_handle!=BLE_CONN_HANDLE_INVALID)
                    {
                      err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                      APP_ERROR_CHECK(err_code);
                    }
                      err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);
                    APP_ERROR_CHECK(err_code);
                    sd_ble_gap_adv_stop();
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>