aboutsummaryrefslogtreecommitdiffstats
path: root/core/downloadfromdcthread.cpp
AgeCommit message (Collapse)Author
2018-10-10QML UI: do not try to download from DC with empty vendor/productGravatar Jan Mulder
Disable the Download button when one of the fields vendor, product, connection is not filled in. The app will crash when trying. In addition, make the underlying core code to actual download more safe by checking this, and silently fail instead of crash. And, yes, this is a double fix in this scenario, but the core code is used in more places, so better safe than sorry. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile RememberDCs: save device addressGravatar Jocke
By saving the device address together with the vendor and product we fix the corner case where a user with two DCs would not get quick select buttons if they where the same vendor and model. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-08qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputerGravatar Linus Torvalds
Some divecomputer backends (ok, right now really only the Aqualung i770R and i300C) want to know the bluetooth name of the dive computer they connect to, because the name contains identifying information like the serial number. This just adds the support for that to our Qt BLE code. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-06Core: remove preexisting field from struct dive_tableGravatar Berthold Stoeger
Dives are now in all cases imported via distinct dive_tables. Therefore the "preexisting" marker is useless. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-05Cleanup: don't produce no-dives error message in libdivecomputer.cGravatar Berthold Stoeger
If no dives were downloaded in do_libdivecomputer_import(), an error message would be produced. To check for downloaded dives, the function would access the global downloadTable instead of the actual table the dives are imported to (at the moment the same - but the interface allows for a different table). Move the error-creation to the caller to avoid this situation. An alternative option would be to check the actual table the dives were supposed to be downloaded to. But from a program-logic point of view "no dives" does not seem like an error condition. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-01Mobile download from DC: show the correct DC rather than the latestGravatar Jocke
Since we now keep track of up to 4 DCs we don't want to display the last used one but rather the one that is connected. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-23Desktop/remember DCs: move non-UI-specific code into the core layerGravatar Dirk Hohndel
This way we can use the same functionality from the mobile UI as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Make device enumeration use the device transport dataGravatar Linus Torvalds
This removes some special-case code for Uemis, replacing it with simply passing in the device transport information. This makes device enumeration work for the Garmin Descent (if it is listed by libdivecomputer as a USB storage device, that is). I don't actually do any of the libdivecomputer parsing yet, and only have a stub for the Garmin Descent, but now the directory selection works with that stub. The actual download obviously does not. [Dirk Hohndel: removed obsolete FIXME from code] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-15core: remove SettingsObjectWrapper and update qPref callsGravatar jan Iversen
remove use of SettingsObjectWrapper:: remove include of SettingsObjectWrapper.h use qPrefFoo:: for setters and getters replace prefs.foo with qPrefXYZ::foo() where feasible (this expands to the same code, but gives us more control over the variable). Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-11Android: don't assume that non-BT means FTDI on AndroidGravatar Dirk Hohndel
We do support download from USB devices like the Atomic Aquatics Cobalt. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11core: remove confusing information from debug messageGravatar Dirk Hohndel
This always looked like a thread number and really made no sense since we had a much more informative debug message just a couple lines above. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-29BT support: disable BT download when compiling without BTGravatar Kristaps Dz
When BT_SUPPORT is not enabled, don't default to "true" for using bluetooth for downloading dives. Otherwise, bluetooth will be forced since the bluetooth button has been removed and is never overridden. Fixes #1541 Signed-off-by: Kristaps Dzonsons <kristaps@bsd.lv>
2018-07-26Whitespace cleanup core divecomputer handlingGravatar Dirk Hohndel
Not entirely script based because of two odd issues where the script creates bogus indentation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-25core: activate qPrefDiveComputerGravatar jan Iversen
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer this activated qPrefDiveComputer and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
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>