diff options
Diffstat (limited to 'core/file.c')
-rw-r--r-- | core/file.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/file.c b/core/file.c index 6f2edcf8d..fe2b0878b 100644 --- a/core/file.c +++ b/core/file.c @@ -132,6 +132,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem, struct div char dm4_test[] = "select count(*) from sqlite_master where type='table' and name='Dive' and sql like '%ProfileBlob%'"; char dm5_test[] = "select count(*) from sqlite_master where type='table' and name='Dive' and sql like '%SampleBlob%'"; char shearwater_test[] = "select count(*) from sqlite_master where type='table' and name='system' and sql like '%dbVersion%'"; + char shearwater_cloud_test[] = "select count(*) from sqlite_master where type='table' and name='SyncV3MetadataDiveLog' and sql like '%CreatedDevice%'"; char cobalt_test[] = "select count(*) from sqlite_master where type='table' and name='TrackPoints' and sql like '%DepthPressure%'"; char divinglog_test[] = "select count(*) from sqlite_master where type='table' and name='DBInfo' and sql like '%PrgName%'"; int retval; @@ -167,6 +168,14 @@ static int try_to_open_db(const char *filename, struct memblock *mem, struct div return retval; } + /* Testing if DB schema resembles Shearwater cloud database format */ + retval = sqlite3_exec(handle, shearwater_cloud_test, &db_test_func, 0, NULL); + if (!retval) { + retval = parse_shearwater_cloud_buffer(handle, filename, mem->buffer, mem->size, table); + sqlite3_close(handle); + return retval; + } + /* Testing if DB schema resembles Atomic Cobalt database format */ retval = sqlite3_exec(handle, cobalt_test, &db_test_func, 0, NULL); if (!retval) { |