112 Commits

Author SHA1 Message Date
Jef Driesen
018c27d7b3 Add support for the Aqualung i450T. 2016-03-31 13:26:34 +02:00
Janice
4765f7bc50 Fix year decoding for Sherwood Amphos Air 2016-02-19 19:47:29 +01:00
Jef Driesen
aafdbe8baa Fix the date for the Oceanic Datamask. 2016-02-16 20:38:03 +01:00
Jef Driesen
6b3874121d Don't ignore zero depth samples in freedive mode.
In freedive mode, samples are only 2 or 4 bytes large, thus a sample
containing all 0x00 bytes represents a zero depth value and not some
invalid data that should be ignored.
2016-01-18 13:03:48 +01:00
Jef Driesen
789fdb4d9a Remove the footer sample for the F10 and F11.
The F10 and F11 don't seem to have a special footer sample after the
profile data. Those 8 bytes appear to be valid sample data.
2016-01-18 13:03:47 +01:00
Jef Driesen
ca032783a2 Fix the decoding of the dive time.
I originally assumed the second byte contains the hour, but that turns
out to be wrong. At least some of the bits have a different meaning.
With only seconds and minutes, the maximum divetime is limited to at
most 99 minutes and 59 seconds. That shouldn't be a problem for
freedives.
2016-01-18 13:03:47 +01:00
Jef Driesen
49af321bc5 Use the correct sample rate from the header.
The Oceanic and Aeris F11 have a configurable sample rate. The possible
sample intervals are 2, 1, 0.5 and 0.25 seconds. Since our smallest unit
of time is one second, we can't represent the last two, and the extra
samples will get dropped for now.
2016-01-18 13:03:47 +01:00
Jef Driesen
9520ecddbc Add support for the Oceanic F11.
This appears to be an Oceanic branded version of the Aeris F11.
2016-01-18 13:03:47 +01:00
Jef Driesen
ff29d218bb Use helper functions to allocate and free objects.
Both the allocation and initialization of the object data structure is
now moved to a single function. The corresponding deallocation function
is intended to free objects that have been allocated, but are not fully
initialized yet. The public cleanup function shouldn't be used in such
case, because it may try to release resources that haven't been
initialized yet.
2016-01-05 20:40:21 +01:00
Jef Driesen
9bc14dca10 Remove some boilerplate code from the cleanup functions.
Instead of freeing the object data structure in the backend specific
cleanup function, the memory is now freed automatically in the base
class function. This reduces the amount of boilerplate code in the
backends. Backends that don't allocate any additional resources, do no
longer require a cleanup function at all.
2016-01-05 20:40:21 +01:00
Jef Driesen
dd779d531a Fix the date parsing for several models.
To store the day (range 1 to 31) as a binary encoded value, only 5 bits
are required. The extra 6th bit is part of the year. The year is also
not BCD encoded. This happened to work by accident, because for a single
nibble, the current implementation of the bcd2dec() function returns the
binary value.
2016-01-04 19:30:40 +01:00
Jef Driesen
06e0de6712 Add a new sample with the active gas mix.
The new gasmix sample contains the index of the active gas mix.

This new sample is intended as a replacement for the existing gas change
events (SAMPLE_EVENT_GASCHANGE and SAMPLE_EVENT_GASCHANGE2). To maintain
backwards compatibility, the legacy events are marked as deprecated but
not removed yet.
2015-12-21 14:03:39 +01:00
Jef Driesen
aa2499ef0f Implement gas switches for the Hollis TX1. 2015-10-28 08:27:24 +01:00
Jef Driesen
99300d4e37 Implement ndl/deco support for the Hollis TX1. 2015-10-28 08:27:24 +01:00
Jef Driesen
3b0e36ccbf Implement ndl/deco support for the Tusa Zen. 2015-10-28 08:27:24 +01:00
Jef Driesen
7341403f73 Fix the temperature for the Tusa Zen. 2015-10-28 08:27:24 +01:00
Jef Driesen
95aa477129 Cache the parser data internally. 2015-10-28 08:27:24 +01:00
Janice
0efa420b71 Convert ndl/deco time to seconds. 2015-10-14 09:11:47 +02:00
Jef Driesen
b7c3582604 Fix the temperature for the Aeris Manta.
The Aeris Manta does not store the temperature as a delta value, but as
an absolute value (at offset 6).
2015-07-06 15:00:22 +02:00
Jef Driesen
b832f4cf1b Cache the header and footer size internally. 2015-05-01 11:28:55 +02:00
Jef Driesen
5a1f1293d2 Disable tank pressure samples for the Aeris Manta.
The Aeris Manta is yet another non-air integrated model that doesn't set
the initial tank pressure to the magic value 10000.
2015-03-06 22:33:10 +01:00
Jef Driesen
c7d2bfc9a0 Add support for the Sherwood Amphos Air. 2015-03-04 08:13:53 +01:00
Jef Driesen
da96f0211a Fix the freedive mode for the DG03 and VT3.
The freedive/gauge bits for the Hollis DG03 and Oceanic VT3 are stored
at another location than our initial assumption.
2015-03-04 08:06:39 +01:00
Jef Driesen
41834a31c7 Fix the freedive mode for the Oceanic Veo 2 and 3.
In freedive mode, the Oceanic Veo 2.0 and 3.0 have samples that are only
4 bytes long, instead of the normal 8 bytes.

The Oceanic VT3 and Hollis DG03 use the same logbook layout, and
although I haven't been able to confirm this with real data, it's very
likely they need the same fix.
2015-02-27 10:18:09 +01:00
Jef Driesen
488c396656 Fix the hour for the Oceanic Veo 2 and 3.
For BCD encoding the hour in a 12 hour clock system, only 5 bits are
required. The extra two bits are used for storing the freedive/gauge
mode.
2015-02-27 10:17:19 +01:00
Jef Driesen
bad4dd4342 Add support for the Oceanic VTX.
The Oceanic VTX is very similar to the Aeris A300 CS. The main
difference is the higher baudrate (115200 vs 38400). This is annoying
because without the correct baudrate, no communication is possible and
thus the existing autodetection based on the version packet doesn't
work. As a workaround, we now rely on the model number from the device
descriptor. The consequence is that the user must select the correct
model now (or at least a model with the same baudrate).
2015-02-19 13:47:48 +01:00
Jef Driesen
4671a31853 Disable gas mixes in freedive mode. 2015-02-14 21:44:58 +01:00
Jef Driesen
d2fce4ac3b Implement the dive mode field. 2015-02-14 21:44:58 +01:00
Jef Driesen
6f14e996d7 Fix the freedive mode for the Aeris Elite T3.
In freedive mode, the Aeris Elite T3 has samples that are only 2 bytes
long, instead of the normal 8 bytes.

Since there are many other models which support a freedive mode, the new
implemention provides the necessary infrastructure to easily integrate
those other models too.
2015-02-14 21:44:58 +01:00
Jef Driesen
6f23ab9ed7 Fix the depth for the Aeris F11.
Since the size of a sample is only 2 bytes, we were actually reading the
depth value from the next sample.
2015-02-10 21:18:23 +01:00
Jef Driesen
6ad341d0c7 Disable tank pressure samples for the Oceanic Geo 2.0.
The Oceanic Geo 2.0 is a non-air integrated model that doesn't seem to
set the initial tank pressure to the magic value 10000.
2015-02-02 09:05:33 +01:00
Jef Driesen
134da18190 Fix the temperature for the Sherwood Amphos.
The sign bit is stored at a different offset.
2014-11-30 21:02:13 +01:00
Janice
71fe683922 Don't look for tank pressure information from a GEO 2014-11-10 13:05:33 +01:00
Dirk Hohndel
d2eacc5c01 Fix temperature parsing for Sherwood Wisdom 3
Adds the new model and treats it like a Wisdom 2 (and many other, similar
versions of the Oceanic Atom2 style dive computers).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 10:03:11 +01:00
Janice McLaughlin
69fec57ed7 Fix the gas mixes for the Aeris A300AI.
The Aeris A300AI supports 4 instead of 3 gas mixes. The offset where the
gas mixes are stored was wrong too.
2014-10-28 09:14:25 +01:00
Jef Driesen
1d2ebd7af1 Fix the header size for the Oceanic VT4 and VT4.1.
This change was already present in the oceanic_atom2_parser_get_field()
function, but not in the oceanic_atom2_parser_samples_foreach()
function. These two should always be kept in sync.

This fixes a bug in the tank pressure detection.
2014-10-28 09:07:18 +01:00
Jef Driesen
853477b3b1 Add support for the Aeris F11.
Most of the changes needed for the F11 are the standard model specific
tweaks. But the F11 also has another interesting "feature". If you try
to download a full memory dump using the standard B1 read command, then
the data starts to repeat after the first 64K. It seems that somehow,
the B1 command can only address the first 64K of the memory. To avoid
this problem, the newer B4 read command needs to be used instead.

This might be a firmware bug, or maybe internally they store the address
in a 12bit variable, which causes the upper bits to get lost? That would
explain the repeating data.
2014-10-27 22:02:04 +01:00
Dirk Hohndel
0bcee519e0 Aeris A300CS: detect the number of cylinders used
The A300CS actually tells us how many of the cylinders it considers "in
use".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:24:18 +01:00
Dirk Hohndel
7a108f555b Aeris A300CS: add reporting of water type (fresh/salt)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:24:18 +01:00
Dirk Hohndel
16fb1c1869 Aeris A300CS: add support for NDL / deco data
Encoded in every sample. The depth is in multiples of 10 feet which gives
somewhat odd metric stop depth - but rounding to full meters would take
care of that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:24:18 +01:00
Dirk Hohndel
d89dd952c9 Add initial support for the Aeris A300CS
This is ignoring a ton of data that the dive computer provides. But it
gives profile, tank pressure and temperatures - so it's a start.

This patch adds a set_dtr and set_rts call to the serial interface prior
to interacting with the device. This change is required for the A300CS to
talk to the computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:24:18 +01:00
Jef Driesen
abe2eab976 Fix the date/time for the Oceanic Pro Plus 3.
The day is stored as a binary value, not a BCD encoded value.
2014-10-25 21:21:43 +02:00
Jef Driesen
693bfa3916 Fix the Tusa Zen header size and pressure.
For the Tusa Zen, the header is 16 bytes smaller. With this change, the
gasmixes and the intial temperature are now parsed correctly.

The tank pressure samples have also been disabled manually, because this
is a non-air integrated model that doesn't seem to set the initial tank
pressure to the magic value 10000.
2014-09-14 22:09:48 +02:00
Jef Driesen
6433a45bbc Fix the date/time for the Aeris Elite T3.
Commit d414da70a42afca0096e0402a426c4ac8d2a2881 added support for a
second Aeris Elite T3 variant. But the parser wasn't updated to take
into account this second model number.
2014-06-25 08:44:36 +02:00
Jef Driesen
368c138858 Fix the gas mixes for a few models.
For the Aeris Manta and Sherwood Insight, the header size should be 16
bytes smaller. Due to this mistake not only two samples were missing,
but also the byte offset for the gas mixes were wrong. This resulted in
invalid gas mixes, with oxygen percentages exceeding 100%.
2014-06-25 08:44:27 +02:00
Jef Driesen
48e73babd6 Fix the temperature for the Sherwood Wisdom 2.
The sign bit should be reversed for this model.
2014-06-20 22:22:41 +02:00
Jef Driesen
8eebc0abd8 Add support for the Beuchat Voyager 2G. 2014-06-07 10:08:04 +02:00
Jef Driesen
b4cc491aee Add support for the Aeris A300. 2014-04-22 14:29:58 +02:00
Jef Driesen
148f059bcb Add support for the Hollis TX1.
The Hollis TX1 has several new features compared to the other models. It
supports trimix and up to 6 different gas mixes can be configured. It
also has twice the amount of memory, which requires an extra bit for the
ringbuffer pointers.
2014-04-22 14:28:27 +02:00
Jef Driesen
3c99f55b6f Add support for trimix gas mixes. 2014-04-22 11:33:53 +02:00