Expand description
HDLC-Lite framing for asynchronous serial links (UART, USB-CDC).
Same discipline as Spinel’s HDLC-Lite: frames are delimited by
0x7E flag bytes, control bytes inside a frame are escaped with
0x7D (XOR 0x20), and each frame carries a trailing 16-bit FCS
(CRC-16/X-25 per RFC 1662), least-significant byte first.
Structs§
- Decoder
- Streaming decoder with an internal reassembly buffer of
Nbytes.
Enums§
Constants§
- ESCAPE
- Escape byte; the following byte is XORed with
ESCAPE_XOR. - ESCAPE_
XOR - XOR applied to escaped bytes.
- FLAG
- Frame delimiter.
Functions§
- crc16
- RFC 1662 FCS-16 (CRC-16/X-25) over
data. - encode_
frame - Encode one frame, including both delimiting flags, into
out. - max_
encoded_ len - Worst-case encoded size for a payload of
payload_lenbytes.