<?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>change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16836/change-advertisement-index-in-advertise-packet</link><description>advertise.png hello there 
 in advertising packet i want something like first name of device and then service data and then manufacture data ?? 
 how can i do that?? 
 from screenshot , i want AD Data 3 first then AD Data 2 in advertisement packet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Oct 2016 13:46:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16836/change-advertisement-index-in-advertise-packet" /><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64432?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 13:46:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0339cad-7745-4b7f-8166-d3e2d296e52e</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;If the problem with the encoding order is solved. This thread should be marked as &amp;quot;solved&amp;quot;, and the new question should be placed in a new question, due to readability for others with the same questions.&lt;/p&gt;
&lt;p&gt;From what I can see, service data is not in the advertising data because service_data is not added to advdata. If that is not the reason, please create a new question instead of continuing in this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64431?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2016 06:38:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57dd9c9f-e08d-403d-ab59-b44ff7ae78cc</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;All you need to do to change the order of the advertised data is to change the order that the data is being encoded in adv_data_encode(..)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64430?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2016 05:30:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e08adbef-bb5c-4d74-a1fd-ccf307eebe24</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;waiting for your response&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64428?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 08:14:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7cb7157-04c5-4f0c-b207-a305e6507dd8</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;ok thanks.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    ble_advdata_t scanrsp;
	  ble_advdata_service_data_t service_data;
    uint8_t data1[3] ={0x01,0x03,0x04};
    // Build advertising data struct to pass into @ref ble_advertising_init.
    memset(&amp;amp;advdata, 0, sizeof(advdata));
    advdata.name_type          = BLE_ADVDATA_SHORT_NAME;
	  advdata.short_name_len = 1;
    advdata.include_appearance = false;

    advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
		service_data.service_uuid =0x0018;
    service_data.data.p_data = data1;
		service_data.data.size = sizeof(data1);
    
    ble_adv_modes_config_t options = {0};
    options.ble_adv_fast_enabled  = BLE_ADV_FAST_ENABLED;
    options.ble_adv_fast_interval = APP_ADV_INTERVAL;
    options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

    err_code = ble_advertising_init(&amp;amp;advdata,NULL, &amp;amp;options, on_adv_evt, NULL);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after writing this function, i am not getting service data in advertisement packet.
can you help me?? what is my problem??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64429?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 06:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e06de241-d8f1-4e4d-97f2-a2bdc390b1df</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;just look at the code. ble_advertising_init() calls ble_advdata_set() which calls adv_data_encode(). Change adv_data_encode() or write your own version of the whole thing.&lt;/p&gt;
&lt;p&gt;I have no idea by the way why you care about the ordering of the fields in the advertising data, it doesn&amp;#39;t matter at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64427?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2016 13:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b1db67-5e2b-40dc-8e7e-4abd848bf0b2</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;i can&amp;#39;t understand how to use adv_data_encode(....)&lt;/p&gt;
&lt;p&gt;like in this function&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;

    // Build and set advertising data
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance      = true;
    advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
   advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = m_adv_uuids;

    ble_adv_modes_config_t options = {0};
    options.ble_adv_fast_enabled  = BLE_ADV_FAST_ENABLED;
    options.ble_adv_fast_interval = APP_ADV_INTERVAL;
    options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

    err_code = ble_advertising_init(&amp;amp;advdata, NULL, &amp;amp;options, on_adv_evt, NULL);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;how to use adv_data_encode(..)??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64426?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2016 10:18:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee460dd-0168-4e03-9235-114a141d1f85</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;My answer below should answer the question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64433?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2016 07:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f936504-4d68-4406-8ae2-12669a30093e</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The data supplied to &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_3_0_1_0_2_1_2_2&amp;amp;anchor=gaddbb12e078d536ef2e93b41d77ff6243"&gt;sd_ble_gap_adv_data_set(..)&lt;/a&gt; is the raw data to be placed in the advertising packet. In the SDK, the advertising module, using ble_advdata_set(..) --&amp;gt; &lt;strong&gt;adv_data_encode(..)&lt;/strong&gt;, encodes the advertising data from the type ble_advdata_t to raw advertising data. Changing the order of the encoding in adv_data_encode, will change the order of the advertised data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change advertisement index in advertise packet</title><link>https://devzone.nordicsemi.com/thread/64425?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2016 06:38:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56248b53-e8f6-4599-8d15-30eef39a4f28</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;what are you asking? What&amp;#39;s &amp;quot;bame&amp;quot; for a start, and what has your question got to do with the parameters in the structure. Please ask a proper question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>