<?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>How can I create a custom 128 bit base uuid?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72901/how-can-i-create-a-custom-128-bit-base-uuid</link><description>Hello, 
 Please give detailed steps to create a custom 128-bit base UUID for our custom service and characteristics.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Mar 2021 08:07:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72901/how-can-i-create-a-custom-128-bit-base-uuid" /><item><title>RE: How can I create a custom 128 bit base uuid?</title><link>https://devzone.nordicsemi.com/thread/300581?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 08:07:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfcb7952-cd0a-48bb-860c-f03a8daa4480</guid><dc:creator>Yadhu KP</dc:creator><description>&lt;p&gt;thank you einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I create a custom 128 bit base uuid?</title><link>https://devzone.nordicsemi.com/thread/300574?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 07:49:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c2a68e5-0def-405d-8548-375223ba8d4a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Ah, I see. I misunderstood the question. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7260/how-to-acquire-a-vendor-base-uuid/25668#25668"&gt;this post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I create a custom 128 bit base uuid?</title><link>https://devzone.nordicsemi.com/thread/300558?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 04:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69ba1836-03ba-4691-8418-b620a1b85b97</guid><dc:creator>Yadhu KP</dc:creator><description>&lt;p&gt;Einar thanks for the reply, but what I really want is the method to create a 128bit base UUID&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I create a custom 128 bit base uuid?</title><link>https://devzone.nordicsemi.com/thread/300400?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 12:35:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c716665-954f-4fe6-978e-6f7e9f380e21</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I recommend you refer to the ble_nus.c implementation which demonstrates usage of a custom 128 bit UUID. Referring to that what you need to add a 128 bit UUID is to fist add the base UUID:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Add a custom base UUID.
    err_code = sd_ble_uuid_vs_add(&amp;amp;nus_base_uuid, &amp;amp;p_nus-&amp;gt;uuid_type);
    VERIFY_SUCCESS(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This adds the base and the &amp;quot;handle&amp;quot; for that base is put in the uuid_type varible, which is an output. This is essentially just a counter, and the first added base UUID will always be&amp;nbsp;BLE_UUID_TYPE_VENDOR_BEGIN which is 2. . (This is why you see some example refer to&amp;nbsp;BLE_UUID_TYPE_VENDOR_BEGIN instead of actually using the handle from the call to&amp;nbsp;sd_ble_uuid_vs_add).&amp;nbsp;If you add another custom base it will be 3 etc.&lt;/p&gt;
&lt;p&gt;Later when adding the service UUID you refer to the type to get the correct base:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;   ble_uuid.type = p_nus-&amp;gt;uuid_type;
    ble_uuid.uuid = BLE_UUID_NUS_SERVICE;

    // Add the service.
    err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                        &amp;amp;ble_uuid,
                                        &amp;amp;p_nus-&amp;gt;service_handle);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and the same when adding characteristics:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Add the TX Characteristic.
    /**@snippet [Adding proprietary characteristic to the SoftDevice] */
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid              = BLE_UUID_NUS_TX_CHARACTERISTIC;
    add_char_params.uuid_type         = p_nus-&amp;gt;uuid_type;
    add_char_params.max_len           = BLE_NUS_MAX_TX_CHAR_LEN;
    add_char_params.init_len          = sizeof(uint8_t);
    add_char_params.is_var_len        = true;
    add_char_params.char_props.notify = 1;

    add_char_params.read_access       = SEC_OPEN;
    add_char_params.write_access      = SEC_OPEN;
    add_char_params.cccd_write_access = SEC_OPEN;

    return characteristic_add(p_nus-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;p_nus-&amp;gt;tx_handles);
    /**@snippet [Adding proprietary characteristic to the SoftDevice] */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>