12 #include <satcat5/ptp_interface.h>
35 { m_support_one_step = en; }
58 inline unsigned tx_count()
const {
return m_tx_count; }
60 inline unsigned rx_count()
const {
return m_rx_count; }
67 void read_begin_packet();
81 bool m_support_one_step;
Ephemeral Writeable interface for a simple array.
Event-handler interface for newly received data.
PacketBuffer with heap allocation (in packet mode).
Abstract API for reading byte-streams and packets.
Wrapper class for forwarding reads to another object.
Abstract API for writing byte-streams and packets.
Generic API for network ports that support PTP.
High-precision timestamp for use with PTP / IEEE1588.
Simulation of a PTP-compatible Ethernet interface controller.
satcat5::io::Writeable * ptp_tx_write() override
Return an object suitable for writing the next PTP frame.
satcat5::ptp::Time ptp_time_now() override
Return the best available estimate of the current time.
void set_zero_pad(unsigned len)
Set minimum frame length. Runt frames are zero-padded.
unsigned rx_count() const
Count packets received.
void set_loss_rate(float rate)
Set rate for randomized drops of outgoing packets.
EthernetInterface(satcat5::io::Writeable *pcap)
Create a simulated interface, with optional packet-capture.
void connect(satcat5::test::EthernetInterface *dst)
Crosslink to specified destination object.
void read_finalize() override
Consume any remaining bytes in this frame, if applicable.
unsigned tx_count() const
Count packets sent.
satcat5::ptp::Time ptp_rx_timestamp() override
Return timestamp of the current incoming message.
satcat5::ptp::Time ptp_tx_timestamp() override
Return timestamp of the most recent outgoing message.
void set_callback(satcat5::io::EventListener *callback) override
Update registered callback for data_rcvd() events.
void support_one_step(bool en)
Enable or disable support for one-step timestamps.
bool write_finalize() override
Mark end of frame and release temporary working data.
satcat5::ptp::Time ptp_tx_start() override
Begin sending a timestamped message.
satcat5::io::Readable * ptp_rx_read() override
Return an object suitable for reading the next PTP frame.
void data_rcvd(satcat5::io::Readable *src) override
The data_rcvd() callback is polled whenever data is available.
"Readable" I/O interface core definitions
"Writeable" I/O interface core definitions
Miscellaneous POSIX wrappers (e.g., heap allocation, log to console...)
High-precision "Time" object for use with PTP / IEEE1588.