CITRIC Packet Format

The CITRIC platform uses TinyOS packets. Please refer to the TinyOS documentation for further information about the packet format, specifically Lesson 4, TEP 113, and Serial.h (located in $TOSROOT/tos/lib/serial). Note that all multiple byte fields are big endian, except the CRC in the serial packet.

Serial Packet

The serial packet format is used to transfer packets over UART and is the encompassing packet format of CITRIC. It has the following fields:

delimiterSerial packet headerAM packetSerial packet footerdelimiter
delimiterprotocol
byte
sequence
number
byte
dispatch
byte
AM packet headerAM packet payloadCRC (2 bytes)delimiter
7E45XX00......XXXX7E

The serial protocol uses 2 special characters, one is the delimiter 0x7E, the other is the escape byte 0x7D. The escape byte is used to send values that are 0x7E or 0x7D and is always followed by a second byte which specificies that value. Thus, a value 0x7E is replaced by the 2 byte sequence 0x7D 0x5E, and 0x7D is replaced by 0x7D 0x5D.

AM Packet

The AM packet is the basic TinyOS packet format and is documented in TinyOS Tutorial Lesson 4. It is divided into 2 parts, header and payload, with the following fields:

AM packet headerAM packet payload
dest ID
(2 bytes)
src ID
(2 bytes)
payload
length
group IDhandler IDpayload
XXXXXXXXXXXXXX...

CB Packet

A CB (cameraboard) Packet is contained in the AM packet payload when the CB packet type is specified in the handler ID of the AM packet header. It is split into header and payload and has the following fields:

AM packet payload
CB packet headerCB packet payload
typeactual src ID
(2 bytes)
payload
XXXXXX...