Merge pull request #1670 from gebart/pr/lwm2m-decimal-point

oma-lwm2m: Handle text/plain floatfix numbers without decimal point
This commit is contained in:
Nicolas Tsiftes 2016-05-23 15:22:35 +02:00
commit 562a33aa16

View file

@ -100,6 +100,11 @@ lwm2m_plain_text_read_float32fix(const uint8_t *inbuf, size_t len,
break;
}
}
if(dot == 0) {
integerpart = counter;
counter = 0;
frac = 1;
}
*value = integerpart << bits;
if(frac > 1) {
*value += ((counter << bits) / frac);