Hello!
I have a characteristic defined to be in user memory by the BLE_GATTS_VLOC_USER flag.
The initial length is 0 and the initial value pointer is NULL.
Now I want my characteristic to dynamically point to different places in my application memory.
For this I tried using the sd_ble_gatts_value_set function like following
// update itemdata characteristic ble_gatts_value_t item_data = {.len = active_data_item->size, .offset = 0, .p_value = (uint8_t *)active_data_item->address}; ret_code_t set_value_result = sd_ble_gatts_value_set(m_gds.conn_handle, m_gds.generic_data_itemdata_char_handles.value_handle, &item_data); APP_ERROR_CHECK(set_value_result);
When trying to update the characteristic I noticed that the length of my characteristic changes when reading the characteristic after setting the value, but not the value itself.
The value itself always seems to stay static and not point to any of my new data I assign.
When changing the characteristic to BLE_GATTS_VLOC_STACK everything works as expected.
But I'd rather have the characteristic values in my own memory, without having a duplicate in the SoftDevice stack
What am I missing?
I am using SDK 15.3.0 in this project
Thanks in advance
Michael!
Edit: Fixed a confusing sentence...