This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sd_ble_gattc_primary_services_discover

Hi, I use s120 stack and ble_app_multilink_central I use function sd_ble_gattc_primary_services_discover(p_client->conn_handle, start_handle, NULL) for discover services. But in table p_ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp.services[i] i get only UUIDs with tupe BLE_UUID_TYPE_BLE. how can I dyscover all services, with UUID type >BLE_UUID_TYPE_VENDOR_BEGIN

Thanks!

  • Hi Ermol,

    When you receive the response from that call, you need to call the sd_ble_gattc_primary service discover again with the start handle updated to the last end group handle + 1

    last = p_ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp.count-1;
    start_handle = p_ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp.services[last].handle_range.end_handle+1;
    sd_ble_gattc_primary_services_discover(p_client->conn_handle, start_handle, NULL);
    

    and continue until you receive a status with BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND

  • Thank you very much, I'm learning s120 too

Related