|
SatCat5
|
Generic API for network ports that support PTP.
Network interfaces with PTP support must derive from this class.
PTP-compatible network interfaces must provide additional methods for accessing precise timestamps, and for inspecting incoming messages to determine their type. This class defines the minimum set of required methods.
Definition at line 27 of file ptp_interface.h.
#include <ptp_interface.h>
Public Member Functions | |
| void | ptp_callback (satcat5::poll::OnDemand *obj) |
| Set callback object for PTP-related packet handling. | |
| virtual satcat5::ptp::Time | ptp_time_now ()=0 |
| Return the best available estimate of the current time. More... | |
| virtual satcat5::ptp::Time | ptp_tx_start ()=0 |
| Begin sending a timestamped message. More... | |
| virtual satcat5::io::Writeable * | ptp_tx_write ()=0 |
| Return an object suitable for writing the next PTP frame. More... | |
| virtual satcat5::ptp::Time | ptp_tx_timestamp ()=0 |
| Return timestamp of the most recent outgoing message. More... | |
| virtual satcat5::io::Readable * | ptp_rx_read ()=0 |
| Return an object suitable for reading the next PTP frame. More... | |
| virtual satcat5::ptp::Time | ptp_rx_timestamp ()=0 |
| Return timestamp of the current incoming message. More... | |
| satcat5::ptp::PacketType | ptp_rx_type () const |
| Return the packet type for the most recent message. | |
Protected Member Functions | |
| Interface () | |
| Constructor is not publicly accessible. | |
| bool | ptp_dispatch (const u8 *peek, unsigned length) |
| Determine if an incoming packet is a PTP message. More... | |
| void | ptp_notify_now () |
| Notify the PTP callback object in immediate mode. | |
| void | ptp_notify_req () |
| Notify the PTP callback object in deferred mode. | |
Private Attributes | |
| satcat5::poll::OnDemand * | m_ptp_callback |
| satcat5::ptp::PacketType | m_ptp_rx_type |
|
protected |
Determine if an incoming packet is a PTP message.
Child class MUST call this method for each received packet. If this method returns true, call ptp_notify_now() or ptp_notify_req(). Otherwise, continue normal processing.
Definition at line 18 of file ptp_interface.cc.
|
pure virtual |
Return an object suitable for reading the next PTP frame.
(This may be the primary interface or a separate pointer.) Child class MUST override this method.
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.
|
pure virtual |
Return timestamp of the current incoming message.
Child class MUST override this method.
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.
|
pure virtual |
Return the best available estimate of the current time.
(This method may be less accurate than Tx and Rx timestamps.)
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.
|
pure virtual |
Begin sending a timestamped message.
Return effective one-step timestamp if known, otherwise zero. Child class MUST override this method.
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.
|
pure virtual |
Return timestamp of the most recent outgoing message.
Child class MUST override this method.
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.
|
pure virtual |
Return an object suitable for writing the next PTP frame.
(This may be the primary interface or a separate pointer.) Child class MUST override this method.
Implemented in satcat5::port::Mailmap, and satcat5::test::EthernetInterface.