Commit dd417ad8 authored by Jean-Claude BAU's avatar Jean-Claude BAU

Add scaledDelayCoefficient parameter in the configuration

The delayCoefficient can be set in ppsi.conf file either with the
delayCoefficient (double) parameter or the scaledDelayCoefficient
(RelativeDifference)  parameter. In ppsi, the priority is given to the
scaledDelayCoefficient.
parent dfe9cdf5
......@@ -103,7 +103,9 @@ static void enable_asymmetryCorrection(struct pp_instance *ppi, Boolean enable )
if ( (ppi->asymmetryCorrectionPortDS.enable=enable)==TRUE ) {
/* Enabled: The delay asymmetry will be calculated */
ppi->asymmetryCorrectionPortDS.scaledDelayCoefficient=
(RelativeDifference)(ppi->cfg.delayCoefficient * REL_DIFF_TWO_POW_FRACBITS);
ppi->cfg.scaledDelayCoefficient != 0 ?
ppi->cfg.scaledDelayCoefficient :
(RelativeDifference)(ppi->cfg.delayCoefficient * REL_DIFF_TWO_POW_FRACBITS);
ppi->portDS->delayAsymCoeff=(RelativeDifference)(calculateDelayAsymCoefficient(ppi->cfg.delayCoefficient) * REL_DIFF_TWO_POW_FRACBITS);
} else {
/* Disabled: The delay asymmetry will be provided by the config (constantAsymmetry) */
......
......@@ -76,6 +76,8 @@ typedef struct Timestamp { /* page 13 (33) -- no typedef expected */
#define REL_DIFF_TWO_POW_FRACBITS ((double)4.611686018427388E18) /* double value returned by pow(2.0,62.0) */
/* Min/max values for RelativeDifference type */
#define RELATIVE_DIFFERENCE_MIN_VALUE INT64_MIN
#define RELATIVE_DIFFERENCE_MAX_VALUE INT64_MAX
#define RELATIVE_DIFFERENCE_MIN_VALUE_AS_DOUBLE -2.0
#define RELATIVE_DIFFERENCE_MAX_VALUE_AS_DOUBLE 1.9999999999999989
......
......@@ -342,6 +342,8 @@ static struct pp_argline pp_global_arglines[] = {
TIME_INTERVAL_MIN_PICOS_VALUE_AS_INT64,TIME_INTERVAL_MAX_PICOS_VALUE_AS_INT64),
INST_OPTION_INT64_RANGE("ingressLatency", ARG_INT64, NULL,cfg.ingressLatency_ps,
TIME_INTERVAL_MIN_PICOS_VALUE_AS_INT64,TIME_INTERVAL_MAX_PICOS_VALUE_AS_INT64),
INST_OPTION_INT64_RANGE("scaledDelayCoefficient", ARG_INT64, NULL,cfg.scaledDelayCoefficient,
RELATIVE_DIFFERENCE_MIN_VALUE,RELATIVE_DIFFERENCE_MAX_VALUE),
INST_OPTION_DOUBLE_RANGE("delayCoefficient", ARG_DOUBLE, NULL,cfg.delayCoefficient,
RELATIVE_DIFFERENCE_MIN_VALUE_AS_DOUBLE,RELATIVE_DIFFERENCE_MAX_VALUE_AS_DOUBLE),
RT_OPTION_INT_RANGE("clock-class", ARG_INT, NULL, clock_quality.clockClass,
......
......@@ -51,6 +51,7 @@ struct pp_instance_cfg __pp_default_instance_cfg = {
.egressLatency_ps=0,
.ingressLatency_ps=0,
.constantAsymmetry_ps=0,
.scaledDelayCoefficient=0,
.delayCoefficient=0,
.desiredState=PPS_PASSIVE, /* Clause 17.3.6.2 ; The default value should be PASSIVE unless otherwise specified */
.masterOnly=FALSE
......
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