<?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>Zephyr NCS Extended advertising restart after disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125774/zephyr-ncs-extended-advertising-restart-after-disconnect</link><description>NRF54L15 NCS 3.02 
 I have to change my BLE advertising from Legacy to Extended. Looking at the Zephyr example &amp;quot;advertiser&amp;quot; which compiles &amp;amp; runs fine, but I notice that behaviour is different in that advertising does not resume after disconnection, compared</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Nov 2025 13:42:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125774/zephyr-ncs-extended-advertising-restart-after-disconnect" /><item><title>RE: Zephyr NCS Extended advertising restart after disconnect</title><link>https://devzone.nordicsemi.com/thread/555234?ContentTypeID=1</link><pubDate>Mon, 24 Nov 2025 13:42:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a388664-fbeb-4411-b89b-ff41af73edb9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Yes, you are right, if you select the legacy advertising start without&amp;nbsp;BT_LE_ADV_OPT_ONE_TIME, then the host seems to auto resume it after the disconnect. I was mistaken and comparing the behavior with our legacy SDK solution. My bad.&lt;/p&gt;
&lt;p&gt;With extended advertising you need to manually restart the advertising as there is no ONE_TIME kind of feature with extended.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr NCS Extended advertising restart after disconnect</title><link>https://devzone.nordicsemi.com/thread/555225?ContentTypeID=1</link><pubDate>Mon, 24 Nov 2025 13:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e2d9c99-e598-45d8-ab0e-9b63f3044a05</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;Here is the code snippet from peripheral_uart from ncs 2.9.0 (this is what I started using as a template for my app)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;BT_CONN_CB_DEFINE(conn_callbacks) = {
	.connected    = connected,
	.disconnected = disconnected,
#ifdef CONFIG_BT_NUS_SECURITY_ENABLED
	.security_changed = security_changed,
#endif
};

static void disconnected(struct bt_conn *conn, uint8_t reason)
{
	char addr[BT_ADDR_LE_STR_LEN];

	bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));

	LOG_INF(&amp;quot;Disconnected: %s, reason 0x%02x %s&amp;quot;, addr, reason, bt_hci_err_to_str(reason));

	if (auth_conn) {
		bt_conn_unref(auth_conn);
		auth_conn = NULL;
	}

	if (current_conn) {
		bt_conn_unref(current_conn);
		current_conn = NULL;
		dk_set_led_off(CON_STATUS_LED);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see there isn&amp;#39;t any provision from restarting advertising on disconnection. I notice that has changed for ncs 3.0.2 as there is now a .recycled callback which *does* restart advertising. I start advertising with the (deprecated)&amp;nbsp;&lt;code&gt;BT_LE_ADV_OPT_CONNECTABLE&lt;/code&gt;&amp;nbsp;and if you look at the definition you see:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	 * If the advertising set was started with @ref bt_le_adv_start
	 * without @ref BT_LE_ADV_OPT_ONE_TIME, the host will attempt to
	 * resume the advertiser under some conditions.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In any case that&amp;#39;s academic really, you&amp;#39;re confirming I need to restart advertising myself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr NCS Extended advertising restart after disconnect</title><link>https://devzone.nordicsemi.com/thread/555190?ContentTypeID=1</link><pubDate>Mon, 24 Nov 2025 11:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b38f5c60-acc4-4f67-a013-91e88e373d77</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Both legacy and extended advertising stop after connection. In peripheral_uart, the advertising is started again in connected() callback.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The API for starting the legacy advertising is different than the extended advertising. For extended advertising, you need to change the calls of&amp;nbsp;&lt;span&gt;bt_le_adv_start to&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/zephyr/connectivity/bluetooth/api/gap.html#c.bt_le_ext_adv_start"&gt;bt_le_ext_adv_start&lt;/a&gt; after you have created an extended advertising set using&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/zephyr/connectivity/bluetooth/api/gap.html#c.bt_le_ext_adv_create"&gt;bt_le_ext_adv_create&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Double check in your connected and disconnected callbacks if there are still traces of starting the legacy advertisement instead of extended.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>