diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-01-21 13:31:06 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-22 11:01:40 +1300 |
commit | a71b7e51d2f95e21759da9191da040972d74c552 (patch) | |
tree | ae4b5d6398d1d40dbefa87acdd2d65a76133b6a2 | |
parent | 14700487730f3d5863ea810452c540d1bb4b9ca8 (diff) | |
download | subsurface-a71b7e51d2f95e21759da9191da040972d74c552.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>
-rw-r--r-- | core/libdivecomputer.c | 7 |
1 files 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"), |