This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_db_discover for two services and one connection handle

Hello,

I'm trying to use the ble_db_discovery module to collect characteristic UUIDs and handles for two services on the same node, with the same connection handle. I first implemented a test program that registers just one service UUID, and it works fine. Then I changed the program to register the other UUID, and that also works well. Both versions discover characteristics of just one service.

The documentation for the discovery module suggests we can register more than one service.

Yet when I try registering for both services (two calls to ble_db_discovery_evt_register) no characteristics are found.

In attempting to understand what is happening, I added more log statements to ble_db_discovery.c. What I notice is that, for the first service that the module explores by enumerating handles, it does appear to go through all the handles that it should. Basically it is calling sd_ble_gattc_characteristics_discover and then processing events. However, when this is completed for the first service, instead of again calling sd_ble_gattc_characteristics_discover, there is a call to sd_ble_gattc_primary_services_discover, and I'm not sure what happens after that.

The other thing I notice is that db_disc_handler is not called with the discovery_complete event after the first service has been explored, because ble_db_discover.c queues the event triggers until all registered services are explored.

Is there an example of using ble_db_discovery for more than one registered service for a single node (one connection handle)?

- T.Herman

(This question uses SDK15.3)

Parents Reply Children
No Data
Related