Hi,
After sd_ble_gatts_hvx() call, is it possible to change or delete value in softdevice buffer before a connection event ?
Thanks by advance for your help
Best regards,
Hi,
After sd_ble_gatts_hvx() call, is it possible to change or delete value in softdevice buffer before a connection event ?
Thanks by advance for your help
Best regards,
Unfortunately no. Once the buffer is given to softdevice, then you cannot edit the contents. This would also be logically wrong to do it, as softdevice will not be able to guarantee you a safe time between hvx and your application wanting to edit it before it is sent by the RADIO.
Thanks for your answer.
I guess we don't really know when the next connection will be to call sd_ble_gatts_hvx() just before ?
Hello,
If you want to sample some data right before the next connection interval, I suggest you look into the radio notification module. There is a good guide here.
Set the notification to trigger before the event by setting NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, and a distance at your choise (e.g. NRF_RADIO_NOTIFICATION_DISTANCE_800US). This will give you an event 800µs before the next connection (interval), where you can use this to sample any data you want to send to the other device.
Check out the guide in the link, and see if it can be of use.
Best regards,
Edvin
Thanks, it's perfect.