<?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>nRF5340 set advertising name in the code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62146/nrf5340-set-advertising-name-in-the-code</link><description>Hi, 
 I want to set advertising name in the main.c. 
 err = bt_set_name(&amp;quot;NAME test&amp;quot;); if (err) { printk(&amp;quot;BLE set name error (err %d)\n&amp;quot;, err); }else{ printk(&amp;quot;BLE set name success\n&amp;quot;); } printk(&amp;quot;BLE name=%s\n&amp;quot;,bt_get_name()); 
 I always get an error (</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jun 2020 07:14:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62146/nrf5340-set-advertising-name-in-the-code" /><item><title>RE: nRF5340 set advertising name in the code</title><link>https://devzone.nordicsemi.com/thread/253424?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 07:14:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b49a1d8b-eef9-4c72-adc9-9c3de15c1059</guid><dc:creator>LeoChen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks, it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 set advertising name in the code</title><link>https://devzone.nordicsemi.com/thread/253221?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 09:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5acb300d-feb6-4271-9c37-b5c2b4cca3ac</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Error 12 means &lt;a href="https://docs.zephyrproject.org/apidoc/latest/errno_8h_a6a05c923dad0c1208043e9c20a58c8e5.html#a6a05c923dad0c1208043e9c20a58c8e5"&gt;ENOMEM&lt;/a&gt;. Have you set &lt;a href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_DEVICE_NAME_DYNAMIC.html"&gt;CONFIG_BT_DEVICE_NAME_DYNAMIC&lt;/a&gt;&amp;nbsp;and &lt;a href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_DEVICE_NAME_MAX.html"&gt;CONFIG_BT_DEVICE_NAME_MAX&lt;/a&gt;&amp;nbsp;larger than the length of the name you try to set?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>