aboutsummaryrefslogtreecommitdiffstats
path: root/core/downloadfromdcthread.cpp
AgeCommit message (Collapse)Author
2018-06-28Add Cressi Giotto, Newton and Drake to list of devicesGravatar Stephen Goodall
Adding Cressi Giotto, Newton and Drake to the list of devices that can be selected on Android devices. Signed-off-by: Stephen Goodall <stephen.goodall88@googlemail.com>
2018-06-27QML UI: go back to always saving libdivecomputer logfileGravatar Dirk Hohndel
This got disabled as unintended (I hope) side effect of commit 807571a588 ("core: update deviceData default from qml"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-28Add Cressi Leonardo to list of devicesGravatar Stephen Goodall
Adding Cressi Leonardo to the list of devices that can be selected on Android devices. Signed-off-by: Stephen Goodall <stephen.goodall88@googlemail.com>
2018-06-21core: print the correct message code for download failuresGravatar Dirk Hohndel
We filled in the missing information and then printed the wrong string. This fixes that and also makes the strings slightly easier to understand. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-09core: remove qml properties from downloadfromcthreadGravatar jan Iversen
Remove Q_OBJECT and qml properties from DCDeviceData class Remove DCDeviceData register from mobile-helper.cpp Change DCDeviceData constructor to be without parameters Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-09core: update deviceData default from qmlGravatar jan Iversen
remove setting default in qml to C++ Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-09core: remove qml properties from desktop compileGravatar jan Iversen
add #ifdef SUBSURFACE_MOBILE to secure qml macros are not compiled with desktop Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-04core: remove unused function getDetectedDeviceAddress()Gravatar jan Iversen
getDetectedDeviceAddress is not used in mobile or desktop version Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-12DC transport debugging messagesGravatar Dirk Hohndel
Show the transport types we support for each of the supported dive computers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27Create one function to determine the supported transportsGravatar Dirk Hohndel
This should make sure we create a consistent view based on all the information available. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27QML UI: add supported dive computers to log fileGravatar Dirk Hohndel
In a more compact format than before. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27Redesign the flow for checking supported DCs on AndroidGravatar Dirk Hohndel
Only filter against the hard coded list if no other supported transports are available for a dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27Use libdc information about supported transportsGravatar Dirk Hohndel
For example, even on platforms that support libusb, libdivecomputer might be compiled without such support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24Only offer dive computers with supported transportsGravatar Dirk Hohndel
On Android we still need to do more filtering as only some of the USB divecomputers are supported. But on iOS this takes care of it without the hard coded list. Additionally, if built without BT or BLE support, the corresponding dive computers are no longer shown (e.g. Perdix AI on Windows). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-13Mobile: add Mares BLE dive computersGravatar Dirk Hohndel
Technically, these aren't BLE, these are just the three devices that are supported by the Mares Bluelink Pro Bluetooth download dongle. While we are at it, admit that this code is no longer automatically created but instead maintained by hand. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-14Cleanup: introduce copy_qstring() functionGravatar Berthold Stoeger
strdup(qPrintable(s)) and copy_string(qPrintable(s)) were such common occurrences that they seem worthy of a short helper-function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14Subsurface-mobile: Add OSTC 2 TR as support dive computerGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-31Workaround for invalid bluetooth device namesGravatar Berthold Stoeger
Owing to bug #1002 invalid bluetooth device addresses of the form "devicename (deviceaddress)" or "deviceaddress (devicename)" may have found their way into the preferences. Recognize such names and extract the correct address. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-27Cleanup: avoid uninitialized membersGravatar Dirk Hohndel
This is basically to make Coverity happy. Coverity CID 208300 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-02Add debug output for vendor/product tuplesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-02Add Heinrichs Weikamp BLE dive computers for iOSGravatar Dirk Hohndel
Not all OSTC 2, 3, and Sport support BLE, but newer models do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-26Update list of divecomputers supported in Subsurface-mobileGravatar Dirk Hohndel
There was some whitespace change as well - this is straight from the tool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-13Make Bluetooth naming consistentGravatar Berthold Stoeger
Currently, on Linux, after selecting a Bluetooth device the name of the device is shown. On reopening the download dialog, on the other hand, the address is shown. In the device selection dialog both are shown. This patch changes the download dialog such that both, name and address, are shown. The bulk of the patch introduces the name of the device in the preferences and DCDeviceData. It has to be noted that DCDeviceData is an encapsulation of the libdivecomputer device_data_t. Nevertheless, the new Bluetooth-name field is, at the moment, not passed through to libdivecomputer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-26Clear error string when starting dive computer dowload.Gravatar Berthold Stoeger
Fixes minor interface inconsistency: After a failed download, the error message was also shown on subsequent successful downloads. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-17Fix Android compile errorGravatar Jan Mulder
Trivial typo only visible on Android build. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-15Android should support the Cobalt dive compoutersGravatar Dirk Hohndel
With an OTA adapter - sadly I can't test that. This driver opens a specific USB device and will ignore the connection settings. It would be better to get some visual feedback for that (in the QML UI), but I'll leave that until this has been verified to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-06Add Cochran dive computers to FTDI listGravatar Dirk Hohndel
Based on information from John Van Ostrand <john@vanostrand.com>. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-26Adjust signature to match data we needGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: remember the last dive computerGravatar Dirk Hohndel
We already have the infrastructure to do so, all we needed to do was hook it all up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19Correct list of Shearwater BLE dive computersGravatar Dirk Hohndel
Some Petrel 2 computers are dual stack. We need to list the Petrel here as well since the Petrel 2 actually identifies itself via BT/BLE as Petrel and we can't tell them appart until after we started a download. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19Move variable into the code block it is used inGravatar Dirk Hohndel
Avoids an "unused variable" warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-19BLE dive computers: add PerdixGravatar Dirk Hohndel
This is both correct (many Perdix support BLE) and necessary as the Perdix AI identifies itself (sadly) as Perdix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18QML UI: correctly match BT names with productsGravatar Dirk Hohndel
And remove the remaining references to the "Paired Bluetooth Devices". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18QML UI: remove the Paired Bluetooth Devices virtual vendorGravatar Dirk Hohndel
We now actually handle connections in a sane manner and don't need that workaround anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16Add the connections that we find to the modelGravatar Dirk Hohndel
So far this only deals with BT addresses. We also need to add other connections that we detect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-08Automate picking supported DCs on iOS and AndroidGravatar Dirk Hohndel
We use a little script to create the code snippet. This script in return relies on comments that were added to the latest libdivecomputer source (in the Subsurface-branch). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03Rewrite the matching code for BT devicesGravatar Dirk Hohndel
This should be much more robust in getting us the correct Bluetooth address and the correct vendor / product for our selection. When we pick a paired device, we extract the address right from its name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04Don't try to dereference empty product/vendor listGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-02QML UI: add more dive computersGravatar Dirk Hohndel
This really needs to be done differently - we need a structured way to associate a transport mechanism with each of the dive computers we support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30QML UI: save BT address as stringGravatar Dirk Hohndel
And do the same LE: prefix marking as in the desktop version. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24Add the EON Steel as support DC on AndroidGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22mobile: prune DC list to download fromGravatar Jan Mulder
Currently, only a small number of dive computers can be downloaded from the mobile app. Only present the supported ones to the user. So, currently restricted to classic BT. Not sure about FTDI support at this point. Version 2 of the same commit after review from Dirk. Fundamentally, support is as follows: Android: BT, BLE, and FTDI. iOS: BLE only. For all other OSses, this commit has no changes. As the BLE backend is not yet ready, no support on iOS yet. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-12Mobile: wrap up fixes for BT download on AndroidGravatar Jan Mulder
Major functional change in this commit is the addition of found static BT devices to the internal administration (on Android), in a way that is equivalent to mobile-on-desktop. So, in both cases, the list of devices in the app are as in the list of devices on the host OS (Linux or Android). To minimize code duplication, the btDeviceDiscovered slot is split in two parts, the part to act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and the part only needed for Android. Remaining to be fixed: the correct handling of the QML UI selection of vendor/product. The first default dive computer is correctly detected, all paired devices from the virtual vendow can be selected, but clicking through vendors results in non logical selections. It is obvious why this is, but a fix is not straigforward at this point. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12Mobile: add BT name to vendor/product capabilityGravatar Jan Mulder
This adds a central function to convert a BT name to a vendor/product pair known to Subsurface. This allows interfacing from a paired BT dive computer, without actively selecting its type, but by selecting it from the list of paired BT devices. So, after this, downloading from multiple (paired) DCs is also possible. And not the niced piece of code ... Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: add internal admin for virtual vendorGravatar Jan Mulder
Added a list of paired BT devices for the "Paired BT Devices" vendor. The devices under this vendor represent all BT devces that can be found from the local BT interface. Some special processing is required, as the BT provided data is (obviously) missing the specific data needed to open a BT device using libdc code. This processing is not in this commit, but will follow. This commit is preparation for that. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: call correct function for BT addressGravatar Jan Mulder
After the recent refactoring of QMLManager to btdiscovery, the manager.getBtAddress() got superseeded by downloadThread.data().getDetectedDeviceAddress(). Corrected this here. Futher some debug output is modified, so that it report the proper function names. This corrects the download from an automatically detected OSTC 3. Manul selection of the same device from the fake vendor "Paired BT Devices" does not work, however. Still work to be done in that area. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: do not crash on selecting dive computersGravatar Jan Mulder
For reasons unknown to me, the DCDeviceData instance was freed way too early, and used afterwards, obviously resulting in a SIGSEGV. This commit creates the DCDeviceData as a direct child of the QMLManager instance, ensuring it does not get freed prematurely. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: move BT handling into core codeGravatar Dirk Hohndel
This shouldn't be part of the UI (qmlmanager), but part of our overall handling of dive computers and BT devices. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: add paired BT devices as vendorGravatar Dirk Hohndel
This way the user can explicitly chose which dive computer they want to download from. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Don't override device name when using BTGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>