Hi, I need to have long attributes. So I need 'Read Blob' operation for read and Queued writes ('Prepare Write' and 'Execute Write'). Does Soft Device for nrf51822 support mentioned commands?
Best regards, Artem Zemlyanukhin
Hi, I need to have long attributes. So I need 'Read Blob' operation for read and Queued writes ('Prepare Write' and 'Execute Write'). Does Soft Device for nrf51822 support mentioned commands?
Best regards, Artem Zemlyanukhin
Hi there,
But why do I have to set p_data = data + offset? I already set offset..
Because auth_reply.params.read.offset refers to the offset within the attribute value, not the offset from the pointer you provide. You are expected to always provide an updated pointer to the data you want to send back, but that offset you provide is where inside the attribute value the data pointed by by p_data will be written to. Remember that when you set update = 1 the data will actually be written to the local attribute (in your case in user memory) as well as sent over the air as a response.
So I guess if update = 0, p_data and offset values do not matter
Correct
But I need to use update = 1 because actually I have array strings (each of 64 bytes) and in different cases I want to point in 'sd_ble_gatts_rw_authorize_reply' different rows fo my array.
Then you are already doing the right thing. But remember, you could also do something else instead: Because the value is in your own memory, you could simply set update to 0 but then modify your value buffer (the one you provided in sd_ble_gatts_characteristic_add() (p_value in ble_gatts_attr_t) so that it fits whatever you want to send back. This may actually be quicker and more efficient than using update = 1 depending on how your application is structured.
Thank you, your answer helped to me!
Thank you, your answer helped to me!