summaryrefslogtreecommitdiffstats
path: root/configuredivecomputer.cpp
diff options
context:
space:
mode:
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.");
}