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

Using reliable_wr how do I know which characteric is actually written

I'm currently using soft device 110 version 7.1 on a 51822.

I have several characteristics that are more than 20 bytes that as a server I want a client to write to. I actually appear to have everything working. I have enabled reliable_wr. When the client writes to me I get BLE_EVT_USER_MEM_REQUEST. When presumably the user has finished writing I then get BLE_GATTS_EVT_WRITE which is then followed by BLE_EVT_USER_MEM_RELEASE. And any user the client writes I do get. I have verified that many times.

The problem is when I get the BLE_GATTS_EVT_WRITE event and I look at p_evt_write->handle it is 0. It appears pretty much everything in the ble_evt_t structure that I'm passed in my ble_evt_dispatch function is 0. So far the only field I have found populated is the OP field (p_evt_write->op). This is set to 6 which apparently means BLE_GATTS_OP_EXEC_WRITE_REQ_NOW. Note this is only the case when I do a reliable write. If I write less than 20 bytes, then the characteristic handle is there along with the length, etc.

So what am I missing here? How am I supposed to know which characteristic is being written to in this case? I've tried looking all over this site for an answer to this specific question and so far I haven't found anything that has helped. Any suggestions as to where to look would be appreciated.

Thanks

Related