<?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 to set variable BLE device name</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51135/how-to-set-variable-ble-device-name</link><description>OS in development environment ：Windows7 HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals CPU :(Nordic) nRF52832 / ARMR Cortex-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD Soft Ver:nRF5_SDK_15.2.0_9412b96 
 The device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Aug 2019 08:03:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51135/how-to-set-variable-ble-device-name" /><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/206031?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 08:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f17570d-6cc1-4fe9-8814-2f9bfa9f50be</guid><dc:creator>CodeLoader</dc:creator><description>&lt;p&gt;Your array with the name is defined like this:&lt;/p&gt;
&lt;p&gt;static uint8_t DEVICE_NAME[16];&lt;/p&gt;
&lt;p&gt;And you call the function like this:&lt;/p&gt;
&lt;p&gt;setGapDeviceName(&amp;amp;DEVICE_NAME);&lt;/p&gt;
&lt;p&gt;Note that&amp;nbsp;&lt;span&gt;setGapDeviceName requires a pointer to a value, not a pointer to a pointer. Don&amp;#39;t take the address of DEVICE_NAME, it&amp;#39;s already an array:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;setGapDeviceName(DEVICE_NAME);&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/206022?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 07:36:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70c42425-d920-4d8a-9fba-82a80567bae3</guid><dc:creator>yokokawa</dc:creator><description>&lt;p&gt;How do I remove pointer specific warnings?&lt;br /&gt;UICR function is undefined&lt;br /&gt;What is missing?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/build_5F00_190826_2D00_1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart_2800_20190826_2D005B00_UICR_5D002900_.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_2800_20190826_2D005B00_UICR_5D002900_.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/205930?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 14:33:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b10b4691-8880-43fb-8778-86b8d6e8f54a</guid><dc:creator>CodeLoader</dc:creator><description>&lt;p&gt;If your name string is not a constant, it&amp;#39;s not a problem. Just cast it to a const pointer and it works:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;void setGapDeviceName(char* name) {
    ble_gap_conn_sec_mode_t sec_mode;
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);
    APP_ERROR_CHECK(sd_ble_gap_device_name_set(&amp;amp;sec_mode, (const uint8_t*)name, strlen(name)));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Mind that in order to make this name change actually work, you have to re-initialize advertising using&amp;nbsp;&lt;strong&gt;ble_advertising_init&amp;nbsp;&lt;/strong&gt;as in the beginning of the program and start advertising using&amp;nbsp;&lt;strong&gt;ble_advertising_stop.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Also, if you are currently advertising, you firstly need to run&amp;nbsp;&lt;strong&gt;ble_advertising_stop&lt;/strong&gt;&amp;nbsp;before reinitializing and restarting.&lt;/p&gt;
&lt;p&gt;Lastly, if you are currently connected to the central, you can&amp;#39;t run any of these (for example, central sends you a new device name). Raise a flag, and when you receive&amp;nbsp;BLE_ADV_EVT_FAST or whatever you use as the advertising start event, check the flag. If flag is raised, clear it and reinitialize the advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/205766?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 07:40:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b63ba256-baf5-4680-95be-900c84cd7fe3</guid><dc:creator>yokokawa</dc:creator><description>&lt;p&gt;I have written a program that uses UICR to remember and call a device name, but I get an error without a function definition.&lt;br /&gt;Please tell me how to fix it.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart_2800_20190815_2D00_UICR_2900_.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_2800_20190815_2D00_UICR_2900_.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/204894?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 04:52:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3683dcc-8779-4183-b443-aab95cada38e</guid><dc:creator>yokokawa</dc:creator><description>&lt;pre class="tw-data-text tw-text-large tw-ta" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;I want to set the device name with the device name in the variable instead of the constant.

&amp;ldquo;Sd_ble_gap_device_name_set&amp;rdquo; needs to be set as a constant.

How can I set the device name in the variable?&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set variable BLE device name</title><link>https://devzone.nordicsemi.com/thread/204735?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 11:44:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc93411-cba6-41bc-94ec-a33f12e81e71</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Check out:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44513/changing-device-name-dynamically/176001#176001"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/44513/changing-device-name-dynamically/176001#176001&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>