aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-30 17:53:51 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-30 17:53:51 -0800
commit46b64d8e21bd770c908cc883f3627f4f08a2c0a7 (patch)
treea479c71e3a7013fbae9c4e380810d2289802e8b1
parent2581b3870f90f07cd4d6585c92b85405860209a7 (diff)
downloadsubsurface-46b64d8e21bd770c908cc883f3627f4f08a2c0a7.tar.gz
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>
-rw-r--r--libdivecomputer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 7b3087f9d..01639e5e5 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -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");