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

How to manage data protection when GATT data attributes are placed on User space ?

Hello,

My device has GATT data attributes configured to have BLE_GATTS_VLOC_USER so the data are in application stack. In this way, the softdevice has direct access to the data via my supplied pointers. My question is this would lead to data access problem such as when softdevice is trying to read the data, and my application thread is trying to update the data. I cannot possibly use a mutex since I do not have control over softdevice or its BLE operations. How could I solve this data access problem ?

Parents
  • Hi Thin Ice,

    To avoid mutual access to the data at the same time, you can either: 

    - Use authorization read instead of normal read so you can have control of what actually sending over BLE.

    - Only use sd_ble_gatts_value_set() to update the data instead of accessing the data buffer directly. This way you can avoid softdevice to access the data when it's updating. 

Reply
  • Hi Thin Ice,

    To avoid mutual access to the data at the same time, you can either: 

    - Use authorization read instead of normal read so you can have control of what actually sending over BLE.

    - Only use sd_ble_gatts_value_set() to update the data instead of accessing the data buffer directly. This way you can avoid softdevice to access the data when it's updating. 

Children
No Data
Related