22 #include <satcat5/pkt_buffer.h>
29 #define SATCAT5_WIN32 1
31 #define SATCAT5_WIN32 0
80 { m_list.push_back(dst); }
82 { m_list.remove(dst); }
88 std::list<satcat5::io::Writeable*> m_list;
98 unsigned nbytes = 4096);
106 bool line_buffer =
true);
111 void write_key(
int ch);
113 const bool m_line_buffer;
141 inline void clear() {m_buff.
clear();}
163 inline void clear() {m_buff.
clear();}
186 inline s64 gps() {
return m_timer.gps();}
188 inline u32 raw() {
return m_timer.
raw();}
201 void service_msec(
unsigned total_msec,
unsigned msec_per_iter = 10);
238 void log_event(s8 priority,
unsigned nbytes,
const char* msg)
override;
239 std::vector<std::string> m_suppress;
Heap-allocated variant of eth::SwitchCore.
A shared-memory Ethernet switch based on the MultiBuffer class.
Ephemeral Writeable interface for a simple array.
BufferedTee copies incoming data to any number of destinations.
BufferedTee(unsigned nbytes=4096)
Create this object and set its buffer size.
void add(satcat5::io::Writeable *dst)
Update the list of destination objects.
bool write_finalize() override
Override end-of-packet handling.
BufferedWriter with heap allocation.
BufferedWriter adds an inline buffer to any Writeable interface.
Stream keyboard input to a Writeable interface.
void poll_always() override
Child class MUST override this method.
MultiBuffer with heap allocation.
A multi-source, multi-sink packet buffer.
PacketBuffer with heap allocation (in packet mode).
The PacketBuffer class is a wrapper for a circular buffer, with optional logic to support retention o...
void clear()
Reset buffer contents.
PacketBuffer with optional wiretap(s).
Abstract API for reading byte-streams and packets.
Wrapper class for forwarding reads to another object.
PacketBuffer with heap allocation (in stream mode).
PacketBuffer with optional wiretap(s).
Abstract API for writing byte-streams and packets.
Poll any OnDemand object using a TimeRef.
Defines the interface for accepting Log messages.
Helper object that prints log::Log messages to console.
ToConsole(s8 threshold=satcat5::log::DEBUG)
On creation, optionally specify the minimum priority to print.
std::string m_last_msg
Most recent message (ignores threshold)
void suppress(const char *msg)
Suppress messages containing a specific string.
void log_event(s8 priority, unsigned nbytes, const char *msg) override
Callback for each formatted Log message.
void disable()
Disable all output messages until threshold is lowered.
bool contains(const char *msg)
Does the last logged message contain the provided substring?
void clear()
Clear the stored copy of the most recent log message.
bool empty()
Is there a stored log message?
s8 m_threshold
Print only if priority >= threshold.
An "Always" object is polled whenever service() is called.
Helper object for heap allocation.
void operator=(const HeapAllocator &)=delete
Disable auto-generated assignment and copy methods.
u8 *const m_buffptr
Pointer to the underlying buffer.
HeapAllocator(unsigned nbytes)
Constructor/destructor through child class only.
HeapAllocator(const HeapAllocator &)=delete
Disable auto-generated assignment and copy methods.
Link a PosixTimer to the main polling timekeeper.
Timer object using ctime::clock().
u32 raw() override
Read current time in arbitrary "ticks".
The TimeRef API provides access to a monotonic time-counter.
TimeVal now()
Create a TimeVal object using the tick-count from raw().
Software-defined Ethernet switch.
Buffered I/O wrappers for PacketBuffer.
I/O interface core definitions.
Diagnostic logging to UART and/or Ethernet ports.
constexpr s8 DEBUG
Define basic priority codes for log messages.
Multi-source, multi-sink packet buffer.
void sleep_msec(unsigned msec)
Cross-platform wrapper for sleep()/Sleep()/etc.
void service_msec(unsigned total_msec, unsigned msec_per_iter=10)
Alternate between sleep_msec() and poll::service_all().
An Ethernet MAC address (with serializable interface).
IPv4 address is a 32-bit unsigned integer.
Timestamp for measuring elapsed time.
TimeRef and TimeVal define the API for monotonic timers.