summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
AgeCommit message (Collapse)Author
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>
2014-10-18Add support to reset OSTC3 settings to defaultGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Read/Write more settings from the OSTC3Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Simplify some OSTC3 Code with macrosGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Define settings ids for the new OSTC3 settingsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Fix 02 typo, rename O2 members in devicesettingsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Add missing compass gain read from the OSTC3Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16Add a missing break after OSTC3 settings writeGravatar Anton Lundin
There was a missing break after writing the settings to the OSTC3. It caused us to fall down into the default case and saying that the operation was unsupported. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16Set the diluent values from the right bufferGravatar Anton Lundin
The OSTC3 settings code read the data from the computer into spData, but set the data into the devicedetails object from dilData. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15Read and write desaturation from OSTC3'sGravatar Anton Lundin
This adds missing code to read and write the desaturation factor to and from OSTC3's. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14Check that the model is a supported oneGravatar Anton Lundin
This code adds some crude checks to verify that the device is a supported one before we actually read/write from it. This is to white/black-list devices so we don't write or read memory that we don't know anything about. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>