Commit graph

8 commits

Author SHA1 Message Date
Salvador Cuñat
521183dc73 OSTCTools - Improve error management (II)
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-13 15:21:30 -07:00
Salvador Cuñat
6b904f9480 OSTCTools - change management of model and dc family
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-12 13:58:17 -07:00
Salvador Cuñat
4e88140b43 OSTCTools - Improve error management
- 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-12 13:58:17 -07:00
Salvador Cuñat
1197be235b OSTCTools - Add unsigned char variable
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-07-06 13:15:29 -07:00
Dirk Hohndel
99bcdb3f30 OSTC tools: prevent unknown dc family
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 21:58:10 -07:00
Robert C. Helling
22bfc4936f Add explicit casts to silence compiler warnings
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-05-28 08:16:37 -07:00
Marcos CARDINOT
59f283a4fc ostctools - resource leaks
some resources are not being freed.

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 13:59:50 -07:00
Salvador Cuñat
3ca4e14d5c OSTCTools-Add support to import .dive files
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>
2015-04-04 10:33:49 -07:00