summaryrefslogtreecommitdiffstats
path: root/ostctools.c
AgeCommit message (Collapse)Author
2015-10-30Move all core-functionality to subsurface-coreGravatar Tomaz Canabrava
And adapt a new CMakeLists.txt file for it. On the way I've also found out that we where double-compilling a few files. I've also set the subsurface-core as a include_path but that was just to reduce the noise on this commit, since I plan to remove it from the include path to make it obligatory to specify something like include "subsurface-core/dive.h" for the header files. Since the app is growing quite a bit we ended up having a few different files with almost same name that did similar things, I want to kill that (for instance Dive.h, dive.h, PrintDive.h and such). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09Whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09OSTCTools - remove useless pointer ldc_datGravatar Salvador Cuñat
This device_data_t pointer was a remnant from initial work. It is useless and can be safely removed. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13OSTCTools - Improve error management (II)Gravatar Salvador Cuñat
Have just found a .dive file in H&W forum which is not correctly parsed by libdivecomputer due (I think) to a bug in OSTC3 FW 1.77 (corrected). If libdc fails to parse a file (whatever is the reason) and the header hasn't been parsed, strcmp(ptr->key, "Serial") will segfault, so avoid comparison if there is no ostcdive->dc.extra_data but set the serial data as we know it from ostctools. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12OSTCTools - change management of model and dc familyGravatar Salvador Cuñat
H&W introduced some changes in dc's data structures with FROG and OSTC3 families (types 0x22 and 0x23 in H&W's terms) that I didn't take into account as we lacked of .dive files to test. BTW I previously set the model to "0" as it was not stored in the file but wasn't relevant for the data parsing in MK2, OSTC and OSTC2N/2C models. Thanks to Anton's advice we have got some OSTC3 dives to test, so this patch takes into account the different data structures for different families, and try to stablish a model number based on device's serial number, as libdc does. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12OSTCTools - Improve error managementGravatar Salvador Cuñat
- Introduce an exit point to cowardly run away from the file if something goes wrong (undefined dc family, inconsistent family/model pair, etc), without crashing subsurface. - Simplifies (user point of view) and makes translatables the error messages shown in the status bar. - Modifies ostc_prepare_data() to emit a return code to manage posible failures. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06OSTCTools - Add unsigned char variableGravatar Salvador Cuñat
In commit 22bfc49 an explicit cast to (char *) was introduced to silence some compiler warnings, but an (unsigned char *) is needed if related values are expected to be greater than 127 or we will get the usual weirdnesses. Just introduce such variable and use it where needed. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21OSTC tools: prevent unknown dc familyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28Add explicit casts to silence compiler warningsGravatar Robert C. Helling
clang complais when converting (char *) to (unsigned char *), so tell it it's fine. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22ostctools - resource leaksGravatar Marcos CARDINOT
some resources are not being freed. Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04OSTCTools-Add support to import .dive filesGravatar Salvador Cuñat
OSTCTools is a windows based software by Robert Angeymar which performs configuration upgrade, memory analysis and download tasks for H&W OSTC devices. Downloaded dives are stored in files (one archive each) with the raw binary data heavily padded at the begining of the file, and some other data not included in H&W dive header protocol as the device's serial number. The import function simply takes the raw data part of the file and lets libdivecomputer do the parseing. Then adds some additional info as OSTC reported dive number and serial device number. Please note that OSTCTools is *not* a real logging software, it simply gets the DC raw data, so there isn't any information about dive site, equipment and so. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>