<?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>Is there a way to turn off the automatic behavior of restarting advertising on disconnect?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65757/is-there-a-way-to-turn-off-the-automatic-behavior-of-restarting-advertising-on-disconnect</link><description>Hello, we understand that the Nordic framework, by default, restarts advertising on disconnect. I learned that here, thank you: 
 https://devzone.nordicsemi.com/f/nordic-q-a/60901/cant-re-start-advertising-after-disconnect 
 We have an application in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Sep 2020 20:09:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65757/is-there-a-way-to-turn-off-the-automatic-behavior-of-restarting-advertising-on-disconnect" /><item><title>RE: Is there a way to turn off the automatic behavior of restarting advertising on disconnect?</title><link>https://devzone.nordicsemi.com/thread/268819?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2020 20:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24a3a710-01ae-423b-8491-08fe69f9b384</guid><dc:creator>riceman0</dc:creator><description>&lt;p&gt;Perfect, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to turn off the automatic behavior of restarting advertising on disconnect?</title><link>https://devzone.nordicsemi.com/thread/268816?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2020 19:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6821aee9-7328-4455-af89-3ea6094ae614</guid><dc:creator>Sigurd</dc:creator><description>[quote user=""]&lt;strong&gt;Can we easily disable this automatic behavior, and optionally (according to our logic) decide whether to restart, or n&lt;/strong&gt;&lt;strong&gt;ot, advertising on disconnect?&lt;/strong&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes. You can disable this by setting&amp;nbsp;ble_adv_modes_config_t::ble_adv_on_disconnect_disabled to true.&lt;/p&gt;
&lt;p&gt;Like shown here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Function for initializing the Advertising functionality.
 */
static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_on_disconnect_disabled = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>