mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-21 19:29:18 +00:00
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:
commit
562a33aa16
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user