<?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>nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39236/nrf52840-stop-advertising</link><description>Hello Everyone 
 I am working on nRF52840 DK, SDK V-15.0. 
 How we can stop advertising? Which API is used to stop advertising? 
 Quick help will be appreciated. 
 Regards 
 Raj</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 01:10:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39236/nrf52840-stop-advertising" /><item><title>RE: nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/thread/204880?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 01:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36e749f7-53ec-4723-aacc-ef25700f1851</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: nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/thread/152126?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 21:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a38f0d85-a71e-4190-80b1-3548d0dd7bc7</guid><dc:creator>Rajneesh</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;strong&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/bjorn-kvaale"&gt;Bj&amp;oslash;rn&lt;/a&gt;&amp;nbsp;Could you please tell me how to disable softdevice for nRF52840 device? &lt;/strong&gt;&lt;strong&gt;I tried with following APIs to disable softdevice but it&amp;#39;s not working:&lt;br /&gt;&lt;br /&gt;1. nrf_sdh_disable_request()&lt;br /&gt;2. sd_softdevice_disable();&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/thread/151988?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 09:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7635b595-40df-4078-bbdf-7b205852d649</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;I have updated the post. My bad for misreading the question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/thread/151966?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 07:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2fa03d0-5272-44b4-8e66-ae5c6071633a</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So there&amp;#39;s no way to &lt;strong&gt;stop&lt;/strong&gt; advertising once it&amp;#39;s started?&lt;/p&gt;
&lt;p&gt;You just have to wait for it to time-out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 stop advertising</title><link>https://devzone.nordicsemi.com/thread/151958?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 07:13:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4817530-6152-47bc-93f7-1808ad7d712e</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Hi Raj,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;Take a look at the &lt;code&gt;sd_ble_gap_adv_stop&lt;/code&gt;() function in the softdevice (ble_gap.h file). &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/13153/disabling-advertising"&gt;This devzone case&lt;/a&gt; could also be useful.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
 *
 * @mscs
 * @mmsc{@ref BLE_GAP_ADV_MSC}
 * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
 * @endmscs
 *
 * @param[in] adv_handle The advertising handle that should stop advertising.
 *
 * @retval ::NRF_SUCCESS The BLE stack has stopped advertising.
 * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle.
 * @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising.
 */
SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Normally, you will advertise for 180 seconds &amp;amp; then advertising will turn off by itself until you press button 1 on the dev kit to turn it back on (works for most examples). See this line in main.c of the ble_app_uart peripheral example (or most other BLE examples):&lt;/p&gt;
&lt;p&gt;#define APP_ADV_DURATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; The advertising duration (180 seconds) in units of 10 milliseconds. */&lt;/p&gt;
&lt;p&gt;Also take a look at the ble_adv_modes_config_t struct in ble_advertising.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;typedef struct
{
    bool     ble_adv_on_disconnect_disabled;     /**&amp;lt; Enable or disable automatic return to advertising upon disconnecting.*/
    bool     ble_adv_whitelist_enabled;          /**&amp;lt; Enable or disable use of the whitelist. */
    bool     ble_adv_directed_high_duty_enabled; /**&amp;lt; Enable or disable direct advertising mode. can only be used if ble_adv_legacy_enabled is true. */
    bool     ble_adv_directed_enabled;           /**&amp;lt; Enable or disable direct advertising mode. */
    bool     ble_adv_fast_enabled;               /**&amp;lt; Enable or disable fast advertising mode. */
    bool     ble_adv_slow_enabled;               /**&amp;lt; Enable or disable slow advertising mode. */
    uint32_t ble_adv_directed_interval;          /**&amp;lt; Advertising interval for directed advertising. */
    uint32_t ble_adv_directed_timeout;           /**&amp;lt; Time-out (number of tries) for direct advertising. */
    uint32_t ble_adv_fast_interval;              /**&amp;lt; Advertising interval for fast advertising. */
    uint32_t ble_adv_fast_timeout;               /**&amp;lt; Time-out (in seconds) for fast advertising. */
    uint32_t ble_adv_slow_interval;              /**&amp;lt; Advertising interval for slow advertising. */
    uint32_t ble_adv_slow_timeout;               /**&amp;lt; Time-out (in seconds) for slow advertising. */
    bool     ble_adv_extended_enabled;           /**&amp;lt; Enable or disable extended advertising. */
    uint32_t ble_adv_secondary_phy;              /**&amp;lt; PHY for the secondary (extended) advertising @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED). */
    uint32_t ble_adv_primary_phy;                /**&amp;lt; PHY for the primary advertising. @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED). */
} ble_adv_modes_config_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There, you can see a timeout for fast advertising &amp;amp; slow advertising (you will only need to worry about fast advertising most likely). The advertising timeout is set in advertising_init().&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>