<?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>Changing the advertising name &amp;quot;on the fly&amp;quot; on nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19612/changing-the-advertising-name-on-the-fly-on-nrf52832</link><description>Hello everyone, 
 I am having difficulties on changing the advertising name of my device (nRF52832). 
 Here is the piece of code that I am using to do it: 
 ble_gap_conn_sec_mode_t	sec_mode;

BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);
err_code </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Feb 2017 20:29:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19612/changing-the-advertising-name-on-the-fly-on-nrf52832" /><item><title>RE: Changing the advertising name "on the fly" on nrf52832</title><link>https://devzone.nordicsemi.com/thread/76323?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 20:29:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bb96243-6d13-4099-a167-2c2d8993709f</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Calling advertising_init runs a lot of code, so I ended up writing my own code to create the advertising data, using a pre-defined array, and I just update the name section of the data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the advertising name "on the fly" on nrf52832</title><link>https://devzone.nordicsemi.com/thread/76322?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 11:35:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d69076c-ec60-4270-92e0-84ffd20a9603</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;@rogerclark
Your application should know what you put in the advertising data last time you called &lt;code&gt;sd_ble_gap_adv_data_set()&lt;/code&gt;. The simple solution if you are only changing the name and use one of the examples from the SDK, would be to call &lt;code&gt;advertising_init()&lt;/code&gt; after &lt;code&gt;sd_ble_gap_device_name_set()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the advertising name "on the fly" on nrf52832</title><link>https://devzone.nordicsemi.com/thread/76321?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 10:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da286447-1b26-47d2-becb-c06ce64de782</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@Jørgen&lt;/p&gt;
&lt;p&gt;What that answer seems to not explain is that you need to write the raw data advertising data using sd_ble_gap_adv_data_set(..)
But AFIK there is no easy way to determine what the existing advertising data looks like.&lt;/p&gt;
&lt;p&gt;I posted a question about this some time ago, and the consensus was the best method was to capture an advertising packet and reverse engineer it to determine what you need to change.&lt;/p&gt;
&lt;p&gt;Its a shame the SD does not have a function to &amp;quot;get&amp;quot; the current adv data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the advertising name "on the fly" on nrf52832</title><link>https://devzone.nordicsemi.com/thread/76320?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 10:27:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6af6180-3a86-4327-ab7c-90a467e989b5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to set the advertising data again when you have changed the name. See &lt;a href="https://devzone.nordicsemi.com/question/70927/generic-access-profile-device-name-change/?answer=71057#post-id-71057"&gt;this answer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>