<?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 device name dynamically</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71836/changing-device-name-dynamically</link><description>Hi, sorry for adding more posts on the same issue, but I don&amp;#39;t see any of the posts that speaks to my current situation. I&amp;#39;m using nRF51822 and SDK 12.3.0, and I&amp;#39;m trying to implement the functionality of changing device name while the device is still</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Feb 2021 19:07:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71836/changing-device-name-dynamically" /><item><title>RE: Changing device name dynamically</title><link>https://devzone.nordicsemi.com/thread/295920?ContentTypeID=1</link><pubDate>Tue, 23 Feb 2021 19:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a29045d3-894f-4a2a-a59b-a4d843aa2acd</guid><dc:creator>moroboshidan</dc:creator><description>&lt;p&gt;Thanks Vidar! I have figured out the issue. I need to disconnect first and then reinitialize and restart advertising after ble_evt_dispatch() returns. I set a flag in nus_data_handler to be true when the device name changed and check at the end of ble_evt_dispatch() if the state is disconnected and the flag is true. If so, set the flag to false and reinitialize and restart advertising.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing device name dynamically</title><link>https://devzone.nordicsemi.com/thread/295768?ContentTypeID=1</link><pubDate>Tue, 23 Feb 2021 09:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a37b3c03-b86a-463d-a84d-655daf1de424</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t start connectable advertising while connected unless you have a project that supports multiple connections, hence the&amp;nbsp;NRF_ERROR_CONN_COUNT error. But It should be sufficient to call&amp;nbsp; sd_ble_gap_device_name_set(); and advertising_init(); The new device name will be used when your device starts advertising after the phone has disconnected.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>