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>
This commit is contained in:
Miika Turkia 2015-02-22 19:57:34 +02:00 committed by Dirk Hohndel
parent f9cb443c73
commit 0f6f1c7ccf

View file

@ -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) {