1269 Commits

Author SHA1 Message Date
Jef Driesen
ba0e7224b0 Release version 0.5.0. v0.5.0 2016-09-30 21:17:08 +02:00
Jef Driesen
1d94d3504f Merge branch 'msvc' 2016-09-29 22:41:12 +02:00
Jef Driesen
81c1944604 Include the public header in the implementation file.
In the public header files, all symbols are marked extern C. When using
a C compiler, there is usually no problem if the header isn't included
in the C file. But the msvc build system uses the C++ compiler (due to
the use of some C99 features not supported by the msvc C compiler).
2016-09-28 15:17:54 +02:00
Jef Driesen
e7ceb96627 Add explicit casts for the msvc C++ compiler. 2016-09-28 15:17:54 +02:00
Jef Driesen
53c75860a7 Add some workarounds for the msvc compiler. 2016-09-28 15:17:54 +02:00
Jef Driesen
995cfd4bbd Update the msvc project file. 2016-09-28 14:50:56 +02:00
Jef Driesen
7714a57c44 Add missing header files to the Makefiles.
To be able to generate a distribution tarball, all files need to be
listed explicitely.
2016-09-28 14:49:52 +02:00
Janice
3cb29abfaa Add support for the Subgear XP-Air 2016-09-24 10:07:15 +02:00
Jef Driesen
03c252335b Fix the firmware version for the HW Frog.
The firmware version in the dive header is stored at byte offset 32
instead of 34.
2016-09-19 15:15:52 +02:00
Jef Driesen
c3039b4aab Merge branch 'usbhid' 2016-09-19 15:15:36 +02:00
Jef Driesen
417ee6e619 Use the new USB HID backend for the Eon Steel. 2016-09-19 15:04:48 +02:00
Jef Driesen
6c6b144fe0 Add a dummy backend for systems without USB HID support.
This dummy implemantion is used when building without libusb and hidapi.
2016-09-19 15:04:48 +02:00
Jef Driesen
ed2a7c91fe Use the hidapi library on Mac OS X.
On Mac OS X, libusb doesn't work for USB HID devices. We can use the
hidapi library instead. Although the hidapi library supports Linux and
Windows too, we keep using libusb there to avoid the extra dependency.
2016-09-19 15:04:48 +02:00
Jef Driesen
bae6cb856e Add a new USB HID communication backend. 2016-09-19 15:04:48 +02:00
Jef Driesen
f30e048afc Add a configure option to build without libusb. 2016-09-19 08:48:04 +02:00
Jef Driesen
5bc52bc5a2 Merge branch 'eonsteel' 2016-09-17 23:49:37 +02:00
Jef Driesen
ec473feabf Restore the sample events.
In commit 864b46603963ea2f70f5166bb7a738a12fc280fc, the sample events
have been removed because we need to parse the enum string descriptor
instead of the numeric value.
2016-09-17 23:37:45 +02:00
Linus Torvalds
5e8b4dd6dc Suunto EON Steel: initialize the tank 'gasmix' index
The gasmix query interface considers cylinders and gas mixes independent
things, so the tank data structure has a pointer to the gasmix index.

But the EON Steel treats cylinders as just having a gasmix (and so does
subsurface, for that matter), so the gasmix index for the tank is just
the same as the tank index.

But we never filled it in, so you'd always see a "gas index" of zero,
and subsurface would end up warning each time about how the gasmix index
doesn't match the cylinder index (but because subsurface actually agreed
with EON Steel, it worked despite the warning).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 14:47:23 +02:00
Linus Torvalds
40bc67d8ff Suunto EON Steel: do the proper enum lookup for a few more cases
Instead of hardcoding the enum values for setpoint type and gas type,
use "lookup_enum()" to actually parse the enum data and use that.

I don't think this matters right now, since the numeric translations
haven't changed, but it is the RigthThing(tm) to do.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 14:47:23 +02:00
Linus Torvalds
6352b90a34 Suunto EON Steel: fix the event begin/end flag
This fixes a bug where the begin/end marker was mistakenly added as the
value instead of as flag.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 14:47:17 +02:00
Linus Torvalds
2b57b1181d Suunto EON Steel: split out gas info parsing
The dive gas parsing cases can be split out into a helper function to
keep things more manageable.  Especially since there will be a couple
more cases coming up.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-16 16:27:53 +02:00
Linus Torvalds
864b466039 EON Steel: look up enum descriptor strings
It turns out you can't hardcode the enum numbers either, since they
change from dive to dive (or possibly firmware version to firmware
version).

So do it right, and actually parse the string descriptor for the enum.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-16 16:27:47 +02:00
Linus Torvalds
a1947f3fb0 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-09-16 16:26:49 +02:00
Linus Torvalds
8ade60304d 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-09-16 16:26:49 +02:00
Linus Torvalds
42601825aa 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-09-16 16:26:49 +02:00
Linus Torvalds
c6b681a753 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-09-16 16:26:49 +02:00
Linus Torvalds
84111fe606 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-09-16 16:26:49 +02:00
Dirk Hohndel
eb61dc4c75 Add tank size reporting for Suunto EON Steel
Sadly the data we get from the EON Steel is a bit of a mess.
It doesn't really tell us if the data is metric or imperial (it always sends
both wet volume and working pressure). And in imperial mode the Suunto
engineers seem a bit confused. The pressure given (entered on the dive computer
in psi) is sent to us not in bar, not in atm... it's "something". As far as I
can tell it's a constant factor of 1.00069182389937 different from bar.
And the wet sizes are a bit to small to get the cuft size the user entered.
But instead of trying to guess and fix the mess, we just pass it through...

So this is somewhat useful, but not really what most users will want.

Linus started this commit with a few lines that parsed the right values out of
the data stream from the Suunto EON Steel. I then added the implementation of
the infrastructure to convert the raw data and report it back to the caller.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-16 16:26:49 +02:00
Jef Driesen
decfa24f92 Fix the gas mix parsing for the Aladin Tec 2G.
Unlike the other models, the Aladin Tec 2G uses only a single byte to
store the oxygen percentage, and there is no need to manually re-map the
deco mix.

Normally, the oxygen percentage is stored using two bytes (little endian
byte order). Thus for a device supporting two gas mixes, four bytes will
be used, and the corresponding gas mix id for each byte is as follows:

  ID: 0 0 1 1

After re-mapping the id of the deco mix, this becomes:

  ID: 0 0 2 2

Since oxygen percentages are limited to the range 0-100%, the highest
byte (marked with an X) should always be zero and can thus be ignored:

  ID: 0 X 2 X

Now, because an oxygen percentage of zero indicates a disabled gas mix,
this is equivalent to a device supporting three (or even four) gas
mixes, each stored using only a single byte:

  ID: 0 1 2 3

We can take advantage of this knowledge to avoid having to re-map the
deco mix id.
2016-09-02 16:34:06 +02:00
Jef Driesen
3b179e7058 Add support for the Sherwood Vision. 2016-08-25 09:10:06 +02:00
Jef Driesen
c506be93f9 Fix the decoding of the maximum depth.
Several devices (e.g. Oceanic Geo, Oceanic Veo 2.0 and Tusa Zen) report
a maximum depth that is clearly too large. The problem is easily fixed
by ignoring the higher bits. The exact bit mask is an educated guess. A
12 bit value is plausible because it's also used for the sample depths.
2016-08-23 07:58:25 +02:00
Jef Driesen
3b18d4a448 Improve the default layout detection.
Select the default memory layout for unsupported devices based on the
amount of memory indicated in the version string. This allows to
download a full memory dump.
2016-08-21 13:27:39 +02:00
Jef Driesen
6d3fbb7e6d Add a warning for unsupported devices. 2016-08-21 13:27:06 +02:00
Jef Driesen
dfa191c9bc Fix the temperature for the Tusa Zen Air. 2016-08-20 21:22:19 +02:00
Jef Driesen
f666cb8cb3 Add support for the Aqualung i550T. 2016-08-20 21:20:01 +02:00
Jef Driesen
2e40d35da4 Merge branch 'uwatec' 2016-08-18 23:32:41 +02:00
Jef Driesen
0ab2d8ccda Use the new settings field for the salinity.
Since the salinity bit is stored in the settings, there is no need for a
separate salinity entry in the header tables.
2016-08-17 14:09:52 +02:00
Jef Driesen
bfcd707889 Fix the parsing of freedives.
In freedive mode the sample rate is only 1 second instead of 4 seconds.
The tank pressure fields appear to be re-used for some other (unknown)
purposes, and should be ignored.
2016-08-17 14:08:50 +02:00
Jef Driesen
8b0a048175 Detect the gauge and freedive mode correctly.
The gauge and freedive mode bits are stored in the settings field. The
location of the gauge bit appears to be the same for all models. For the
freedive bit it depends on the model, and also not all models support
it.
2016-08-17 08:10:36 +02:00
Jef Driesen
1226b47c6d Add the salinity field for the Aladin Tec. 2016-08-17 08:10:11 +02:00
Jef Driesen
769d90aca2 Add support for the Scubapro Mantis 2. 2016-08-14 10:07:45 +02:00
Jef Driesen
af7e7aed19 Fix the decoding of the dive time.
The dive time is stored in two separate bytes: one for the number of
minutes, and another one for the hours. Since we only took into account
the first byte containing the minutes, the divetime for dives longer
than one hour was always too short.
2016-08-12 11:47:41 +02:00
Jef Driesen
ae93a6ab08 Add support for the Scubapro Mantis.
The Scubapro Mantis uses the same model number as the Meridian, and
works out of the box.
2016-08-11 08:57:47 +02:00
Jef Driesen
9e585a9525 Fix the Aeris 500AI serial number.
The Aeris 500AI serial number appears to be located at a slightly
different offset, and with an unusual encoding. It's a BCD encoded
number, but with the digits of each byte swapped.
2016-08-08 09:20:55 +02:00
Jef Driesen
00c2705786 Add the serial number encoding to the layout.
At the moment, the encoding of the serial number is tied to the global
pointer mode. To support devices where this is no longer the case, a new
entry for the serial number encoding is added.
2016-08-08 08:38:23 +02:00
Thomas Gschwind
0a769cdd57 Add salinity and timezone fields to Aladin Tec 2G 2016-08-07 09:31:21 +02:00
Janice
e99b8ac837 Add NDL and RBT for the ATOM31 and I450T 2016-08-05 10:26:07 +02:00
Jef Driesen
b4dc2532e8 Add support for the new extended hardware descriptor.
The latest v2.09 (hwOS) and v1.1.0 (hwOS4) firmware introduced a new
variant of the hardware descriptor command. This extended command
returns:

 - a 16 bit hardware descriptor
 - a 16 bit feature descriptor
 - an 8 bit model descriptor

The hardware descriptor is backwards compatible with the existing one
(upper bits are all zero for now). For the OSTC4, the feature descriptor
is currently used to indicated the Bonex scooter version (0x01), and the
model descriptor is 0x43. For all other models, the feature and model
descriptors are always zero for now.

For older firmware versions, which do not support the new extended
descriptor yet, there is an automatic fallback to the previous
descriptor.
2016-08-02 10:44:34 +02:00
Jef Driesen
9ef840fc96 Update the OSTC device descriptors.
There are a few new hardware variants since the last update.
2016-07-30 21:40:56 +02:00
Jef Driesen
f94aab3c8e Merge branch 'ostc4' 2016-07-30 21:39:56 +02:00