<?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>[nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86994/nrf-connect-sdk-how-to-change-bt-name</link><description>Target nRF52832(nrf52dk_nrf52832) SDK NCS v1.9.1 Base source 1. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_hids_keyboard 2. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_hids_keyboard My project require two mode(HID and NUS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Apr 2022 08:18:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86994/nrf-connect-sdk-how-to-change-bt-name" /><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/365117?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 08:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b1723cf-1e12-4f6f-a357-269613cce5f2</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;awesome! it works. I though it is too difficult. &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/365109?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 07:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0546f5c2-7716-49cb-9a55-006b7d284f1a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;OK Thanks. You need to remove the &amp;quot;static const&amp;quot; from the &amp;quot;sd2&amp;quot; definition to get rid of the &amp;quot;initializer is not constant&amp;quot; error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/365054?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 23:49:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d5c27f6-6fee-4839-9431-ad7c4351e7dd</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;Here is my source code &amp;amp; build error.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1651016851556v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1651016902768v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/364863?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 08:33:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c24ca277-da2d-458b-bba6-a54b658b548d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Can you post the compile error(s) here? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/364859?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 08:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63b78bac-3833-4d32-978e-dbd92bb43c2d</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;extended scan is not my problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BT_DATA(BT_DATA_NAME_COMPLETE,&amp;nbsp;&lt;/span&gt;&lt;strong&gt;new_name&lt;/strong&gt;&lt;span&gt;, 32),&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;new_name can be &amp;quot;ABCD0001&amp;quot;(8) or&amp;nbsp;&amp;quot;ABCDEF0001&amp;quot;(10) under 32Bytes in our product.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;BT_DATA(BT_DATA_NAME_COMPLETE,&amp;nbsp;&lt;/span&gt;&lt;strong&gt;new_name&lt;/strong&gt;&lt;span&gt;, strlen(&lt;strong&gt;new_name)&lt;/strong&gt;),&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-&amp;gt; I cannot have this usage due to compile error. so I open this case. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have no choice but to use fixed length(32) whatever new_name is.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1650961522267v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I have new name as &amp;quot;RFR901&amp;quot;, we can see NULL(\0\0\0...) in sniffer.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/364856?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 08:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:237c39bb-9eca-4c1f-8263-7695926586a4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;A regular advertisement packet can only hold 31 bytes of payload, which explains why your device name won&amp;#39;t fit. For larger advertisement packets you could use the extended advertising feature introduced in Bluetooth 5: &lt;a href="https://blog.nordicsemi.com/getconnected/bluetooth-5-advertising-extensions"&gt;https://blog.nordicsemi.com/getconnected/bluetooth-5-advertising-extensions&lt;/a&gt;. But the drawback then is that the device will only be seen be scanners that supports extended scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/364060?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 02:25:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd5e8408-5c1f-471b-8922-b82d76e86d92</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;static const struct bt_data ad[] = {&lt;br /&gt; BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),&lt;br /&gt; BT_DATA(BT_DATA_NAME_COMPLETE, &lt;strong&gt;DEVICE_NAME&lt;/strong&gt;, DEVICE_NAME_LEN),&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;span&gt;static const struct bt_data ad[] = {&lt;/span&gt;&lt;br /&gt;&lt;span&gt;BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),&lt;/span&gt;&lt;br /&gt;&lt;span&gt;BT_DATA(BT_DATA_NAME_COMPLETE, &lt;strong&gt;new_name&lt;/strong&gt;, 32),&lt;/span&gt;&lt;br /&gt;&lt;span&gt;};&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;char new_name[32+1];&lt;/p&gt;
&lt;p&gt;memset(&lt;span&gt;new_name, 0x0, sizeof(new_name));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;strcpy(new_name, &amp;quot;NewName&amp;quot;);&lt;/p&gt;
&lt;p&gt;I could change&amp;nbsp;&amp;nbsp;&lt;span&gt;DEVICE_NAME to new_name. It worked.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;But&amp;nbsp;DEVICE_NAME_LEN should have 32.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(I cannot use actual length)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m afraid that wrong length made system halt.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;In addition, I don&amp;#39;t have to use&amp;nbsp;&lt;span&gt;bt_set_name()&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363828?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 09:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96c83d33-08c2-43ea-a0ca-272c40952e95</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you manage to update the adv. name dynamically as well, or is it something you are still struggling with?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363403?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 01:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc59e5a0-2224-4cff-9735-52dc2c7fc4a2</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;I found &lt;span&gt;bt_set_name(&amp;quot;NEW_NAME&amp;quot;) worked. After connection, peer device had &amp;quot;NEW_NAME&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I have to advertise name as &amp;quot;NEW_NAME&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My customer will have&amp;nbsp;several my BLE devices, so I have to tell them what device is working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363340?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2022 08:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74d827ee-e0e8-4596-99df-1281ff861125</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;I want to use NEW name but not DEVICE_NAME.&lt;br /&gt;I&amp;#39;ll receive new name via UART before bt_enable(). and I have to display new name&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363338?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2022 07:26:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d02d1615-55ea-4cf4-8baf-eda2d40059b2</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;&lt;strong&gt;DEVICE_NAME is determined at compile time.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void main()
{
    String DEVICE_NAME = &amp;quot;Uart name&amp;quot;; // this is for example only.
                                        You can determine this variable anywhere
    uint8_t 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),
    };
    
    static const struct bt_data sd[] = {
    	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL),
    };
    
    #define BT_LE_ADV_CONN_TEST BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \
                                                   adv_param_interval_min, \
                                                   adv_param_interval_max, NULL)
    
    err = bt_le_adv_start(BT_LE_ADV_CONN_TEST, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
    if (err) {
    	LOG_ERR(&amp;quot;Advertising failed to start (err %d)&amp;quot;, err);
    	return;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363331?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2022 23:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db1e7552-27f5-4f90-9cf6-73c97f0f3a99</guid><dc:creator>Tim Hwang</dc:creator><description>&lt;p&gt;Thanks for updating.&lt;/p&gt;
&lt;p&gt;DEVICE_NAME is determined at compile time. What I&amp;#39;m asking you is how I can change ad[] variable in runtime.&lt;/p&gt;
&lt;p&gt;In my test,&amp;nbsp;&lt;span&gt;bt_set_name() did not work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I believe you have good solution.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF Connect SDK] How to change BT name</title><link>https://devzone.nordicsemi.com/thread/363302?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2022 08:55:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8210b37a-177b-4c9f-a073-16f76c8e2558</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;String DEVICE_NAME = &amp;quot;Uart name&amp;quot;;
uint8_t 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),
};

static const struct bt_data sd[] = {
	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL),
};

#define BT_LE_ADV_CONN_TEST BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \
                                               adv_param_interval_min, \
                                               adv_param_interval_max, NULL)

err = bt_le_adv_start(BT_LE_ADV_CONN_TEST, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
if (err) {
	LOG_ERR(&amp;quot;Advertising failed to start (err %d)&amp;quot;, err);
	return;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>