diff options
author | glerch <guido.lerch@gmail.com> | 2015-09-10 16:12:57 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-10 12:30:24 -0700 |
commit | b4f9d2786d7e808114979e6a2017738d5380068c (patch) | |
tree | 4f793f6a72edf0fb233aa3fbf8ac0dc2aa425618 /uemis-downloader.c | |
parent | c0cbafdc939cb9141c33b1c0e836bba8144dd467 (diff) | |
download | subsurface-b4f9d2786d7e808114979e6a2017738d5380068c.tar.gz |
Uemis downloader: new routine to load divespots
Added load_uemis_divespot.
This will be used later in do_uemis_import to improve
the amount of divespots that must be loaded actually.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index 058dbc229..f2f4ba4c2 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -1032,6 +1032,24 @@ static void do_delete_dives(struct dive_table *td, int idx) td->dives[x]->downloaded = false; } +static bool load_uemis_divespot(const char *mountpath, int divespot_id) +{ + char divespotnr[10]; + snprintf(divespotnr, sizeof(divespotnr), "%d", divespot_id); + param_buff[2] = divespotnr; +#if UEMIS_DEBUG & 2 + fprintf(debugfile, "getDivespot %d\n", divespot_id); +#endif + bool success = uemis_get_answer(mountpath, "getDivespot", 3, 0, NULL); + if (mbuf && success) { +#if UEMIS_DEBUG & 2 + do_dump_buffer_to_file(mbuf, strdup("Spot"), round); +#endif + return parse_divespot(mbuf); + } + return false; +} + const char *do_uemis_import(device_data_t *data) { const char *mountpath = data->devname; |