Packet Payloads
This document defines the CBOR payload structure for each Fusain message type.
For packet framing, see Packet Format. For the canonical schema, see
fusain.cddl.
All payloads are CBOR maps with integer keys. Optional fields (marked with
?) may be omitted.
Message Types
Configuration Commands
Type |
Name |
Description |
|---|---|---|
Configure motor controller parameters |
||
Configure pump controller parameters |
||
Configure temperature controller parameters |
||
Configure glow plug parameters |
||
Subscribe to data from appliance |
||
Unsubscribe from appliance data |
||
Enable/disable telemetry broadcasts |
||
Configure communication timeout |
||
0x18-0x1E |
Reserved |
Reserved for future configuration commands |
Request device capabilities |
Control Commands
Type |
Name |
Description |
|---|---|---|
Set system mode/state |
||
Set motor RPM |
||
Set pump rate |
||
Control glow plug |
||
Temperature controller control |
||
Request telemetry data (polling mode) |
||
0x26-0x2E |
Reserved |
Reserved for future control commands |
Heartbeat/connectivity check |
Telemetry Data
Type |
Name |
Description |
|---|---|---|
System state and status |
||
Motor telemetry |
||
Pump status and events |
||
Glow plug status |
||
Temperature readings |
||
Device capabilities announcement |
||
0x36-0x3E |
Reserved |
Reserved for future telemetry messages |
Heartbeat response |
Error Messages
Type |
Name |
Description |
|---|---|---|
Command validation failed |
||
Command rejected by state machine |
||
0xE2-0xEF |
Reserved |
Reserved for future error messages |
Configuration Commands
Configuration commands are sent from controllers to appliances to set
persistent parameters. Message types range from 0x10 to 0x1F.
MOTOR_CONFIG
0x10Configure motor controller parameters.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
motor |
int |
Motor index (negative values reserved) |
1 (?) |
pwm_period |
uint |
PWM period in nanoseconds (optional) |
2 (?) |
pid_kp |
float |
Proportional gain (optional) |
3 (?) |
pid_ki |
float |
Integral gain (optional) |
4 (?) |
pid_kd |
float |
Derivative gain (optional) |
5 (?) |
max_rpm |
int |
Maximum RPM (optional) |
6 (?) |
min_rpm |
int |
Minimum stable RPM (optional) |
7 (?) |
min_pwm_duty |
uint |
Minimum PWM pulse width in nanoseconds (optional) |
PUMP_CONFIG
0x11Configure fuel pump parameters.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
pump |
int |
Pump index (negative values reserved) |
1 (?) |
pulse_ms |
uint |
Solenoid pulse duration in milliseconds (optional) |
2 (?) |
recovery_ms |
uint |
Recovery time after pulse in milliseconds (optional) |
TEMPERATURE_CONFIG
0x12Configure temperature controller parameters.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
thermometer |
int |
Temperature sensor index (negative values reserved) |
1 (?) |
pid_kp |
float |
Proportional gain (optional) |
2 (?) |
pid_ki |
float |
Integral gain (optional) |
3 (?) |
pid_kd |
float |
Derivative gain (optional) |
GLOW_CONFIG
0x13Configure glow plug parameters.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
glow |
int |
Glow plug index (negative values reserved) |
1 (?) |
max_duration |
uint |
Maximum glow duration in milliseconds (optional) |
DATA_SUBSCRIPTION
0x14Subscribe to data from an appliance (controller-to-controller routing).
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
appliance_address |
uint |
64-bit address of the appliance to subscribe to |
DATA_UNSUBSCRIBE
0x15Remove a data subscription.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
appliance_address |
uint |
64-bit address of the appliance to unsubscribe from |
TELEMETRY_CONFIG
0x16Enable or disable periodic telemetry broadcasts.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
enabled |
bool |
Telemetry broadcast enabled |
1 |
interval_ms |
uint |
Broadcast interval in milliseconds (0 = polling mode) |
TIMEOUT_CONFIG
0x17Configure communication timeout behavior.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
enabled |
bool |
Timeout enabled |
1 |
timeout_ms |
uint |
Timeout interval in milliseconds (5000-60000) |
DISCOVERY_REQUEST
0x1FRequest device capabilities from all appliances. Appliances respond with DEVICE_ANNOUNCE.
Payload: nil (empty)
Control Commands
Control commands are sent from controllers to appliances for real-time
operational control. Message types range from 0x20 to 0x2F.
STATE_COMMAND
0x20Set system operating mode.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
mode |
uint |
Operating mode (see values below) |
1 (?) |
argument |
int |
Mode-specific parameter (optional) |
Mode Values
Value |
Mode |
Argument |
|---|---|---|
0 |
IDLE |
Ignored |
1 |
FAN |
Target RPM |
2 |
HEAT |
Pump rate (milliseconds) |
255 |
EMERGENCY |
Ignored |
MOTOR_COMMAND
0x21Set motor speed.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
motor |
int |
Motor index (negative values reserved) |
1 |
rpm |
int |
Target speed (0 = stop) |
PUMP_COMMAND
0x22Set fuel pump rate.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
pump |
int |
Pump index (negative values reserved) |
1 |
rate_ms |
int |
Pulse interval in milliseconds (0 = stop) |
GLOW_COMMAND
0x23Control glow plug.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
glow |
int |
Glow plug index (negative values reserved) |
1 |
duration |
int |
Burn duration in milliseconds (0 = extinguish) |
TEMPERATURE_COMMAND
0x24Configure temperature controller operation.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
thermometer |
int |
Temperature sensor index (negative values reserved) |
1 |
type |
uint |
Command type (see values below) |
2 (?) |
motor_index |
uint |
Motor to control (WATCH_MOTOR only, optional) |
3 (?) |
target_temperature |
float |
Target temperature in °C (SET_TARGET_TEMPERATURE only, optional) |
Command Type Values
Value |
Type |
Description |
|---|---|---|
0 |
WATCH_MOTOR |
Associate temperature sensor with a motor |
1 |
UNWATCH_MOTOR |
Remove motor association |
2 |
ENABLE_RPM_CONTROL |
Enable automatic RPM adjustment |
3 |
DISABLE_RPM_CONTROL |
Disable automatic RPM adjustment |
4 |
SET_TARGET_TEMPERATURE |
Set target temperature for PID control |
SEND_TELEMETRY
0x25Request specific telemetry data (polling mode).
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
telemetry_type |
uint |
Telemetry type (see values below) |
1 (?) |
index |
uint |
Peripheral index (0xFFFFFFFF = all, optional) |
Telemetry Type Values
Value |
Type |
|---|---|
0 |
STATE |
1 |
MOTOR |
2 |
TEMPERATURE |
3 |
PUMP |
4 |
GLOW |
PING_REQUEST
0x2FConnectivity check and timeout reset. Appliances respond with PING_RESPONSE.
Payload: nil (empty)
Telemetry Data
Telemetry messages are sent from appliances to controllers. Message types
range from 0x30 to 0x3F.
STATE_DATA
0x30System state and error status.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
error |
bool |
Error flag (true if error occurred) |
1 |
code |
uint |
Error code (see values below) |
2 |
state |
uint |
Current state (see values below) |
3 |
timestamp |
uint |
Time since boot in milliseconds |
State Values
See Burn Cycle for operational details.
Value |
State |
Description |
|---|---|---|
0 |
INITIALIZING |
System startup in progress |
1 |
IDLE |
Ready for operation |
2 |
BLOWING |
Fan running without combustion |
3 |
PREHEAT |
Glow plug warming |
4 |
PREHEAT_STAGE_2 |
Combustion starting, not yet stable |
5 |
HEATING |
Normal combustion active |
6 |
COOLING |
Cooldown sequence in progress |
7 |
ERROR |
Fault detected |
8 |
E_STOP |
Emergency stop active |
Error Code Values
Value |
Code |
Description |
|---|---|---|
0 |
NONE |
No error |
1 |
OVERHEAT |
Temperature exceeded safety limit |
2 |
SENSOR_FAULT |
Temperature sensor failure |
3 |
IGNITION_FAIL |
Failed to reach ignition temperature |
4 |
FLAME_OUT |
Temperature dropped during heating |
5 |
MOTOR_STALL |
Motor RPM below threshold |
6 |
PUMP_FAULT |
Pump operation failure |
7 |
COMMANDED_ESTOP |
Emergency stop commanded |
MOTOR_DATA
0x31Motor telemetry.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
motor |
int |
Motor index (negative values reserved) |
1 |
timestamp |
uint |
Time since boot in milliseconds |
2 |
rpm |
int |
Current measured speed |
3 |
target |
int |
Target speed setpoint |
4 (?) |
max_rpm |
int |
Maximum achievable speed (optional) |
5 (?) |
min_rpm |
int |
Minimum stable speed (optional) |
6 (?) |
pwm |
uint |
Current PWM pulse width in nanoseconds (optional) |
7 (?) |
pwm_max |
uint |
PWM period in nanoseconds (optional) |
PUMP_DATA
0x32Fuel pump status and events.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
pump |
int |
Pump index (negative values reserved) |
1 |
timestamp |
uint |
Event timestamp since boot in milliseconds |
2 |
type |
uint |
Event type (see values below) |
3 (?) |
rate |
int |
Current pump rate in milliseconds (optional) |
Event Type Values
Value |
Type |
Description |
|---|---|---|
0 |
INITIALIZING |
Pump controller starting up |
1 |
READY |
Pump ready for operation |
2 |
ERROR |
Pump fault detected |
3 |
CYCLE_START |
Beginning of a pump cycle |
4 |
PULSE_END |
Solenoid pulse completed |
5 |
CYCLE_END |
Recovery period completed |
GLOW_DATA
0x33Glow plug status.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
glow |
int |
Glow plug index (negative values reserved) |
1 |
timestamp |
uint |
Status timestamp since boot in milliseconds |
2 |
lit |
bool |
Glow state (true = lit, false = off) |
TEMPERATURE_DATA
0x34Temperature readings and PID status.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
thermometer |
int |
Sensor index (negative values reserved) |
1 |
timestamp |
uint |
Reading timestamp since boot in milliseconds |
2 |
reading |
float |
Current temperature in °C |
3 (?) |
temperature_rpm_control |
bool |
PID control active (optional) |
4 (?) |
watched_motor |
int |
Motor being controlled (optional) |
5 (?) |
target_temperature |
float |
Target temperature in °C (optional) |
DEVICE_ANNOUNCE
0x35Device capabilities (response to DISCOVERY_REQUEST).
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
motor_count |
uint |
Number of motors |
1 |
thermometer_count |
uint |
Number of temperature sensors |
2 |
pump_count |
uint |
Number of pumps |
3 |
glow_count |
uint |
Number of glow plugs |
End-of-Discovery Marker
Routers send a special DEVICE_ANNOUNCE to mark the end of discovery:
ADDRESS field: Stateless address (
0xFFFFFFFFFFFFFFFF)All capability fields (motor_count, thermometer_count, pump_count, glow_count): 0
This packet indicates discovery is complete. It is the ONLY DEVICE_ANNOUNCE sent when no appliances are available. See Session Initiation for details.
PING_RESPONSE
0x3FHeartbeat response to PING_REQUEST.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
uptime_ms |
uint |
System uptime in milliseconds |
Error Messages
Error messages are sent from appliances to controllers when commands fail.
Message types range from 0xE0 to 0xEF.
ERROR_INVALID_CMD
0xE0Command validation failed.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
error_code |
int |
Error category (1 = invalid parameter, 2 = invalid index) |
1 (optional) |
rejected_field |
uint |
CBOR key of the field that failed validation |
2 (optional) |
constraint |
uint |
Constraint violation type (see values below) |
Error Code Values
Value |
Description |
|---|---|
1 |
Invalid parameter value (out of range, NaN, etc.) |
2 |
Invalid device index (motor, pump, or sensor does not exist) |
Constraint Values
Value |
Name |
Description |
|---|---|---|
0 |
UNSPECIFIED |
No specific constraint (backward compatible) |
1 |
VALUE_TOO_LOW |
Value below minimum allowed |
2 |
VALUE_TOO_HIGH |
Value above maximum allowed |
3 |
VALUE_INVALID |
Value is NaN, Infinity, or otherwise invalid |
4 |
VALUE_CONFLICT |
Value conflicts with another field |
5 |
INDEX_NOT_FOUND |
Device index does not exist |
6 |
FIELD_REQUIRED |
Required field is missing |
7 |
TYPE_MISMATCH |
Field has wrong CBOR type |
8 |
OPERATION_BLOCKED |
Operation not allowed in current context |
9 |
VALUE_IN_GAP |
Value in invalid gap (e.g., rpm between 1 and min_rpm-1) |
ERROR_STATE_REJECT
0xE1Command rejected by state machine.
Payload Fields
Key |
Field |
Type |
Description |
|---|---|---|---|
0 |
error_code |
int |
State that rejected the command |
1 (optional) |
rejection_reason |
uint |
Why the state rejected the command (see values below) |
Rejection Reason Values
Value |
Name |
Description |
|---|---|---|
0 |
UNSPECIFIED |
No specific reason (backward compatible) |
1 |
RESOURCE_CONTROLLED |
Resource controlled by state machine |
2 |
INVALID_IN_STATE |
Operation not valid in current state |
3 |
TRANSITION_BLOCKED |
State transition not allowed (reserved) |