<?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>Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24454/why-is-my-device-name-being-truncated</link><description>Using SDK 14.0.0 with SD 132 v5, the device name I&amp;#39;m advertising with here is &amp;quot;000000DK&amp;quot;. But the advertising module is truncating it to &amp;quot;0000&amp;quot;. It will do this if I have too much advertising data, but I don&amp;#39;t. I should have 31 bytes and that should be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Nov 2021 11:07:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24454/why-is-my-device-name-being-truncated" /><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/339397?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 11:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a007264-5e29-47b2-8bee-9044767158a6</guid><dc:creator>Spacha</dc:creator><description>&lt;p&gt;This&amp;nbsp;is an old thread but thought to give an update in case someone stumbles upon this problem.&lt;/p&gt;
&lt;p&gt;As&amp;nbsp;mentioned before, the advertisement space is limited&amp;nbsp;to 31 bytes including device appearance, name and other advertisement data. To have longer name, you need to get rid of something else (for example appearance, which gives some 4 bytes more space, or UUID, which gives a lot more).&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a demonstration of the &lt;code&gt;advertising_init()&lt;/code&gt; function that is used to configure the advertisements. The comments show where you can&amp;nbsp;give more space for the device name (appearance and UUID).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = true; //&amp;lt;&amp;lt; To remove appearance, set this to false
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    
    //&amp;lt;&amp;lt; Comment out these 2 lines to remove the UUID from the advertisement
    //&amp;lt;&amp;lt; This gives a lot of space for the name.
    init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/195477?ContentTypeID=1</link><pubDate>Sun, 30 Jun 2019 11:21:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3206ac8-b3e2-4e66-a27f-ed1769d1ed3b</guid><dc:creator>Shimon_nohayo</dc:creator><description>&lt;p&gt;I have a very similar problem,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you explain what do you mean by removing UUID?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Shimon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/195476?ContentTypeID=1</link><pubDate>Sun, 30 Jun 2019 11:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2101cc04-34ae-4b11-af4d-a35f4775fc06</guid><dc:creator>Shimon_nohayo</dc:creator><description>&lt;p&gt;I have a very similar problem,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you explain what do you mean by removing UUID?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Shimon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/120092?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2018 12:15:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:934d3b0d-9bf8-497e-9011-9d93e9e74c1b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;31 bytes is maximum. If you want to have a longer device name you need to remove something else, UUID for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/120053?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2018 07:52:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6548294f-adfa-4c0d-b9ca-db94e304730a</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I wrote function for advertising like that;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = false;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;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;But still I can not see full device name. When include_appearance is true I can see 4 charecter,&amp;nbsp;When include_appearance is&amp;nbsp;false I can see 8 charecter. I understand the data length calculation but I want to see full device name. So, Can I make the length more than 31 bytes?&amp;nbsp;Or is there another way to see full device name?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/96281?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2017 09:10:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd8f9f52-7568-43a2-a2e0-5fbaa86a485c</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Bingo. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/96280?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 23:44:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92884ed1-4137-433b-b75d-bfa565289909</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Here you go, &lt;code&gt;\components\ble\common\ble_advdata.h&lt;/code&gt; file line #148 inside struct &lt;code&gt;ble_advdata_t&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bool include_appearance; /**&amp;lt; Determines if Appearance shall be included. */
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/96279?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 23:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eddb0d90-93d7-4ea4-a438-22940c9abf26</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;There seems to be line #373 of &lt;code&gt;\components\ble\ble_advertising\ble_advertising.c&lt;/code&gt; file saying:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_advertising-&amp;gt;advdata.include_appearance = p_init-&amp;gt;advdata.include_appearance;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;so I expect new parameter of some init structure  called &lt;code&gt;include_appearance&lt;/code&gt; which you just need to set properly when calling module. init or adv. start...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/96278?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 23:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7ce3016-3bce-4cf7-b652-0daf16c94a29</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Nothing&amp;#39;s changed in what I&amp;#39;m attempting to advertise. What&amp;#39;s changed is the SDK or the SD, I&amp;#39;m fairly sure. My question was, how do I omit the appearance from the advertising packet?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is my device name being truncated?</title><link>https://devzone.nordicsemi.com/thread/96277?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 23:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68d0f3f2-0219-4116-afec-e99187de5a0f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;On the picture you have (beside last Device Name AD) three AD objects. They come in Length-Tag-Value form where length counts also Tag. So by simple math 3+2+17+3(length bytes) = 25 bytes which leaves just 6 for whole Device Name AD element to be 31 in total. When you cut Length and Tag you have your 4 bytes so module is having this right. The question is which AD element has changed since previous version (and then by looking to changes in SDK code you should easily spot why and how to fix it).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>