<?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>advertise multiple services</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16748/advertise-multiple-services</link><description>Hi, 
 This seems to be an issue that pops up often. However, I wasn&amp;#39;t able to find an answer here in the Nordic forum. 
 What I have: 
 
 a number of vendor services 
 (services / characteristics are successfully added, I can see them using a Central</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Sep 2016 13:44:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16748/advertise-multiple-services" /><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64028?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 13:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddb7abd7-0393-448a-97a3-1c1f3da0a2d7</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;I GET IT :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64029?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 13:12:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:379b0770-b8fc-41e4-8a20-3fff98d60627</guid><dc:creator>J&amp;#248;rgen Kvalvaag</dc:creator><description>&lt;p&gt;I think it is a bit confusing in this example, that NUS_SERVICE_UUID_TYPE maps directly to BLE_UUID_TYPE_VENDOR_BEGIN. The first vs_uuid added will be type 2 (which maps to BLE_UUID_TYPE_VENDOR_BEGIN). But the second vs_uuid will be type 3 and so on. Hence the define name vendor_BEGIN, it maps to the first vendor specific uuid in the table.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64030?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 12:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87bd849a-e108-4cb3-a2ba-4900e17671cd</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi Kristin,&lt;/p&gt;
&lt;p&gt;Thank you for this. Referring to the ble_app_uart example, NUS_SERVICE_UUID_TYPE maps to BLE_UUID_TYPE_VENDOR_BEGIN (--&amp;gt; s. ble_types.h).&lt;/p&gt;
&lt;p&gt;But how/where to I tell the SoftDevice which one of my services I actually want? BLE_UUID_TYPE_VENDOR_BEGIN just says that I want a vendor-specific service.&lt;/p&gt;
&lt;p&gt;And: when setting up advertising/scan response: how/where do I tell the SoftDevice to use service A for the advertise packet and service B for the scan response?&lt;/p&gt;
&lt;p&gt;Thank you again,
Matthias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64027?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 11:30:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afb98720-1b3b-4e85-9e79-c725fab035ae</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Advertising two custom services means to advertise 2 x 16 bytes of data. The maximum payload for advertising data is 31 bytes. It means that two custom services won&amp;#39;t fit within the advertising data. What you can do is to add one service UUID in the advertising data, and add the other service UUID in the scan response data.&lt;/p&gt;
&lt;p&gt;Regarding how to add the service UUIDs: In ble_app_uart in the SDK, the  struct ble_uuid_t is used to manange UUIDs.&lt;/p&gt;
&lt;p&gt;ble_uuid_t.uuid is byte 12-13 of the advertised UUID.&lt;/p&gt;
&lt;p&gt;ble_uuid.type refers to the base UUID of the service, added using &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_3_0_1_0_2_0_2_2_8&amp;amp;anchor=ga265b4251110a15120d0aa97e5152163b"&gt;sd_ble_uuid_vs_add(..)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The base UUID is the 128-bit/16-byte UUID without byte 12-13. It means that when adding a 128-bit UUID using sd_ble_uuid_vs_add(..), byte 12-13 will be discarded (replaced by zeros). When using services and/or characteristics,  you have to refer to both the base UUID and byte 12-13 of the UUID in use.&lt;/p&gt;
&lt;p&gt;In ble_app_uart, BLE_UUID_NUS_SERVICE is byte 12-13 and NUS_SERVICE_UUID_TYPE is the base UUID.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64026?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 12:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93bb1917-4356-46f9-acef-dddcbd5e4e38</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;or another question: if you look at the UART example&lt;/p&gt;
&lt;p&gt;static ble_uuid_t   m_adv_uuids[] = {
{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
};  /**&amp;lt; Universally unique service identifier. */&lt;/p&gt;
&lt;p&gt;BLE_UUID_NUS_SERVICE --&amp;gt; what is in byte 12/13
NUS_SERVICE_UUID_TYPE --&amp;gt; that we&amp;#39;re talking about a vendor service&lt;/p&gt;
&lt;p&gt;My question: where do we say WHICH vendor service&lt;/p&gt;
&lt;p&gt;Greetings
Matthias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64025?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 12:35:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92cc2c27-6831-489f-966a-983c7496192e</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;Thank you for your quick reply. Yes I understand the uart app.&lt;/p&gt;
&lt;p&gt;Ok, let&amp;#39;s assume that I have added 6 vendor services using &amp;#39;sd_ble_uuid_vs_add&amp;#39; and &amp;#39;sd_ble_gatts_service_add&amp;#39;.&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;d like to advertise service #3 and #6. How do I setup &amp;#39;ble_advertising_init&amp;#39; parameters, the &amp;#39;ble_uuid_t&amp;#39; list respectively?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertise multiple services</title><link>https://devzone.nordicsemi.com/thread/64024?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 12:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60917f96-07b0-436b-96da-de2f5768dfb9</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Have a look at ble_app_uart, it advertises a vendor specific UUID. What do you mean by 3rd and 5th service?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>