Commit e78c5d6a authored by Pietro Fezzardi's avatar Pietro Fezzardi

trivial: change old one-way delay to meanPathDelay

both in comments and in diagnostics
parent 0a440eb3
...@@ -74,7 +74,7 @@ struct pp_frgn_master { ...@@ -74,7 +74,7 @@ struct pp_frgn_master {
* machine are implemented. * machine are implemented.
* *
* pp_avg_fltr: It is a variable cutoff/delay low-pass, infinite impulse * pp_avg_fltr: It is a variable cutoff/delay low-pass, infinite impulse
* response (IIR) filter. The one-way delay filter has the difference equation: * response (IIR) filter. The meanPathDelay filter has the difference equation:
* s*y[n] - (s-1)*y[n-1] = x[n]/2 + x[n-1]/2, * s*y[n] - (s-1)*y[n-1] = x[n]/2 + x[n-1]/2,
* where increasing the stiffness (s) lowers the cutoff and increases the delay. * where increasing the stiffness (s) lowers the cutoff and increases the delay.
*/ */
......
...@@ -32,7 +32,7 @@ static struct cmd_line_opt cmd_line_list[] = { ...@@ -32,7 +32,7 @@ static struct cmd_line_opt cmd_line_list[] = {
{"-M NUMBER", "do not accept delay values of more than NUMBER nanoseconds"}, {"-M NUMBER", "do not accept delay values of more than NUMBER nanoseconds"},
{"-t", "do not adjust the system clock"}, {"-t", "do not adjust the system clock"},
{"-a NUMBER,NUMBER", "specify clock servo P and I values (min == 1)"}, {"-a NUMBER,NUMBER", "specify clock servo P and I values (min == 1)"},
{"-w NUMBER", "specify one way delay filter stiffness"}, {"-w NUMBER", "specify meanPathDelay filter stiffness"},
CMD_LINE_SEPARATOR, CMD_LINE_SEPARATOR,
{"-b NAME", "bind PTP to network interface NAME"}, {"-b NAME", "bind PTP to network interface NAME"},
//{"-u ADDRESS", "also send uni-cast to ADDRESS\n"}, -- FIXME: useful? //{"-u ADDRESS", "also send uni-cast to ADDRESS\n"}, -- FIXME: useful?
......
...@@ -12,7 +12,7 @@ void pp_servo_init(struct pp_instance *ppi) ...@@ -12,7 +12,7 @@ void pp_servo_init(struct pp_instance *ppi)
{ {
int d; int d;
SRV(ppi)->mpd_fltr.s_exp = 0; /* clears one-way delay filter */ SRV(ppi)->mpd_fltr.s_exp = 0; /* clears meanPathDelay filter */
SRV(ppi)->ofm_fltr.s_exp = 0; /* clears offset-from-master filter */ SRV(ppi)->ofm_fltr.s_exp = 0; /* clears offset-from-master filter */
ppi->frgn_rec_num = 0; /* no known master */ ppi->frgn_rec_num = 0; /* no known master */
DSPAR(ppi)->parentPortIdentity.portNumber = 0; /* invalid */ DSPAR(ppi)->parentPortIdentity.portNumber = 0; /* invalid */
...@@ -74,7 +74,7 @@ static int pp_servo_bad_event(struct pp_instance *ppi) ...@@ -74,7 +74,7 @@ static int pp_servo_bad_event(struct pp_instance *ppi)
TimeInternal *s_to_m_dly = &SRV(ppi)->s_to_m_dly; TimeInternal *s_to_m_dly = &SRV(ppi)->s_to_m_dly;
TimeInternal *mpd = &DSCUR(ppi)->meanPathDelay; TimeInternal *mpd = &DSCUR(ppi)->meanPathDelay;
/* Discard one-way delays that overflow a second (makes no sense) */ /* Discard meanPathDelays that overflow a second (makes no sense) */
if (mpd->seconds) if (mpd->seconds)
return 1; return 1;
...@@ -129,7 +129,7 @@ void pp_servo_got_resp(struct pp_instance *ppi) ...@@ -129,7 +129,7 @@ void pp_servo_got_resp(struct pp_instance *ppi)
/* Calc mean path delay, used later to calc "offset from master" */ /* Calc mean path delay, used later to calc "offset from master" */
add_TimeInternal(mpd, &SRV(ppi)->m_to_s_dly, &SRV(ppi)->s_to_m_dly); add_TimeInternal(mpd, &SRV(ppi)->m_to_s_dly, &SRV(ppi)->s_to_m_dly);
div2_TimeInternal(mpd); div2_TimeInternal(mpd);
pp_diag(ppi, servo, 1, "One-way delay: %s\n", fmt_TI(mpd)); pp_diag(ppi, servo, 1, "meanPathDelay: %s\n", fmt_TI(mpd));
if(pp_servo_bad_event(ppi)) if(pp_servo_bad_event(ppi))
return; return;
...@@ -179,7 +179,7 @@ void pp_servo_got_resp(struct pp_instance *ppi) ...@@ -179,7 +179,7 @@ void pp_servo_got_resp(struct pp_instance *ppi)
/ mpd_fltr->s_exp; / mpd_fltr->s_exp;
mpd->nanoseconds = mpd_fltr->y; mpd->nanoseconds = mpd_fltr->y;
pp_diag(ppi, servo, 1, "After avg(%i), one-way delay: %i\n", pp_diag(ppi, servo, 1, "After avg(%i), meanPathDelay: %i\n",
(int)mpd_fltr->s_exp, mpd->nanoseconds); (int)mpd_fltr->s_exp, mpd->nanoseconds);
/* update 'offsetFromMaster', (End to End mode) */ /* update 'offsetFromMaster', (End to End mode) */
...@@ -329,7 +329,7 @@ void pp_servo_got_resp(struct pp_instance *ppi) ...@@ -329,7 +329,7 @@ void pp_servo_got_resp(struct pp_instance *ppi)
ppi->t_ops->adjust_offset(ppi, -adj); ppi->t_ops->adjust_offset(ppi, -adj);
} }
pp_diag(ppi, servo, 2, "One-way delay averaged: %s\n", fmt_TI(mpd)); pp_diag(ppi, servo, 2, "meanPathDelay averaged: %s\n", fmt_TI(mpd));
pp_diag(ppi, servo, 2, "Offset from m averaged: %s\n", fmt_TI(ofm)); pp_diag(ppi, servo, 2, "Offset from m averaged: %s\n", fmt_TI(ofm));
pp_diag(ppi, servo, 2, "Observed drift: %9i\n", pp_diag(ppi, servo, 2, "Observed drift: %9i\n",
(int)SRV(ppi)->obs_drift); (int)SRV(ppi)->obs_drift);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment