26 #include <satcat5/pkt_buffer.h>
31 #ifndef SATCAT5_SLIP_BUFFSIZE
32 #define SATCAT5_SLIP_BUFFSIZE 1600
35 #ifndef SATCAT5_SLIP_PACKETS
36 #define SATCAT5_SLIP_PACKETS 32
76 enum class State {SLIP_RDY, SLIP_ESC, SLIP_EOF, SLIP_ERR};
78 satcat5::io::SlipDecoder::State m_state;
BufferedCopy copies from any Readable source to any Writeable sink.
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.
Buffered SLIP encoder / decoder pair.
satcat5::io::SlipDecoder m_decode
Decoder object.
satcat5::io::PacketBuffer m_buff
Decoder writes to buffer.
SlipCodec(satcat5::io::Writeable *dst, satcat5::io::Readable *src)
Constructor links to specified source and destination.
satcat5::io::BufferedCopy m_copy
Push/pull adapter.
u8 m_rawbuff[SATCAT5_SLIP_BUFFSIZE]
Working buffer for m_rx.
Buffered SLIP encoder / decoder pair with opposite polarity.
u8 m_rawbuff[SATCAT5_SLIP_BUFFSIZE]
Working buffer for m_rx.
SlipCodecInverse(satcat5::io::Writeable *dst, satcat5::io::Readable *src)
Constructor links to specified source and destination.
satcat5::io::BufferedCopy m_copy
Push/pull adapter.
satcat5::io::PacketBuffer m_buff
Encoder writes to buffer.
satcat5::io::SlipEncoder m_encode
Encoder object.
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.
SlipDecoder(satcat5::io::Writeable *dst)
Permanently link this encoder to an output object.
void write_overflow() override
Optional error handling for write overflow.
void write_overflow() override
Optional error handling for write overflow.
void write_next(u8 data) override
Write the next byte to the underlying buffer or device.
SlipEncoder(satcat5::io::Writeable *dst)
Permanently link this encoder to an output object.
bool write_finalize() override
Mark end of frame and release temporary working data.
unsigned get_write_space() const override
How many bytes can be written without blocking?
Abstract API for writing byte-streams and packets.
Buffered I/O wrappers for PacketBuffer.