18 enum class PacketType {NON_PTP, PTP_L2, PTP_L3};
31 { m_ptp_callback = obj; }
62 {
return m_ptp_rx_type; }
68 , m_ptp_rx_type(PacketType::NON_PTP) {}
84 satcat5::ptp::PacketType m_ptp_rx_type;
Abstract API for reading byte-streams and packets.
Abstract API for writing byte-streams and packets.
An "OnDemand" object is polled only on request.
virtual void poll_demand()=0
Deferred event handler, called after request().
void request_poll()
Call this method to request polling at a later time.
Generic API for network ports that support PTP.
virtual satcat5::ptp::Time ptp_rx_timestamp()=0
Return timestamp of the current incoming message.
Interface()
Constructor is not publicly accessible.
virtual satcat5::ptp::Time ptp_tx_timestamp()=0
Return timestamp of the most recent outgoing message.
bool ptp_dispatch(const u8 *peek, unsigned length)
Determine if an incoming packet is a PTP message.
satcat5::ptp::PacketType ptp_rx_type() const
Return the packet type for the most recent message.
virtual satcat5::io::Writeable * ptp_tx_write()=0
Return an object suitable for writing the next PTP frame.
virtual satcat5::ptp::Time ptp_time_now()=0
Return the best available estimate of the current time.
void ptp_notify_now()
Notify the PTP callback object in immediate mode.
void ptp_callback(satcat5::poll::OnDemand *obj)
Set callback object for PTP-related packet handling.
virtual satcat5::io::Readable * ptp_rx_read()=0
Return an object suitable for reading the next PTP frame.
virtual satcat5::ptp::Time ptp_tx_start()=0
Begin sending a timestamped message.
void ptp_notify_req()
Notify the PTP callback object in deferred mode.
High-precision timestamp for use with PTP / IEEE1588.
Basic type aliases and prototypes used throughout SatCat5.