<?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 discover the all  service uuid</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86841/how-to-discover-the-all-service-uuid</link><description>Hi! 
 In my device,I make a master to connect a slave，in the NRF5_SDK，all examples for client are initialize with the service uuid.The questions is when the master don&amp;#39;t konw the slave service uuid before connect,how to discover the all slave service</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Apr 2022 13:56:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86841/how-to-discover-the-all-service-uuid" /><item><title>RE: How to discover the all  service uuid</title><link>https://devzone.nordicsemi.com/thread/362887?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2022 13:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c7f1e05-84cd-41b0-ad5f-e23dd7163fb6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can look at the ble_app_uart_c example. Please note that this application knows the UUID that it is looking for, but the method is the same if you don&amp;#39;t know it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can see that in the ble_evt_handler -&amp;gt; case BLE_GAP_EVT_CONNECTED, it calls ble_db_discovery_start(). This will trigger a series of callbacks in&amp;nbsp;db_disc_handler(). In this example, the only thing that this callback does is to call ble_nus_c_on_db_disc_evt(..., p_evt).&amp;nbsp; You can see in this function (ble_nus_c_on_db_disc_evt() in ble_nus_c.c) that it only checks whether the p_evt-&amp;gt;evt_type is BLE_DB_DISCOVERY_COMPLETE, and then it checks whether the UUID in the DISCOVERY_COMPLETE event is the same as the NUS service UUID. If that returns true, then it checks if the characteristics are the ones that it expects to find.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So instead of checking whether the UUID is a specific service UUID, you can do whatever you want to do with the UUIDs in this callback (db_disc_handler()).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>