prf::pr::hdlc::HdlcDecoder class final

Streaming HDLC decoder.

Input contract:

Output contract:

This stage intentionally stops before FCS validation.

Public functions

auto pop_byte(std::uint8_t* out_byte) -> bool
Pop one decoded byte.
auto pop_event(FrameEvent* out_event) -> bool
Pop one frame event.
auto pop_frame(DecodedFrame* out_frame) -> bool
Pop one completed HDLC frame.
void process_level_bit(bool level_bit)
Feed one raw channel level bit (NRZI level).
void reset()
Reset all decode state and clear output queues.

Function documentation

bool prf::pr::hdlc::HdlcDecoder::pop_byte(std::uint8_t* out_byte)

Pop one decoded byte.

Returns true if a byte was available.

bool prf::pr::hdlc::HdlcDecoder::pop_event(FrameEvent* out_event)

Pop one frame event.

Returns true if an event was available.

bool prf::pr::hdlc::HdlcDecoder::pop_frame(DecodedFrame* out_frame)

Pop one completed HDLC frame.

Returns true if a frame was available.

The returned frame contains bytes exactly as transmitted between HDLC flags (after NRZI decode and bit destuffing), including trailing FCS.