summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
AgeCommit message (Collapse)Author
2015-10-01Avoid possible uninitialized memory readGravatar Dirk Hohndel
Coverity CID 1325286 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-25Skip OSTC3 configs which the sport doesn't handleGravatar Anton Lundin
Use model name to skip some configs which the Sport doesn't handle and starts misbehaving on. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-25Probe and expose OSTC3 model informationGravatar Anton Lundin
This looks at the OSTC3 hw descriptor and exposes that model info as a read-only line edit, so you can see in clear text the name of the model of computer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12Lift dis- and connect out from config operationsGravatar Anton Lundin
When working with ostc's via bluetooth, they will reboot and exit bluetooth mode when you send the disconnect command. Thats kinda inconvenient when you would like to read your settings, change something and write it back, you need to start bluetooth mode on your device twice. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Progress reporting reading/writing OSTC settingsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Progress reporting reading/writing OSTC3 settingsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Enable the configuration of more OSTC settingsGravatar Anton Lundin
This enables enables you to configure a couple more settings in the OSTC devices, roughly corresponding to the new ones that can be configured in the OSTC3 devices. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Enable the configuration of more OSTC3 settingsGravatar Anton Lundin
This enables enables you to configure a couple of new settings in the OSTC3 devices. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Remove getters and setters in DeviceDetailsGravatar Anton Lundin
The DeviceDetails class is just a storage container for passing values back and forth between backend and ui code. The different names between the setters and getters just made it a pain to write nice macros and keeping the two ends in sync, so this just removes the setters and getters in favor of having the members public. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06Implement the custom Bluetooth serial communication and use itGravatar Claudiu Olteanu
Create a custom Bluetooth serial communication using the QTBluetooth API and use it when the Bluetooth download mode is enabled. First try to connect on RFCOMM channel 1 because this is the default RFCOMM channel of SPP service for most devices. If this doesn't work try again on RFCOMM channel number 5 because it could be a Petrel2 device. Add a fake open function for the custom implementation. This is used when the selected device is HW OSTC 2N and the Bluetooth mode is activated, then fake the open call of the serial device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address uninitialized member warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27Enable diagnostic logs from dc configurationGravatar Anton Lundin
This implements support for writing debug/diagnostic logs when configuring dive computers and upgrading the firmware. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27Remove the lastError from DeviceThreadsGravatar Anton Lundin
There is no reason for the DeviceThreads to keep a copy of the last error around, so this removes that code. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27Restructure ReadSettingsThread::runGravatar Anton Lundin
This moves the dc_device_close call inside the if case for dc_device_open, to get rid of the special error case and to look and behave the same as the other ::run calls. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26ifdef hw_ostc3_device_config_{read,write} usageGravatar Anton Lundin
hw_ostc3_device_config_{read,write} came into existence in libdivecomputer 0.5.0 series, and by accident lost there ifdef's when they moved out to separate functions. This returns those ifdefs. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21Emit 100% progress after quick actionsGravatar Anton Lundin
These actions are basically instant. The infrastructure are in place so if someone feels for building a proper progress, be my guest, but this just makes sure the progress bar acts like in the other cases to the user. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21Emit progress from suunto vyper config operationsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21Emit progress events from firmware updatesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21Add infrastructure to emit progress from threadsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21Refactor device handling threadsGravatar Anton Lundin
This refactors the device handling threads into having one common ancestor class. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30Cleanup OSTC settings debug codeGravatar Anton Lundin
The old OSTC settings debug code was a bit ugly. This cleans that up and contains all the ugly-ness behind the DEBUG_OSTC ifdef. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Remove debug codeGravatar Anton Lundin
This debug code was accidentally added in b2f4896f ("Whitespace cleanup") Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Another whitespace updateGravatar Dirk Hohndel
grmbl. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Move Constructor next to rest of the classGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to write_ostc_settingsGravatar Anton Lundin
This lifts the writing of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to write_ostc3_settingsGravatar Anton Lundin
This lifts the writing of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to read_ostc_settingsGravatar Anton Lundin
This lifts the reading of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to read_ostc3_settingsGravatar Anton Lundin
This lifts the reading of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to write_suunto_vyper_settingsGravatar Anton Lundin
This lifts the writing of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Lift code out to read_suunto_vyper_settingsGravatar Anton Lundin
This lifts the reading of settings out of the run() method and introduces better error handling when libdivecomputer returns a error. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Whitespace cleanupGravatar Dirk Hohndel
Plus removal of a few qDebug() calls I introduced earlier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Minor style cleanupGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22Enable firmware updates for OSTC3/OSTC SportGravatar Anton Lundin
This enables the dormant OSTC3/OSTC Sport firmware update code, now when the hw_ostc3_device_fwupdate call is available in libdivecomputer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08Read and write alarm time correctly for StingerGravatar Anton Lundin
The Stinger stores the alarm time in seconds, instead of minutes as the Vyper does it. This corrects for that. Reported-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08Make sure the device open error reaches the userGravatar Anton Lundin
This is a bit ugly fix to make sure the right error message reaches the user in case of being unable to open the device. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07Style cleanupGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02Remove libdivecomputer ifdefs for configuring OSTCGravatar Anton Lundin
The hw_ostc_device_eeprom_read / hw_ostc_device_eeprom_write functions have bin in libdivecomputer since v0.1.0, so there was an error when the read settings part ended up behind ifdef's. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01configuredivecomputerthreads.cpp: conditionally define read_ostc_cf()Gravatar Lubomir I. Ivanov
Fixes a warning. The function is only used if DC_VERSION_CHECK(0, 5, 0) is defined. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19Change the OSTC3 macros to have a ; in the endGravatar Anton Lundin
This changes the OSTC3 READ_SETTING/WRITE_SETTING macros into something that can have a ; in the end which makes some editors auto-indent it better. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Write config data to the OSTCGravatar Anton Lundin
This adds code that writes configuration data to the OSTC. As we don't look at all the values in the OSTC config blocks, we read the current blocks and only change the values we can change. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Debug code for OSTC CFGravatar Anton Lundin
This code is to debug the rest of the existing CF's, so we can look at the rest of the values. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Decode CF configuration data from OSTCGravatar Anton Lundin
This adds code to decode the custom functions data. We only decode the relevant CF's. The relevant ones are chosen by which ones have corresponding settings in the OSTC3. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Decode configuration data from OSTCGravatar Anton Lundin
This adds code to decode the configuration blocks from the OSTC. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Debug code to simulate read/write to OSTC memoryGravatar Anton Lundin
This adds debug code to simulate the read and write to OSTC memory dumps. The OSTC configuration happens via writing whole 512 byte blocks to the memory and this code is useful when debugging that process Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Cleanup syntax and styling in Configure DCGravatar Anton Lundin
This cleans up some styling and syntax in the Configure Dive Computer code path. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Check return value after firmware updatesGravatar Anton Lundin
This reports back a error to the user if the firmware update failed. We should re-wire this to have a log-function that gets called from libdivecomputer via the context to get an actual error message. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Fix compability with libdivecomputer < 0.5.0Gravatar Anton Lundin
hw_ostc_device_fwupdate was introduced after 0.4.2 so ifdef it to libdivecomputer >= 0.5.0. The scope of users interested in this feature probably isn't big enough to justify a bump of our dependencies to a unreleased version of libdivecomputer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20Configure support for OSTC, Mk.2/2N/2CGravatar Anton Lundin
First out is firmware updates. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20Style cleanupGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Correct OSTC3 read/write of pressure sensor offsetGravatar Anton Lundin
The OSTC3 stores the pressure sensor offset as a signed 8-bit integer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>