Changeset d5793ea in subsurface


Ignore:
Timestamp:
Jul 8, 2017, 9:57:21 AM (2 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
b1f4a29
Parents:
ed43b5d
git-author:
Dirk Hohndel <dirk@…> (07/07/17 22:19:23)
git-committer:
Dirk Hohndel <dirk@…> (07/08/17 09:57:21)
Message:

If we detect a different model than expected, use it

This is useful if the underlying code in libdivecomputer can reliably
detect specific hardware models.

Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/libdivecomputer.c

    red43b5d rd5793ea  
    10011001                                devinfo->serial, devinfo->serial);
    10021002                }
     1003                if (dc_descriptor_get_model(devdata->descriptor) != devinfo->model) {
     1004                        fprintf(stderr, "EVENT_DEVINFO gave us the correct detected product (model %d instead of %d)\n",
     1005                                devinfo->model, dc_descriptor_get_model(devdata->descriptor));
     1006                        dc_descriptor_t *better_descriptor = get_descriptor(dc_descriptor_get_type(devdata->descriptor), devinfo->model);
     1007                        if (better_descriptor != NULL) {
     1008                                devdata->descriptor = better_descriptor;
     1009                                devdata->product = dc_descriptor_get_product(better_descriptor);
     1010                                devdata->vendor = dc_descriptor_get_vendor(better_descriptor);
     1011                                devdata->model = str_printf("%s %s", devdata->vendor, devdata->product);
     1012                        }
     1013                }
    10031014                /*
    10041015                 * libdivecomputer doesn't give serial numbers in the proper string form,
Note: See TracChangeset for help on using the changeset viewer.