I have a 384 byte, writable, variable length, vloc user characteristic and I want to trigger an event when the write completes so my application can operate on the data.
Right now I get the BLE_GATTS_EVT_WRITE event, check for op == BLE_GATTS_OP_EXEC_WRITE_REQ_NOW, walk down the list of handles in the prepared write data, looking for my value handle. If I find the handle I get the length with sd_ble_gatts_value_get() and act on the data using the buffer I allocated for the characteristic value (it is vloc_user). There is also the case that the central has <=20 bytes to write, so you also have to check for handle in the op == BLE_GATTS_OP_WRITE_REQ case as well.
It seems like there should be an easier way to handle this condition. The softdevice has already processed the prepared write and the data is sitting in the buffer, I just need to know that the value handle has been written to.
Is there a more direct solution?