1.3 KiB
1.3 KiB
Host ↔ Teensy Protocol v1 — Working Spec
Status: draft scaffold. Cédric should finalize the exact wire format before implementation locks.
Philosophy
This is a setpoint/telemetry protocol, not G-code.
Requirements:
- versioned frames;
- length-delimited or COBS-delimited framing;
- CRC-16 or CRC-32 on every frame;
- deterministic parsing;
- ACK/NACK for every command;
- machine-readable NACK reason codes;
- no text parsing in the control path.
Host → Teensy messages
HEARTBEATMANUAL_STARTSETPOINTMANUAL_STOPSEGMENT_STARTPAUSERESUMEABORTESTOP
Teensy → Host messages
ACKNACKTELEMETRYEVENTSEGMENT_DONEABORT_COMPLETE
v1 production subset
Manual v1 only needs:
HEARTBEATMANUAL_STARTSETPOINTMANUAL_STOPACK/NACKTELEMETRYEVENT
But define and parse the future segment messages now so Phase 3 does not require a protocol reset.
Open protocol choices
- JSON-lines, MessagePack, or compact binary structs?
- CRC-16 vs CRC-32?
- COBS framing vs length-prefix + CRC?
- Serial baud rate and reconnect behavior?
- Whether heartbeat is host-only or bidirectional?
Recommendation: choose the simplest robust format Cédric is comfortable debugging on the bench.