Closed binloan closed 8 years ago
Thank for filing the issue, we are working on a helper class that make get/set characteristics and working with Gatt Server easier than currently. If you like to test it out, you can switch to the development branch, you will need to flash with the latest 0.7.0 beta firmware as well.
Imagine the read command below. It shall read the current value of the first characteristic in the service which is active.
But if you try to read a value thats bigger than one byte the value will only contain the first byte. Example:
READ: 01-FF-22 Value (converted to
int32_t
) will be: 1The issue is inside the
int32_t Adafruit_BLE::readline_parseInt(void)
function. The input of the buffer is a char array which also contains "-" as seperators.strtol
fails here because it can not convert the "-" into a number, so only the first byte is converted. Also if the characteristic value starts with a 0 in the first byte, the whole value is ignored.