1272 Commits

Author SHA1 Message Date
Linus Torvalds
1b5ccf5983 EON Steel: pass in the type descriptor to samples that need it
The samples that take 'enum' types need the type descriptor to parse
what the enum type means.

This doesn't actually use the data yet, I need to add parsing of the
enum descriptor string.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21 19:58:29 +09:00
Linus Torvalds
79e2e3b0b5 Add 'string' event type
The event numbers are an indecipherable mess, and Suunto EON Steel has
notifications, events and warnings that just don't fit.  Plus they
really come as strings from the EON Steel anyway.

So add a "SAMPLE_EVENT_STRING" type, and for that type the event has a
"const char *name" instead of the odd and meaningless flags/value pair.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21 19:58:29 +09:00
Linus Torvalds
2e26ae4708 Make the tank "type" field more useful
Right now it only has an indication of whether the cylinder size is
imperial or metric, which is frankly quite useless.

Turn it into a bitmask instead, where we keep the imperial/metric data
for compatibility, but add another two bits that say that it's a CC
cylinder, and whether it's the oxygen or diluent cylinder.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21 19:58:29 +09:00
Linus Torvalds
f38e8fe9ee EON Steel: mark tank cache initialized when filling it in
The previous commit fixed the cache initialization testing, and
uncovered the fact that the tank size cache initialization didn't set
the initialized bit correctly.  That oversight had been hidden by the
fact that we then tested the bit wrongly, so not setting it right didn't
use to matter as long as there were other higher cache bits that were
set.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17 12:07:39 +09:00
Linus Torvalds
0aeae321dc EON Steel: fix uninitialized field cache entries
The check for whether we had initialized a field in the EON Steel cache
data structure was wrong, causing some entries to be returned
successfully even if their field had never been initialized.

In most cases, it didn't matter, since the cache data was initialized to
zero (which is a fine default for uninitialized data), so most of the
time it didn't matter.

But for the recently added dive mode field, this caused OC dives to be
returned as freedives, for example.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-16 15:58:57 +09:00
Linus Torvalds
de7ed23bec Initial Suunto EON Steel CCR support
This does the basic divemode and setpoint parsing for the EON Steel, and
gets the CCR download right in the big picture.

The cylinder information is still confusing and incorrect, but this is a
big step in the right direction.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-21 13:08:09 -07:00
Linus Torvalds
341b7c2dad Suunto EON Steel: add descriptor debugging output
.. every time I look for a new feature I add debug code to print out all
the descriptors.  So let's just do it once and for all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-21 13:08:03 -07:00
Dirk Hohndel
26b027cad8 Merge branch 'partsOfMaster' into Subsurface-branch 2016-06-12 23:10:48 -07:00
Jef Driesen
5361bc06bd Fix the nitrox gas mix parsing.
Mares Darwin compatible devices support a nitrox mode. The nitrogen
percentage should only be taken into account when the dive mode is set
to nitrox, because the last used value remains in place for air dives.
2016-06-12 23:10:37 -07:00
Jef Driesen
87facc940b Add support for the dive mode field. 2016-06-12 23:10:22 -07:00
Jef Driesen
bdc1c1349e Fix the length of the Vyper Novo gas change event.
Just like the Suunto DX, the Vyper Novo uses 5 bytes for the 0x06 gas
change event.
2016-06-12 23:09:54 -07:00
Jef Driesen
f67bdcd080 Add support for the Aqualung i300. 2016-06-12 23:09:43 -07:00
Jef Driesen
dbba7f3272 Fix the date for the Sherwood Insight 2. 2016-04-27 16:20:04 +02:00
Jef Driesen
33f5206f79 Add support for the Beuchat Mundial 2 and 3.
These two models use the same memory layout and data format as the
Oceanic F10.

Reported-By: Nick Shore <support@mac-dive.com>
2016-04-27 09:09:06 +02:00
Jef Driesen
3978dea153 Merge branch 'eonsteel' 2016-04-26 21:04:32 +02:00
Dirk Hohndel
2015546952 Merge branch 'master' into Subsurface-branch v4.5.6 2016-04-26 09:35:06 -07:00
Jef Driesen
d40cdb4755 Add the devinfo event.
The devinfo event with the device serial number is required for the
fingerprint feature. Without this event, applications won't be able to
load (or save) the correct fingerprint. All necessary information is
already available in the initial handshake packet.
2016-04-26 10:59:02 +02:00
Jef Driesen
76c52b582a Add support for the fingerprint feature. 2016-04-26 10:56:52 +02:00
Jef Driesen
ce82829284 Fix a memory leak.
A new buffer is allocated for each dive, but only the last one is freed.
Since the code is already prepared to simply re-use the same buffer,
there is no need to allocate those extra buffers.
2016-04-26 10:56:48 +02:00
Dirk Hohndel
480e54ace7 Fix OSTC3 merge errors
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 17:37:25 -07:00
Jef Driesen
0899486378 Add support for the new DX data format.
Just like the D4i and D6i, the new header is a few bytes larger. The
correct variant can again be detected by means of the logbook id tag at
the start of the header.
2016-04-19 09:02:52 +02:00
Dirk Hohndel
ecebda3b19 Fix Shearwater breakage caused by bad merging
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 05:55:12 -07:00
Miika Turkia
6c6752d87e Add dummy serial number usage to dctool
After adding support for serial number on dc parsers on
libdivecomputer's Subsurface branch, we need to add the serial parameter
to parser calls as well. Just using 0...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-16 08:32:14 -07:00
Dirk Hohndel
8356e22e61 Merge branch 'master' into Subsurface-branch v4.5.5 2016-04-09 08:29:44 -07:00
Jef Driesen
018c27d7b3 Add support for the Aqualung i450T. 2016-03-31 13:26:34 +02:00
Dirk Hohndel
515dc17914 Fix merge error that causes double free when downloading from EON Steel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-30 19:51:25 -05:00
Jef Driesen
f3fb2391f9 Add support for the Cressi Newton.
The Cressi Newton appears to be compatible with the Leonardo and Giotto.
2016-03-29 16:34:59 +02:00
Jef Driesen
469717a2a1 Add support for imperial units in the xml output.
Libdivecomputer always uses metric units internally. But when reverse
engineering a device that stores everything using imperial units, it's
very convenient to be able to switch the output to imperial units too.
2016-03-29 16:34:27 +02:00
Jef Driesen
8ab3fb0542 Always close the xml tags.
The dive and sample xml tags were not closed properly if an error
occurred during parsing.
2016-03-27 22:02:52 +02:00
Jef Driesen
cb0584adc1 Get the gas mixes from the sample data.
The Shearwater devices support adding, removing or editing gas mixes
during the dive. The pre-defined gas mixes available in the opening and
closing block are only a snapshot of the configuration at the start and
at the end of the dive. Thus by editing the gas mixes during the dive
it's possible to switch to a gas mix that is not present in the opening
(or even the closing block). The parser doesn't support that.

To avoid this problem, we now collect the available gas mixes from the
sample data. As a side effect we only return those gas mixes that are
effectively used during the dive.
2016-03-23 14:47:09 -07:00
Jef Driesen
f37b4b06db Cache the dive mode internally.
This simply moves the code to the get the dive mode from its own
function into the existing caching function.
2016-03-23 14:47:09 -07:00
Jef Driesen
aa2f670224 Add support for the Shearwater Perdix. 2016-03-23 14:47:09 -07:00
John Van Ostrand
af30fbb3f8 Add support for the Cochran Commander and EMC. 2016-03-23 14:47:09 -07:00
Dirk Hohndel
b13d8da426 Don't build examples by default
They are broken in this branch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 14:47:09 -07:00
Jef Driesen
7f6348b066 Add support for the Uwatec Aladin Sport.
The Aladin Sport appears to be compatible with the Aladin 2G.
2016-03-23 14:47:09 -07:00
Jef Driesen
95d69ea30d Add support for the Suunto Zoop/Vyper Novo.
The Zoop Novo and Vyper Novo are compatible with respectively the D4i
and D6i.
2016-03-23 14:47:09 -07:00
Jef Driesen
cc12560b29 The new D6i data format support 3 gas mixes. 2016-03-23 14:47:09 -07:00
Jef Driesen
784844d8dd Add support for the new D4i and D6i data format.
One of the newer D4i and D6i firmware versions (for example v1.5.9),
introduces a new variant of the data format. The new dive header is 8
bytes larger. The correct variant can be detected by means of the
logbook id tag at the start of the header.
2016-03-23 14:47:09 -07:00
Jef Driesen
2fc31b72e7 Add support for the HW OSTC 4.
Except for the firmware update and a few other minor differences, the
new OSTC4 is backwards compatible with the OSTC3.
2016-03-23 14:47:08 -07:00
Jef Driesen
2e0db552ad Read and cache the hardware descriptor.
By reading the hardware descriptor immediately after entering download
or service mode, we can identify the specific model and adapt to minor
differences in the communication protocol.
2016-03-23 14:26:45 -07:00
Jef Driesen
6bb60bba31 Pass an array to the checksum function. 2016-03-23 14:25:14 -07:00
Jef Driesen
c8b166dadb Get the gas mixes from the sample data.
The Shearwater devices support adding, removing or editing gas mixes
during the dive. The pre-defined gas mixes available in the opening and
closing block are only a snapshot of the configuration at the start and
at the end of the dive. Thus by editing the gas mixes during the dive
it's possible to switch to a gas mix that is not present in the opening
(or even the closing block). The parser doesn't support that.

To avoid this problem, we now collect the available gas mixes from the
sample data. As a side effect we only return those gas mixes that are
effectively used during the dive.
2016-03-23 10:50:21 +01:00
Jef Driesen
c964fa5ad9 Cache the dive mode internally.
This simply moves the code to the get the dive mode from its own
function into the existing caching function.
2016-03-23 10:50:21 +01:00
Jef Driesen
0bb3f7ebd1 Add support for the Shearwater Perdix. 2016-03-23 10:48:59 +01:00
John Van Ostrand
9a4e2b75a5 Add support for the Cochran Commander and EMC. 2016-03-22 20:09:45 +01:00
Jef Driesen
280f1871f0 Add support for the Uwatec Aladin Sport.
The Aladin Sport appears to be compatible with the Aladin 2G.
2016-03-17 08:22:39 +01:00
Jef Driesen
50ba063a46 Add support for the Suunto Zoop/Vyper Novo.
The Zoop Novo and Vyper Novo are compatible with respectively the D4i
and D6i.
2016-03-11 10:36:05 +01:00
Jef Driesen
63dcee9eaa The new D6i data format support 3 gas mixes. 2016-03-11 10:35:46 +01:00
Jef Driesen
2e64d47dff Add support for the new D4i and D6i data format.
One of the newer D4i and D6i firmware versions (for example v1.5.9),
introduces a new variant of the data format. The new dive header is 8
bytes larger. The correct variant can be detected by means of the
logbook id tag at the start of the header.
2016-03-09 14:14:10 +01:00
Jef Driesen
42e234a0f9 Merge branch 'ostc4' 2016-03-07 13:10:48 +01:00