Hello,
Please take a look at the below function. I am able to write/read the characteristic data from nRF App.
Now here is my function to update the characteristic data.
But here my problem is in 1st code block if I am setting the attr_char_value.max_len or attr_char_value.init_len =2. Then in 2nd code block, I have to set uint16_t len = 2 so similarly if I set 1st code block attr_char_value.max_len or attr_char_value.init_len =20 I have to set in 2nd code block, I have to set uint16_t len = 20. If it is so, then If I need to write 20 bytes and I am expecting to have 5 bytes response then also I am getting those 5 bytes+ remaining last 15 bytes data in App.
For example, supporting I am writing "HELLO" in the data characteristic and then expecting a response in the update data characteristic is "HI". Then, current I am getting updated data characteristics as ""HILLO".
How can I set dynamic length while I am updating data characteristics?
Note: I am not using ble_nus.h library.
Is it possible to have the required length using sd_ble_gatts_hvx() function? or what is my mistake in above code?
Thanks and regards,
Neeraj Dhekale