On Saturday 09 January 2016 23:52:22 Roy Kang wrote:
> Dear all,
>
> I have sent double data from arduino to android.
>
> value is 32.17
>
> - Arduino side (ocserver.cpp)
> My code is as below.
> if (OC_REST_GET == entiryHandlerRequest->method)
> {
> double temp = 32.17;
> OCRepPayloadSetPropDouble(payload, "temp", temp);
> }
> ...
>
> - Android side (SimpleClient.java)
> temp: -3.47786198xxxxxxx (x is number)
>
> As i know, arduino mega is little endian.
> Android is little endian, too.
> I guess, it doesn't cause of endian.
>
> What is problem ?
It's not endianness.
There's a bug somewhere. Anyway, this code is changing since we will not
transmit floating point anymore.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center