On Thursday 14 January 2016 02:26:29 ??? wrote:
> > There's a bug somewhere. Anyway, this code is changing since we will not
> > transmit floating point anymore.
>
>
> Could you explain this issue in detail? Why do you think IoTivity will not
> support floating point? And then how we can exchange floating point data
> between oic server and oic client?
This is coming as an update/errata to the standard, so it hasn't happened yet.
IoTivity may do floating point if it wishes to. In fact, the API will allow
converting the fixed-precision payloads to floating point.
But the protocol may not require floating-point. They are extremely expensive
for very constrained devices, as often FP support is implemented in software.
Imagine a temperature sensor that needs to transmit the current temperature,
say 22.3?C. The options were:
* send as integer and drop the fractional part: 22
not acceptable precision
* send as thousandths of degrees: 22300
people didn't want it
* send as millikelvins: 295450
people liked this even less
So we opted for using fixed precision floating point. The temperature 22.3 is
sent as array [-1, 223], while a pressure sensor measuring 1013 hPa could send
value [2, 1013] (if the unit is pascals), [-3, 1013] if the unit is bar or
simply 1013 if the unit is millibar.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center