Commit 3c3fa1a5 authored by Jean-Claude BAU's avatar Jean-Claude BAU

BMCA: Update frequencyTraceable and timeTraceable

The frequencyTraceable and timeTraceable fields in timePropertiesDS are
now set to TRUE only when the defaultDS clock class is
PTP_CLASS_GM_LOCKED(6) or PTP_CLASS_GM_HOLDOVER(7). These field values
will follow the degradation of the clock class in case of locking issue.
parent 051a01c0
...@@ -50,21 +50,18 @@ void bmc_m1(struct pp_instance *ppi) ...@@ -50,21 +50,18 @@ void bmc_m1(struct pp_instance *ppi)
parent->grandmasterPriority1 = defds->priority1; parent->grandmasterPriority1 = defds->priority1;
parent->grandmasterPriority2 = defds->priority2; parent->grandmasterPriority2 = defds->priority2;
/* Time Properties data set */
/* based on the clock class we set the frequency traceable flags */
prop->frequencyTraceable= (
(defds->clockQuality.clockClass < PP_PTP_CLASS_GM_UNLOCKED) ||
(defds->clockQuality.clockClass < PP_ARB_CLASS_GM_UNLOCKED)) ? TRUE : FALSE;
/* FIXME: if we don't know better we stay with theses values*/ /* FIXME: if we don't know better we stay with theses values*/
ptpTimescale=TRUE; /* Default value */ ptpTimescale=TRUE; /* Default value */
timeSource=INTERNAL_OSCILLATOR; /* Default value */ timeSource=INTERNAL_OSCILLATOR; /* Default value */
prop->frequencyTraceable=
prop->timeTraceable=FALSE; /* Default value */
switch (defds->clockQuality.clockClass) { switch (defds->clockQuality.clockClass) {
case PP_PTP_CLASS_GM_LOCKED: case PP_PTP_CLASS_GM_LOCKED:
case PP_PTP_CLASS_GM_HOLDOVER: case PP_PTP_CLASS_GM_HOLDOVER:
timeSource = GPS; timeSource = GPS;
prop->frequencyTraceable=
prop->timeTraceable=TRUE;
break; break;
case PP_ARB_CLASS_GM_LOCKED: case PP_ARB_CLASS_GM_LOCKED:
case PP_ARB_CLASS_GM_HOLDOVER: case PP_ARB_CLASS_GM_HOLDOVER:
...@@ -99,14 +96,13 @@ void bmc_m1(struct pp_instance *ppi) ...@@ -99,14 +96,13 @@ void bmc_m1(struct pp_instance *ppi)
if (ret) if (ret)
{ {
prop->timeTraceable = FALSE; prop->timeTraceable = FALSE; /* Clear it if it was set */
prop->currentUtcOffsetValid = FALSE; prop->currentUtcOffsetValid = FALSE;
prop->leap59 = FALSE; prop->leap59 = FALSE;
prop->leap61 = FALSE; prop->leap61 = FALSE;
} }
else else
{ {
prop->timeTraceable = TRUE;
prop->currentUtcOffsetValid = TRUE; prop->currentUtcOffsetValid = TRUE;
prop->leap59 = (leap59 != 0); prop->leap59 = (leap59 != 0);
prop->leap61 = (leap61 != 0); prop->leap61 = (leap61 != 0);
...@@ -115,7 +111,6 @@ void bmc_m1(struct pp_instance *ppi) ...@@ -115,7 +111,6 @@ void bmc_m1(struct pp_instance *ppi)
/* 9.4 for ARB just take the value when built */ /* 9.4 for ARB just take the value when built */
prop->currentUtcOffset = PP_DEFAULT_UTC_OFFSET; prop->currentUtcOffset = PP_DEFAULT_UTC_OFFSET;
/* always false */ /* always false */
prop->timeTraceable = FALSE;
prop->currentUtcOffsetValid = FALSE; prop->currentUtcOffsetValid = FALSE;
prop->leap59 = FALSE; prop->leap59 = FALSE;
prop->leap61 = FALSE; prop->leap61 = 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