92 {
return !operator==(other);}
95 {wr->write_u32((u32)
wkn); wr->write_u32(
tow);}
186 void reset(
bool full =
false);
193 inline s64
now()
const {
return m_gps;}
Real-time clock for tracking date/time.
void set(s64 gps)
Set current GPS time.
satcat5::ptp::Time ptp() const
Current time as Precision Time Protocol timestamp.
satcat5::datetime::GpsTime gps() const
Current time as GPS week number and time-of-week.
void reset(bool full=false)
Reset internals after changes to SATCAT5_CLOCK.
s64 now() const
Current time as milliseconds since GPS epoch.
u32 uptime_msec() const
Get elapsed time since startup, in milliseconds.
satcat5::datetime::RtcTime rtc() const
Current time as ISL12082 real-time clock timestamp.
Clock()
Constructor defaults to T = 0 (unknown).
u32 uptime_usec() const
Get elapsed time since startup, in microseconds.
void timer_event() override
Child class MUST override this method.
Abstract API for reading byte-streams and packets.
Abstract API for writing byte-streams and packets.
Internal buffer used by the Log class.
Global helper object that services all OnDemand objects.
Timer objects are polled after a fixed delay or at a regular interval.
High-precision timestamp for use with PTP / IEEE1588.
static const u8 RTC_MIL_BIT
Bit-flag in HR field indicating 24-HOUR clock format.
static constexpr u32 ONE_WEEK
Common time-related constants, measured in milliseconds.
static constexpr s64 TIME_ERROR
A date/time of zero indicates an error.
satcat5::ptp::Time to_ptp(s64 time)
Convert an internal timestamp into the designated format.
static constexpr u32 ONE_MINUTE
Common time-related constants, measured in milliseconds.
static constexpr u32 ONE_DAY
Common time-related constants, measured in milliseconds.
s64 from_rtc(const satcat5::datetime::RtcTime &time)
Convert the designated format into an internal timestamp.
satcat5::datetime::RtcTime to_rtc(s64 time)
Convert an internal timestamp into the designated format.
static constexpr u32 ONE_SECOND
Common time-related constants, measured in milliseconds.
static constexpr u32 ONE_HOUR
Common time-related constants, measured in milliseconds.
static const datetime::RtcTime RTC_ERROR
Special datetime::RtcTime value indicating an error.
satcat5::datetime::GpsTime to_gps(s64 time)
Convert an internal timestamp into the designated format.
s64 from_ptp(const satcat5::ptp::Time &time)
Convert the designated format into an internal timestamp.
s64 from_gps(const satcat5::datetime::GpsTime &time)
Convert the designated format into an internal timestamp.
I/O interface core definitions.
Core event-processing loop for SatCat5 software.
High-precision "Time" object for use with PTP / IEEE1588.
GPS week-number and time-of-week.
s64 convert() const
Convert to standard form.
Hardware RTC (e.g., Renesas ISL12082).
u8 hr
Hour (0-23) + MIL bit.
u8 ct
Century (20 = year 20xx)
u8 dw
Day of week (0-6, 0 = Sunday)
s64 convert() const
Convert to standard form.
void write_to(satcat5::io::Writeable *wr) const
Write legacy binary format (Deprecated).
bool read_from(satcat5::io::Readable *rd)
Read legacy binary format (Deprecated).
u32 days_since_epoch() const
Days since 2000 Jan 1 (a Saturday).
void log_to(satcat5::log::LogBuffer &wr) const
Format as an ISO8601 / RFC3339 timestamp.
bool validate() const
Are current contents valid?
u32 msec_since_midnight() const
Milliseconds since midnight (0 - 86.4M).
Timestamp for measuring elapsed time.
TimeRef and TimeVal define the API for monotonic timers.