<?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 do I add a custom characteristic value UUID.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7534/how-do-i-add-a-custom-characteristic-value-uuid</link><description>I try to add a custom characteristic value&amp;#39;s UUID. I couldn&amp;#39;t find any example or document that provide this information. All I can find is a function sd_ble_gatts_descriptor_add(), which is for adding custom characteristic description. Does the API has</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Jun 2015 23:56:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7534/how-do-i-add-a-custom-characteristic-value-uuid" /><item><title>RE: How do I add a custom characteristic value UUID.</title><link>https://devzone.nordicsemi.com/thread/26839?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2015 23:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ffe11d5-ca14-46bc-a130-c598488e2f56</guid><dc:creator>utrank00</dc:creator><description>&lt;p&gt;Thanks!.  This helps me to resolve the issue that I had.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add a custom characteristic value UUID.</title><link>https://devzone.nordicsemi.com/thread/26838?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2015 06:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92732f33-9166-4872-8bde-fd28cfc318b6</guid><dc:creator>Andreas</dc:creator><description>&lt;p&gt;Good morning,&lt;/p&gt;
&lt;p&gt;for me it works like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static uint32_t custom_characteristic_char_add(ble_device_t * p_dev, const ble_device_init_t * p_dev_init)
  

{
    ble_gatts_char_md_t char_md;
    ble_gatts_attr_t    attr_char_value;
    ble_uuid_t          ble_uuid;
    ble_gatts_attr_md_t attr_md;

    memset(&amp;amp;char_md, 0, sizeof(char_md));

    char_md.char_props.write         = 1;
    char_md.char_props.write_wo_resp = 1;
    char_md.p_char_user_desc         = NULL;
    char_md.p_char_pf                = NULL;
    char_md.p_user_desc_md           = NULL;
    char_md.p_cccd_md                = NULL;
    char_md.p_sccd_md                = NULL;

    ble_uuid.type = p_dev-&amp;gt;uuid_type;
    ble_uuid.uuid = BLE_CUSTOM_UUID;

    memset(&amp;amp;attr_md, 0, sizeof(attr_md));

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);

    attr_md.vloc    = BLE_GATTS_VLOC_STACK;
    attr_md.rd_auth = 0;
    attr_md.wr_auth = 0;
    attr_md.vlen    = 1;

    memset(&amp;amp;attr_char_value, 0, sizeof(attr_char_value));

    attr_char_value.p_uuid    = &amp;amp;ble_uuid;
    attr_char_value.p_attr_md = &amp;amp;attr_md;
    attr_char_value.init_len  = 1;
    attr_char_value.init_offs = 0;
    attr_char_value.max_len   = BLE_DEVICE_MAX_CUSTOM_UUID_LEN;

    return sd_ble_gatts_characteristic_add(p_dev-&amp;gt;service_handle,
                                           &amp;amp;char_md,
                                           &amp;amp;attr_char_value,
                                           &amp;amp;p_dev-&amp;gt;customUUID_handles);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will get a custom characteristic with a custio defined UUID (#define BLE_CUSTOM_UUID 0x1234).&lt;/p&gt;
&lt;p&gt;I think this is done in the example nus_service... (UART over BLE).&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>