X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=libdivecomputer.c;h=49c4f3695da6ca60bf3d42904d26c3f1b61e2588;hb=3a6652634b2152352f6f5a2b9ee3d549140ae337;hp=d2da5381d8bd71edb34005460e8f1a6e26bdd97c;hpb=4e7161efd6738cc50c3879846b5df7d1d58c3c58;p=ext%2Fsubsurface.git diff --git a/libdivecomputer.c b/libdivecomputer.c index d2da538..49c4f36 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -18,6 +18,9 @@ #include #include +/* handling uemis Zurich SDA files */ +#include "uemis.h" + /* * I'd love to do a while-loop here for pending events, but * that seems to screw up with the dive computer reading timing. @@ -37,7 +40,7 @@ static void error(const char *fmt, ...) va_start(args, fmt); error = g_error_new_valist( - g_quark_from_string("divelog"), + g_quark_from_string("subsurface"), DIVE_ERROR_PARSE, fmt, args); va_end(args); report_error(error); @@ -434,12 +437,14 @@ cancel_cb(void *userdata) static void do_import(device_data_t *data) { - /* FIXME! Needs user input! */ - const char *devname = "/dev/ttyUSB0"; device_t *device = NULL; device_status_t rc; - rc = device_open(devname, data->type, &device); + if (data->type == DEVICE_TYPE_UEMIS) { + return uemis_import(); + } + + rc = device_open(data->devname, data->type, &device); if (rc != DEVICE_STATUS_SUCCESS) { error("Unable to open %s (%s)", data->name, data->devname); return; @@ -504,6 +509,7 @@ struct device_list { { "Cressi Edy", DEVICE_TYPE_CRESSI_EDY }, { "Zeagle N2iTiON 3", DEVICE_TYPE_ZEAGLE_N2ITION3 }, { "Atomics Cobalt", DEVICE_TYPE_ATOMICS_COBALT }, + { "Uemis Zurich SDA", DEVICE_TYPE_UEMIS }, { NULL } };