|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Messages in SLIP (RFC 1055), each ended by 0xC0. More...
#include <Framing.hpp>
Public Member Functions | |
| size_t | buffered () const noexcept |
| Decoded bytes held for a frame that has not ended. | |
| template<MessageSink Sink> | |
| FrameReport | push (Message bytes, Sink &&sink) |
| void | reset () noexcept |
| Drop any partial frame and any discard in progress. | |
| SlipFramer (size_t max_message=default_max_line) noexcept | |
Static Public Attributes | |
| static constexpr uint8_t | end = 0xC0 |
| static constexpr uint8_t | escape = 0xDB |
| static constexpr uint8_t | escaped_end = 0xDC |
| static constexpr uint8_t | escaped_escape = 0xDD |
Private Attributes | |
| bool | m_discarding { false } |
| bool | m_escaped { false } |
| size_t | m_max_message |
| std::vector< uint8_t > | m_pending |
Messages in SLIP (RFC 1055), each ended by 0xC0.
The payload may hold any bytes, with 0xC0 and 0xDB escaped. Empty frames are skipped, so a leading 0xC0 is harmless. An escape followed by anything but the two defined codes, or by 0xC0, drops the frame and counts it as discarded with FrameFault::Invalid. A decoded message longer than max_message is dropped with FrameFault::Oversized. Either way the framer resumes after the next 0xC0.
Not thread safe: one thread at a time per framer.
Definition at line 654 of file Framing.hpp.