aboutsummaryrefslogtreecommitdiffstats
path: root/core/downloadfromdcthread.cpp
AgeCommit message (Collapse)Author
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>
2017-05-29Use magic 'ftdi' as device name on AndroidGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29mobile: dive_table.preexisting not set importing from mobileGravatar Jan Mulder
Searching why the mobile app also downloads pre existing dives, it appears that in the mobile app, the preexisting attribute is 0, where it should be the number of dives before the download. This is easily solved by adding the correct setting on the download thread. This solves the issue of downloading pre existing dives. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-05-27QML UI: add the DownloadThreadGravatar Tomaz Canabrava
For this I had to also make the DCDeviceData accessible, and for that it needed to be a pointer. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Set descriptor when starting thread.Gravatar Tomaz Canabrava
Set the descriptor when starting the thread, this removes code from the desktop code and makes everything in sync always. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Extract the device_data_t into helper classGravatar Tomaz Canabrava
Keeping the Desktop and QML versions of Subsurface using the same codebase will keep the code saner, this change makes the Desktop version use the DCDeviceData helper sturct that encapsulates the device_data_t member for easy access on the QML. This also helped move a bit of initializations from the UI to the Core - and that's always good. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27New class DCDeviceDataGravatar Tomaz Canabrava
this class encapsulates the device_data_t from libdivecomputer in a way that permit us to use it on QML. this will be needed to prepare the data for the download thread. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Move the fill_computer_list() out of widgetsGravatar Tomaz Canabrava
fill_computer_list() creates a Qt friendly structure that contains all of the necessary information about dive computers and it's devices, and it's needed both in Qml and Widgets to allow the user to download their dives. This patch makes it possible to use the code in QML without duplication. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Separate the download thread from the widget logicGravatar Tomaz Canabrava
This is important to not duplicate code for the Qml view. Now the DownloadFromDiveComputer widget is mostly free from important code (that has been upgraded to the core folder), and I can start coding the QML interface. There are still a few functions on the desktop widget that will die so I can call them via the QML code later. I also touched the location of a few globals (please, let's stop using those) - because it was declared on the desktop code and being used in the core. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>