Finally, clear explanation of TinyOS 2.x serial packet structure
 TinyOS 2.x   A message sent through serial ports from motes to PC will typically look like this:    00 FF FF 00 00 08 00 09 19 77 02 07 00 13 00 00     The first byte 00  is the leading zero.  After that, the whole packet is of the type " serial_packet_t ", defined in tinyos-2.x/tos/lib/serial/Serial.h .   Inside the serial_packet_t structure, the first 7 bytes are of the type " serial_header_t" , which is also defined in tinyos-2.x/tos/lib/serial/Serial.h . In the case above, it would be FF FF 00 00 08 00 09 . Within the "serial_header_t", the following structure takes place:   nx_am_addr_t           dest           //  Destination  (2 bytes)  nx_am_addr_t               src               // Source  (2 bytes)  nx_uint8_t                                    length   //  Payload Length  (1 byte)  nx_am_group_t       group   // Group ID  (1 byte)  nx_am_id_t                    type      // Active Message Handler Type  (1 byte), some enum value that you can def...