the double format is supported in T1 afaik.
how do i know? here's a message format I used when sending data to and
from the Cricket motes:
typedef struct CricketCoordMessage {
uint8_t id;
char X[1];
double CoordX;
char Y[2];
double CoordY;
}CricketCoordMessage;
worked just fine.
the #include <stdio.h> line was also there at the top of the header file,
but I didn't put it there (came with the Cricket code).
and I used 4 bytes for double (i was working with the assumption that
double refers to a double word which would be two two byte words hence 4
bytes long). it worked just fine there too.
back to K&R with me.
Sankar.
On Mon, 27 Nov 2006 14:50:02 -0600, Michael Schippling <[EMAIL PROTECTED]>
wrote:
huh...as I said I don't use them...
and I'm not setup to verify your assertion right now.
Perhaps the math lib only supports floats.
MS
venkatesh s wrote:
I had questioned the same long back. As we know that float takes 4
bytes and double takes 8 bytes, experimentally on mica2 motes, it had
no effect on the number of bytes. It was fixed to 4 bytes for both
float and double.. Is it platform specific??
Date: Sat, 25 Nov 2006 19:40:36 -0700
From: Michael Schippling < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
Subject: Re: [Tinyos-help] working with floats and tinyos1
To: Sankar Gorthi <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
Cc: [email protected]
<mailto:[email protected]>
Message-ID: <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
As long as you remain on the same platform with the same math lib
floats and doubles should be transparent, as described. However
sending them to a base-station could be problematic. I believe
the MIG message generator for Java can deal with both FP types,
but I try to avoid them so I'm not sure...a couple experiments
might be in order...under TOS floats should be 4 bytes and doubles
8,
and I have some faith that they are standard IEEE format. So the
only issue would be getting the byte ordering right.
Or...as I keep reiterating, fixed-point integers can often do
all the work at a much smaller cost.
MS
------------------------------------------------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help