Skip to content

Commit

Permalink
Add support for the traceability management request.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Mar 3, 2013
1 parent 32c8635 commit 4dfcca7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ static int clock_management_get_response(struct clock *c, struct port *p,
datalen = sizeof(*mtd);
respond = 1;
break;
case TRACEABILITY_PROPERTIES:
mtd = (struct management_tlv_datum *) tlv->data;
mtd->val = c->tds.flags & (TIME_TRACEABLE|FREQ_TRACEABLE);
datalen = sizeof(*mtd);
respond = 1;
break;
case TIME_STATUS_NP:
tsn = (struct time_status_np *) tlv->data;
tsn->master_offset = c->master_offset;
Expand Down
10 changes: 9 additions & 1 deletion pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct management_id idtab[] = {
{ "TIME", TIME, not_supported },
{ "CLOCK_ACCURACY", CLOCK_ACCURACY, do_get_action },
{ "UTC_PROPERTIES", UTC_PROPERTIES, not_supported },
{ "TRACEABILITY_PROPERTIES", TRACEABILITY_PROPERTIES, not_supported },
{ "TRACEABILITY_PROPERTIES", TRACEABILITY_PROPERTIES, do_get_action },
{ "TIMESCALE_PROPERTIES", TIMESCALE_PROPERTIES, not_supported },
{ "PATH_TRACE_LIST", PATH_TRACE_LIST, not_supported },
{ "PATH_TRACE_ENABLE", PATH_TRACE_ENABLE, not_supported },
Expand Down Expand Up @@ -338,6 +338,14 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "CLOCK_ACCURACY "
IFMT "clockAccuracy 0x%02hhx", mtd->val);
break;
case TRACEABILITY_PROPERTIES:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "TRACEABILITY_PROPERTIES "
IFMT "timeTraceable %d"
IFMT "frequencyTraceable %d",
mtd->val & TIME_TRACEABLE ? 1 : 0,
mtd->val & FREQ_TRACEABLE ? 1 : 0);
break;
case TIME_STATUS_NP:
tsn = (struct time_status_np *) mgt->data;
fprintf(fp, "TIME_STATUS_NP "
Expand Down

0 comments on commit 4dfcca7

Please sign in to comment.