Module cobs

Module cobs 

Source
Expand description

COBS (Consistent Overhead Byte Stuffing) codec for serial framing.

COBS encodes a byte stream so that 0x00 never appears in the payload, making 0x00 a reliable frame delimiter. After line noise or partial reads, the decoder simply discards bytes until the next 0x00 and resyncs — recovery is always at most one frame away.

Overhead: at most 1 byte per 254 input bytes (~0.4%).

§Wire format

[ COBS-encoded payload ] [ 0x00 ]

Structs§

CobsCodec
COBS frame codec for tokio_util::codec::Framed.