<?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>Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63228/attaching-custom-128-bit-characteristic-uuids-to-custom-128-bit-service-uuid-where-the-base-does-not-match</link><description>Hi, 
 I am trying to emulate a vendor&amp;#39;s tool, whose BLE properties are configured as follows: Custom 128 bit Service UUID like XXXXXXXX- 0000 -XXXX-XXXX-XXXXXXXXXXXX 
 Custom 128 bit Characteristic UUID like XXXXXXXX- 0001 -XXXX-XXXX-XXXXXXXXXXXX 
 There</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jul 2020 11:54:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63228/attaching-custom-128-bit-characteristic-uuids-to-custom-128-bit-service-uuid-where-the-base-does-not-match" /><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/258986?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 11:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fea5d2b-4dac-419b-877f-11c37f28cde2</guid><dc:creator>only1chi</dc:creator><description>&lt;p&gt;I did finally figure it out looking at other posts. As it turns out, I was not registering my base uuid. I fixed this by calling services_init() function first before calling advertising_init().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/258928?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 07:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a41745cc-3357-4f2b-966a-98624128e80f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I recommend to check out some of the threads with similar problems:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/17312/nrf52-returning-error-code-7-when-trying-to-set-proprietary-uuid-in-advertising-data"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/17312/nrf52-returning-error-code-7-when-trying-to-set-proprietary-uuid-in-advertising-data&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The description from the error code is:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html#ga2e55f7d7e631d072c24f2d6bc0860cc8"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html#ga2e55f7d7e631d072c24f2d6bc0860cc8&lt;/a&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" rowspan="1"&gt;&lt;a title="Invalid Parameter." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group__nrf__error.html#ga0a5831cf5092e0dd43a01869676ee076"&gt;NRF_ERROR_INVALID_PARAM&lt;/a&gt;&lt;/td&gt;
&lt;td colspan="1" rowspan="1"&gt;Invalid UUID type.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/258890?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 02:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a88c7f4-444f-47b3-99a3-f2756a82c364</guid><dc:creator>only1chi</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think that too much data is the problem.&lt;/p&gt;
&lt;p&gt;The error code is&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;NRF_ERROR_INVALID_PARAM&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;This is from the function&lt;/p&gt;
&lt;pre&gt;sd_ble_uuid_encode(&amp;amp;uuid, &amp;amp;encoded_size, NULL)&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t quite understand why this function is returning an error_code = 7;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/258034?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 09:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44d385fb-1bc7-4b15-8e23-bfa95b43f442</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I think you are trying to put to much data into the advertising packet, and you get an error due to size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you tried to debug to find where the error code that is causing the crash is coming from? Typically by checking&amp;nbsp;app_error_fault_handler().&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/257881?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 14:00:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce0a1692-be8d-4768-9163-8657243887a3</guid><dc:creator>only1chi</dc:creator><description>&lt;p&gt;I configured&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_VS_UUID_COUNT count to 7.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;The failure happens in during advertising initialization, in function&amp;nbsp;ble_advdadta_encode.&amp;nbsp;&lt;br /&gt;The failure goes away if I don&amp;#39;t include my custom service in the m_adv_uuids[] array.&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/257878?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 13:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:810c67d0-5616-4ba2-a71c-1ee49591bef5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;What have you configured to&amp;nbsp;NRF_SDH_BLE_VS_UUID_COUNT to?&lt;/p&gt;
&lt;p&gt;Have you tried to debug to find where the error code that is causing the crash is coming from? Typically by checking&amp;nbsp;app_error_fault_handler().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/257874?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 13:49:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e56bc0eb-42bd-42f9-ba4f-1dac17be1b4c</guid><dc:creator>only1chi</dc:creator><description>&lt;p&gt;I do have one more question:&lt;br /&gt;&lt;br /&gt;My application has three services, including battery service and device information service.&lt;br /&gt;In my main.c file, I try to add the services, along with my custom service for advertising. However, this causes a crash.&lt;br /&gt;This is the piece of code that adds my service uuid. How do I make my custom service advertise its UUID?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;// YOUR_JOB: Use UUIDs for service(s) used in your application.
static ble_uuid_t m_adv_uuids[] =                                               /**&amp;lt; Universally unique service identifiers. */
{
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
    {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
    {BLE_UUID_VECTOR_PUMP, BLE_UUID_TYPE_VENDOR_BEGIN}
};
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/257869?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 13:38:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c93f8d5-9c4c-462b-91aa-c4901302011f</guid><dc:creator>only1chi</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thank you. Your suggestion worked. I can now see all my 6 characteristics attached to the same service.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1593610648193v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Chiz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match</title><link>https://devzone.nordicsemi.com/thread/257794?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 11:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:204a2c57-8c93-4d1e-8900-ff0afda6969d</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I believe this should work.&lt;/p&gt;
&lt;p&gt;You need to call&amp;nbsp;sd_ble_uuid_vs_add for all 6 UUIDs, make sure that you buffer away the uuid_type for each of the calls, since the uuid_type is the handle that you need to reference later when adding the characteristics (or services).&lt;/p&gt;
&lt;p&gt;When you later want to add the charactertistics you use&amp;nbsp;&lt;span&gt;sd_ble_gatts_characteristic_add() as normal,&amp;nbsp;however make sure that the&amp;nbsp;&lt;em&gt;p_attr_char_value&lt;/em&gt;&amp;nbsp;now reference the uuid_type (e.g. UUID) that you want to use in &lt;em&gt;p_attr_char_value&lt;/em&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.0/structble__uuid__t.html"&gt;infocenter.nordicsemi.com/.../structble__uuid__t.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>