COBS Codec
Frames binary packets with Consistent Overhead Byte Stuffing. COBS encoding removes every 0x00 byte from the data,
at a cost of at most one byte per 254, so a single 0x00 can mark the end of each frame.
Received bytes are split at each 0x00. The bytes in between are COBS-decoded, and the decoded data becomes the
message payload. Empty frames are skipped: some senders put a 0x00 in front of each frame to flush line noise. When
sending, the payload is COBS-encoded and a 0x00 delimiter is appended. Enter the plain data in the message input,
not the encoded form.
A frame that does not decode is discarded, together with the rest of the receive buffer. Decoding restarts with the next bytes.
Use it when firmware frames binary packets (structs, protobuf, CBOR) with COBS and 0x00 delimiters. For SLIP
framing, which uses 0xC0 as its delimiter, use SLIP.
Configuration reference
| Config ID | cobs_codec |
| Selected by | app_codec = "cobs_codec" |
| Platforms | Linux, Windows, Android |
| License | Free |
Consistent Overhead Byte Stuffing - eliminates a sentinel byte from data stream for framing
This codec has no settings of its own.
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_codec": "cobs_codec"
}
}