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

sd_ble_gattc_read and BLE_GATTC_EVT_READ_RSP

Hi,

When I call sd_ble_gattc_read, I receive the BLE_GATTC_EVT_READ_RSP event very shortly after -- as expected. Within the event handler (registered with the Soft Device Handler via NRF_SDH_BLE_OBSERVER) for that BLE_GATTC_EVT_READ_RSP event, I then call sd_ble_gattc_read again as long as 

BLE_GATT_STATUS_ATTERR_INVALID_OFFSET != pEvent->evt.gattc_evt.params.read_rsp.offset

per the message sequence chart in the API documentation.

I am attempting to read a characteristic of length 1. The problem is that I receive the BLE_GATTC_EVT_READ_RSP event with .offset = 0 and .len = 0 many times (at least several dozen times) before eventually receiving the BLE_GATTC_EVT_READ_RSP event with .offset = BLE_GATT_STATUS_ATTERR_INVALID_OFFSET.

Am I doing something wrong? Should I not call sd_ble_gattc_read from within the event handler for BLE_GATTC_EVT_READ_RSP?

Configuration: SoftDevice v6.0.0 (SDK v15.0.0) with 4 FreeRTOS threads (i.e. the Soft Device thread, the Idle thread, and two application threads).

 

Thank you for your help.

Related