Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problems getting service discovery to work on SDK 15 with db_discovery module

Hi,

I'm trying to do service discovery on a peripheral but I'm not getting any events back. I'll explain shortly what I'm doing and maybe you could tell me if I missed anything.

  • Initializing db_discovery module (ble_db_discovery_init(db_disc_handler);)
  • Passing BLE events over to the discovery module (ble_db_discovery_on_ble_evt)
  • Register to discover a UUID (ble_db_discovery_evt_register)
  • Listen to the events raised in the discovery callback

By doing that I get the following debug output and nothing more:

ble_db_disc         : Starting discovery of service with UUID 0x9BE5 on connection handle 0x0

Do you have any idea what could I be doing wrong? I put some debug output directly on the callback to print out the discovery events, but I'm not getting any at all.

Parents
  • Hi Andy, 

    It seems to be correct, have you tried to add a breakpoint in the db_discovery module and check if BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event returns ? Make sure you enable BLE_DB_DISCOVERY_ENABLED in sdk_config.h 

    Which firmware you have on the peripheral ?

    Have you tried to test with the ble_app_uart_c example ? I the example we use the db_discovery. 

Reply
  • Hi Andy, 

    It seems to be correct, have you tried to add a breakpoint in the db_discovery module and check if BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event returns ? Make sure you enable BLE_DB_DISCOVERY_ENABLED in sdk_config.h 

    Which firmware you have on the peripheral ?

    Have you tried to test with the ble_app_uart_c example ? I the example we use the db_discovery. 

Children
Related