<?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>User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/285/user-custom-data-in-advertising-packets</link><description>The BTLE specification does allow user/custom data to be added to the advertising packets. Which field in the advertising data structure is the right place for adding such data? I&amp;#39;d like to avoid hacks, so prefer to do it only where appropriate.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 May 2021 12:11:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/285/user-custom-data-in-advertising-packets" /><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/310426?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 12:11:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e28ec50-0d3d-4079-b4b3-73a7208f4464</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Is it possible to make custom service and advertise instead of Manufacturer Specific Data? we don&amp;#39;t have 16bit company identifier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1526?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 12:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05f87cf4-8236-4e8e-aad0-418bdd2f2319</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Yes, you can send data like this. If your data is related to some service then you can send it as service data (for example send current battery state info related to battery service). See this: &lt;a href="https://devzone.nordicsemi.com/question/12846/adding-service_data-to-advertising-custom-service/?answer=12850#post-id-12850"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1525?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 11:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7986f6c3-8196-42ce-b5a0-40c2f236f63d</guid><dc:creator>michurin</dc:creator><description>&lt;p&gt;Does it make sense to output data in such way?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1524?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 06:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df18adc2-0d1c-47eb-959a-35adb604f9af</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;If you&amp;#39;re asking whether you can update your manufacturer specific data by calling advertising_init(adv_flags, new_data_val) then yes, you can do it like this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1523?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2014 02:19:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b9c7a8a-df3f-4a32-bf01-045f7353bd9b</guid><dc:creator>michurin</dc:creator><description>&lt;p&gt;Does it make any sense if I want to output some value via advertising package to use  manufacturer specific data? if so, then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;typedef union {
    uint8_t  adv_manuf_data_data[1];
    int16_t  val;
} actual_data_u;
   /*****/
static void advertising_init(uint8_t adv_flags, int16_t val) 
{
    actual_data_u my_data;
  /****/  
   actual_data.val = val;
   adv_manuf_data_array.p_data = my_data.adv_manuf_data_data;
   adv_manuf_data_array.size = sizeof(adv_manuf_data_data); 
   /****/
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When I need to change then I&amp;#39;ll call this function again.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1520?ContentTypeID=1</link><pubDate>Fri, 20 Jun 2014 11:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d767c2fd-b584-4e02-b2d9-456eef6bf409</guid><dc:creator>leo</dc:creator><description>&lt;p&gt;thx :) it works now!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1519?ContentTypeID=1</link><pubDate>Sun, 15 Jun 2014 12:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5171307-4732-4b7d-9a2e-decdfda1ce67</guid><dc:creator>leo</dc:creator><description>&lt;p&gt;hi Torbjørn,&lt;/p&gt;
&lt;p&gt;unfortunately the attachment isn&amp;#39;t available any more. Could you please upload it again?
Thanks in advance! :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1522?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2013 16:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98b4a701-8b55-4113-9669-7b9dd7eacad7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I am glad I could be of assistance ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1521?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2013 20:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b1a752-d5b8-4cf3-9207-ad6b215d0099</guid><dc:creator>Maximilian M&amp;#252;ller</dc:creator><description>&lt;p&gt;Hi Torbjørn,&lt;/p&gt;
&lt;p&gt;Thanks for the hint.&lt;/p&gt;
&lt;p&gt;I used the &amp;quot;NRF_FICR-&amp;gt;DEVICEADDR[0]&amp;quot; and &amp;quot;NRF_FICR-&amp;gt;DEVICEADDR[1]&amp;quot; lines of code in order to retrieve the Device address and then I send it as part of the &lt;em&gt;manufacturerSpecificData&lt;/em&gt; together with the company ID. (in the &lt;em&gt;advdata_update&lt;/em&gt; routine of the ble_app_temp project)&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Cordially,&lt;/p&gt;
&lt;p&gt;Maximilian Müller&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1517?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2013 10:04:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bee66f91-0c92-47ea-bef2-4cea38c0eaf6</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Please note that Pål is a stack developer, and doesn&amp;#39;t know the SDK very well. :-) He therefore focuses on how the softdevice API is made.&lt;/p&gt;
&lt;p&gt;If you use the SDK, you&amp;#39;re most likely better off looking at Torbjørn&amp;#39;s answer below, as the SDK wraps up the setting of advertisement data quite nicely. By using it, you can set the data up in C structs instead of pure data arrays. Take a look at the ble_advdata_t type, and especially its p_service_data_array and p_manuf_specific_data fields.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1518?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2013 12:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a1827f-b5e9-4fb7-9a56-9bcd82323750</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;For a small example of how to include manufacturer specific data in the advertise packet please have a look at the attached example. It is based on the HRS example in the SDK, the only change is to the advertise packet.&lt;/p&gt;
&lt;p&gt;Regards
Torbjørn&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_manufacturer_5F00_data.zip"&gt;ble_app_hrs_manufacturer_data.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1516?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2013 11:39:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b64afe95-2b5d-4207-b477-1cab54076e0f</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;When I refer to GAP  then I&amp;#39;m talking about the Bluetooth 4.0 Specification - Volume 3, Part C,&lt;/p&gt;
&lt;p&gt;Specification can be found here:
&lt;a target="_blank" href="https://www.bluetooth.org/en-us/specification/adopted-specifications" rel="nofollow"&gt;https://www.bluetooth.org/en-us/specification/adopted-specifications&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1515?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 12:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ab60b81-0f78-411b-8eec-3858d9ce9adc</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;Where exactly are you referring to when you say &amp;quot;GAP (11.1)&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1514?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 12:03:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a842ffbf-7161-42dd-af94-2498ca1bc263</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;The first byte is the length of this field, the second one is the ID for manufacturer specific data.&lt;/p&gt;
&lt;p&gt;Have a look at GAP (11.1) for information on how do do this information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1513?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 12:02:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3cb72db-564a-47bd-8446-d3a0d1de6837</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;Thanks! What would &amp;#39;Service Data&amp;#39; look like? (Some of these fields are a mystery to me... what do the first two bytes mean?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1512?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 12:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94f3d229-a4ce-470f-a33d-fb4bd60c7b03</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;uint8_t adv_data[] = {0x07, 0xFF, (COMPANY_ID &amp;amp; 0xFF), ((COMPANY_ID &amp;gt;&amp;gt; 8) &amp;amp; 0xFF), 0x01, 0x02, 0x03, 0x04, 0x05};&lt;/p&gt;
&lt;p&gt;this is Manufacturer Specific Data, data length 5, don&amp;#39;t think we have any examples using this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1511?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 11:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35b403eb-8b9f-4c83-b94b-00512b356102</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;Are there an example of this working? I can&amp;#39;t find any use of these structures in the SDK. My attempts so far don&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1510?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 10:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e037656e-6f5f-4edf-b54f-e1972c85546e</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;It should be reflected immediately if I recall it correctly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1509?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 10:26:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:729c7166-72f1-4853-adb0-fd5cc158a023</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;Thanks! Will changes to these fields be reflected immediately, or a stop/resume of advertising be needed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User/custom data in advertising packets?</title><link>https://devzone.nordicsemi.com/thread/1508?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 10:22:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39c47582-54c8-439d-9c7d-22f03b93f125</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;The best place to add user/custom data is in the field Service Data (GAP 11.1.10) if you have a 16bit UUID service or in the Manufacturer Specific (Data GAP 11.1.4) if you have a 16 bit company identifier&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>