<?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>Number of services found at the peers GATT database is 0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26453/number-of-services-found-at-the-peers-gatt-database-is-0</link><description>Hi everyone, 
 I am developing a remote control using nRF52832 chip. My prototype is currently developed in PC10040 board. The IDE is Eclipse Oxygen, and the SDK is S132 v5.0.0. 
 Currently, I am trying to discover the services. But the number of of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Nov 2017 15:32:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26453/number-of-services-found-at-the-peers-gatt-database-is-0" /><item><title>RE: Number of services found at the peers GATT database is 0</title><link>https://devzone.nordicsemi.com/thread/104087?ContentTypeID=1</link><pubDate>Fri, 03 Nov 2017 15:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3aab206-6099-441e-b124-c4b1eec134be</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to register the services you are interested in discovering at the server using the function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.1.0/group__ble__db__discovery.html?cp=4_0_0_6_2_1_9#gaf0f29a047cb3eb1f1b65d19be8192fc0"&gt;ble_db_discovery_evt_register()&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the rscs service, which is a Bluetooth SIG UUID (16-bit), this is done like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_rscs_c_init(ble_rscs_c_t * p_ble_rscs_c, ble_rscs_c_init_t * p_ble_rscs_c_init)
{
    VERIFY_PARAM_NOT_NULL(p_ble_rscs_c);
    VERIFY_PARAM_NOT_NULL(p_ble_rscs_c_init);

    ble_uuid_t rscs_uuid;

    rscs_uuid.type = BLE_UUID_TYPE_BLE;
    rscs_uuid.uuid = BLE_UUID_RUNNING_SPEED_AND_CADENCE;

    p_ble_rscs_c-&amp;gt;evt_handler             = p_ble_rscs_c_init-&amp;gt;evt_handler;
    p_ble_rscs_c-&amp;gt;conn_handle             = BLE_CONN_HANDLE_INVALID;
    p_ble_rscs_c-&amp;gt;peer_db.rsc_cccd_handle = BLE_GATT_HANDLE_INVALID;
    p_ble_rscs_c-&amp;gt;peer_db.rsc_handle      = BLE_GATT_HANDLE_INVALID;

    return ble_db_discovery_evt_register(&amp;amp;rscs_uuid);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For Vendor UUID services (128-bit), e.g. for the NUS Service, this is done like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_nus_c_init(ble_nus_c_t * p_ble_nus_c, ble_nus_c_init_t * p_ble_nus_c_init)
{
    uint32_t      err_code;
    ble_uuid_t    uart_uuid;
    ble_uuid128_t nus_base_uuid = NUS_BASE_UUID;

    VERIFY_PARAM_NOT_NULL(p_ble_nus_c);
    VERIFY_PARAM_NOT_NULL(p_ble_nus_c_init);

    err_code = sd_ble_uuid_vs_add(&amp;amp;nus_base_uuid, &amp;amp;p_ble_nus_c-&amp;gt;uuid_type);
    VERIFY_SUCCESS(err_code);

    uart_uuid.type = p_ble_nus_c-&amp;gt;uuid_type;
    uart_uuid.uuid = BLE_UUID_NUS_SERVICE;

    p_ble_nus_c-&amp;gt;conn_handle           = BLE_CONN_HANDLE_INVALID;
    p_ble_nus_c-&amp;gt;evt_handler           = p_ble_nus_c_init-&amp;gt;evt_handler;
    p_ble_nus_c-&amp;gt;handles.nus_tx_handle = BLE_GATT_HANDLE_INVALID;
    p_ble_nus_c-&amp;gt;handles.nus_rx_handle = BLE_GATT_HANDLE_INVALID;

    return ble_db_discovery_evt_register(&amp;amp;uart_uuid);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>