I am trying to work with endianness in the blip/tinyos platform on an 
epic mote. The mote sends a simple struct consisting of 0x1234 in a 
uint16_t field to fec0::64. Now, when I run ip-driver to listen on 
fec0::64 and use netcat to dump hex, I see the following:

If I use htons(0x1234) in the tinyos code before sending, I see "34 12"
If I don't, I see "12 34"

Now isn't it the convention that network traffic has to be big endian? 
Therefore, shouldn't we see "12 34" in netcat's output if I use htons in 
the mote code? I am a little confused since it is actually the other way 
around.

My question is: Does ip-driver do any kind of byte manipulation or does 
it just create an interface and read from it? Does the blip stack do 
htons automatically before sending and receiving data on the mote?

Thanks,
Harsha
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to