mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
a42df06dbf
commit
5472036931
4 changed files with 65 additions and 5 deletions
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue