pmc: Support getting and setting the local synchronization uncertain flag.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
b8194a177a
commit
6c5b61a64c
5
pmc.c
5
pmc.c
|
@ -305,6 +305,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
|
||||||
sen->duration,
|
sen->duration,
|
||||||
(sen->bitmask[0] & 1 << NOTIFY_PORT_STATE) ? "on" : "off");
|
(sen->bitmask[0] & 1 << NOTIFY_PORT_STATE) ? "on" : "off");
|
||||||
break;
|
break;
|
||||||
|
case TLV_SYNCHRONIZATION_UNCERTAIN_NP:
|
||||||
|
mtd = (struct management_tlv_datum *) mgt->data;
|
||||||
|
fprintf(fp, "SYNCHRONIZATION_UNCERTAIN_NP "
|
||||||
|
IFMT "uncertain %hhu", mtd->val);
|
||||||
|
break;
|
||||||
case TLV_PORT_DATA_SET:
|
case TLV_PORT_DATA_SET:
|
||||||
p = (struct portDS *) mgt->data;
|
p = (struct portDS *) mgt->data;
|
||||||
if (p->portState > PS_SLAVE) {
|
if (p->portState > PS_SLAVE) {
|
||||||
|
|
22
pmc_common.c
22
pmc_common.c
|
@ -110,6 +110,7 @@ struct management_id idtab[] = {
|
||||||
{ "TIME_STATUS_NP", TLV_TIME_STATUS_NP, do_get_action },
|
{ "TIME_STATUS_NP", TLV_TIME_STATUS_NP, do_get_action },
|
||||||
{ "GRANDMASTER_SETTINGS_NP", TLV_GRANDMASTER_SETTINGS_NP, do_set_action },
|
{ "GRANDMASTER_SETTINGS_NP", TLV_GRANDMASTER_SETTINGS_NP, do_set_action },
|
||||||
{ "SUBSCRIBE_EVENTS_NP", TLV_SUBSCRIBE_EVENTS_NP, do_set_action },
|
{ "SUBSCRIBE_EVENTS_NP", TLV_SUBSCRIBE_EVENTS_NP, do_set_action },
|
||||||
|
{ "SYNCHRONIZATION_UNCERTAIN_NP", TLV_SYNCHRONIZATION_UNCERTAIN_NP, do_set_action },
|
||||||
/* Port management ID values */
|
/* Port management ID values */
|
||||||
{ "NULL_MANAGEMENT", TLV_NULL_MANAGEMENT, null_management },
|
{ "NULL_MANAGEMENT", TLV_NULL_MANAGEMENT, null_management },
|
||||||
{ "CLOCK_DESCRIPTION", TLV_CLOCK_DESCRIPTION, do_get_action },
|
{ "CLOCK_DESCRIPTION", TLV_CLOCK_DESCRIPTION, do_get_action },
|
||||||
|
@ -236,6 +237,27 @@ static void do_set_action(struct pmc *pmc, int action, int index, char *str)
|
||||||
}
|
}
|
||||||
pmc_send_set_action(pmc, code, &sen, sizeof(sen));
|
pmc_send_set_action(pmc, code, &sen, sizeof(sen));
|
||||||
break;
|
break;
|
||||||
|
case TLV_SYNCHRONIZATION_UNCERTAIN_NP:
|
||||||
|
cnt = sscanf(str, " %*s %*s %hhu", &mtd.val);
|
||||||
|
if (cnt != 1) {
|
||||||
|
fprintf(stderr, "%s SET needs 1 value\n",
|
||||||
|
idtab[index].name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (mtd.val) {
|
||||||
|
case SYNC_UNCERTAIN_DONTCARE:
|
||||||
|
case SYNC_UNCERTAIN_FALSE:
|
||||||
|
case SYNC_UNCERTAIN_TRUE:
|
||||||
|
pmc_send_set_action(pmc, code, &mtd, sizeof(mtd));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "\nusage: set SYNCHRONIZATION_UNCERTAIN_NP "
|
||||||
|
"%hhu (false), %hhu (true), or %hhu (don't care)\n\n",
|
||||||
|
SYNC_UNCERTAIN_FALSE,
|
||||||
|
SYNC_UNCERTAIN_TRUE,
|
||||||
|
SYNC_UNCERTAIN_DONTCARE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TLV_PORT_DATA_SET_NP:
|
case TLV_PORT_DATA_SET_NP:
|
||||||
cnt = sscanf(str, " %*s %*s "
|
cnt = sscanf(str, " %*s %*s "
|
||||||
"neighborPropDelayThresh %u "
|
"neighborPropDelayThresh %u "
|
||||||
|
|
Loading…
Reference in New Issue