Hi,
Have a look at TEP 113: Serial Communication
In section 3.6 Packet Format the layout of the bytes is explained.
What you see is the "raw" frame at the lowest level of the serial
stack. It is encoded in a HDLC-like way.
In your case the frame 7e 42 7d 5e 00 00 7d 5d 04 01 00 96 00 1c 32 7e
can be split into:
-- HDLC header
7e HDLC framing byte (start of frame)
42 Protocol byte (0x42 = 66 -> )
7d HDLC escape character because next byte should be '7e'
5e Sequence number
-- Payload = Active Message
00 00 7d 5d 04 01 00 96 00 (here again there is an HDLC escape
character 7d....)
Payload "HDLC decoded" = 00 00 7d 04 01 00 96 00
According to the serial_header_t in Serial.h of the latest TinyOS this
would correspond to:
00 00 dest
7d 04 source
01 length
00 AM group
96 AM Type
00 1 byte Data
-- HDLC footer
1c 16 bits CRC high byte
32 16 bits CRC low byte
7e HDLC framing byte (end of frame)
The Payload seems strange to me... Which version of TinyOS are you
using ? How do you test ? With a standard application or one you wrote
yourself ?
I suggest you to have a look at the TEPs mentioned above and in
sources found in your TinyOS source tree under lib/serial .
Regards
Romain
On Wed, Jul 13, 2011 at 7:32 AM, TJ <[email protected]> wrote:
> Hey.
>
> I get the following line in hex (similar to this) when i receive a packet
> from the MicaZ mote on Ubuntu.
> 7e 42 7d 5e 00 00 7d 5d 04 01 00 96 00 1c 32 7e
>
> I'm not really sure on what the all the numbers are, except that the one in
> red is the node id, and one in green is a count. This I know because of the
> structure i put in.
>
> If my program sends the same line from the PC to the mote, will the mote
> understand it??
>
> Always Yours
> Tejovanth
> Tj n Spook
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help