summaryrefslogtreecommitdiffstats
path: root/core/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 15:52:10 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 16:09:04 -0700
commite6c2b14588d1a6cf920ae3d84e996238a933e5c5 (patch)
tree23cf24b891c0f1f110186939384f172933b0ca44 /core/libdivecomputer.c
parent9111ce01e7b8b06d70ddf93be3c1be1406d1ba94 (diff)
downloadsubsurface-e6c2b14588d1a6cf920ae3d84e996238a933e5c5.tar.gz
More meaningful device info display
While it's nice to have the numerical model in the logfile, on the screen the user wants to see the dive computer product name. And none of those hex numbers that make the text so long that it becomes useless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/libdivecomputer.c')
-rw-r--r--core/libdivecomputer.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 55be49839..0e414d360 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -948,16 +948,6 @@ static void event_cb(dc_device_t *device, dc_event_type_t event, const void *dat
progress_bar_fraction = (double)progress->current / (double)progress->maximum;
break;
case DC_EVENT_DEVINFO:
- dev_info(devdata, translate("gettextFromC", "model=%u (0x%08x), firmware=%u (0x%08x), serial=%u (0x%08x)"),
- devinfo->model, devinfo->model,
- devinfo->firmware, devinfo->firmware,
- devinfo->serial, devinfo->serial);
- if (devdata->libdc_logfile) {
- fprintf(devdata->libdc_logfile, "Event: model=%u (0x%08x), firmware=%u (0x%08x), serial=%u (0x%08x)\n",
- devinfo->model, devinfo->model,
- devinfo->firmware, devinfo->firmware,
- devinfo->serial, devinfo->serial);
- }
if (dc_descriptor_get_model(devdata->descriptor) != devinfo->model) {
fprintf(stderr, "EVENT_DEVINFO gave us the correct detected product (model %d instead of %d)\n",
devinfo->model, dc_descriptor_get_model(devdata->descriptor));
@@ -969,6 +959,14 @@ static void event_cb(dc_device_t *device, dc_event_type_t event, const void *dat
devdata->model = str_printf("%s %s", devdata->vendor, devdata->product);
}
}
+ dev_info(devdata, translate("gettextFromC", "model=%s firmware=%u serial=%u"),
+ devdata->product, devinfo->firmware, devinfo->serial);
+ if (devdata->libdc_logfile) {
+ fprintf(devdata->libdc_logfile, "Event: model=%u (0x%08x), firmware=%u (0x%08x), serial=%u (0x%08x)\n",
+ devinfo->model, devinfo->model,
+ devinfo->firmware, devinfo->firmware,
+ devinfo->serial, devinfo->serial);
+ }
/*
* libdivecomputer doesn't give serial numbers in the proper string form,
* so we have to see if we can do some vendor-specific munging.