<?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>For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74312/for-nrf52840-need-to-be-change-the-ble-device-name-and-set-the-password-example-code</link><description>Dear !! 
 
 Good day!! 
 
 I want to change the device name using command from mobile along wither after setting the device name i want update the Password, so can you share any example code. 
 
 
 Regards 
 Chandru</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Apr 2021 09:14:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74312/for-nrf52840-need-to-be-change-the-ble-device-name-and-set-the-password-example-code" /><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306260?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 09:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b47beac-9d90-491c-b53e-974c846c7cce</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Then I suggest you start by fixing the errors so that it builds without warnings. If it still does not work, then please let me know how you test in detail. Also you cannot ignore return values. How do you know that&amp;nbsp;sd_ble_gap_device_name_set() is successfull?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306246?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 08:29:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32a23fef-a806-4c6a-8e2a-c0e8b6779a8c</guid><dc:creator>chandru jasi</dc:creator><description>&lt;p&gt;Dear sir,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Device name set code is below, and i&amp;#39;m able to change the device name but once reset or OF/ON conditions the existing name is coming, what to to??&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static void setDeviceName(uint8_t *device_name)&lt;br /&gt;{&lt;br /&gt; ble_gap_conn_sec_mode_t sec_mode;&lt;br /&gt; BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);&lt;/p&gt;
&lt;p&gt;/* Change device name */&lt;br /&gt; uint32_t err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode,&lt;br /&gt; (const uint8_t *)device_name,&lt;br /&gt; strlen(device_name));&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;/* Store Current connection state od adv lib */&lt;br /&gt; uint16_t m_adv_current_slave_link_conn_handle_saved = m_advertising.current_slave_link_conn_handle;&lt;/p&gt;
&lt;p&gt;/* Re-initialize advertising module */&lt;br /&gt; advertising_init();&lt;/p&gt;
&lt;p&gt;/* Re-store Current connection state lib */&lt;br /&gt; m_advertising.current_slave_link_conn_handle = m_adv_current_slave_link_conn_handle_saved;&lt;/p&gt;
&lt;p&gt;printf(&amp;quot;Name has been set %s \n&amp;quot;,device_name);&lt;br /&gt; nrf_gpio_pin_clear(GREEN_LED);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Chandru.A&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306242?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 08:13:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:283a5991-ca33-454b-a72c-0e026f5e3d00</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Can you show what you have done and explain how you test and in which way it does not work? Also let me know if you get any error or warnings?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306238?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 08:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf7cbeeb-77e9-45e7-89d5-e24db74161d4</guid><dc:creator>chandru jasi</dc:creator><description>&lt;p&gt;Dear sir,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As requested by you, I have tried the device name change, which is not changed, and the i&amp;#39;m using&amp;nbsp;&lt;span&gt;&amp;nbsp;nRF5 SDK&amp;nbsp;&lt;/span&gt; ble_app_uart (nRF52840_V17\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart) base code,&amp;nbsp; herewith i want to the change device name by using command command from mobile. Or uart . kindly suggest the solutions&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Chandru.A&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306227?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 07:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fdca921-6c6d-4298-b451-5c65503ac22a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Chandru,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Is this the passkey that can be used for MITM protection in BLE pairing, or is it something else? If you mean passkey, then you can set a passkey as shown &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/12957/error-while-bonding-with-pass-key-display/49361#49361"&gt;here&lt;/a&gt;. If you want to set it from the phone then you need a custom service for it, or if you just want to generate it you could use the RNG to generate a 6 digit random number.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306223?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 07:19:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f3c80d-fb93-4ce1-a311-640a653bc529</guid><dc:creator>chandru jasi</dc:creator><description>&lt;p&gt;Dear sir,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks For quick responds!!.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding password, Once we changed device name&amp;nbsp; like that, even password needs to be change, once connect with mobile again it should not ask PW. and every new pair the device should ask password, which is the our expectations.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp;Regards&lt;/p&gt;
&lt;p&gt;Chandru&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For nrf52840 need to be change the BLE device name and set the Password example code!!</title><link>https://devzone.nordicsemi.com/thread/306219?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 07:09:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81d6c584-c24c-4cfe-8584-f99d75bb635b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Chandru,&lt;/p&gt;
&lt;p&gt;Assuming you use the nRF5 SDK you can change the device name using&amp;nbsp;sd_ble_gap_device_name_set(), for instance as suggested &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44513/changing-device-name-dynamically/176001#176001"&gt;here.&lt;/a&gt;&amp;nbsp;Note that the advertising data also needs to be generated again as you can see in the end of the snippet. This snippet shows how to do this from the nRF isolated. You can also write to the device name characteristic (UUID&amp;nbsp;0x2A00) from the phone as you suggest if you only use Android, but for iOS this is not possible. So another option would be to use another mechanism (typically another custom service) to set the device name from a mobile phone, and then use the code indicated above.&lt;/p&gt;
&lt;p&gt;Regarding password I am not sure what you refer to there. Can you elaborate?&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>