The protocol consists of single ASCII characters sent at 9600 baud (a faster rate may be chosen for the next release), with no parity, 8 data bits and no flow control. The actual commands that are currently implemented are listed below:
Command type Command Description Command ================================================================================= Control commands Halt H Stop S Ready ' ' Start s Game Notifications Begin first half 1 Begin half time h Begin second half 2 Begin overtime half 1 o Begin overtime half 2 O Begin penalty shootout a Command type Command Description Yellow Team Command Blue Team Command ================================================================================= Game restarts Kick off k K Penalty p P Direct Free kick f F Indirect Free kick i I Extras Timeout t T Timeout end z z Goal scored g G decrease Goal score d D Yellow Card y Y Red Card r R Cancel c
The data is sent inside an UDP packet multiple times per second to the IPv4 multicast address 224.5.23.1, port 10001 using a TP 100 MBit/s Ethernet connection.
Each UDP packet contains 6 Bytes:
+---------+---------+---------+---------+-------------------+ | Command | Counter | Goals bl| Goals ye| time left (16 Bit)| +---------+---------+---------+---------+-------------------+
The referee box uses this code for the packet:
struct GameStatePacket{
char cmd; // current referee command
unsigned char cmd_counter; // increments each time new command is set
unsigned char goals_blue; // current score for blue team
unsigned char goals_yellow; // current score for yellow team
unsigned short time_remaining; // seconds remaining for current game stage (network byte order)
};
The receiver can check the counter value to see if it already got this command.
