Pigweed
 
Loading...
Searching...
No Matches
pw::hdlc::Encoder Class Reference

Encodes and writes HDLC frames. More...

#include <encoder.h>

Public Member Functions

constexpr Encoder (stream::Writer &output)
 Construct an encoder which will write data to output.
 
Status StartUnnumberedFrame (uint64_t address)
 
Status WriteData (ConstByteSpan data)
 
Status FinishFrame ()
 Finishes a frame. Writes the frame check sequence and a terminating flag.
 

Detailed Description

Encodes and writes HDLC frames.

Member Function Documentation

◆ StartUnnumberedFrame()

Status pw::hdlc::Encoder::StartUnnumberedFrame ( uint64_t  address)
inline

Writes the header for an U-frame. After successfully calling StartUnnumberedFrame, WriteData may be called any number of times.

◆ WriteData()

Status pw::hdlc::Encoder::WriteData ( ConstByteSpan  data)

Writes data for an ongoing frame. Must only be called after a successful StartInformationFrame call, and prior to a FinishFrame() call.


The documentation for this class was generated from the following file: