My GATT service measures a few values, and stores them (~ 100 bytes). When the GATT server (phone) requests data from a specific characteristic, I would like to return the stored values.
Since sending more than 20 bytes (GATT_MTU) requires multiple chunks, I'd like the server code to automatically update an index on each successive read by the client. The client issues successive reads until it received < GATT_MTU bytes, which indicates end of data.
I am unable to find a way to make the nRF51 return control into my code, upon a GATT read, such as via a callback. This is necessary to determine which chunk to send, and increment the index for the next anticipated read.
A callback is needed for any type of dynamic data to be returned, hence the post title.
I feel I must be missing something -- this seems like an obvious API call. Hope someone can point me to the right API call.