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>
This commit is contained in:
glerch 2015-09-10 16:12:57 +02:00 committed by Dirk Hohndel
parent c0cbafdc93
commit b4f9d2786d

View file

@ -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;