SatCat5
ptp_time.h File Reference

Detailed Description

High-precision "Time" object for use with PTP / IEEE1588.

This file defines the satcat5::ptp::Time object, which is a high-precision timestamp intended for use with the IEEE1588 Precision Time Protocol (PTP).

For simpler but less precise timestamps,

See also
datetime.h.

Definition in file ptp_time.h.

#include <satcat5/types.h>
#include <satcat5/utils.h>
Include dependency graph for ptp_time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  satcat5::ptp::Time
 High-precision timestamp for use with PTP / IEEE1588. More...
 

Functions

satcat5::ptp::Time satcat5::ptp::from_datetime (s64 gps_msec)
 Convert from SatCat5 date/time to a ptp::Time object.
 
constexpr satcat5::ptp::Time satcat5::ptp::TIME_ZERO (0LL)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_NANOSECOND (SUBNS_PER_NSEC)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_MICROSECOND (SUBNS_PER_USEC)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_MILLISECOND (SUBNS_PER_MSEC)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_SECOND (SUBNS_PER_SEC)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_MINUTE (SUBNS_PER_SEC *60)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_HOUR (SUBNS_PER_SEC *3600)
 Common time-related constants.
 
constexpr satcat5::ptp::Time satcat5::ptp::ONE_DAY (SUBNS_PER_SEC *3600 *24)
 Common time-related constants.
 

Variables

constexpr s64 satcat5::ptp::NSEC_PER_SEC = 1000000000LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::NSEC_PER_MSEC = 1000000LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::NSEC_PER_USEC = 1000LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::USEC_PER_SEC = 1000000LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::MSEC_PER_SEC = 1000LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::SUBNS_PER_NSEC = 65536LL
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::SUBNS_PER_USEC = SUBNS_PER_NSEC * NSEC_PER_USEC
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::SUBNS_PER_MSEC = SUBNS_PER_NSEC * NSEC_PER_MSEC
 Define commonly used scaling factors.
 
constexpr s64 satcat5::ptp::SUBNS_PER_SEC = SUBNS_PER_NSEC * NSEC_PER_SEC
 Define commonly used scaling factors.