<?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 get data from Unknown Service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82158/how-to-get-data-from-unknown-service</link><description>Hello. I am trying to get data from BLE sensors. Sensors work like Nordic uart service. Main problem is that every BLE sensor has different 128-bit UUID of that service. If i use central nus example from nRF5 SDK and change NUS_BASE_UUID to 128-bit UUID</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Dec 2021 08:26:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82158/how-to-get-data-from-unknown-service" /><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341797?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 08:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3368295-3510-4f05-88bc-e45cbe8cf2cd</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Dima,&lt;/p&gt;
&lt;p&gt;I am very glad that it helped.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341757?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 21:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d3b2437-3b20-475d-8b21-4d10f01316e3</guid><dc:creator>nda</dc:creator><description>&lt;p&gt;Thank you very much. That helped.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341717?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 14:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b8555d5-d4c4-4e43-a292-a9d5ba5377ab</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Dima,&lt;/p&gt;
&lt;p&gt;You can add this new functionality&lt;strong&gt;&amp;nbsp;(sd_ble_opt_set(BLE_GATTC_OPT_UUID_DISC, &amp;amp;(ble_opt_t){.gattc_opt.uuid_disc.auto_add_vs_enable = 1});) &lt;/strong&gt;which is described in the migration document&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638451160372v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;in the ble_app_uart example after iniitalization of soft device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;static void ble_stack_init(void)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;err_code = nrf_sdh_enable_request();&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;//configure the BLE stack using the default settings. Fetch the start address of the application RAM .&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;uint32_t ram_start = 0;&lt;/p&gt;
&lt;p&gt;err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;//Enable BLE stack&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;//Register a handler for BLE events&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_opt_set(BLE_GATTC_OPT_UUID_DISC, &amp;amp;(ble_opt_t){.gattc_opt.uuid_disc.auto_add_vs_enable = 1}); &lt;strong&gt;// (this line is from the migration document-improved functionality)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you please try and see what is the consequence. Please let us know.&lt;/p&gt;
&lt;p&gt;Best Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341570?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 15:26:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:610a5127-57d9-4621-9b60-4cf8881dbc19</guid><dc:creator>nda</dc:creator><description>&lt;p&gt;Thank you for your answer, but main problem is that&amp;nbsp;&lt;span&gt;p_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;params&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;discovered_db&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;srv_uuid&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;uuid is 16 Bit UUID, but i need 128 bit UUID. If i use&amp;nbsp;sd_ble_gattc_primary_services_discover i also receive only&amp;nbsp;16 Bit UUIDs of services. How can i get 128 bit UUID?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341564?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 15:07:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96cc5657-988b-461b-9688-562bed55a3e2</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Dima,&lt;/p&gt;
&lt;p&gt;We do not have any direct tutorial for it. Since I mentioned in my previous message that is one of the&amp;nbsp;new features of s140_nrf52_7.2.0 when migrating from s140_nrf52_7.0.1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, here is the technique from our expat which can be added in the existing example ble_app_uart_c (&lt;span&gt;SDK17.0.2\examples\ble_central\ble_app_uart_c). Inside this code you can see that the discovery is started in the BLE_GAP_EVT_CONNECTED in the ble_evt_handler() by using ble_db_discovery_start. Then the discovery event handler is set in db_discovery_init() function and it is set to db_disc_handler().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This call back forwards the event to ble_nus_c_on_db_disc_evt() in ble_nus_c.c (&lt;span&gt;17.1.0\components\ble\ble_services\ble_nus_c\ble_nus_c.c)&lt;/span&gt;. And that is the event that checks the UUID. So, it checks if the device has the nus UUID:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;// Check if the NUS was discovered.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; ( &amp;nbsp; &amp;nbsp;(&lt;/span&gt;&lt;span&gt;p_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;evt_type&lt;/span&gt;&lt;span&gt; == BLE_DB_DISCOVERY_COMPLETE)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; &amp;nbsp;(&lt;/span&gt;&lt;span&gt;p_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;params&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;discovered_db&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;srv_uuid&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;uuid&lt;/span&gt;&lt;span&gt; == BLE_UUID_NUS_SERVICE)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; &amp;nbsp;(&lt;/span&gt;&lt;span&gt;p_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;params&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;discovered_db&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;srv_uuid&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt; == &lt;/span&gt;&lt;span&gt;p_ble_nus_c&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;uuid_type&lt;/span&gt;&lt;span&gt;))&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Whatever UUID is being looked for will be present in this this event. We think this callback will trigger once for every service, and it contains an array of all the characteristics.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Best Regards,&lt;/p&gt;
&lt;p&gt;kazi Afroza Sultana&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341396?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 20:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d42e18a8-5434-4e6b-ac44-05b9376dd8a3</guid><dc:creator>nda</dc:creator><description>&lt;p&gt;I dont know how to use your information. What example should i see or what tutorial should i read to understand what you are talking about?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get data from Unknown Service</title><link>https://devzone.nordicsemi.com/thread/341097?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 13:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9c354ef-4eb5-4a72-96ab-8689b0c6affb</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Dima,&lt;/p&gt;
&lt;p&gt;Thanks for your query.&lt;/p&gt;
&lt;p&gt;Central needs performing service discovery after connecting to the BLE device to know which service is available ( which should provides the UUID). And the central device needs to have information of the BLE service in order to read it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the SoftDevice v.7.2.0, this feature has been improved. You have to enable the BLE_GATTC_OPT_UUID_DISC option to discover 128 bit UUIDS more efficiently. This option enables the automatic insertion of discovered 128 bit UUIDs to the vendor specific UUID table.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638193261251v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You can find this here:&amp;nbsp;&lt;span&gt;sdk_17_2.0_folder\ components\softdevice\s140\doc&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope it helps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kazi Afroza Sultana&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>