Precision Time Protocol (PTP) time format

Overview

The PTP time struct can store time information in high precision format (nanoseconds). The extended timestamp format can store the time in fractional nanoseconds accuracy. The PTP time format is used in generic Precision Time Protocol (gPTP) implementation.

API Reference

group ptp_time

Precision Time Protocol time specification.

struct net_ptp_time
#include <ptp_time.h>

Precision Time Protocol Timestamp format.

This structure represents a timestamp according to the Precision Time Protocol standard.

Seconds are encoded as a 48 bits unsigned integer. Nanoseconds are encoded as a 32 bits unsigned integer.

struct net_ptp_extended_time
#include <ptp_time.h>

Precision Time Protocol Extended Timestamp format.

This structure represents an extended timestamp according to the Precision Time Protocol standard.

Seconds are encoded as 48 bits unsigned integer. Fractional nanoseconds are encoded as 48 bits, their unit is 2*(-16) ns.