You may have seen this, which explains the data stream pretty well: http://www.octavetech.com/pubs/TB5-01%20Deciphering%20TinyOS%20Serial%20Packets.pdf
When using Listen, what you see is almost what you get. Messages are bracketed by 0x7E sync bytes and a prefix byte says what kind of packet it is. Also non-sync 0x7E data bytes are 'escaped' with an additional 0x7D byte. All this is covered in the above doc -- except for the fact that 0x7D data bytes also need to be escaped. I believe Listen elides these, but ListenRaw will show you everything as is. The hard part will be reverse engineering the CRC calculation, but you can find code for it in the tools/java tree someplace. MS virginia estellers wrote:
Hi, I'd like to write some code in Visual Basic while getting the sensor data throught the serial port. I'm already able to send bytes to the serial, but I've no idea on how to build the packets so that the mote with TOSBASE knows what does it mean, and what's more important for me, how to unpack the data it sends me so that it makes sense. Are the bytes we can read with java.tinyos.tools.Listen in the same format that what is travelling through the serial? I've been reading the Listen code, but i'm quite lost. Could anyone help me? Any hints? Any comments will be much appreciated. Virginia PS: I'm using tinyos 1.x on windows+cygwin _______________________________________________ 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
