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

How to use BLE_GATTS_VLOC_USER ?

Do I still have to call sd_ble_gatts_value_set() on the characteristic handle [using whatever temporary buffer I would have been using anyway for BLE_GATTS_VLOC_STACK]?

Or can I simply modify the referenced buffer, and characteristic reads will magically start returning the updated buffer value? (I am not using rd_auth for characteristic reads; the ble_gatts_attr_md_t for the characteristic has rd_auth=0.)

Thanks!

Parents
  • So if variable-length attributes are being used with VLOC_USER, then sd_ble_gatts_value_set() must be called? If the characteristic value is large, is there any way to avoid the memcpy penalty in sd_ble_gatts_value_set()?

    For now please use the same pointer in the call to sd_ble_gatts_value_set() as the one you supplied when creating the attribute. This should work fine for your case and should not require any additional memory on the application side.

Reply
  • So if variable-length attributes are being used with VLOC_USER, then sd_ble_gatts_value_set() must be called? If the characteristic value is large, is there any way to avoid the memcpy penalty in sd_ble_gatts_value_set()?

    For now please use the same pointer in the call to sd_ble_gatts_value_set() as the one you supplied when creating the attribute. This should work fine for your case and should not require any additional memory on the application side.

Children
No Data
Related