Protocol Spec¶
This document outlines the control and data collection protocol used to send and receive data from the laser microcontroller.
Format of this document¶
Most packets are represented using [name:type] syntax.
Some types are as follows:
u{n}: an unsigned{n}bit integer in little endian format. (ex.u8)i{n}: a signed{n}bit integer in little endian format. (ex.i8)[{len}]{type}: an array of{type}with length{len}(ex.[10]u8)
General Message Format¶
Data commands (type=0)¶
DATA_UPTIME (type=0,subtype=0)¶
A regular status heartbeat (sent every ~0.5s)
DATA_LOG (type=0,subtype=1)¶
Some logging information from the firmware.
DATA_SENSOR (type=0,subtype=2)¶
Sensor data
COMMAND commands (type=½)¶
GET_INFO (type=1,subtype=0)¶
Gets the current status from the Arduino. (No arguments)
RET_INFO (type=2,subtype=0)¶
Sends the status back to the computer.
[uuid:[36]u8] // As a fixed length string
[version:u16]
[build_date:[11]u8] // In the format: Mmm dd yyyy
[build_time:[8]u8] // In the format: hh:mm:ss
LASER_POWER (type=1,subtype=2)¶
Sets a pin high or low