Messages

All messages start with a uint8 indicating the message type, followed by zero or more fields specific to that message type.

Unless otherwise specified, all message fields are little-endian, and strings are null-terminated.

Message type quick reference

Type ID

(base 10)

Type ID

(base 16)

Message

0 0x00

InfoRequest

1 0x01

InfoResponse

10 0x0A

StartFirmwareUploadRequest

11 0x0B

StartFirmwareUploadResponse

12 0x0C

StartFileUploadRequest

13 0x0D

StartFileUploadResponse

16 0x10

TransferChunkRequest

17 0x11

TransferChunkResponse

20 0x14

BeginFirmwareUpdateRequest

21 0x15

BeginFirmwareUpdateResponse

22 0x16

SetHubNameRequest

23 0x17

SetHubNameResponse

24 0x18

GetHubNameRequest

25 0x19

GetHubNameResponse

26 0x1A

DeviceUuidRequest

27 0x1B

DeviceUuidResponse

30 0x1E

ProgramFlowRequest

31 0x1F

ProgramFlowResponse

32 0x20

ProgramFlowNotification

70 0x46

ClearSlotRequest

71 0x47

ClearSlotResponse

33 0x21

ConsoleNotification

50 0x32

TunnelMessage

40 0x28

DeviceNotificationRequest

41 0x29

DeviceNotificationResponse

0 0x00

DeviceBattery

1 0x01

DeviceImuValues

2 0x02

Device5x5MatrixDisplay

10 0x0A

DeviceMotor

11 0x0B

DeviceForceSensor

12 0x0C

DeviceColorSensor

13 0x0D

DeviceDistanceSensor

14 0x0E

Device3x3ColorMatrix

60 0x3C

DeviceNotification


0x00 InfoRequest

Format

Description

uint8

Message type (0x00)

0x01 InfoResponse

Format

Description

uint8

Message type (0x01)

uint8

RPC major version.

uint8

RPC minor version.

uint16

RPC build number.

uint8

Firmware major version.

uint8

Firmware minor version.

uint16

Firmware build number.

uint16

Maximum packet size in bytes.

uint16

Maximum message size in bytes.

uint16

Maximum chunk size in bytes.

uint16

Product Group Device type.


0x0A StartFirmwareUploadRequest

Format

Description

uint8

Message type (0x0A)

uint8[20]

File SHA.

uint32

CRC32 for the file.

0x0B StartFirmwareUploadResponse

Format

Description

uint8

Message type (0x0B)

uint8

Response Status.

uint32

Number of bytes already uploaded for this File SHA. Used to resume an interrupted upload.


0x0C StartFileUploadRequest

Format

Description

uint8

Message type (0x0C)

string[32]

Name of the file as it will be stored on the hub.

uint8

Program slot to store the file in.

uint32

CRC32 for the file.

0x0D StartFileUploadResponse

Format

Description

uint8

Message type (0x0D)

uint8

Response Status.


0x10 TransferChunkRequest

Format

Description

uint8

Message type (0x10)

uint32

Running CRC32 for the transfer.

uint16

Chunk payload size.

uint8[size]

Chunk payload.

0x11 TransferChunkResponse

Format

Description

uint8

Message type (0x11)

uint8

Response Status.


0x14 BeginFirmwareUpdateRequest

Format

Description

uint8

Message type (0x14)

uint8[20]

File SHA.

uint32

CRC32 for the file.

0x15 BeginFirmwareUpdateResponse

Format

Description

uint8

Message type (0x15)

uint8

Response Status.


0x16 SetHubNameRequest

Format

Description

uint8

Message type (0x16)

string[30]

New hub name.

0x17 SetHubNameResponse

Format

Description

uint8

Message type (0x17)

uint8

Response Status.


0x18 GetHubNameRequest

Format

Description

uint8

Message type (0x18)

0x19 GetHubNameResponse

Format

Description

uint8

Message type (0x19)

string[30]

Hub name.


0x1A DeviceUuidRequest

Format

Description

uint8

Message type (0x1A)

0x1B DeviceUuidResponse

Format

Description

uint8

Message type (0x1B)

uint8[16]

Device UUID.


0x1E ProgramFlowRequest

Format

Description

uint8

Message type (0x1E)

uint8

Program Action.

uint8

Program slot to use.

0x1F ProgramFlowResponse

Format

Description

uint8

Message type (0x1F)

uint8

Response Status.

0x20 ProgramFlowNotification

Format

Description

uint8

Message type (0x20)

uint8

Program Action.


0x46 ClearSlotRequest

Format

Description

uint8

Message type (0x46)

uint8

Program slot to clear.

0x47 ClearSlotResponse

Format

Description

uint8

Message type (0x47)

uint8

Response Status.


0x21 ConsoleNotification

Format

Description

uint8

Message type (0x21)

string[256]

Console message.

0x32 TunnelMessage

Format

Description

uint8

Message type (0x32)

uint16

Payload size in bytes.

uint8[size]

Payload data.


0x28 DeviceNotificationRequest

Format

Description

uint8

Message type (0x28)

uint16

Desired notification interval in milliseconds. (0 = disable)

0x29 DeviceNotificationResponse

Format

Description

uint8

Message type (0x29)

uint8

Response Status.

0x3C DeviceNotification

Format

Description

uint8

Message type (0x3C)

uint16

Payload size in bytes.

uint8[size]

Payload as an array of device messages (see below).

Device messages

The DeviceNotification payload is a sequence of device messages.

Like the standard messages, device messages start with a uint8 indicating how to interpret the rest of the message.

0x00 DeviceBattery

Format

Description

uint8

Message type (0x00)

uint8

Battery level in percent.

0x01 DeviceImuValues

Format

Description

uint8

Message type (0x01)

uint8

Hub Face pointing up.

uint8

Hub Face configured as yaw face.

int16

Yaw value in respect to the configured yaw face.

int16

Pitch value in respect to the configured yaw face.

int16

Roll value in respect to the configured yaw face.

int16

Accelerometer reading in X axis.

int16

Accelerometer reading in Y axis.

int16

Accelerometer reading in Z axis.

int16

Gyroscope reading in X axis.

int16

Gyroscope reading in Y axis.

int16

Gyroscope reading in Z axis.

0x02 Device5x5MatrixDisplay

Format

Description

uint8

Message type (0x02)

uint8[25]

Pixel value for display.

0x0A DeviceMotor

Format

Description

uint8

Message type (0x0A)

uint8

Hub Port the motor is connected to.

uint8

Motor Device Type.

int16

Absolute position in degrees, in the range -180 to 179.

int16

Power applied to the motor, in the range -10000 to 10000.

int8

Speed of the motor, in the range -100 to 100.

int32

Position of the motor, in the range -2147483648 to 2147483647.

0x0B DeviceForceSensor

Format

Description

uint8

Message type (0x0B)

uint8

Hub Port the force sensor is connected to.

uint8

Measured value, in the range 0 to 100.

uint8

0x01 if the sensor detects pressure, 0x00 otherwise.

0x0C DeviceColorSensor

Format

Description

uint8

Message type (0x0C)

uint8

Hub Port the color sensor is connected to.

int8

Color detected by the sensor.

uint16

Raw red value, in the range 0 to 1023.

uint16

Raw green value, in the range 0 to 1023.

uint16

Raw blue value, in the range 0 to 1023.

0x0D DeviceDistanceSensor

Format

Description

uint8

Message type (0x0D)

uint8

Hub Port the distance sensor is connected to.

int16

Measured distance in millimeters, in the range 40 to 2000. (-1 if no object is detected.)

0x0E Device3x3ColorMatrix

Format

Description

uint8

Message type (0x0E)

uint8

Hub Port the color matrix is connected to.

uint8[9]

Displayed pixel values. Each pixel is encoded with the brightness in the high nibble and the color in the low nibble.