This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

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.

Public Members

union net_ptp_time.[anonymous] [anonymous]

Seconds encoded on 48 bits.

uint32_t nanosecond

Nanoseconds.

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.

Public Members

union net_ptp_extended_time.[anonymous] [anonymous]

Seconds encoded on 48 bits.

union net_ptp_extended_time.[anonymous] [anonymous]

Fractional nanoseconds on 48 bits.