This is an extension that provides a client version of the XRP protocol for transmitting robot hardware interface state to an XRP robot over UDP.
## Configuration
The XRP client has a number of configuration options available through environment variables.
``HALSIMXRP_HOST``: The host to connect to. Defaults to localhost.
``HALSIMXRP_PORT``: The port number to connect to. Defaults to 3540.
## XRP Protocol
The WPILib -> XRP protocol is binary-based to save on bandwidth due to hardware limitations of the XRP robot. The messages to/from the XRP follow a the format below:
| _uint16_t_ sequence | _uint8_t_ control | [<Tagged Data>](#tagged-data) |
### Control Byte
The control byte is used to indicate the current `enabled` state of the WPILib robot code. When this is set to `1`, the robot is enabled, and when it is set to `0` it is disabled.
Messages originating from the XRP have an unspecified value for the control byte.
### Tagged Data
The `Tagged Data` section can contain an arbitrary number of data blocks. Each block has the format below:
The `size` byte encodes the size of the data block, _excluding_ itself. Thus the smallest block size is 2 bytes, with a size value of 1 (1 size byte, 1 tag byte, 0 payload bytes). Maximum size of the payload is 254 bytes.
Utilizing tagged data blocks allows us to send multiple pieces of data in a single UDP packet. The tags currently implemented for the XRP are as follows: