From 13f5c75ac49d88bd1d1f45e798a5e75b6426aa81 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 16 Apr 2018 18:14:59 -0700 Subject: Convert our custom IO model to new libdivecomputer IO model This converts our old custom IO model to the new model that libdivecomputer introduced. This is partly based on Jef's rough patch to make things build, with further work by me. The FTDI code is temporarily disabled here, because it will need to be integrated with the new way of opening devices. The ble_serial code goes away entirely, since now libdivecomputer knows about BLE transport natively, and doesn't need to have any serial wrapper around it. Signed-off-by: Jef Driesen Signed-off-by: Linus Torvalds --- desktop-widgets/downloadfromdivecomputer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index ad8416a07..e185960c9 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -84,7 +84,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : ui.downloadCancelRetryButton->setText(tr("Download")); QString deviceText = dc->dc_device(); -#if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_IO) +#if defined(BT_SUPPORT) ui.bluetoothMode->setText(tr("Choose Bluetooth download mode")); ui.bluetoothMode->setChecked(dc->downloadMode() == DC_TRANSPORT_BLUETOOTH); btDeviceSelectionDialog = 0; @@ -318,7 +318,7 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() dc->setProduct(data->product()); dc->setDevice(data->devName()); -#if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_IO) +#if defined(BT_SUPPORT) dc->setDownloadMode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL); #endif @@ -477,7 +477,7 @@ void DownloadFromDCWidget::updateDeviceEnabled() descriptor = descriptorLookup.value(ui.vendor->currentText() + ui.product->currentText()); // call dc_descriptor_get_transport to see if the dc_transport_t is DC_TRANSPORT_SERIAL - if (dc_descriptor_get_transport(descriptor) == DC_TRANSPORT_SERIAL) { + if (dc_descriptor_get_transports(descriptor) & DC_TRANSPORT_SERIAL) { // if the dc_transport_t is DC_TRANSPORT_SERIAL, then enable the device node box. ui.device->setEnabled(true); } else { -- cgit v1.2.3-70-g09d2