<?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 128bits UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4172/custom-128bits-uuid</link><description>Hi,
I have some problems to advertise a custom 128bit UUID.
I succeeded to set the 128bit base UUID and my Characteristics UUIDs are 128bits.
But how I can set the PrimaryService UUID to be 128 bits?
I tried to set the returned type from sd_ble_uuid_vs_add</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Oct 2014 06:41:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4172/custom-128bits-uuid" /><item><title>RE: Custom 128bits UUID</title><link>https://devzone.nordicsemi.com/thread/14930?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2014 06:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd85145b-615e-405b-9c39-a30087edf491</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;What is BLE_UUID_SP_DATA_TYPE and BLE_UUID_SP_CMD_TYPE? Is it pointers to uuid_type from sd_ble_uuid_vs_add() call?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I&amp;#39;m using it for the ble_advdata_set() the device is not found by scanning.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think the problem may be that you have exceeded maximum advertising packet size and ble_advdata_set() call return an error and device reset from APP_ERROR_CHECK(err_code);. Check your app_error_handler() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bits UUID</title><link>https://devzone.nordicsemi.com/thread/14929?ContentTypeID=1</link><pubDate>Wed, 22 Oct 2014 21:07:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29065e13-f766-4038-b15d-2decedf911f2</guid><dc:creator>eli</dc:creator><description>&lt;p&gt;Hi, I do the same thing, using the uuit_base_type that had been generated by the  sd_ble_uuid_vs_add(). When I&amp;#39;m using it for the ble_advdata_set() the device is not found by scanning.
If I am changing the uuid type only in the advertising function, to BLE_UUID_TYPE_BLE only then I can see the device. It is very strange that all the characteristics and uuid nationalizations are done with the custom type nut the advertising function doesn&amp;#39;t like it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bits UUID</title><link>https://devzone.nordicsemi.com/thread/14928?ContentTypeID=1</link><pubDate>Wed, 22 Oct 2014 18:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af3b3aa-d1c1-4b6d-82d3-bbe82c44e8ff</guid><dc:creator>eli</dc:creator><description>&lt;p&gt;Yes it works, but the question is how I make the advertising ble_advdata_set() with 128 uuid?
please take a look at the advertising_init(). I am trying to advertise two services, when I am setting the UUID&amp;#39;s types to BLE_UUID_TYPE_VENDOR_BEGIN or the type I got from sd_ble_uuid_vs_add(),  I cannot find the device at all. I works only with the BLE_UUID_TYPE_BLE.&lt;/p&gt;
&lt;p&gt;static void advertising_init(void)
{
uint32_t      err_code;
ble_advdata_t advdata;
uint8_t       flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// YOUR_JOB: Use UUIDs for service(s) used in your application.
//ble_uuid_t adv_uuids[] = {{BLE_UUID_SP_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}};
  ble_uuid_t adv_uuids[] = {
				{BLE_UUID_SP_DATA_SERVICE,    BLE_UUID_SP_DATA_TYPE},
				{BLE_UUID_SP_CMD_SERVICE,     BLE_UUID_SP_CMD_TYPE}};

// Build and set advertising data
memset(&amp;amp;advdata, 0, sizeof(advdata));

advdata.name_type               = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance      = true;
advdata.flags.size              = sizeof(flags);
advdata.flags.p_data            = &amp;amp;flags;
advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
advdata.uuids_complete.p_uuids  = adv_uuids;

err_code = ble_advdata_set(&amp;amp;advdata, NULL);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom 128bits UUID</title><link>https://devzone.nordicsemi.com/thread/14927?ContentTypeID=1</link><pubDate>Wed, 22 Oct 2014 07:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82b976f1-02e5-4aca-934b-ccaa58720e99</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;You can to set custom service UUID like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_cs_init(ble_cs_t * p_cs, const ble_cs_init_t * p_cs_init)
{
    ble_uuid128_t   cs_base_uuid = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
                                    0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};
...
    // Add custom base UUID.
    err_code = sd_ble_uuid_vs_add(&amp;amp;cs_base_uuid, &amp;amp;p_cs-&amp;gt;uuid_type);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }

    ble_uuid.type = p_cs-&amp;gt;uuid_type;
    ble_uuid.uuid = BLE_UUID_CS_SERVICE;
    // Add service.
    err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                        &amp;amp;ble_uuid,
                                        &amp;amp;p_cs-&amp;gt;service_handle);
    /**@snippet [Adding proprietary Service to S110 SoftDevice] */
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }
    // Add Characteristics.
...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;UPD:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To add your custom service UUID to advertising packets you need to do this:&lt;/p&gt;
&lt;p&gt;In ble_cs.h:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BLE_UUID_CS_SERVICE            0x0001                       /**&amp;lt; The UUID of the Custom Service. */
#define BLE_UUID_CS_TX_CHARACTERISTIC  0x0002                       /**&amp;lt; The UUID of the TX Characteristic. */
#define BLE_UUID_CS_RX_CHARACTERISTIC  0x0003                       /**&amp;lt; The UUID of the RX Characteristic. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In main.c:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ble_cs_t                          m_cs;                                          /**&amp;lt; Structure to identify the Custom Service. */

static void advertising_init(uint8_t adv_flags)
{
    uint32_t      err_code;
    ble_advdata_t advdata;

    ble_uuid_t adv_uuids[] = 
    {
        {BLE_UUID_CS_SERVICE,                    m_cs.uuid_type}
    };
...
    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = adv_uuids;
    err_code = ble_advdata_set(&amp;amp;advdata, 0);
...
}

static void services_init(void)
{
    uint32_t          err_code;
    ble_cs_init_t     cs_init;
...
    memset(&amp;amp;cs_init, 0, sizeof(cs_init));

    cs_init.data_handler = cs_data_handler;
    cs_init.initial_tx_char_val = a_send_onoff_mode;
    
    err_code = ble_cs_init(&amp;amp;m_cs, &amp;amp;cs_init);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>