aboutsummaryrefslogtreecommitdiffstats
path: root/uemis.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-28 22:02:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-28 22:02:03 -0700
commita79b74ed36f6a52db947ff24761a3fd331c75cdc (patch)
treec5986baa8d28be329ae8396d31f2e8d15739ccac /uemis.c
parent10fac7a6af7e95b45029372f32ce544c705f6887 (diff)
downloadsubsurface-a79b74ed36f6a52db947ff24761a3fd331c75cdc.tar.gz
Track Uemis last dive downloaded on a per data-file basis
Actually, it's even better than that. Thanks to the new divecomputer datastructure we can now simply look up in the dive_table which dives have been downloaded from this specific Uemis SDA. This patch removes the old gconf based code - which leads to one unfortunate problem: the first time a Uemis SDA owner runs this version of Subsurface against their data file ALL dives will be downloaded again (which may not be a bad thing as we have improved a few other details of Uemis support so now they get their deco information, surface pressure and other data that we have started to support since 2.1). Still, this is not ideal. But I didn't want to keep the legacy code around since this new solution is so much cleaner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis.c')
-rw-r--r--uemis.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/uemis.c b/uemis.c
index 198d90358..3c5bef082 100644
--- a/uemis.c
+++ b/uemis.c
@@ -199,16 +199,10 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
else
dive->salinity = 10000; /* grams per 10l fresh water */
+ /* this will allow us to find the last dive read so far from this computer */
dc->model = strdup("Uemis Zurich");
-
- /*
- * FIXME:
- * - make the deive ID the first word of the SHA1 sum of the deviceid string
- * - do we want to have a dive ID? Without one, we'll just use the dive date,
- * which is likely fine.
- */
- dc->deviceid = 0;
- dc->diveid = 0;
+ dc->deviceid = *(uint32_t *)(data + 9);
+ dc->diveid = *(uint16_t *)(data + 7);
/* dive template in use:
0 = air