<?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>Device Name Change</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35942/device-name-change</link><description>Hi all , 
 I&amp;#39;m using SDK 15.0, working on ble_uart.c 
 I need to change the DEVICE NAME of the frequently. 
 Can you please tell me how to change the the device name and store it in a buffer. 
 If you provide a example code, it will be a great help. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Aug 2020 11:16:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35942/device-name-change" /><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/267191?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 11:16:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5524485a-7920-4035-af6b-55af8ce2216f</guid><dc:creator>zachar</dc:creator><description>&lt;p&gt;hi Abian&amp;nbsp; &amp;nbsp;could&amp;nbsp; provide&amp;nbsp; full&amp;nbsp; example&amp;nbsp; of this tree function&lt;/p&gt;
&lt;p&gt;i am suing softdevce 112&amp;nbsp; on nrf52801 rigago mudule&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sd_ble_gap_adv_stop(missing param)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;where in the code&amp;nbsp; &amp;nbsp;&lt;span&gt;m_adv_data&amp;nbsp; and adv_param&amp;nbsp;&lt;/span&gt; ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sd_ble_gap_adv_start(missing param )&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;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/241419?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2020 15:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77f9e91a-788b-4e69-b155-fcbf6de5bb13</guid><dc:creator>abiangb</dc:creator><description>&lt;p&gt;Hi all,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I solved this issue&amp;nbsp;with&amp;nbsp;the following steps:&lt;br /&gt;&lt;br /&gt;1)You must to call the sd_ble_gap_adv_stop() function.&lt;/p&gt;
&lt;p&gt;2)Then you would change any config data as you want using for example sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);&lt;/p&gt;
&lt;p&gt;3) And finally, you must to call sd_ble_gap_adv_start() function to initialize the BLE.&lt;/p&gt;
&lt;p&gt;All of this is used in SDK 15.0.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Abian.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/237686?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 10:31:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:008aeab8-83e2-4527-bc3c-bbfb1b54bc76</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;sorry&amp;nbsp; , i didn&amp;#39;t get you .can you share me briefly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/236571?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 13:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b26342ca-bbf1-4753-b1c6-1b2e72300e58</guid><dc:creator>Atok</dc:creator><description>&lt;p&gt;Then use&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ble_advertising_restart_without_whitelist(m_advertising);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;after calling my function to update the advertisement data&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bluetooth_update_name(&amp;quot;DEVICE 123&amp;quot;);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This should work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Markus, Technokrat GmbH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/236533?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 12:33:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d1d08c7-6c1f-4d85-9dff-7b242ac44425</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;thank you ,i dono know whether you understood my question, may be my communication problem . I am explaining it again, we are using custom board nrf52832 , i will connect the device using nrf toolbox app ,and then i will give command as for example &amp;#39;1&amp;#39; , when i receive &amp;#39;1&amp;#39; , it should stop advertise and then it should re advertise with the new name which i was given in the condition&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if(command==&amp;#39;1&amp;#39;)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;change_name;&lt;/p&gt;
&lt;p&gt;stop_adv;&lt;/p&gt;
&lt;p&gt;start_adv;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;similar to this it should work&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&amp;amp;Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;pspavi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/236290?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 14:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3b1c8bb-69de-49c4-9fd4-5f18f78dfaa6</guid><dc:creator>Atok</dc:creator><description>&lt;p&gt;Hi pspavi&lt;br /&gt;&lt;br /&gt;There is sadly no direct solution for the &lt;em&gt;NRF Toolbox&lt;/em&gt;&amp;#39;s standard firmware to do this.&lt;br /&gt;A first step is to check out whether you a ready to setup and build your own custom &amp;quot;Nordic UART Service&amp;quot; (NUS) firmware to do this.&lt;br /&gt;&lt;br /&gt;I have written my own multi-service application including multi-protocol support and non-volatile configuration, which I cannot share for confidentiality reasons.&lt;br /&gt;&lt;br /&gt;Yet the code mentioned before is the crucial part to change a device&amp;#39;s name. My suggestion for you is to adapt your &lt;em&gt;main.c&lt;/em&gt; code to include my logic to control the &lt;em&gt;ble_advertising_init_t &lt;/em&gt;related parts&amp;nbsp;with your own defined NUS command.&lt;br /&gt;&lt;br /&gt;Have a look inside&lt;em&gt; \examples\ble_peripheral\ble_app_uart&lt;/em&gt;&amp;nbsp;or &lt;em&gt;\examples\ble_peripheral\experimental\ble_app_cli&lt;/em&gt; in the SDK to see how to scaffold your own NUS application. It gave me the crucial starting point to do more complex setups.&lt;br /&gt;&lt;br /&gt;Also see&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_cli.html"&gt;Command Line Interface library&lt;/a&gt;&amp;nbsp;for how to add a custom command.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;Markus, Technokrat GmbH&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/236250?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 12:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8425b10e-2a0f-4e79-8020-2381f3950751</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;Hi....atok ..sorry for late , i didn&amp;#39;t receive your notification . yes i want to change my device name after bonding&amp;nbsp; periodically via nrf toolbox ,how to do that ? i tried all the ways and read many threads , i don&amp;#39;t know how to Re- initialize the advertising again ... can you share me sample code so that i can , it will be more helpfull&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&amp;amp;Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;pspavi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/232157?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 17:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3482bd15-d5fb-4b06-aff1-547d009aec8e</guid><dc:creator>Atok</dc:creator><description>&lt;p&gt;Hi pspavi&lt;br /&gt;What do you intend to do?&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;&lt;br /&gt;Markus, Technokrat GmbH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/232032?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 09:39:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:416f0f2b-a221-49ea-85f2-58b029f0f503</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;hi atok... i need your help pls . i need to change the device name using ble app uart&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/220152?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 16:31:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee9844ba-f652-4d10-9837-31c878485e8a</guid><dc:creator>Atok</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/venu"&gt;venu gopal&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I found myself in the situation to implement a dynamically updating device name. Here some working, user-friendly code. The idea is to reuse the&amp;nbsp;ble_advertising_init_t struct from initialization:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;nrf_sdh_ble.h&amp;quot;


BLE_ADVERTISING_DEF(m_advertising);
static ble_advertising_init_t adv_init;

/* This function will update the device name and advertising data accordingly. */
void bluetooth_update_name(uint8_t* name) {
	ret_code_t err_code;
	ble_gap_conn_sec_mode_t sec_mode;

	BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&amp;amp;sec_mode);

	if (current_config.name[0] != &amp;#39;\0&amp;#39;) {
		err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode, name, strnlen(name, 10));
		APP_ERROR_CHECK(err_code);
	}
	else {
		err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode, (const uint8_t *)NUS_DEVICE_NAME, strlen(NUS_DEVICE_NAME));
		APP_ERROR_CHECK(err_code);
	}


  //sd_ble_gap_adv_stop(&amp;amp;m_advertising.adv_handle);

	err_code = ble_advdata_encode(&amp;amp;adv_init.advdata, m_advertising.enc_advdata, &amp;amp;m_advertising.adv_data.adv_data.len);
	VERIFY_SUCCESS(err_code);

	if (m_advertising.adv_modes_config.ble_adv_extended_enabled == true)
	{
#ifdef BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED
		m_advertising.adv_data.scan_rsp_data.len = BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED;
#else
		m_advertising.adv_data.scan_rsp_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;
#endif // BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED
	}
	else
	{
		m_advertising.adv_data.scan_rsp_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;
	}

	err_code = ble_advdata_encode(&amp;amp;adv_init.srdata,
		m_advertising.adv_data.scan_rsp_data.p_data,
		&amp;amp;m_advertising.adv_data.scan_rsp_data.len);

	sd_ble_gap_adv_set_configure(&amp;amp;m_advertising.adv_handle,
		m_advertising.p_adv_data,
		NULL);
}


/* This is my initialization routine for advertising */
static void advertising_init(void) {
	uint32_t err_code;

	memset(&amp;amp;adv_init, 0, sizeof(adv_init));

	adv_init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
	adv_init.advdata.include_appearance = false;
	adv_init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

	adv_init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
	adv_init.srdata.uuids_complete.p_uuids = m_adv_uuids;

	adv_init.config.ble_adv_fast_enabled = true;
	adv_init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
	adv_init.config.ble_adv_fast_timeout = APP_ADV_DURATION;

	adv_init.evt_handler = on_adv_evt;

	err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;adv_init);
	APP_ERROR_CHECK(err_code);

	ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you have some questions, please ask right away &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;&lt;br /&gt;&lt;br /&gt;Best regards&lt;/p&gt;
&lt;p&gt;Markus, Technokrat GmbH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/186534?ContentTypeID=1</link><pubDate>Sun, 12 May 2019 23:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcc1a207-f397-4666-ab2b-14585a3eb8d4</guid><dc:creator>saka4849</dc:creator><description>&lt;p&gt;Hi Arya,&lt;/p&gt;
&lt;p&gt;You will need to call sd_ble_gap_adv_stop() after you have changed the name with sd_ble_gap_device_name_set().&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44513/changing-device-name-dynamically/176001#176001"&gt;this thread&lt;/a&gt; for more info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/184908?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 13:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:233a2848-4f0e-448b-863e-83d47064d312</guid><dc:creator>Arya</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;Can you elaborate a little bit about the APIs to use to disable, re-initialize, and start advertising again?&amp;nbsp; I am actually trying to do the same but unable to find the error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/138539?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 13:56:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:794d55bb-f12f-42a7-99e4-ea98dae5bcde</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you&amp;nbsp;use&amp;nbsp;sd_ble_gap_device_name_set() you actually only update the name in the &lt;a href="https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.device_name.xml"&gt;device name characteristic&lt;/a&gt; in the &lt;a href="https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xml"&gt;Generic Access service&lt;/a&gt;. To change the name being advertised as well, you will need to disable, re-initialize, and start advertising again,&amp;nbsp;&lt;em&gt;after&lt;/em&gt; you have changed the characteristic with&amp;nbsp;sd_ble_gap_device_name_set().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/138418?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 04:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8985dfa-f483-4151-99ae-baac10bc0fee</guid><dc:creator>venu gopal</dc:creator><description>&lt;p&gt;Hi Andy&lt;/p&gt;
&lt;p&gt;I checked all those threads.&lt;/p&gt;
&lt;p&gt;All are for previous SDK 14, 13, 12.&lt;/p&gt;
&lt;p&gt;When i tried to implement in SDK 15.0 I it is unsuccessfull.&lt;/p&gt;
&lt;p&gt;Here i have attached my &lt;strong&gt;main.c&amp;nbsp;&amp;nbsp;&lt;/strong&gt;file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check and give some suggestion.&lt;/p&gt;
&lt;p&gt;If you have any example code in SDK 15.0 please share.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6318.main.c"&gt;devzone.nordicsemi.com/.../6318.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/138408?ContentTypeID=1</link><pubDate>Sun, 01 Jul 2018 16:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a61516f-74f7-4696-bab2-e09aee9f7908</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Then you need to change the advertisement data. There are lots of threads about that already.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/138405?ContentTypeID=1</link><pubDate>Sun, 01 Jul 2018 14:45:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ecd0d02-1b3f-4112-94bd-ed39eee2e9c3</guid><dc:creator>venu gopal</dc:creator><description>&lt;p style="text-align:left;"&gt;Hi Andy&lt;/p&gt;
&lt;p style="text-align:left;"&gt;I need to change the DEVICE NAME.&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;In my application i need to change the device name automatically after it got disconnected from the phone(ble&amp;nbsp; uart connection)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Name Change</title><link>https://devzone.nordicsemi.com/thread/138378?ContentTypeID=1</link><pubDate>Sat, 30 Jun 2018 13:10:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20917e36-8dd2-4474-b122-458ff2ec70f1</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Why do you need to do that? Do you need to change the device name or the advertisement data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>