aboutsummaryrefslogtreecommitdiffstats
path: root/core/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-21 13:31:06 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-22 13:07:19 +1300
commitc000123121f64e6cb03a39d0e0e3bba12b3a0491 (patch)
treed85b967af28caa08ce06d346910788126bd33927 /core/libdivecomputer.c
parent50eec0231c84a90b9735cd86c15899f051b573e6 (diff)
downloadsubsurface-c000123121f64e6cb03a39d0e0e3bba12b3a0491.tar.gz
libdivecomputer: small wording change in a warning
While in theory the DEVINFO event should give us the correct detected product, it's also possible that the code that usually detects the product gave up and returns an unknown model. Try to have the message reflect that situation more accurately. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/libdivecomputer.c')
-rw-r--r--core/libdivecomputer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index a2e2890b8..eace3a885 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -1069,14 +1069,17 @@ static void event_cb(dc_device_t *device, dc_event_type_t event, const void *dat
break;
case DC_EVENT_DEVINFO:
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));
dc_descriptor_t *better_descriptor = get_descriptor(dc_descriptor_get_type(devdata->descriptor), devinfo->model);
if (better_descriptor != NULL) {
+ fprintf(stderr, "EVENT_DEVINFO gave us a different detected product (model %d instead of %d), which we are using now.\n",
+ devinfo->model, dc_descriptor_get_model(devdata->descriptor));
devdata->descriptor = better_descriptor;
devdata->product = dc_descriptor_get_product(better_descriptor);
devdata->vendor = dc_descriptor_get_vendor(better_descriptor);
devdata->model = str_printf("%s %s", devdata->vendor, devdata->product);
+ } else {
+ fprintf(stderr, "EVENT_DEVINFO gave us a different detected product (model %d instead of %d), but that one is unknown.\n",
+ devinfo->model, dc_descriptor_get_model(devdata->descriptor));
}
}
dev_info(devdata, translate("gettextFromC", "model=%s firmware=%u serial=%u"),