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

Parallel db dyscovering services for several connections?

Hi,

Can I try to discovery services for the next connections while it is performing for the other connection?

I use "ble db discover" manager. And I cant find this limitation in the SDK 10 documentation. However I get the "NRF_ERROR_BUSY" (exactly for sd_ble_gattc_primary_services_discover() ) when I try to discovery services for the next device while the previous discovering (for other device and connection handle!) was not completed.

Is it OK?

Best regards, Y0lo

Parents
  • Petter, I was making the demo-project to reproduce this issue when I have found the reason of this problem.

    Reason: I tried to call GATT writing/reading operations from db_discovery_evt_handler() while other services were not discovered.

    For example if the battery level notification is enabled while the device information services was no discovered completely it cause the error in db discovery module: Inside on_srv_disc_completion() sd_ble_gattc_primary_services_discover() return NRF_ERROR_BUSY

    So as I understand there are the next solutions:

    1. Do any GATT operations only when all services were discovered
    2. Add queue for all GATT operations (even for sd_ble_gattc_primary_services_discover() and sd_ble_gattc_characteristics_discover())

    Am I right?

Reply
  • Petter, I was making the demo-project to reproduce this issue when I have found the reason of this problem.

    Reason: I tried to call GATT writing/reading operations from db_discovery_evt_handler() while other services were not discovered.

    For example if the battery level notification is enabled while the device information services was no discovered completely it cause the error in db discovery module: Inside on_srv_disc_completion() sd_ble_gattc_primary_services_discover() return NRF_ERROR_BUSY

    So as I understand there are the next solutions:

    1. Do any GATT operations only when all services were discovered
    2. Add queue for all GATT operations (even for sd_ble_gattc_primary_services_discover() and sd_ble_gattc_characteristics_discover())

    Am I right?

Children
Related