summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-27 08:27:16 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-27 08:31:04 -0800
commit9f95f3ce18a1c25b0407335f472987c64940153d (patch)
treeee2c690e6e4d555ce31277324dd99408ad6c4cff /libdivecomputer.c
parent1c65b2f3c4dab4927ad319a5383dabfae689aae3 (diff)
downloadsubsurface-9f95f3ce18a1c25b0407335f472987c64940153d.tar.gz
Keep undecoded firmware / serial info from libdivecomputer
This needs to become a string in libdivecomputer - but for now let's just keep the integers so we can parse it elsewhere when we know which model it is - the generic parsing into a string is completely bogus and needs to go. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 4b2512626..fed448c9c 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -733,16 +733,8 @@ static void event_cb(dc_device_t *device, dc_event_type_t event, const void *dat
/* really, serial and firmware version are NOT numbers. We'll try to save them here
* in something that might work, but this really needs to be handled with the
* DC_FIELD_STRING interface instead */
- if (serial != 0) {
- snprintf(buffer, sizeof(buffer), "%04u-%04u", serial / 10000, serial % 10000);
- devdata->serial = strdup(buffer);
- fprintf(stderr, "libdc devinfo serial nr converted to %s\n", devdata->serial);
- }
- if (devinfo->firmware != 0) {
- snprintf(buffer, sizeof(buffer), "%02u.%02u", devinfo->firmware / 100, devinfo->firmware % 100);
- devdata->firmware = strdup(buffer);
- fprintf(stderr, "libdc devinfo firmware version converted to %s\n", devdata->firmware);
- }
+ devdata->libdc_serial = devinfo->serial;
+ devdata->libdc_firmware = devinfo->firmware;
break;
case DC_EVENT_CLOCK:
dev_info(devdata, translate("gettextFromC", "Event: systime=%" PRId64 ", devtime=%u\n"),