<?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>Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name</link><description>Hello, 
 I am using nRF 52840 DK board and using nRF52SDK17.0.2. I am trying to advertise data in GAP with the name &amp;quot; IG_Last4CharMAC_RFL &amp;quot; for example &amp;quot; IG_4DA8_RFL &amp;quot; but whenever I increase below obj.data.size =2; to obj.data.size =12; it is getting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 12 Mar 2022 06:07:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name" /><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357773?ContentTypeID=1</link><pubDate>Sat, 12 Mar 2022 06:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:512b551e-fac3-4bf1-9dc5-df83e2a137f2</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Karl Ylvisaker,&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357680#357680"]Now you have moved both the UUID list and the service data into the scan response[/quote]
&lt;p&gt;Corrected. Moved UUID to advdata and kept service data into the scan response.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357680#357680"]At least I do not see any issue in the code snippet you have provided.[/quote]
&lt;p&gt;Okay, Noted.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357680#357680"]I would recommend that you clean up the code a little, and remove all commented lines to increase readability and maintainability.[/quote]
&lt;p&gt;Corrected and thanks for this. I will keep it in mind.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357680#357680"]Are you not going to be using an advertising event handler in your application?[/quote]
&lt;p&gt;Currently Not needed. Maybe I will use it in the future.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357680?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 13:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cb9e937-040d-4c24-84ef-f7242153c3b0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Neeraj,&lt;br /&gt;&lt;br /&gt;Now you have moved both the UUID list and the service data into the scan response, which are the two big datafields in your advertising. Keep in mind that I do not know the size of the UUID data, but since the SoftDevice would complain if it did not fit into the scan response then I would think that this is all right!&lt;br /&gt;At least I do not see any issue in the code snippet you have provided.&lt;br /&gt;I would recommend that you clean up the code a little, and remove all commented lines to increase readability and maintainability.&lt;br /&gt;&lt;br /&gt;Are you not going to be using an advertising event handler in your application?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357654?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 12:34:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2a14653-08e7-4e1c-bc82-19eff63d8090</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Karl Ylvisaker,&lt;/p&gt;
&lt;p&gt;I moved my GAP service data (which was in&amp;nbsp;advdata in the above example) to scan response and then it works. Now it is getting displayed full name as mentioned above.&lt;/p&gt;
&lt;p&gt;Here is updated advertising_init() function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;
uint32_t err;

ble_advdata_service_data_t obj;
obj.service_uuid = BLE_UUID_TX_POWER_SERVICE;

obj.data.p_data = loadcellData;
obj.data.size =12;
    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; //displayed in raw as type 0x01
   // 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.advdata.p_manuf_specific_data = 0xFF;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.srdata.p_tx_power_level = &amp;amp;BT_TX_POWER;
    init.srdata.p_service_data_array =&amp;amp;obj;
    init.srdata.service_data_count=1;

      //init.config.ble_adv_primary_phy      = BLE_GAP_PHY_1MBPS;
    //init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS;
    //init.config.ble_adv_extended_enabled = true;

    //init.config.ble_adv_directed_high_duty_enabled  = true;
    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = BT_GAP_INT_MAX;
    init.config.ble_adv_slow_interval = BT_GAP_INT_MIN;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.config.ble_adv_slow_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);
    NRF_LOG_INFO(&amp;quot;ble_advertising_init %d&amp;quot;,err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
    NRF_LOG_INFO(&amp;quot;advertising_init done.&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please check and correct me if I am wrong or the way I did.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Neeraj&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357605?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 10:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fac7b16d-df66-48db-9a9a-495c5e55f7ff</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="Neeraj Dhekale"]I have tried to implement scan response by checking int ble_app_uart. And now 1st&amp;nbsp; 7 characters are getting displayed for example &amp;quot;&lt;strong&gt;IG_4D25&lt;/strong&gt;&amp;quot; still 3 more characters are yet to be displayed.[/quote]
&lt;p&gt;Then the advertising packet is still too big to fit within the 31 byte limit.&lt;br /&gt;Currently you have flags (3 bytes), tx power (3 bytes), service data (16 bytes) and 2 bytes overhead for the name datafield. This leaves 7 bytes that you can use for the device name.&lt;br /&gt;How many bytes of the scan response packet are you using? Perhaps you could move the device name into the scan response as well, if there is more room left there. Alternatively you could try to move TX power to the scan response, to free up 3 additional bytes in the advertising data payload.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357530?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 06:06:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4340076-8eca-485e-ab85-4dcdda116fb6</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Karl Ylvisaker,&lt;/p&gt;
&lt;p&gt;Thanks for confirming. I have tried to implement scan response by checking int ble_app_uart. And now 1st&amp;nbsp; 7 characters are getting displayed for example &amp;quot;&lt;strong&gt;IG_4D25&lt;/strong&gt;&amp;quot; still 3 more characters are yet to be displayed.&lt;/p&gt;
&lt;p&gt;My updated advertising_init() function is below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;
uint32_t err;

ble_advdata_service_data_t obj;
obj.service_uuid = BLE_UUID_TX_POWER_SERVICE;

obj.data.p_data = loadcellData;
obj.data.size =12;
    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; //displayed in raw as type 0x01
   // 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.advdata.p_manuf_specific_data = 0xFF;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.advdata.p_tx_power_level = &amp;amp;BT_TX_POWER;
    init.advdata.p_service_data_array =&amp;amp;obj;
    init.advdata.service_data_count=1;

      //init.config.ble_adv_primary_phy      = BLE_GAP_PHY_1MBPS;
    //init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS;
    //init.config.ble_adv_extended_enabled = true;

    //init.config.ble_adv_directed_high_duty_enabled  = true;
    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = BT_GAP_INT_MAX;
    init.config.ble_adv_slow_interval = BT_GAP_INT_MIN;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.config.ble_adv_slow_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);
    NRF_LOG_INFO(&amp;quot;ble_advertising_init %d&amp;quot;,err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
    NRF_LOG_INFO(&amp;quot;advertising_init done.&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357359?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 10:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4150a72b-20a5-48b7-b5c2-3c6e4984ed22</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Neeraj Dhekale"]only adding above line will work?[/quote]
&lt;p&gt;No, the scan response data should be put in the same&amp;nbsp;&lt;span&gt;ble_advertising_init_t&amp;nbsp;structure as the advertising data.&lt;br /&gt;You can see an example of how this is done in the ble_app_uart peripheral example in the nRF5 SDK.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357353?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 09:43:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5ba9605-f122-4ef6-aa23-270b575bd80f</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;I have tried to add below line to advertising_init(). But it doesnot work. it is still showing name as &amp;quot;IG_&amp;quot; in nRF connect app.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;memset(&amp;amp;scanrsp, 0, sizeof(scanrsp));
    scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    scanrsp.uuids_complete.p_uuids  = m_adv_uuids;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;only adding above line will work?&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357338?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 09:09:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f839fbd-44ab-4f22-a01c-b460802fcc52</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Neeraj Dhekale,&lt;br /&gt;&lt;br /&gt;Great, I am glad to hear that you have added the checks back in.&lt;br /&gt;I look forward to hearing your update on the use of scan response!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357334?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 08:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:834d4724-f84d-405f-9a05-dfd6443c8170</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Karl Ylvisaker,&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357325#357325"]could this be an option for you, to move the name into the scan response instead?[/quote]
&lt;p&gt;I will try this and will update you.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357325#357325"]I also notice that you have commented out the APP_ERROR_CHECK for the ble_advertising_init[/quote]
&lt;p&gt;corrected. &lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/85656/softdevice---the-increasing-size-of-advertisement-causes-crop-in-advertisement-name/357325#357325"]and that there is no APP_ERROR_CHECK for your TX_POWER set function - I would strongly advice that you add APP_ERROR_CHECKS for both of these, so that you may know if the program encounters an error here.[/quote]
&lt;p&gt;Corrected. Thank you so much for this.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - The increasing size of advertisement causes crop in advertisement name</title><link>https://devzone.nordicsemi.com/thread/357325?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 08:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dc64e6d-d24e-4fe1-a65e-dbc7713de79f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Legacy advertising has a hard 31 byte limit, meaning that the entire data payload of the advertising must be less than 31 bytes. Each new datafield (such as device name, flags, manufacturer specific data) also requires 2 bytes of overhead.&lt;br /&gt;The SoftDevice will remove characters from the device name if it is not room for the entire name.&lt;br /&gt;I notice that you are not setting up a scan response in your code - could this be an option for you, to move the name into the scan response instead?&lt;br /&gt;The scan response can be 31 bytes as well, effectively doubling the possible advertising data.&lt;br /&gt;&lt;br /&gt;I also notice that you have commented out the APP_ERROR_CHECK for the ble_advertising_init, and that there is no APP_ERROR_CHECK for your TX_POWER set function - I would strongly advice that you add APP_ERROR_CHECKS for both of these, so that you may know if the program encounters an error here.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>