13#define S (gPtpCoreState)
18 memset(&S.stats, 0,
sizeof(
PtpStats));
29#define PTP_TE_FILT_Fc_HZ (0.1)
33 double a = exp(-
PTP_TE_FILT_Fc_HZ * 2 * M_PI * (S.slave.messaging.syncPeriodMs / 1000.0));
36 double y_prev = S.stats.filtTimeErr, y;
37 y = a * y_prev + (1 - a) * d;
38 S.stats.filtTimeErr = y;
42 CLILOG(S.logging.locked && (locked != S.stats.locked),
"PTP %s!\n", locked ?
"LOCKED" :
"DIVERGED");
45 if (locked != S.stats.locked) {
49 S.stats.locked = locked;
In this module are the core and user events defined.
@ PTP_UEV_LOCKED
The average clock accuracy is sufficient.
@ PTP_UEV_UNLOCKED
Our clock has deviated from the master in average.
Core of the PTP implementation. Defines functions for message processing, clock tuning,...
In here reside a multitude of fundamental PTP-related constants and definitions.
#define PTP_ACCURACY_LIMIT_NS
Limit of the LOCKED state.
uint64_t ptp_get_current_master_clock_identity()
This module features functions to tweak around the PTP engine's almost every property.
#define PTP_TE_FILT_Fc_HZ
Cutoff frequency (Hz)
void ptp_collect_stats(int64_t d)
const PtpStats * ptp_get_stats()
This is the statistics module that gathers data of the operating PTP-engine.
Structure for statistics.