flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
stats.h File Reference

This is the statistics module that gathers data of the operating PTP-engine. More...

#include <stdint.h>
#include <stdbool.h>
#include "ptp_types.h"

Go to the source code of this file.

Macros

#define PTP_IS_LOCKED(th)   ((ptp_get_stats()->filtTimeErr < (th)) && (ptp_get_current_master_clock_identity() != 0))
 Is the PTP clock seemingly locked considering threshold passed?
 

Functions

void ptp_clear_stats ()
 
const PtpStatsptp_get_stats ()
 
void ptp_collect_stats (int64_t d)
 

Detailed Description

This is the statistics module that gathers data of the operating PTP-engine.

Definition in file stats.h.

Macro Definition Documentation

◆ PTP_IS_LOCKED

#define PTP_IS_LOCKED (   th)    ((ptp_get_stats()->filtTimeErr < (th)) && (ptp_get_current_master_clock_identity() != 0))

Is the PTP clock seemingly locked considering threshold passed?

Expression to test if the clock could be considered locked measuring agains a specific filtered PTP time error

Parameters
ththreshold in nanoseconds

Definition at line 41 of file stats.h.

Function Documentation

◆ ptp_clear_stats()

void ptp_clear_stats ( )

Clear statitics.

Definition at line 17 of file stats.c.

◆ ptp_collect_stats()

void ptp_collect_stats ( int64_t  d)

Collect statistics.

Parameters
dtime error in nanoseconds.

Definition at line 32 of file stats.c.

◆ ptp_get_stats()

const PtpStats * ptp_get_stats ( )

Get statistics.

Returns
const pointer to the filled PTP stats object

Definition at line 23 of file stats.c.