<?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 to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17946/how-to-find-128-bit-uuid-services-with-sd_ble_gattc_primary_services_discover</link><description>I am using the heart_rate_collector example code as a base of understanding of the Nordic stack. I have a device I am trying to connect to and the primary service I want to use is marked as an unknown service with a 128 bit uuid. It is the fourth service</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Oct 2023 01:23:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17946/how-to-find-128-bit-uuid-services-with-sd_ble_gattc_primary_services_discover" /><item><title>RE: How to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/thread/451603?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 01:23:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:879b24e5-815b-490f-942e-f68916df511e</guid><dc:creator>mhassan@thoughttechnology.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size:150%;"&gt;there are 2 important thing to discover 128bit or vendor specified UUIDs. first we should add the uuid by the&amp;nbsp;sd_ble_uuid_vs_add function to discover them as known 128bit uuid. second is we should track found uuid end service handler value and use next number to start discovery again until reahing to 0xffff value. discovery can be done in several steps. in order to read complete 128bit uuid i&amp;#39;m still working on it i guess we should read data from gat or something.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;#160; &amp;#160; &amp;#160;int cnt=p_prim_srvc_disc_rsp_evt-&amp;gt;count;

&amp;#160; &amp;#160; uint16_t&amp;#160; &amp;#160; &amp;#160; ServiceStartHandle = p_prim_srvc_disc_rsp_evt-&amp;gt;services[cnt-1].handle_range.end_handle;
if (cnt&amp;gt; 0 &amp;amp;&amp;amp; ServiceStartHandle != 0xffff)
{

StartDiscovery(ServiceStartHandle + 1);
Log(&amp;quot;Continue Discovery from service handle 0x%04X.....&amp;quot;, ServiceStartHandle);
}
else
{
Log(&amp;quot;Discovery Finished ------------------------------&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/thread/69217?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 13:49:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469a6588-d971-4104-8661-0ed3c3bf2292</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Johnnie,&lt;/p&gt;
&lt;p&gt;Is the &amp;quot;unknown&amp;quot; service UUID is known to the central in other words, the central knows which 128 bit UUID it&amp;#39;s looking for ? Or it&amp;#39;s a generic central and the peripheral&amp;#39;s proprietary 128 bit UUID (s) are not known in advance to the central ?&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s known for the central, the central should add the UUID base into the base UUID data base using sd_ble_uuid_vs_add (so there is a uuid_type bound to that UUID)&lt;/p&gt;
&lt;p&gt;By doing that, you won&amp;#39;t receive BLE_UUID_TYPE_UNKNOWN  when receiving BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP  or BLE_GATTC_EVT_CHAR_DISC_RSP.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t know in advance, then you have to accept BLE_UUID_TYPE_UNKNOWN   then after that do a read with sd_ble_gattc_read() on the start handle received on that event. Then you will have the 128 bit UUID returned as the value of that handle.&lt;/p&gt;
&lt;p&gt;After that you can add the UUID to get the uuid_type  for that UUID if you want.&lt;/p&gt;
&lt;p&gt;Note that by spec sd_ble_gattc_primary_service_discover() won&amp;#39;t return all the UUID, it&amp;#39;s only return the next (can be more than one) primary service. The client expected to call that again with Starting handle set to one greater than the last end handle.   Check section 4.4.1 Vol 3 Part G in the Bluetooth Spec v4.2&lt;/p&gt;
&lt;p&gt;I suggest to have a look at our ble_db_discovery.c library.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/thread/69216?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2016 17:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0c8a66c-85f5-4fa4-b379-0e1ff12565b3</guid><dc:creator>dbuijsma</dc:creator><description>&lt;p&gt;Just to clarify: this question concerns the &amp;quot;pc-ble-driver&amp;quot; found here: &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver"&gt;github.com/.../pc-ble-driver&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/thread/69215?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2016 16:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06dcbe7f-e70b-4572-889b-06c3baf0d1b3</guid><dc:creator>Johnnie</dc:creator><description>&lt;p&gt;I have checked out the pc-ble-driver code which lists the version of software I am using as &amp;quot;SoftDevice s132 API version 3&amp;quot;.  Neither of these two symbols can be found in the sources (&amp;quot;find . -type f -exec grep DISCOVER {} ; -print&amp;quot; fails to find them).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to find 128 bit uuid services with sd_ble_gattc_primary_services_discover</title><link>https://devzone.nordicsemi.com/thread/69214?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2016 12:30:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c401bcca-a7c1-4682-82be-98de3fe7f0d2</guid><dc:creator>FormerMember</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The maximum number of services that a central/master will be searching for is defined by  BLE_DB_DISCOVERY_MAX_SRV.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.0.0%2Flib_ble_db_discovery.html&amp;amp;cp=4_0_0_3_1_2"&gt;DB discovery module&lt;/a&gt; to search for a set of UUIDs, the UUIDs have to be added to the module using ble_db_discovery_evt_register().&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>