<?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>Problems with Discovery all the services, including custum UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22235/problems-with-discovery-all-the-services-including-custum-uuid</link><description>Hello Community 
 I have read the following threads: 
 devzone.nordicsemi.com/.../ 
 devzone.nordicsemi.com/.../ 
 
 In order to know how to discover my services, including the 128 bit UUID base, but I can only find 3 of 5 of them. Also I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 May 2017 09:31:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22235/problems-with-discovery-all-the-services-including-custum-uuid" /><item><title>RE: Problems with Discovery all the services, including custum UUID</title><link>https://devzone.nordicsemi.com/thread/87363?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 09:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:498d98a5-8a50-4f90-ac8b-3033f8489a5f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;In fact there are only 16-byte (128-bit) UUIDs in BLE, there is just agreement that for &amp;quot;standard&amp;quot; (= listed at BT SIG) UUIDs the &amp;quot;base&amp;quot; is well-known (you can find it in BT SIG Core document) and so it can be shortened to 2 bytes (16 bits). Now Nordic stack (Soft Device) works the same way for all UUIDs on GATT layer: whatever is exchange over radio link it appears as 2-byte &amp;quot;short&amp;quot; UUID (3rd and 4th byte which means bytes 12 and 13 in zero-indexed array of bytes with little endian encoding) and reference to base UUID in the Soft Device (G)ATT table. By default there is of course only BT SIG base UUID listed, all the rest must be provisioned by application (= you). Now to the practical things, how to do actual Service Discovery:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You always want to know your target 16-byte UUIDs at compile time (or at FW boot before SD init). Then you can provision them into the stack and you will be always getting 16-bite (2-byte) UUID + reference to 16-byte base in GATT event callbacks so you can always do what you want.&lt;/li&gt;
&lt;li&gt;If for whatever reason you don&amp;#39;t know these then you need to use workaround explained by me in the first referenced question&amp;amp;answer: read the GATT handle of Service/Characteristic and you will get 16-bytes of full UUID a response. Then you can act immediately and optionally you can provision it to the SD so next time you will get proper short UUID + reference to known (&amp;quot;registered&amp;quot;) base. Just remember that if you don&amp;#39;t know how many such proprietary bases you meet during FW runtime then you cannot scale the table during SD init and so you should not provision everything to the SD through &lt;code&gt;sd_ble_uuid_vs_add&lt;/code&gt; because you will run out of memory (= SD will return error result code).&lt;/li&gt;
&lt;li&gt;The best way to see if you are doing proper Service Discovery sequence you should get BLE trace and look into the commands on ATT/GATT layer. If you go through all the handles you want then your logic is probably correct. If not then you can easily spot the bug. The UART debug print-out you paste here is not enough (if you don&amp;#39;t want to look into RF traces then you need to print much more, e.g. what handle ranges and SD call you do and what is in event data upon callback from each step).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>