From a71b7e51d2f95e21759da9191da040972d74c552 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 21 Jan 2019 13:31:06 -0800 Subject: 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 --- core/libdivecomputer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index b3dd8f5e4..18e365a11 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -1062,14 +1062,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"), -- cgit v1.2.3-70-g09d2