<?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>manufacturer specific data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9467/manufacturer-specific-data</link><description>Hi, 
 I want to use the whole payload of the advertising packet. I decided to use the manufacturer specific data. BUt I cant&amp;#180;use the whole payload by myself. I get this payload: 11 00 is &amp;quot;my&amp;quot; test company identifier 1-5 is my payload. I can&amp;#180;t find the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2015 07:59:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9467/manufacturer-specific-data" /><item><title>RE: manufacturer specific data</title><link>https://devzone.nordicsemi.com/thread/34970?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2015 07:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88cce758-7b8f-4f1d-a102-082bb150d108</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi. Good to hear! If you are satisfied with the answer and don&amp;#39;t have any more related questions then please accept the answer and close the case. This will make it easier for other users with the same problem to search for and find the answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: manufacturer specific data</title><link>https://devzone.nordicsemi.com/thread/34969?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2015 07:41:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cafec757-ba7d-4744-bd70-a1591da881ff</guid><dc:creator>SKo</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;your solution works perfect. By the way with your response you solved another issue I was facing. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: manufacturer specific data</title><link>https://devzone.nordicsemi.com/thread/34968?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 13:00:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55d4d6df-e842-447c-a351-70e209bc99a7</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;As Carles describes &lt;a href="https://devzone.nordicsemi.com/question/49078/fully-custom-advertisement-data/"&gt;here&lt;/a&gt;, you can put whatever data you want in the advertising packet, but you will have to comply with the triplet format [size, type, data] format that is described in the spec. &lt;a href="https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile"&gt;Here&lt;/a&gt; is a list of types and &lt;a href="https://devzone.nordicsemi.com/question/37952/setting-tx_power_level/"&gt;here&lt;/a&gt; is more info on the triplet format. Comparing the data in your packet with the list you can see that the three first bytes of your advdata packet is a flag field, 02 = size (1 byte), 01 = type (flags, 1 byte), 06 = data (flags, 06 = &lt;em&gt;BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;However, getting rid of the flag field is easier said than done, but there is a workaround. In SDK 9 advertising is initiated with &lt;em&gt;ble_advertising_init()&lt;/em&gt; which takes your advpacket, some options, etc as arguments. &lt;em&gt;ble_advertising_init()&lt;/em&gt; is checking the validity of your advdata and will return an error if the packet doesn&amp;#39;t include a flag field. The function also passes some important options and an eventhandler to be used in various functions in ble_advertising.c. In the end of &lt;em&gt;ble_advertising_init()&lt;/em&gt; you will find &lt;em&gt;sd_ble_gap_adv_data_set()&lt;/em&gt; defined in ble_gap.h. This is the function that sets your advdata and it won&amp;#39;t complain as long as you follow the triplet scheme. So det simplest workaround I found (without tinkering with ble_advertising.c or ble_advdata.c) was this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    
    // Build an advertising packet as usual containing flags
    memset(&amp;amp;advdata, 0, sizeof(advdata));
    advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    // Sett all relevant options
    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;

    // Call ble_advertising_init() to pass the options and the event handler to ble_advertising.c 
    err_code = ble_advertising_init(&amp;amp;advdata, NULL, &amp;amp;options, on_adv_evt, NULL);
    APP_ERROR_CHECK(err_code);
    
    // Build your advertising packet. 
    uint8_t m_addl_adv_manuf_data[] = {0x08, 0xFF, 0x11, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05};   
    
    // Cheat the softdevice by overwriting the advertising packet data
    err_code = sd_ble_gap_adv_data_set(m_addl_adv_manuf_data, sizeof(m_addl_adv_manuf_data), NULL, 0);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The packet &lt;em&gt;m_addl_adv_manuf_data&lt;/em&gt; is a 9 byte long array.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Length field, 1 byte&lt;/li&gt;
&lt;li&gt;Data type value indicating manufacturer specific data, 1 byte&lt;/li&gt;
&lt;li&gt;Manuf data, 7 bytes. (Company identifier 0x0011, payload 0x01, 0x02, 0x03, 0x04, 0x05)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you are fine with some tinkering, possibly causing ripple effects in all examples and code your SDK folders, there is a very simple workaround:&lt;/p&gt;
&lt;p&gt;Comment out the following in &lt;em&gt;ble_advdata_set()&lt;/em&gt; found in ble_advdata.c:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    err_code = advdata_check(p_advdata);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then you will skip the flag validation entirely. By doing this the code you posted worked &amp;quot;out of the box&amp;quot; on my system.&lt;/p&gt;
&lt;p&gt;Finally note that because of the triplet system you will not be able to have more than 29 bytes of useful payload.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>