<?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>How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91952/how-can-i-make-peripheral-device-name-configurable</link><description>Dear all 
 I am developing a BLE product, and would like to have a different device name for each unit like Product1, Product2 etc. when advertising, so user can identify each of them. 
 I noticed Device name in Generic Access service is read only, is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Sep 2022 11:21:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91952/how-can-i-make-peripheral-device-name-configurable" /><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386364?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 11:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ac7957c-4496-4d7f-a51c-4c392ee9e868</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Ping,&lt;/p&gt;
&lt;p&gt;Good to know that things are working. Also interesting to know that&amp;nbsp;&lt;span&gt;CONFIG_BT_DEVICE_NAME_DYNAMIC doesn&amp;#39;t matter. &lt;br /&gt;&lt;/span&gt;&lt;span&gt;Its name is very clear and it has always been on for me so&amp;nbsp;I didn&amp;#39;t check what happened if it is turned off. Interesting, I wonder what it is for then.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regarding saving over power cycles, you could refer to this recent Q&amp;amp;A:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/91450/recommended-solution-for-persistent-data-storage-in-ncs/383965"&gt;RE: Recommended solution for persistent data storage in NCS&lt;/a&gt;&amp;nbsp;. The question looks different at first but they are discussing exactly what you need over there.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386354?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 10:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cf0f81d-1e63-4eb7-b74b-2bc36767e1b1</guid><dc:creator>PingISTL</dc:creator><description>&lt;p&gt;Thank you, it works now, just don&amp;#39;t think the last option(&lt;span&gt;CONFIG_BT_DEVICE_NAME_DYNAMIC&lt;/span&gt;&lt;span&gt;&amp;nbsp;)&lt;/span&gt; is necessary as I stop adv first and restart again after I got a full name with ID.&lt;/p&gt;
&lt;p&gt;One more question, I need to save the full device name&amp;nbsp;with ID once it is received, so it stays over power cycles, how can I&amp;nbsp;do that&amp;nbsp;please?&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;
&lt;p&gt;Ping&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386336?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 09:15:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d98e99e-5672-4ee2-9d04-271487fe72e3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Ping,&lt;/p&gt;
&lt;p&gt;Yes, what you are doing is&amp;nbsp;&lt;em&gt;one&lt;/em&gt; correct way of doing it. Just want to point out a few things to be careful about it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you are not using the full name of your device in the advertisement, you should use the ad data flag &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;BT_DATA_NAME_SHORTENED&lt;/span&gt; instead of &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;BT_DATA_NAME_COMPLETE&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;. Apparently it will still work, but it is improper.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If you are already providing a Local Name data in your &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_data_ad&lt;/span&gt; array, don&amp;#39;t set the&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_le_adv_param.option&lt;/span&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;BT_LE_ADV_OPT_USE_NAME&lt;/em&gt;&amp;nbsp;&lt;/span&gt;when creating advertisement set or starting advertisement.&lt;br /&gt;I did some quick experiments and both &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_le_ext_adv_set_data()&lt;/span&gt; and &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_le_adv_start()&lt;/span&gt; don&amp;#39;t like it and will fail.&lt;br /&gt;&lt;br /&gt;(And as you might have guessed,&amp;nbsp;&lt;em&gt;one&lt;/em&gt; different way is&amp;nbsp;the opposite&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;BT_DATA_NAME_COMPLETE&lt;/em&gt;&lt;/span&gt; and just use the advertising option&amp;nbsp;&lt;em&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;BT_LE_ADV_OPT_USE_NAME&lt;/span&gt;&lt;/em&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;.)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Remember to set the Kconfig &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_BT_DEVICE_NAME_DYNAMIC&lt;/span&gt; appropriately&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you want to discover different solutions, you can also try looking into Manufacturer Data and a custom app parsing data from it as well. Depends on your&amp;nbsp;product design, it might be more suitable.&lt;/p&gt;
&lt;p&gt;Best regarsd,&lt;br /&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386247?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 15:58:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3d9f615-1da4-464a-b40d-e7b50d4952c3</guid><dc:creator>PingISTL</dc:creator><description>&lt;p&gt;Thank you for your contribution, Hieu&lt;/p&gt;
&lt;p&gt;My application requires a name change after it starts up, to attach a bit more id related information in the name.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is a good idea that it starts with local device name - shorted version of like Product , and then attach a ID. so, it becomes ProductID later. In my application the ID is from host MCU via serial interface.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t mind stop advertising and restart again later, my question is - do I define two set of ad data like below?&amp;nbsp; I might need to make the complete device name as a variable, I suppose? Do I advertise with both local name and complete device name? any examples please?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define DEVICE_NAME             CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME_LEN         (sizeof(DEVICE_NAME) - 1)

static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
};&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;
&lt;p&gt;Ping&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386242?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 15:25:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c09c2ac1-bfaf-4323-b006-ae0f59b21ee5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The API is actually valid in NCS v1.9.1 too:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrfx/drivers/ficr/hal.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrfx/drivers/ficr/hal.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid I don&amp;#39;t fully understand your setup. Are you saying you need the unique ID to&amp;nbsp;be provided to the nRF52 chip from a different MCU?&lt;/p&gt;
&lt;p&gt;In any case, there are a number of ways to&amp;nbsp;influence the device&amp;#39;s &amp;quot;appearance&amp;quot; to a scanner.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;First solution: Advertise with Local Name data, and update that data. This can be done&amp;nbsp;even during advertising.&lt;/p&gt;
&lt;p&gt;The caveat is that the Local Name has to be&amp;nbsp;the same or a shortened version of the Device Name itself. &lt;br /&gt;See the section about Local Name in &lt;a href="https://www.bluetooth.com/specifications/specs/?status=active&amp;amp;show_latest_version=0&amp;amp;show_latest_version=1&amp;amp;keyword=&amp;amp;filter="&gt;Bluetooth&lt;/a&gt; Core Specification Supplement for more details.&lt;/p&gt;
&lt;p&gt;But anyway, the actual caveat is, if you want to add some dynamic run-time determined element to the Local Name, you are required by Bluetooth Spec to update the device name itself. Which brings us to:&lt;/p&gt;
&lt;p&gt;Second solution: Advertise with Device Name data. If name has to be changed, stop advertising,&amp;nbsp;set new name, and start advertising again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There might be more ways. But now I can only think of those two.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386208?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 13:41:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7235517a-15a9-4ee0-853b-84b752dab7db</guid><dc:creator>PingISTL</dc:creator><description>&lt;p&gt;Hello, Hieu&lt;/p&gt;
&lt;p&gt;Thanks for reply!&lt;/p&gt;
&lt;p&gt;I use nrf Connect v1.9.1 and VS Code. Not sure above API is valid with this version?&lt;/p&gt;
&lt;p&gt;The BLE is hosted by another MCU, and the unique ID is better from my host MCU, my&amp;nbsp;question is - is it possible to make it configurable after it is programmed with an initial default factory device name.&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;
&lt;p&gt;Ping&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I make peripheral device name configurable?</title><link>https://devzone.nordicsemi.com/thread/386165?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 12:16:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:234109dc-fce6-4813-b7f9-0c14f200f9f2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;one solution you can try is to concatenate the device name with information from in the Factory Information Configuration Registers (FICR). It&amp;#39;s best to use the read-only, factory written Device ID.&lt;/p&gt;
&lt;p&gt;You can explore more here:&lt;/p&gt;
&lt;p&gt;nRF5 SDK:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/drivers_nrfx_v2.7.0/group__nrf__ficr__hal.html"&gt;https://infocenter.nordicsemi.com/topic/drivers_nrfx_v2.7.0/group__nrf__ficr__hal.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;nRF Connect SDK: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/ficr/hal.html?highlight=ficr"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/ficr/hal.html?highlight=ficr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>