-
Notifications
You must be signed in to change notification settings - Fork 0
protocol definition
RRDTP version 1 is a data streaming protocol. One host acts as the server, and is the authoritative source for all data values. Multiple clients can connect to the server to send and receive updates to data values. Values can be stored hierarchically in categories. The design of RRDTP draws inspiration from WPI Network Tables, but is designed to be simpler and more easily portable to resource-limited platforms.
Each packet will contain an event type. The currently defined event types are listed below.
-
Set value: sent to change a value. Either a client, or the server can send this type of packet.
-
Delete value: sent to indicate that a value should be deleted. Either a client, or the server can send this type of packet.
Values can be one of 7 types.
- int - signed 32-bit integer
- long - signed 64-bit integer
- float - single precision floating point number
- double - double precision floating point number
- boolean - true/false boolean flag
- string - string (ASCII or UTF8)
- unformatted - plain unformatted data. The calling code is responsible for endianness conversion.
Values are identified by a hierarchical naming scheme similar to Java packages. If the value isn't stored in any category, then it can be referred to simply by its name, such as "value1". If the value is stored within a category and any number of subcategories, then it can be referred to by separating the categories with a period ".", for example "category.sub-category.value1". Valid characters that can be used in category and value names are letters, numbers, underscores "_", and hyphens "-". Identifiers are case sensitive ("Value1" != "VALUE1" != "VaLuE1"). Value identifiers are always specified as ASCII format strings ending in a null terminator. The maximum length for a value identifier is 255 characters. Whether the data is actually stored hierarchically is up to the implementation, but all implementations must enforce the standard identifier scheme.
All RRDTP packets begin with a header containing the protocol version and the event type (see Events section above). After the header, the packet format will be different depending on the event type.
| Field Name | Type | Size |
|---|---|---|
| Protocol Version | int | 1 byte |
| Event Type | int | 1 byte |
Sent to create or update a value entry. The system that creates the value (sends the set packet first) is considered to own the value, and is (by default) the only system allowed to update that value later.
| Field Name | Type | Size |
|---|---|---|
| Identifier Length | int | 1 byte |
| Identifier String | string | n<256 bytes |
| Data Type | int | 1 byte |
| Data | variable | n bytes |
Sent to indicate that a value entry can be deleted. A value deletion packet contains only the value identifier and can only be sent by the owner of the value entry. If a host besides the owner sends a deletion packet, then it should be ignored.