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>
This commit is contained in:
Anton Lundin 2015-09-12 22:37:35 +02:00 committed by Dirk Hohndel
parent a42df06dbf
commit 5472036931
4 changed files with 65 additions and 5 deletions

View file

@ -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.");
}