Add time stamp to the debugging printout of vendor specific samples

They are useful for debugging things in libdivecomputer and this way it's
easier to match the data to specific points in the dive profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-30 17:53:51 -08:00
parent 2581b3870f
commit 46b64d8e21

View file

@ -247,7 +247,8 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
printf(" <bearing>%u</bearing>\n", value.bearing);
break;
case DC_SAMPLE_VENDOR:
printf(" <vendor type=\"%u\" size=\"%u\">", value.vendor.type, value.vendor.size);
printf(" <vendor time='%u:%02u' type=\"%u\" size=\"%u\">", FRACTION(sample->time.seconds, 60),
value.vendor.type, value.vendor.size);
for (i = 0; i < value.vendor.size; ++i)
printf("%02X", ((unsigned char *) value.vendor.data)[i]);
printf("</vendor>\n");