<?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>Custom Service Data UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63678/custom-service-data-uuid</link><description>Hi! 
 I am trying to add service data to my scan response service data for a custom service. I am unsure of how to set the UUID correctly for this. 
 UUID declaration: 
 
 Where I set the UUID for the service: 
 
 Setting the response service data: 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Jul 2020 14:17:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63678/custom-service-data-uuid" /><item><title>RE: Custom Service Data UUID</title><link>https://devzone.nordicsemi.com/thread/260613?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:17:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a52c3272-3ab8-4a0c-8772-90e85c424a65</guid><dc:creator>24thFrame</dc:creator><description>&lt;p&gt;Thank you! I am already using what you showed (setting uuids_complete.p_uuids with my custom service ID).&lt;/p&gt;
&lt;p style="border-left:2px solid grey;color:#707070;margin-left:20px;padding-left:10px;"&gt;Unfortunately, in the BLE advertising module in the SDK, we have only implemented support for 16-bit UUIDs when it comes to Service Data. Sorry for this inconvenience.&lt;/p&gt;
&lt;p&gt;Ah thank you, that answers my question. I guess I should either use the manufacture data&amp;nbsp;or just use the service data with a generic ID.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Data UUID</title><link>https://devzone.nordicsemi.com/thread/260497?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 08:45:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ef35dfd-2e1c-49ce-accc-855ccf917deb</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;When advertising what 128 bit service UUID you have, it&amp;#39;s usually done like this (from ble_app_uart example), by putting it into the &amp;quot;Service UUID&amp;quot; field.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;

    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_LIMITED_DISC_MODE;

    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.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_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);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;where&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static ble_uuid_t m_adv_uuids[]          =                                          /**&amp;lt; Universally unique service identifier. */
{
    {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You are instead trying to put your 128bit service UUID in the &amp;quot;Service Data&amp;quot; field.&lt;/p&gt;
&lt;p&gt;Looking at the &lt;a href="https://www.bluetooth.com/specifications/bluetooth-core-specification/"&gt;Bluetooth&amp;nbsp;Core Specification Supplement&lt;/a&gt;, this is described like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1594974995376v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, in the BLE advertising module in the SDK, we have only implemented support for 16-bit UUIDs when it comes to Service Data. Sorry for this inconvenience.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1594975515552v2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Data UUID</title><link>https://devzone.nordicsemi.com/thread/260247?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 22:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20a7f45d-e229-4f07-8f7f-ed12c43fd9b1</guid><dc:creator>24thFrame</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;, good catch with the 056 -&amp;gt; 0x56. :)&lt;/p&gt;
&lt;p&gt;Sorry, I don&amp;#39;t think I phrased my question correctly. I&amp;#39;m aware that the base ID is the base for all bytes except 13 and 14 bytes, which are replaced by the two bytes for each specific service or characteristic (in my case&amp;nbsp;TIMECODE_SERVICE_UUID, though I now realize from your example that I should be setting it to 0x0001 for consistency). What I don&amp;#39;t understand is how to pass that value to&amp;nbsp;service_data.service_uuid.&lt;/p&gt;
&lt;p&gt;For example, with the code above,&amp;nbsp;&lt;strong&gt;service_data.service_uuid = TIMECODE_SERVICE_UUID&lt;/strong&gt;&amp;nbsp;will return&amp;nbsp;&lt;strong&gt;00000001-0000-1000-8000-00805f9b34fb (&lt;/strong&gt;according to the Bluetooth library on my phone app I am working on), the Bluetooth base ID with my&amp;nbsp;&lt;span&gt;TIMECODE_SERVICE_UUID (0x0001)&lt;/span&gt;. I need it to be my &lt;em&gt;custom&lt;/em&gt; service ID (&lt;strong&gt;3fe10001-3073-4194-a4fa-2d14c2742e8b&lt;/strong&gt;, which is&amp;nbsp;TIMECODE_SERVICE_UUID using TIMECODE_SERVICE_UUID_BASE as the base).&lt;/p&gt;
&lt;p&gt;Is this possible? Or am I misunderstanding how service data sends the ID (eg. it it always 2 bytes, as the expected value for p_service_data_array.service_uuid is uint16_t)? Or maybe the ID I posted above is how the app library I am using on my phone interprets the service ID in the service data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Data UUID</title><link>https://devzone.nordicsemi.com/thread/259808?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 07:46:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95feddd6-a360-43ab-b07b-70d1c13a6c7e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Note that the service UUID is formed by the UUID base, but byte 13 and 14 of the UUID is formed by the 2 bytes of the service UUID.&lt;/p&gt;
&lt;p&gt;E.g. for the NUS service, &lt;br /&gt;The BASE is&amp;nbsp;&lt;span&gt;{{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, &lt;strong&gt;0x00, 0x00&lt;/strong&gt;, 0x40, 0x6E}}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;and the 2 byte UUID for the NUS service is 0x0001&lt;/p&gt;
&lt;p&gt;The complete NUS service UUID will then be 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, &lt;strong&gt;0x01, 0x00&lt;/strong&gt;, 0x40, 0x6E&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Byte 13 and 14&amp;nbsp;&lt;/span&gt;in your&amp;nbsp;TIMECODE_SERVICE_UUID_BASE,&amp;nbsp;&lt;span&gt;&amp;quot;0xDA, 0x19,&amp;quot;,&lt;/span&gt;&amp;nbsp;is therefore ignored.&lt;/p&gt;
&lt;p&gt;Also note that in your&amp;nbsp;TIMECODE_SERVICE_UUID_BASE, your second byte, 056, is not defined as hex value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>