From e6c2b14588d1a6cf920ae3d84e996238a933e5c5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 9 Jul 2017 15:52:10 -0700 Subject: 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 --- core/libdivecomputer.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'core/libdivecomputer.c') 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. -- cgit v1.2.3-70-g09d2