<?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>Restart Advertising after changing device name</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69452/restart-advertising-after-changing-device-name</link><description>Hi, 
 I have read a few other related tickets but still have not found a fix 
 
 We want to be able to change device name in the field to show a meaningful name when scanning. 
 We set the name at runtime after reading out of flash. 
 During a boot, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Dec 2020 21:13:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69452/restart-advertising-after-changing-device-name" /><item><title>RE: Restart Advertising after changing device name</title><link>https://devzone.nordicsemi.com/thread/284894?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 21:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:535fa3c8-1692-41fb-869e-eec85b4b6f06</guid><dc:creator>grant.r</dc:creator><description>&lt;p&gt;Thankyou, calling sd_ble_gap_adv_set_configure with advdata non-null was the key.&lt;/p&gt;
&lt;p&gt;I was using a mix of example code and sdk calls to reset / restart.&lt;/p&gt;
&lt;p&gt;The example code initialise function called set_configure without the adv data. Calling ble_advertising_start, after initialising again, makes another call to sd_ble_gap_adv_set_configure with the advdata pointer passed correctly&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void ble_app_restart_advertising(void)
{
    // Stop
    bool erase_bonds = false;
    uint32_t err_code = sd_ble_gap_adv_stop(m_advertising.adv_handle);
    NRF_LOG_INFO(&amp;quot;Stopping advertising&amp;quot;);

    // Re-init
    advertising_init();

    ble_app_advertising_start(&amp;amp;erase_bonds);

    NRF_LOG_INFO(&amp;quot;Starting advertising&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restart Advertising after changing device name</title><link>https://devzone.nordicsemi.com/thread/284750?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 10:44:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1003864-6cea-41e2-9d68-703d302437f8</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You will also need to update the advertisement data. This can be done using the Softdevice call: sd_ble_gap_adv_set_configure&lt;/p&gt;
&lt;p&gt;Or if you use the sdk advertisement module by using the SDK function &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__ble__advertising.html#ga99dab70061ce04aea98bf226dc0c989f"&gt;&lt;span&gt;&lt;span&gt;ble_advertising_advdata_update&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>