From a79b74ed36f6a52db947ff24761a3fd331c75cdc Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 28 Nov 2012 22:02:03 -0700 Subject: 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 --- uemis.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'uemis.c') 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 -- cgit v1.2.3-70-g09d2