summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-02-22 19:57:34 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-22 10:02:41 -0800
commit0f6f1c7ccf77d053db053f66fc3e41e016f1597b (patch)
treec74e17f0dbeecd3f8ba4dcf2cd0199f5c5c5fb21 /parse-xml.c
parentf9cb443c73eba33c1232b735261b5165535c3f2e (diff)
downloadsubsurface-0f6f1c7ccf77d053db053f66fc3e41e016f1597b.tar.gz
Include DC information on Cobalt import
Note that I use the serial number as device ID as is done with the Suunto DM5 import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 16988cd38..2e7882ece 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2665,13 +2665,20 @@ extern int cobalt_dive(void *param, int columns, char **data, char **column)
*/
settings_start();
dc_settings_start();
- if (data[9])
+ if (data[9]) {
utf8_string(data[9], &cur_settings.dc.serial_nr);
+ cur_settings.dc.deviceid = atoi(data[9]);
+ cur_settings.dc.model = strdup("Cobalt import");
+ }
- cur_settings.dc.deviceid = 0xffffffff;
dc_settings_end();
settings_end();
+ if (data[9]) {
+ cur_dive->dc.deviceid = atoi(data[9]);
+ cur_dive->dc.model = strdup("Cobalt import");
+ }
+
snprintf(get_buffer, sizeof(get_buffer) - 1, get_cylinder_template, cur_dive->number);
retval = sqlite3_exec(handle, get_buffer, &cobalt_cylinders, 0, &err);
if (retval != SQLITE_OK) {