diff options
Diffstat (limited to 'core/configuredivecomputer.cpp')
-rw-r--r-- | core/configuredivecomputer.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/core/configuredivecomputer.cpp b/core/configuredivecomputer.cpp index b59f1916b..6fef1eb21 100644 --- a/core/configuredivecomputer.cpp +++ b/core/configuredivecomputer.cpp @@ -635,24 +635,16 @@ QString ConfigureDiveComputer::dc_open(device_data_t *data) fprintf(data->libdc_logfile, "built with libdivecomputer v%s\n", dc_version(NULL)); } -#if defined(SSRF_CUSTOM_IO) if (data->bluetooth_mode) { -#if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_IO) - rc = dc_context_set_custom_io(data->context, get_qt_serial_ops(), data); -#endif -#ifdef SERIAL_FTDI - } else if (!strcmp(data->devname, "ftdi")) { - rc = dc_context_set_custom_io(data->context, &serial_ftdi_ops, data); +#if defined(BT_SUPPORT) + rc = ble_packet_open(&data->iostream, data->context, data->devname, data); #endif } if (rc != DC_STATUS_SUCCESS) { report_error(errmsg(rc)); } else { -#else - { -#endif - rc = dc_device_open(&data->device, data->context, data->descriptor, data->devname); + rc = dc_device_open(&data->device, data->context, data->descriptor, data->iostream); } if (rc != DC_STATUS_SUCCESS) { @@ -672,6 +664,8 @@ void ConfigureDiveComputer::dc_close(device_data_t *data) if (data->context) dc_context_free(data->context); data->context = NULL; + dc_iostream_close(data->iostream); + data->iostream = NULL; if (data->libdc_logfile) fclose(data->libdc_logfile); |