FIRST Robotic Competition in Oregon: Protocol Command Table 20041007

Packet Definition

Packet structure and pointers:

This ASCII diagram naturally has to be viewed with a monospaced font.

                  The commands() function gets passed a pointer to here. (char *packetPayloadSrc)
                  //============================================================================
                  ||
                  ||
                  ||    The command() function gets passed a pointer to here. (char *packetPayload)
                  ||    //========================================================================
                  ||    ||
                  ||    ||                       Replaced with a null
                  ||    ||                       //====================
                  ||    ||                       ||
                  ||    ||                       ||
                 \\//  \\//                     \\//
                  \/    \/                       \/
    /-|-|-|-|-|-|-|----------------------------|-|-|-|-|-|-|-\
    | Start | Dest| Src |   Payload commands   | End | Cksum |
    \-|-|-|-|-|-|-|----------------------------|-|-|-|-|-|-|-/
  

The sections of the packet with |-|-|-| are the sections that have been stripped out before the commands() function gets ahold of the packet.

Byte# What Comment
1 Start Always '$'.
3 Dest This is the node number of the destination device.
2 Src This is the node number of the sourcing device.
4 Commands This is one or more commands. See the command table
n-2 End Always '\n'.
n-1 CKSUM1 High Nibble of the Checksum
n CKSUM0 Low Nibble of the Checksum

Command Table

Message Name Char Length Mess. Char [1st byte] Mod. Char Time Len. Data Chars Comments
WRITE 4 1 Addr: [0-F] - - [0-F] [0-F] Write one byte of decoded data to the port.
READ 2 2 Addr: [0-F] - - - Request read from specified port.
DATAIS 4 3 Addr: [0-F] - - [0-F] [0-F] The value of the requested port is supplied as data. This is the reply to a 'READ' message.
CONFIGWR 4 4 Addr: [0-F] - - [0-F] [0-F] Write configuration for port X. Data byte following is mode, where 1 bits are OUTPUT and 0 bits are input.
CONFIGRD 2 5 Addr: [0-F] - - - Read configuration for port X. No data following. Port config byte is returned in a reply message.
CONFIGIS 4 6 Addr: [0-F] - - [0-F] [0-F] Read configuration reply from port X. This is the reply to a CONFIGRD message.
- - [7-9A-D] - - - - not used.
PERIODIC >=6 E Addr: [0-F] [0-F] [0-F] [0-F] [0-F] any even number of [0-F]

Set a periodic process. The time field is delay in milliseconds, high nibble first. The data field contains twice the number of nibbles specified by "length". That field is treated as a message that is processed at an interval specified by the time value.

A periodic process X can be cancelled by sending it a zero length process string. Example:
E50000

ERROR >6 F Level: [0-F] - [0-F] [0-F] any even number of [0-F] Error report or other message to be logged or reported to humans.

For example, if the packet was:

$12D51A02122059\n


Last modified 11 Dec 2006
http://brown.armoredpenguin.com/~abrown/contact.html
http://brown.armoredpenguin.com/~abrown/first/first2004/coprocessor/ProtoclCommandTable20041007.html