9 #include <satcat5/ntp_header.h>
12 #include <satcat5/udp_core.h>
13 #include <satcat5/udp_dispatch.h>
53 ~
Client() SATCAT5_OPTIONAL_DTOR;
59 s8 poll_rate = satcat5::ntp::Header::TIME_1MIN);
66 {
return m_iface.
ready(); }
74 { m_stratum = stratum; }
Limited read of next N bytes.
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Client and/or server for the Network Time Protocol (NTP).
void client_connect(const satcat5::ip::Addr &server, s8 poll_rate=satcat5::ntp::Header::TIME_1MIN)
Enable client mode by connecting to the specified server.
void timer_event() override
Child class MUST override this method.
void client_close()
Close the connection to a remote server.
void client_set_rate(s8 poll_rate)
Set the client polling rate.
satcat5::ptp::Time to_ptp(u64 t) const
Convert NTP timestamp to PTP format.
bool client_ok()
Is the client currently connected?
u64 to_ntp(const satcat5::ptp::Time &t) const
Convert any PTP timestamp to NTP format.
u64 ntp_now() const
Get the current time in NTP format.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
Client(satcat5::ptp::TrackingClock *refclk, satcat5::udp::Dispatch *iface)
Set the reference clock and network interface for this client.
void server_start(u8 stratum)
Enable or disable server mode.
Timer objects are polled after a fixed delay or at a regular interval.
A source for ptp::Measurement events, usually a ptp::Client.
High-precision timestamp for use with PTP / IEEE1588.
Generic interface to a numerically-controlled reference clock.
Implementation of "net::Address" for UDP Dispatch.
bool ready() const override
Is this address object ready for use? Child MUST override this method.
Dispatcher sorts incoming UDP messages by port index.
Core event-processing loop for SatCat5 software.
Define the API for generating ptp::Measurement events.
IPv4 address is a 32-bit unsigned integer.