Skip to main content

Module codec

Module codec 

Source
Expand description

COBS framing: encode/decode frames and accumulate partial reads.

Each frame is COBS-encoded and terminated with a 0x00 sentinel byte. The sentinel never appears in the encoded data, so it unambiguously marks frame boundaries.

Uses the ucobs crate — the same COBS implementation as the firmware.

Structs§

FrameReader
Stateful COBS frame accumulator.

Functions§

decode_frame
COBS-decode a frame (without the sentinel). Returns None on decode error.
encode_frame
COBS-encode data and append the 0x00 sentinel.
read_frame
Read one complete COBS frame from a blocking Read source.