<?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>Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93787/advertising-both-service-data-and-manufacturing-data</link><description>Hi team, 
 We are using NRF52833 with PCA10100 on it and soft device version is s140. 
 We are advertising with both service data and manufacturing data. 
 1. Initially when we are advertising ( advertising_init function ) with both service data and manufacturing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Nov 2022 08:28:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93787/advertising-both-service-data-and-manufacturing-data" /><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/396128?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2022 08:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65e047aa-f1e6-4faf-b787-4a1e0066fe95</guid><dc:creator>hareesh gorle</dc:creator><description>&lt;p&gt;Hi Joakim,&lt;/p&gt;
[quote userid="115540" url="~/f/nordic-q-a/93787/advertising-both-service-data-and-manufacturing-data"]We are using NRF52833 with PCA10100 on it and soft device version is s140.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;nRF5 SDK version is&amp;nbsp;nRF5_SDK_17.1.0_ddde560.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hareesh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395998?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2022 13:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c24ff79-67a7-4b73-a43a-2e2a44398956</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll take a closer look.&lt;/p&gt;
&lt;p&gt;Which version of the nRF5 SDK are you working with?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395957?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2022 11:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbc410bb-8227-40ad-bb1b-004f698f9711</guid><dc:creator>hareesh gorle</dc:creator><description>&lt;p&gt;Hi Joakim,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="115540" url="~/f/nordic-q-a/93787/advertising-both-service-data-and-manufacturing-data"]1. Initially when we are advertising (&lt;span&gt;advertising_init&amp;nbsp; function&lt;/span&gt;) with both service data and manufacturing data, we are able to see the device full name in advertisement.[/quote]
&lt;p&gt;Initially it is working fine. That you can see in the following image.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2022_2D00_11_2D00_16-at-16.45.26.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Once I update the manufacture data and service data with the&amp;nbsp; same length, the following error coming.&lt;/p&gt;
[quote userid="115540" url="~/f/nordic-q-a/93787/advertising-both-service-data-and-manufacturing-data/395782"]&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;info&amp;gt; app: Updating advertising data!&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 12 [NRF_ERROR_DATA_SIZE] [/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here I am attaching both advertise_init() and advdata_update() functions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ble_advdata_t  new_advdata;

static void advertising_init(void)
{
    uint32_t  err_code;
    uint8_t serv_data[16] = {0};
    uint8_t manf_data[1] = {0x3C};

    ble_advertising_init_t init;

    ble_advdata_manuf_data_t manuf_spec_data;

    ble_advdata_service_data_t service_data;

    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; 
   
    service_data.service_uuid =  BLE_UUID_NUS_SERVICE;
    service_data.data.size = sizeof(serv_data);
    service_data.data.p_data = serv_data; 

    manuf_spec_data.company_identifier = 0xFFFF;
    manuf_spec_data.data.p_data = manf_data;
    manuf_spec_data.data.size = sizeof(manf_data);

    init.srdata.uuids_more_available.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_more_available.p_uuids = m_adv_uuids;

    init.srdata.p_service_data_array = &amp;amp;service_data;
    init.srdata.service_data_count = 1;

    init.advdata.p_manuf_specific_data = &amp;amp;manuf_spec_data;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = 0;//APP_ADV_DURATION; // to make advertisment infinate

    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);

}

static void adv_data_update_timer_handler(void * p_context)
{
    ret_code_t                  err_code;
    ble_advdata_manuf_data_t    manuf_data;
    ble_advdata_service_data_t  new_servdata;

    uint8_t new_serv_data[16] = {0};

    static uint8_t payload_index = 0;

    NRF_LOG_INFO(&amp;quot;Updating advertising data!&amp;quot;);
    
    manuf_data.company_identifier = 0xFFFF;
    manuf_data.data.p_data = manufacturing_data_payload_list + payload_index;
    manuf_data.data.size = PAYLOAD_SIZE;

    new_advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    new_advdata.include_appearance = false; // to change BLE symbol apperence as user mentioned
    new_advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; //for infinate advertisement

    new_servdata.service_uuid =  BLE_UUID_NUS_SERVICE;
    new_servdata.data.size = sizeof(new_serv_data);
    new_servdata.data.p_data = new_serv_data; 

    new_advdata.uuids_more_available.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    new_advdata.uuids_more_available.p_uuids = m_adv_uuids;

    new_advdata.p_service_data_array = &amp;amp;new_servdata;
    new_advdata.service_data_count = 1;        

    new_advdata.p_manuf_specific_data = &amp;amp;manuf_data;

    err_code = ble_advertising_advdata_update(&amp;amp;m_advertising, &amp;amp;new_advdata, NULL);
    APP_ERROR_CHECK(err_code);  

    if(payload_index == TOP_INDEX)
    {
        payload_index = 0;
    }
    else
    {
        payload_index++;
    }

    NRF_LOG_INFO(&amp;quot;Advertising data updated!&amp;quot;);

}
&lt;/pre&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now my question is,&amp;nbsp;&lt;span&gt;How to advertise both service data and manufacturing data dynamically without losing any data ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please check the code and let me know if anything I need to change.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hareesh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395791?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 13:09:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff4f0abe-ac8f-41f1-a3d2-262bcaf90758</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Thanks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The error is most likely returning from&amp;nbsp;&lt;span&gt;ble_advdata_encode().&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" rowspan="1"&gt;NRF_ERROR_DATA_SIZE&lt;/td&gt;
&lt;td colspan="1" rowspan="1"&gt;If the operation failed because not all the requested data could fit into the provided buffer or some encoded AD structure is too long and its length cannot be encoded with one octet.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395782?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 12:52:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8853fdec-f64f-4e0a-ba74-7fdff0302261</guid><dc:creator>hareesh gorle</dc:creator><description>&lt;p&gt;Hi Joakim,&lt;/p&gt;
&lt;p&gt;Initially I am advertising with manufacturing and service data.&lt;/p&gt;
&lt;p&gt;Once I update the manufacture data, the following error coming.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;info&amp;gt; app: Updating advertising data!&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 12 [NRF_ERROR_DATA_SIZE] at C:\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart\main.c:363&lt;br /&gt;PC at: 0x0002B9AB&lt;br /&gt;&amp;lt;error&amp;gt; app: End of error report.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;err_code = ble_advertising_advdata_update(&amp;amp;m_advertising, &amp;amp;new_advdata, NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&amp;nbsp; &amp;nbsp; =======================================&amp;gt;&amp;gt;&lt;span&gt;main.c:363&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help me to resolve the issue.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hareesh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395684?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 07:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25bb7e15-5638-4f3e-8781-04e07d9a6640</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hello Hareesh.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For future reference:&amp;nbsp;&lt;br /&gt;When uploading code, you can use the &amp;quot;Insert -&amp;gt; Code&amp;quot; feature. That makes it a lot easier for us to read your ticket.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;__________&lt;/p&gt;
&lt;p&gt;As for your questions:&amp;nbsp;&lt;/p&gt;
[quote user=""]we are unable to see the device full name in advertisement[/quote]
&lt;p&gt;You have a limited amount of data available in the advertising packet. I don&amp;#39;t see you mention anything specific about your setup so I assume this is normal BLE advertising, thus having 31 bytes available.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the advertising packet contains more data than allowed, the SD will automatically shorten the device name in order to fit all the data in the advertising packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume that is why you are missing data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please take another look at your advertising data and double check that you aren&amp;#39;t exceeding the limit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Br,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising both service data and manufacturing data</title><link>https://devzone.nordicsemi.com/thread/395669?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2022 04:17:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f6b367d-bbf9-46a9-b9b6-eccf69949db3</guid><dc:creator>hareesh gorle</dc:creator><description>&lt;p&gt;Is there anyone to help me ?.....Please reply&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>