summaryrefslogtreecommitdiffstats
path: root/configuredivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-09-12 22:37:35 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-12 14:02:32 -0700
commit547203693193ab1428cb7e1e8c4704d7e68ed3bd (patch)
treee86f27e9d0c8038c3d667d425dd6a3916fe3c44e /configuredivecomputer.cpp
parenta42df06dbfc9d55d74ee416d14ab79a8606f34f7 (diff)
downloadsubsurface-547203693193ab1428cb7e1e8c4704d7e68ed3bd.tar.gz
Connect up custom serial in dc configuration
This connects up the custom serial code in the configure dive computer dialogs. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'configuredivecomputer.cpp')
-rw-r--r--configuredivecomputer.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/configuredivecomputer.cpp b/configuredivecomputer.cpp
index 9e03bc66e..1262492de 100644
--- a/configuredivecomputer.cpp
+++ b/configuredivecomputer.cpp
@@ -632,7 +632,28 @@ QString ConfigureDiveComputer::dc_open(device_data_t *data)
dc_context_set_logfunc(data->context, logfunc, fp);
}
- rc = dc_device_open(&data->device, data->context, data->descriptor, data->devname);
+#if defined(SSRF_CUSTOM_SERIAL)
+ dc_serial_t *serial_device = NULL;
+
+ if (data->bluetooth_mode) {
+ rc = dc_serial_qt_open(&serial_device, data->context, data->devname);
+#ifdef SERIAL_FTDI
+ } else if (!strcmp(data->devname, "ftdi")) {
+ rc = dc_serial_ftdi_open(&serial_device, data->context);
+#endif
+ }
+
+ if (rc != DC_STATUS_SUCCESS) {
+ return errmsg(rc);
+ } else if (serial_device) {
+ rc = dc_device_custom_open(&data->device, data->context, data->descriptor, serial_device);
+ } else {
+#else
+ {
+#endif
+ rc = dc_device_open(&data->device, data->context, data->descriptor, data->devname);
+ }
+
if (rc != DC_STATUS_SUCCESS) {
return tr("Could not a establish connection to the dive computer.");
}