|
SatCat5
|
Inline HDLC encoder and decoder objects.
The High-Level Data Link Control (HDLC) protocol for the data-link layer. This file implements the byte-stuffed "asynchronous framing" portion of that protocol defined in IETF RFC 1662 Section 4, which is typically used with byte-aligned physical layers such as RS-232.
Higher-level functions including insertion of address and control headers, duplexing, I/S/U frames, and link-state management are NOT currently supported, but may be added in a future update.
The HdlcEncoder accepts a Writeable interface, inserts inter-frame "flag" tokens, appends a 16-bit or 32-bit checksum, and finally performs byte-stuffing for reserved token values.
The HdlcDecoder performs the inverse, accepting an HDLC stream one byte at a time through the Writeable interface, decoding the result, and forwarding valid frames to a different Writeable object.
In both cases, the input uses the io::Writeable API. To attach either input to an io::Readable interface, use io::BufferedCopy.
See also: Wikipedia article https://en.wikipedia.org/wiki/High-Level_Data_Link_Control See also: ISO/IEC 3309:1984 https://law.resource.org/pub/in/bis/S04/is.11418.1.1986.pdf See also: RFC 1662 https://datatracker.ietf.org/doc/html/rfc1662#section-3.1
Definition in file codec_hdlc.h.
#include <satcat5/crc16_checksum.h>#include <satcat5/eth_checksum.h>#include <satcat5/io_checksum.h>Go to the source code of this file.
Classes | |
| class | satcat5::io::HdlcEncoder |
| Inline HDLC encoder (framing layer only). More... | |
| class | satcat5::io::HdlcEncoder::ByteStuff |
| class | satcat5::io::HdlcDecoder |
| Inline HDLC decoder (framing layer only). More... | |