<?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>gatt service inquiry</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57773/gatt-service-inquiry</link><description>Hi, 
 In addition to listening the advertiser&amp;#39;s and beacon data we also need to offer the master application - which is connected to BLE-module via UART - the possibility to connect to peripheral and get information of available GATT-services. For this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Feb 2020 07:24:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57773/gatt-service-inquiry" /><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235860?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 07:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83041564-925c-475e-98d1-dd77329a09a0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;Thank you for the explanation. It seems like you look for something like the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_c___f_u_n_c_t_i_o_n_s.html&amp;amp;&amp;amp;anchor=gaa778ccc1990e05fffa4aaf304c95e614"&gt;sd_ble_gattc_primary_services_discover()&lt;/a&gt; function instead of the discovery module. I&amp;#39;m sorry I didn&amp;#39;t realize that earlier, but this function didn&amp;#39;t come to mind initially. The&amp;nbsp;sd_ble_gattc_primary_services_discover() function should be able to find all 128-bit UUIDs and support the ones in the table provided to ble_vs_uuids_assign. You should not have to know the list of service UUIDs in order to discover them using this function.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235632?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 07:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b002fcb9-cb69-42da-ba55-60ec5157fb63</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;ok Simon,&lt;/p&gt;
&lt;p&gt;It seems that&amp;nbsp;I haven&amp;#39;t been able to express our problem clearly enough.&lt;/p&gt;
&lt;p&gt;Lets go step by step:&lt;/p&gt;
&lt;p&gt;1. we listen to beacons and find a peripheral with UUID 0x&lt;span&gt;7571823740D8 as shown in the above&amp;nbsp;conversation&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. we make a connection to the peripheral&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3. we know absolutely nothing about the services the peripheral is offering&lt;/p&gt;
&lt;p&gt;4. how do we make an application, which after making a connection can find that e.g. service with uuid 0x180F is found on the peripheral, without us knowing it in advance? So that we can make a similar list that the Android app is showing.&lt;/p&gt;
&lt;p&gt;The modification I made&amp;nbsp;using&amp;nbsp;&lt;strong&gt;ble_db_discovery_evt_register()&lt;/strong&gt;&amp;nbsp;above made an assumption that I &lt;strong&gt;knew&lt;/strong&gt; the services registered are available, which I actually don&amp;#39;t know in the real world.&lt;/p&gt;
&lt;p&gt;I think that we now need some code examples showing step-by-step the operation needed.&lt;/p&gt;
&lt;p&gt;BR Jukka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235628?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 07:35:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18be03d1-f6b8-40b4-8302-74560c3f65a9</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;This is done similarly in the Android app as well. It does a service discovery (including registering the UUIDs from the peripheral) and then does a service discovery to find all services, both known and unknown.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235485?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 14:10:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5899f359-5cfb-4519-9446-c733cf21a08a</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;One more thing, Simon&lt;/p&gt;
&lt;p&gt;We were just thinking, how does the Nordic&amp;#39;s Android app get all the known and unknown service informations from the connected device? Is there after all some way to collect them, other than discovery module?&lt;/p&gt;
&lt;p&gt;BR: Jukka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235477?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 13:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328753c1-d596-464a-b50a-c8130924068c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;Glad we were able to get to the bottom of this! I&amp;#39;m sorry I didn&amp;#39;t realize what you were looking for earlier though, and that you didn&amp;#39;t get exactly what you wanted out of the discovery module.&lt;/p&gt;
&lt;p&gt;Best of luck and regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235464?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 13:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f309207-fbd1-4a02-b3b9-026bc00b3c21</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;Thank You&amp;nbsp;Simon for your patience,&lt;/p&gt;
&lt;p&gt;No we are finally getting somewhere. Found exactly one example in SDK where the&amp;nbsp;&lt;strong&gt;ble_db_discovery_evt_register()&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;function was used and based on that I made the following addition to initialization function:&lt;/p&gt;
&lt;p&gt;ble_uuid_t amt_uuid;&lt;/p&gt;
&lt;p&gt;amt_uuid.type = BLE_UUID_TYPE_BLE;&lt;br /&gt; amt_uuid.uuid = 0x180F;&lt;br /&gt; ble_db_discovery_evt_register(&amp;amp;amt_uuid);&lt;/p&gt;
&lt;p&gt;amt_uuid.uuid = 0x180A;&lt;br /&gt; ble_db_discovery_evt_register(&amp;amp;amt_uuid);&lt;/p&gt;
&lt;p&gt;amt_uuid.uuid = 0x1801;&lt;br /&gt; ble_db_discovery_evt_register(&amp;amp;amt_uuid);&lt;/p&gt;
&lt;p&gt;amt_uuid.uuid = 0x1800;&lt;br /&gt; ble_db_discovery_evt_register(&amp;amp;amt_uuid);&lt;/p&gt;
&lt;p&gt;And now getting the information quite as expected:&lt;/p&gt;
&lt;p&gt;scan_evt_handler: Connecting to target 7571823740d8&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONNECTED&lt;br /&gt;gatt_evt_handler: MTU exchange completed, Ble NUS max data length set to 20 bytes&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_EXCHANGE_MTU_RSP: 23 bytes&lt;br /&gt;gatt_evt_handler: NRF_BLE_GATT_EVT_DATA_LENGTH_UPDATED&lt;br /&gt;ble_evt_handler: BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP, count=1, UUIDs: 0x101180F&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=1, charsx UUIDs: 0x1012A19&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=0&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_DESC_DISC_RSP&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP, count=1, UUIDs: 0x2901180A&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=3, charsx UUIDs: 0x29012A23 0xFF012A26 0x12A27&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=1, charsx UUIDs: 0x29012A28&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP, count=1, UUIDs: 0x29011801&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=0&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP, count=1, UUIDs: 0x29011800&lt;br /&gt;BLE_DB_DISCOVERY_COMPLETE: srv_uuid=0x180F, count=1&lt;br /&gt;BLE_DB_DISCOVERY_COMPLETE: srv_uuid=0x180A, count=4&lt;br /&gt;BLE_DB_DISCOVERY_COMPLETE: srv_uuid=0x1801, count=0&lt;br /&gt;BLE_DB_DISCOVERY_COMPLETE: srv_uuid=0x1800, count=3&lt;br /&gt;BLE_DB_DISCOVERY_AVAILABLE&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_CHAR_DISC_RSP: count=3, charsx UUIDs: 0x29012A00 0xFF012A01 0x12A04&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONN_PARAM_UPDATE&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_DISCONNECTED&lt;/p&gt;
&lt;p&gt;Summa summarum is that the answer to the original question is: no, there&amp;#39;s no way to ask what services the peripheral has to offer, but one has to&amp;nbsp;go through the services that we expect it to offer.&lt;/p&gt;
&lt;p&gt;I think that we can now continue with this. It was not quite what we expected and surely affects our plans in offering the command interface for our customers, but maybe they already know what to expect - better than we did.&lt;/p&gt;
&lt;p&gt;Once again, thanks for the great support.&lt;/p&gt;
&lt;p&gt;Regards, Jukka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235333?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 08:16:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0cdb950-8841-43c8-adca-361b4c1b11ff</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;If the UUIDs of the services are not known by the central, you&amp;#39;ll have to register the UUIDs of the peripheral using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;ble_db_discovery_evt_register&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;as described in the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_ble_db_discovery.html"&gt;Database Discovery Module&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;documentation before you can start discovery with&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;ble_db_discovery_start&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235182?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 12:38:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42a84357-e3ab-4c9d-8064-3bbf28949244</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;The db_disc_handler() is quite original, only addition is to have debug prints there:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void db_disc_handler(ble_db_discovery_evt_t * p_evt)
{
    if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_COMPLETE)
    {
        printf(&amp;quot;BLE_DB_DISCOVERY_COMPLETE: srv_uuid=%u, count=%u\r\n&amp;quot;, p_evt-&amp;gt;params.discovered_db.srv_uuid.uuid, p_evt-&amp;gt;params.discovered_db.char_count);
    }
    else if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_ERROR)
    {
        printf(&amp;quot;BLE_DB_DISCOVERY_ERROR: error=%u\r\n&amp;quot;, p_evt-&amp;gt;params.err_code);
    }
    else if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_AVAILABLE)
    {
        printf(&amp;quot;BLE_DB_DISCOVERY_AVAILABLE\r\n&amp;quot;);
    }
    else if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_SRV_NOT_FOUND)
    {
        printf(&amp;quot;BLE_DB_DISCOVERY_SRV_NOT_FOUND\r\n&amp;quot;);
    }

    ble_nus_c_on_db_disc_evt(&amp;amp;m_ble_nus_c, p_evt);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, does your comment &amp;quot;&lt;span&gt;&lt;em&gt;you have to know the UUIDs and UUID types of services you want to discover&lt;/em&gt;&amp;quot; mean that actually one can&amp;#39;t discover what services the&amp;nbsp;peripheral has got to offer, but&amp;nbsp;it must asked if the peripheral offers the services that we are expecting?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR, Jukka&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235157?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 11:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b405edac-746a-4402-82a4-75c54e8d25f0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;In your db_disc_handler function, what events are you calling? If you see the db_disc_handler in I.E. the original ble_app_uart_c example you can see the ble_nus_c_on_db_disc_evt() which handles the discovery correctly. You can see that you have to know the UUIDs and UUID types of services you want to discover. Have you done so in your application?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/235053?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 06:39:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d81deb6-b32d-4adb-b285-634c51b74d7d</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;The device connected is a sealed box, only access to it&amp;#39;s secrets is the Nordic Android tool. I have the following log file and partial snapshot to offer:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/beaconInfo.txt"&gt;devzone.nordicsemi.com/.../beaconInfo.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20200219_2D00_082046.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/234951?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 14:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91a371fd-c2cc-4031-a6f2-c55e6c74d571</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Okay, I can&amp;#39;t see anything strange going on here. I noticed while digging through the documentation, that only the following descriptors will be searched for at the peer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Client Characteristic Configuration&lt;/li&gt;
&lt;li&gt;Characteristic Extended Properties&lt;/li&gt;
&lt;li&gt;Characteristic User Description&lt;/li&gt;
&lt;li&gt;Report Reference.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Can you confirm that your services include any of these descriptors?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/234852?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 10:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd6dc369-1438-4295-a39a-0dbe5baa2261</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Basically the initialization procedure is the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for initializing the BLE stack.
 *
 * @details Initializes the SoftDevice and the BLE event interrupt.
 */
static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}



/**@brief Function for initializing the GATT library. */
void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_central_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the UART. */
static void uart_init(void)
{
    ret_code_t err_code;

    app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = RX_PIN_NUMBER,
        .tx_pin_no    = TX_PIN_NUMBER,
        .rts_pin_no   = RTS_PIN_NUMBER,
        .cts_pin_no   = CTS_PIN_NUMBER,
        .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
        .use_parity   = false,
        .baud_rate    = UART_BAUDRATE_BAUDRATE_Baud115200
    };

    APP_UART_FIFO_INIT(&amp;amp;comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);

    APP_ERROR_CHECK(err_code);
}

/**@brief Function for initializing the Nordic UART Service (NUS) client. */
static void nus_c_init(void)
{
    ret_code_t       err_code;
    ble_nus_c_init_t init;

    init.evt_handler = ble_nus_c_evt_handler;

    err_code = ble_nus_c_init(&amp;amp;m_ble_nus_c, &amp;amp;init);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing buttons and leds. */
static void buttons_leds_init(void)
{
    ret_code_t err_code;
    bsp_event_t startup_event;

    err_code = bsp_init(BSP_INIT_LEDS, bsp_event_handler);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_btn_ble_init(NULL, &amp;amp;startup_event);
    APP_ERROR_CHECK(err_code);
}

static ret_code_t mtimer_err_code;

/**@brief Function for initializing the timer. */
static void timer_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);

    mtimer_err_code = app_timer_create(&amp;amp;m_connection_timer, APP_TIMER_MODE_SINGLE_SHOT, connection_timer_tick_callback);
}


/**@brief Function for initializing the nrf log module. */
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}


/**@brief Function for initializing power management.
 */
static void power_management_init(void)
{
    ret_code_t err_code;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);
}


/** @brief Function for initializing the database discovery module. */
static void db_discovery_init(void)
{
    ble_db_discovery_init_t db_init;
    
    memset(&amp;amp;db_init, 0, sizeof(ble_db_discovery_init_t));
    
    db_init.evt_handler  = db_disc_handler;
    db_init.p_gatt_queue = &amp;amp;m_ble_gatt_queue;
    
    ret_code_t err_code = ble_db_discovery_init(&amp;amp;db_init);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for handling the idle state (main loop).
 *
 * @details Handles any pending log operations, then sleeps until the next event occurs.
 */
static void idle_state_handle(void)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}


int main(void)
{
    // Initialize.
    log_init();
    timer_init();
    uart_init();
    buttons_leds_init();
    db_discovery_init();
    power_management_init();
    ble_stack_init();
    gatt_init();
    nus_c_init();
    scan_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;BLE UART central example started.&amp;quot;);
    scan_start();

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the sdk_config.h is attached.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3581.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../3581.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BR: Jukka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/234836?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 09:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d77a9d7f-63e6-4c06-9e5f-be27d7ed79a8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you upload a snippet showing how you&amp;#39;ve added the discovery module in your application? There must be some configurations that haven&amp;#39;t been done properly.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/234658?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 13:17:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d23bc7-62a5-42f6-85a0-2ce6ed804b32</guid><dc:creator>Jukka Lamminmaki</dc:creator><description>&lt;p&gt;Th&amp;auml;nx for the response, Simon&lt;/p&gt;
&lt;p&gt;So it is the callback function db_disc_handler() handling - or routing - the database discovery events. I have one beacon box which looks like the following in the Nordic android tool:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20200217_2D00_145812.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;showing some services available, of which the Battery service seems to be the only standardized.&lt;/p&gt;
&lt;p&gt;However our software shows the following output when connecting to the same device :&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Advertising type=0x0B, device WGX_iBeacon, addrtype=1, addr=7571823740D8&amp;nbsp; rssi=-76, phy=1, sphy=255&amp;nbsp; &lt;br /&gt;Match found, connecting...&lt;br /&gt;Connecting, started 30s connection timer&lt;br /&gt;scan_evt_handler: Connecting to target 7571823740d8&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONNECTED&lt;br /&gt;gatt_evt_handler: MTU exchange completed, Ble NUS max data length set to 20 bytes&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_EXCHANGE_MTU_RSP: 23 bytes&lt;br /&gt;gatt_evt_handler: NRF_BLE_GATT_EVT_DATA_LENGTH_UPDATED&lt;br /&gt;ble_evt_handler: BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT&lt;br /&gt;&lt;strong&gt;db_disc_handler: BLE_DB_DISCOVERY_SRV_NOT_FOUND&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;db_disc_handler: BLE_DB_DISCOVERY_AVAILABLE&lt;/strong&gt;&lt;br /&gt;ble_evt_handler: BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_CONN_PARAM_UPDATE&lt;br /&gt;ble_evt_handler: BLE_GAP_EVT_DISCONNECTED&lt;/p&gt;
&lt;p&gt;So it seems that the same services are not found with our own application, which is based on the ble_app_uart_c example.&lt;/p&gt;
&lt;p&gt;Rgrds, Jukka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gatt service inquiry</title><link>https://devzone.nordicsemi.com/thread/234398?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 12:31:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f20ae59d-9caa-4e97-bad6-71f3d11f9be8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jukka&lt;/p&gt;
&lt;p&gt;It seems like you&amp;#39;re looking for a way to discover services. Have you checked out our &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_db_discovery.html"&gt;database discovery module&lt;/a&gt; which handles service discovery on GATT servers? The &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_blinky_c.html"&gt;ble_app_blinky_c example&lt;/a&gt; for one is an example using this to discover the services available in the peripheral it connects to.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, you can run discovery algorithms yourself by using sd_ble_gattc_&lt;strong&gt;XX&lt;/strong&gt; functions, but I personally think the module is the easiest to use.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>