Well, I don't know exactly who and when this started...
but yes, it is a default-like thing across all platforms.

It is dependent on 'nesC' rather than 'tinyos',
and I think people started to use it since tinyos-1.2 (not 1.1.15).

MoteIV/Boomerang used it, and it became a standard thing in T2
ever since Phil wrote his T2 programming manual.
Relevant doc might be Phil's book... and maybe some TEPs? I don't know.

If you think about it, it is just ntoh, hton thing,
and it's not too bad once you get used to it.
it took me a week :-)

Thanks

- jpaek


Michael Schippling wrote:
Yes, I'm using T1. And yes the CountMsg uses nx_ types,
and the telos/AM.h header in T1.1.15 does not.

So is the big-endian nx_*int* thing a default behavior
across all platforms? Do you know in what TOS version
this started? And can you point me to relevant doc?

I have to assume that this was done just to confuse me
and make TOS that much harder to deal with...

thanks
MS


Jeongyeup Paek wrote:
You are using T1 right?

In T1, the TOS_Msg struct does not use nx types.
So, all TOS_Msg header fields (e.g. addr) are
in host format, which will be little endian in Tmote sky.

Although I haven't seen CountUart demo, probably
their payload is using a nx struct with nx_uint16_t fields.
Then these will be transmitted in big endian.

If you want to avoid this, find the file that
defines the payload structure, and modify nx_uint16_t to nxle_uint16_t.
Hopefully, everything will show in little endian.

Thanks

- jpaek


Michael Schippling wrote:
I have apparently confused myself with new code...

I'm just starting to do useful work with Boomerang and Tmote sky.
I believe this means TOS1.1.15 plus now-defunct Moteiv addons.

Running the CountUart demo, I get this data stream from Listen:

    04 00 00 00 00 00 7E 00 04 7D 00 1C 00 01
    04 00 00 00 00 00 7E 00 04 7D 00 1D 00 01
    04 00 00 00 00 00 7E 00 04 7D 00 1E 00 01  ...
                          ^  ^        !  !

According to my reading of the telos/AM.h file, the bytes marked
with the hats ^ (bytes 6 & 7) are the destination address, which
for the UART is 0x007E. This value seems to be in little-endian
format. The bytes marked with bangs ! (bytes 10 & 11) are the
count value from the CountMsg payload, but this seems to be in
big-endian format, as does the next value (the mote source ID)
of 0x0001.

What am I looking at wrong here?

thx
MS
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


--

Jeongyeup Paek
Ph.D. student
Embedded Networks Laboratory
Department of Computer Science
University of Southern California
http://enl.usc.edu/~jpaek
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to