Add support for the clock_accuracy management request.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
78e37ebf0b
commit
32c8635aef
6
clock.c
6
clock.c
|
@ -222,6 +222,12 @@ static int clock_management_get_response(struct clock *c, struct port *p,
|
|||
datalen = sizeof(*mtd);
|
||||
respond = 1;
|
||||
break;
|
||||
case CLOCK_ACCURACY:
|
||||
mtd = (struct management_tlv_datum *) tlv->data;
|
||||
mtd->val = c->dds.clockQuality.clockAccuracy;
|
||||
datalen = sizeof(*mtd);
|
||||
respond = 1;
|
||||
break;
|
||||
case TIME_STATUS_NP:
|
||||
tsn = (struct time_status_np *) tlv->data;
|
||||
tsn->master_offset = c->master_offset;
|
||||
|
|
7
pmc.c
7
pmc.c
|
@ -69,7 +69,7 @@ struct management_id idtab[] = {
|
|||
{ "DOMAIN", DOMAIN, do_get_action },
|
||||
{ "SLAVE_ONLY", SLAVE_ONLY, do_get_action },
|
||||
{ "TIME", TIME, not_supported },
|
||||
{ "CLOCK_ACCURACY", CLOCK_ACCURACY, not_supported },
|
||||
{ "CLOCK_ACCURACY", CLOCK_ACCURACY, do_get_action },
|
||||
{ "UTC_PROPERTIES", UTC_PROPERTIES, not_supported },
|
||||
{ "TRACEABILITY_PROPERTIES", TRACEABILITY_PROPERTIES, not_supported },
|
||||
{ "TIMESCALE_PROPERTIES", TIMESCALE_PROPERTIES, not_supported },
|
||||
|
@ -333,6 +333,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
|
|||
fprintf(fp, "SLAVE_ONLY "
|
||||
IFMT "slaveOnly %d", mtd->val & DDS_SLAVE_ONLY ? 1 : 0);
|
||||
break;
|
||||
case CLOCK_ACCURACY:
|
||||
mtd = (struct management_tlv_datum *) mgt->data;
|
||||
fprintf(fp, "CLOCK_ACCURACY "
|
||||
IFMT "clockAccuracy 0x%02hhx", mtd->val);
|
||||
break;
|
||||
case TIME_STATUS_NP:
|
||||
tsn = (struct time_status_np *) mgt->data;
|
||||
fprintf(fp, "TIME_STATUS_NP "
|
||||
|
|
Loading…
Reference in New Issue