33 #include <satcat5/pkt_buffer.h>
38 #ifndef SATCAT5_COBS_BUFFSIZE
39 #define SATCAT5_COBS_BUFFSIZE 1600
42 #ifndef SATCAT5_COBS_PACKETS
43 #define SATCAT5_COBS_PACKETS 32
BufferedCopy copies from any Readable source to any Writeable sink.
Buffered COBS encoder / decoder pair.
satcat5::io::BufferedCopy m_copy
Push/pull adapter.
CobsCodec(satcat5::io::Writeable *dst, satcat5::io::Readable *src)
Constructor links to specified source and destination.
u8 m_rawbuff[SATCAT5_COBS_BUFFSIZE]
Working buffer for m_rx.
satcat5::io::CobsDecoder m_decode
Decoder object.
satcat5::io::PacketBuffer m_buff
Decoder writes to buffer.
Buffered COBS encoder / decoder pair with opposite polarity.
satcat5::io::PacketBuffer m_buff
Encoder writes to buffer.
CobsCodecInverse(satcat5::io::Writeable *dst, satcat5::io::Readable *src)
Constructor links to specified source and destination.
u8 m_rawbuff[SATCAT5_COBS_BUFFSIZE]
Working buffer for m_rx.
satcat5::io::BufferedCopy m_copy
Push/pull adapter.
satcat5::io::CobsEncoder m_encode
Encoder object.
unsigned get_write_space() const override
How many bytes can be written without blocking?
CobsDecoder(satcat5::io::Writeable *dst)
Permanently link this encoder to an output object.
void write_next(u8 data) override
Write the next byte to the underlying buffer or device.
void write_overflow() override
Optional error handling for write overflow.
void write_overflow() override
Optional error handling for write overflow.
unsigned get_write_space() const override
How many bytes can be written without blocking?
void write_next(u8 data) override
Write the next byte to the underlying buffer or device.
bool write_finalize() override
Mark end of frame and release temporary working data.
CobsEncoder(satcat5::io::Writeable *dst)
Permanently link this encoder to an output object.
The PacketBuffer class is a wrapper for a circular buffer, with optional logic to support retention o...
Abstract API for reading byte-streams and packets.
Wrapper class for forwarding reads to another object.
Abstract API for writing byte-streams and packets.
Buffered I/O wrappers for PacketBuffer.