<?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 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53123/custom-128bit-uuid-is-advertised-incorrectly</link><description>Hello, 
 I am having some trouble attempting to advertise a single custom 128bit uuid. I have two custom services sharing the same base uuid. Everything works correctly after connecting, the correct uuids show up for both services and chars. The problem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Oct 2019 05:36:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53123/custom-128bit-uuid-is-advertised-incorrectly" /><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215197?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 05:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c30e279-3ce8-4b79-b7dd-fff5e67c952f</guid><dc:creator>mrono</dc:creator><description>[quote userid="5673" url="~/f/nordic-q-a/53123/custom-128bit-uuid-is-advertised-incorrectly/215194"]Would you be willing to expand more on how I could get the correct value at runtime in advertising_init() please![/quote]
&lt;p&gt;Try something like this in advertising_init():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    static ble_uuid_t adv_uuid;
    adv_uuid.uuid = BLE_UUID_DCS_SERVICE;
    adv_uuid.type = m_cus.uuid_type;

    // ....
    
    init.advdata.uuids_complete.uuid_cnt = 1;
    init.advdata.uuids_complete.p_uuids  = &amp;amp;adv_uuid;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Once you have initialized the custom service then m_cus.uuid_type holds the correct index to that service&amp;#39;s base UUID.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215194?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 04:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38d2fba8-bf6a-44d7-a672-d0a6b067c8c6</guid><dc:creator>k3nt</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/mrono"&gt;mrono&lt;/a&gt;&amp;nbsp;and &lt;a href="https://devzone.nordicsemi.com/members/bjorn_2d00_spockeli"&gt;bjorn-spockeli&lt;/a&gt;Thank you both for your responses! mrono, it does seem that you were correct in your suspicion. I am in fact using the dfu service and was initializing it before my own custom services. I tested moving the dfu service init to after my service inits and now the correct UUID base is being advertised. I also agree with you very strongly that this is not a suitable solution, and nowhere have I ever seen mention of the importance in the order of service inits in regards to advertising. Would you be willing to expand more on how I could get the correct value at runtime in advertising_init() please!&lt;/p&gt;
&lt;p&gt;-Kent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215095?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd0b252f-6022-4103-99d5-09e473f9f13b</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;I agree that the issue is caused by the order of operations. A Nordic service, possibly DFU or NUS, is initialized first. Therefore the first VS UUID in the table is the Nordic one. However, I don&amp;#39;t think relying on the order is the proper way to fix this.&lt;/p&gt;
&lt;p&gt;In my opinion the error is right here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ble_uuid_t m_adv_uuids[] = {{BLE_UUID_DCS_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_UUID_TYPE_VENDOR_BEGIN basically means &amp;quot;The index of&amp;nbsp;the first vendor specific base UUID&amp;quot;. Here you don&amp;#39;t want the first base UUID, but specifically the base UUID of the DCS_SERVICE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The correct base UUID is available from p_cus-&amp;gt;uuid_type once the service has been initialized. So I&amp;#39;d forget the m_adv_uuids[]-array entirely and get the correct value at runtime in advertising_init().&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215071?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 12:21:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c44dc05d-7bb5-4857-bece-2c4896d8c387</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/mrono"&gt;mrono&lt;/a&gt;: Thanks for sharing.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/k3nt"&gt;k3nt&lt;/a&gt;: Then there must be something with the order of the function calls that adds the VS UUID and populated the GATT table . If you have multiple vendor specific base UUIDs then you must call&amp;nbsp;&amp;nbsp;&lt;span&gt;sd_ble_uuid_vs_add() before any&amp;nbsp;sd_ble_gatts_service_add, sd_ble_gatts_characteristic_add or&amp;nbsp;sd_ble_gatts_descriptor_add calls.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215061?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 11:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed7e6156-2ba1-41cd-91e8-a4172e9458b2</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;That seems to be the Nordic base UUID (BLE_NORDIC_VENDOR_BASE_UUID), mixed with the custom service UUID.&lt;/p&gt;
&lt;p&gt;I recall seeing this earlier. If you have two vendor specific base UUIDs, the way many Nordic examples are written don&amp;#39;t specify which one do you want to use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/215013?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 09:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1784f672-b22e-4368-a1bc-fd9f0d2365ed</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok. Would you mind sharing the project folder? I would like to reproduce the issue here on a nRF52 DK. This would make it easier to debug.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/214927?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 21:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27e0325f-cc53-4dd8-bd50-e88daa12c9d6</guid><dc:creator>k3nt</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;Yes, it returns 0 for both custom services.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bit UUID is Advertised Incorrectly</title><link>https://devzone.nordicsemi.com/thread/214844?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 12:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b290463b-ec16-4a5e-a42e-301a1e5c7041</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Kent,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;have you verified that&amp;nbsp;sd_ble_uuid_vs_add() returns NRF_SUCCESS?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>