When using BLE_GATTS_VLOC_USER to store multi-word characteristic values that are updated by application code, what is the recommended way to prevent a partially updated value being sent to a client?
Options I've considered include (in decreasing order of appeal):
- Just disable all interrupts via PRIMASK, store the new value, and re-enable them. This is easy and robust, but would potentially delay SD high-priority interrupts by a couple microseconds.
- Don't use BLE_GATTS_VLOC_USER.
- Use read authentication so the application can schedule the update and read to avoid conflicts.
The first is the only one that's attractive. How timing sensitive is the soft device? Is a 10 us delay in processing SD interrupts likely to cause problems?
(My context is S130 2.0.1 with bare metal nRF51 programming, no SDK, but if there's a viable SDK-based solution I can probably adapt it.)