6 #include <satcat5/io_override.h>
27 #if SATCAT5_ALLOW_DELETION
28 Override::~Override() {
63 if (m_ovr_rd == src) {
67 }
else if (m_remote) {
78 if (m_ovr_rd == src) {m_ovr_rd = 0;}
86 void Override::watchdog_reset() {
87 if (m_remote && m_timeout) {
Remote-control override of an I/O device.
void set_remote(satcat5::io::Writeable *tx, satcat5::io::Readable *rx)
Attach the remote-control interface.
void data_rcvd(satcat5::io::Readable *src) override
The data_rcvd() callback is polled whenever data is available.
void timer_event() override
Child class MUST override this method.
void set_override(bool remote)
Manually set local or remote mode.
void data_unlink(satcat5::io::Readable *src) override
Unlink this EventListener from the designated source, because the designated Readable object is being...
void set_timeout(unsigned msec)
Set timeout for automatic return to local mode.
Abstract API for reading byte-streams and packets.
void read_notify()
Attempt notification by calling m_callback->data_rcvd().
bool copy_and_finalize(satcat5::io::Writeable *dst, satcat5::io::CopyMode mode=CopyMode::PACKET)
Copy data to a Writeable object, then finalize.
virtual void set_callback(satcat5::io::EventListener *callback)
Update registered callback for data_rcvd() events.
virtual unsigned get_read_ready() const =0
How many bytes can be read without blocking?
Wrapper class for forwarding reads to another object.
void read_src(satcat5::io::Readable *src)
Children may reset the source object as needed.
Abstract API for writing byte-streams and packets.
Wrapper class for forwarding writes to another object.
void timer_stop()
Stop all future notifications.
void timer_once(unsigned msec)
Configure a one-time notification after X milliseconds.
CopyMode
Specify read and write behavior for Readable::copy_and_finalize().
satcat5::io::NullRead null_read
Global instances of the basic NullRead and NullSink objects.