Hello everyone,
It seems like a very basic issue but somehow I am unable to resolve it.
I have a characteristic of length 20 bytes. This characteristic is supposed to receive a string of max 20 bytes. When I receive the string in this characteristic and my string is of less than 20 characters (which will be in most of the cases); the received string is appended by the remaining bytes which were already part of the characteristic previously.
Here is the code I am using to receive string:
Now,
GATT_MSG.p_value is where I have the string (appended by the previously written characters)
What I wish GATT_MSG.len should have is the LENGTH of the received string BUT GATT_MSG.len is ALWAYS=20 which is the total length of this particular characteristic.
Can anyone help me figuring out how can I determine the length of characteristic received?
Thanks