Next: , Up: Binary monitor   [Contents][Index]


13.1 Command Structure

byte 0: 0x02 (STX)
byte 1: API version ID (currently 0x01)

The API version identifies incompatible changes, such as modifying the header structure, or rearranging or changing the meaning of existing response fields. The API version does not need to be incremented for additional fields. If all the variable length fields are prefixed with their lengths then you should be able to add new ones to any response. The server can assume default values for older clients, and for newer clients with longer commands it should be able to ignore the extra fields safely.

byte 2-5: length

Note that the command length does *not* count the STX, the command length, the command byte, or the request ID. Basically nothing in the header, just the body.

byte 6-9: request id

In little endian order. All multibyte values are in little endian order, unless otherwise specified. There is no requirement for this to be unique, but it makes it easier to match up the responses if you do.

byte 10: The numeric command type

See Commands.

byte 11+: The command body.

See Commands.