Facilitates decoding of data frames using the HDLC protocol by returning packets as they are decoded and storing incomplete data frames in a buffer.
Decoder does not own the buffer it writes to. It can be used to write bytes to any buffer. The DecoderBuffer template class allocates a buffer.
|
|
constexpr | Decoder (ByteSpan buffer) |
| |
|
| Decoder (const Decoder &)=delete |
| |
|
Decoder & | operator= (const Decoder &)=delete |
| |
|
| Decoder (Decoder &&)=default |
| |
|
Decoder & | operator= (Decoder &&)=default |
| |
| Result< Frame > | Process (std::byte new_byte) |
| | Parses a single byte of an HDLC stream.
|
| |
|
template<typename F , typename... Args> |
| void | Process (ConstByteSpan data, F &&callback, Args &&... args) |
| | Processes a span of data and calls the provided callback with each frame or error.
|
| |
| size_t | max_size () const |
| |
|
void | Clear () |
| | Clears and resets the decoder.
|
| |