Expand description
The transmit-side packet builder — allocation-free.
Builds the full wire packet: command + checksum, encoded as UTF-8 bytes,
written into a caller-provided buffer. The checksum is a bytewise sum mod
256, formatted as 2 uppercase hex chars — exactly the app’s
SkydroidControl.getCrc.
Functions§
- build
- Build the full wire packet from raw command bytes:
command + checksum, written intoout. Returns the total bytes written, orNoneifoutis too small (cmd.len() + 2needed). - build_
command - Build a wire packet from any
Commandimplementor, writing intoout. - checksum_
byte - Compute the checksum byte for a command:
(sum of all bytes) mod 256. - checksum_
hex - Compute the 2-character uppercase-hex checksum string as ASCII bytes.
- verify
- Given a full packet (
cmd + 2-char checksum), verify the checksum matches.