On 5/26/10 3:06 PM, tmi...@recipes4linux.com wrote:
> Quoting Michael Schippling <sc...@santafe.edu>:
>
>> You need to send messages in the TOS_Msg or message_t format.
>> Find the struct definition for the telos platform.
>> For TOS1.x it is in: opt/tinyos-1.x/tos/platform/telos/AM.h
>> and probably something similar for T2.
>>
>> The tricky parts are: values of 0x7E and 0x7D need to be
>> "escaped" because they are frame delimiters, and you
>> need to calculate a CRC value correctly. There are some
>
> Thanks for the quick reply on this query.  This is a side
> project for me so I don't get to spend as much time on it
> as I would like.
>
> Do you know if the whole TOS_Msg is CRC'ed or just the
> data portion?
>
> The inbound message seems to have whole TOS_Msg CRC and
> that's what I'm doing on the outbound message.
>
> Another "tricky part" is endianess, my host is big-endian
> and the MPS430 in the radio is little-endian.

Are the motes running TinyOS 1.x or 2.x?  The two versions use different 
serial packet formats.  TinyOS 2.x's packet format is documented in TEP 
113 
(http://tinyos.cvs.sourceforge.net/*checkout*/tinyos/tinyos-2.x/doc/html/tep113.html).

If you're using TinyOS 2.x, the CRC is computed over the entire packet 
(excluding the delimiters).  Note that the CRC is computed before 
escaping the packet, which is in turn done before adding the delimiter 
bytes.  Also note that CRC is sent in little endian order, even through 
the other fields are normally in big endian order.

You may want to take a look at the TinyOS C SDK, which can be found in 
$TOSROOT/support/sdk/c/sf.  Documentation is a little sparse, but it 
saves you the trouble of writing packet assembly/parsing code.  We've 
cross-compiled it for the NSLU2 without any problems.

Greg Hackmann
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to