789 Commits

Author SHA1 Message Date
Jef Driesen
9f42f6b87d Release version 0.4.2. v0.4.2 2014-02-06 20:22:19 +01:00
Jef Driesen
040679f76a Improve the progress events.
Reading the data packet in multiple smaller chunks greatly improves the
progress events. Instead of just two events, before and after the
download, there are now many intermediate events. This change also
allows to significantly reduce the timeout, from 30 seconds to just one
second, which avoids blocking for too long in case the device doesn't
respond at all.
2014-01-23 09:48:56 +01:00
Jef Driesen
4ae3a4f3ab Remove the infinite timeout.
An infinite timeout causes major problems, because if the device doesn't
respond at all, the read call will block forever. With the eon serial
line settings (1200 8N2), the total time to read the 2305 byte packet is
about 21.129 seconds. A timeout of 30 seconds should be plenty of time.
2014-01-23 09:48:56 +01:00
Jef Driesen
914e740087 Fix the memory layout for the VT4.x.
The VT4.x memory layout appears to be slightly different from the Atom
3.x memory layout. The logbook ringbuffer does start at offset 0x420
instead of 0x400.
2013-12-23 21:05:52 +01:00
Tim Wootton
459b1574b8 Add iconhd gas change event
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-27 06:57:18 +01:00
Stephane Bensoussan
4c94460831 Use only 11 bits for the depth.
When using up to 14 bits for the depth, the resulting values are too
large in some cases. Most likely the upper bits are used to store
something else. Even with only 11 bits, the resulting depth range
(0-204.7m) should still be more than sufficient.
2013-10-21 11:41:19 +02:00
Jef Driesen
938839e694 Add support for the Scubapro XTender 5.
The XTender 5 is identical to the other models in the Zeagle N2iTiON3
family, and can be added to the list of supported devices without any
further changes.
2013-10-18 20:10:28 +02:00
Tim Wootton
734533e4d1 Fix units for atmospheric pressure for iconhd type
Was returning mbar, should have been bar.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-15 11:49:46 +02:00
Tim Wootton
2af365cfb7 Adds support for DC_FIELD_ATMOSPHERIC to the iconhd parser
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-12 20:33:52 +02:00
Patrick Valsecchi
8edbceaa4d Use the correct vtable for the Shearwater Petrel.
That was an harmless copy&paste error.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
2013-10-11 15:41:57 +02:00
Jef Driesen
8e0355c354 Buffer the slip packet before sending.
On Mac OS X, sending the slip packet byte by byte results in an abysmal
performance. The first byte takes up to 160ms to send, and each next
byte approximately 250ms. The packet to request a data block is
typically 7 bytes large, and therefore takes about 1660ms to send.
Because a dive is transmitted as multiple smaller packets (typically
144 bytes without protocol overhead), downloading a single dive can
easily take several seconds.

However, when sending the entire slip packet at once, the time remains
roughly identical to sending just the first byte. The result is that
the time for sending a packet reduces significantly, proportional to
the length of the packet.

Under the hood, the slip packet is now internally buffered, and the
buffer is send only when the entire packet is complete, or whenever the
buffer gets full. But in practice, the buffer is large enough to always
store an entire packet.

In the original bug report, downloading 57 dives took about 40 minutes.
After applying the patch, that time reduced to only 5 minutes!
2013-09-21 11:30:39 +02:00
Jef Driesen
6f7495dd3e Add support for a new Uwatec Aladin 2G variant.
This new variant has a different model number and has switched to the
Uwatec Galileo data format.
2013-09-19 08:56:40 +02:00
Jef Driesen
043fc4166c Add support for the Oceanic OCi.
The new Oceanic OCi appears to be almost identical to the already
supported Oceanic OC1. The most important change is the different
location for the logbook ringbuffer.
2013-09-17 13:06:56 +02:00
Jef Driesen
b96780ce75 Add support for the Sherwood Amphos. 2013-09-16 09:57:34 +02:00
Jef Driesen
85fd0c524f Fix the memory layout descriptors.
The profile ringbuffer appears to be slightly smaller than expected for
some models. For the Mares Matrix (and all compatible devices) it ends
earlier, while for the Icon HD Net Ready it starts later.

This bug resulted in missing dives, because all remaining dives were
getting dropped once a dive that crossed the ringbuffer boundary was
reached.
2013-09-09 15:05:58 +02:00
Jef Driesen
1bfcb8c3c1 Mark the Oceanic Veo 2.0 as a non air integrated model. 2013-09-05 20:41:46 +02:00
Jef Driesen
1331db75cb Fix the memory layout for the Atom 3.x and VT4.x.
The logbook ringbuffer appears to start at offset 0x400 instead of
0x240. Since these ringbuffer boundaries have to be taken taken into
account only once the ringbuffer has been filled completely, this bug
affects users with more than 200 dives only. Thus, no surprise it didn't
get noticed earlier.
2013-09-05 08:21:25 +02:00
Jef Driesen
b35e07b71b Add cancellation support to several backends.
Some backends are technically capable of supporting cancellation, but
still lacked the necessary code to enable it.
2013-09-03 20:13:49 +02:00
Jef Driesen
888b6ab03f Disable the cancellation callback during shutdown.
Several backends require a shutdown command to be send before closing
the connection. If such a command gets cancelled, that might result in
an unclean shutdown. Backends where this is problematic can always
ignore cancellation requests internally, but it's less error-prone (and
much easier) to simply disable the cancellation callback for all
backends, before closing the connection.
2013-09-03 20:09:31 +02:00
Alexander Neumann
37cb54c376 Add Mares Puck 2 dive computer
This dive computer has the same enclosure as the Mares Puck, but the
wire protocol is that of the Puck Pro. The original software identifies
it as a "Mares Puck 2", and the handshake string also contains the
sequence "PUCK 2", so this string is used to identify the device.
2013-08-12 13:11:07 +02:00
Michael Andreen
5f8da384e6 Identify event 0x07 on Suunto d9-style computers as Below Floor.
This event is on when accumulating deco time. Once you reach the floor
deco time will start decreasing and the event will stop. Going below the
floor again will re-activate the event.

Signed-off-by: Michael Andreen <harv@ruin.nu>
2013-08-05 23:02:19 +02:00
Jef Driesen
5c16b28fb9 Use only 12 bits for the temperature.
When using all 16 bits for the temperature, the resulting values are
clearly wrong in some cases. Most likely the upper 4 bits are used to
store something else. Even with only 12 bits, the resulting temperature
range (0-409.5°C) should still be more than sufficient.
2013-07-16 08:46:49 +02:00
Jef Driesen
b4250ef74d Post release version bump to 0.4.2. 2013-07-01 21:44:05 +02:00
Jef Driesen
2d3e707839 Release version 0.4.1. v0.4.1 2013-07-01 21:35:38 +02:00
Jef Driesen
bed4d19aca Add support for the new bailout event.
The new bailout event is reported to the application as a normal gas
change event.
2013-06-19 10:39:10 +02:00
Jef Driesen
b1574848b2 Interpret the 7th bit of the event byte correctly.
In the OSTC3 data format, the 7th bit of the event byte is used to
indicate whether another event byte is present or not. For the OSTC2,
this 7th bit remained unused, and I assumed it would eventually get used
in the same way as the OSTC3 does. But that assumption turns out to be
wrong. Starting with firmware v2.66 the 7th bit is used for a new
bailout event.

This patch leaves the existing logic intact, but except for the OSTC3
format (version 0x23), the maximum number of events bytes is now limited
to just one byte.
2013-06-19 10:34:02 +02:00
Jef Driesen
6ad8d61253 Fix the date/time for the Oceanic Geo 2.0. 2013-06-15 07:58:59 +02:00
Jef Driesen
d7c59dff58 Adjust the length based on the firmware version.
The OSTC 3 dataformat does contain the profile length twice: once in the
main 256 byte header, and again in the small profile header. However due
to a firmware bug, both values are not identical. The value in the main
header is wrong and 3 bytes larger than the value in the small profile
header. This bug was fixed in firmware version 0.93.

Unfortunately we rely on the length in the main header to calculate the
number of bytes to read when downloading the dive. The consequence is
that for all dives recorded with firmware 0.93 or later, the length is
calculated incorrectly, and the download fails. Luckily the firmware
version is stored in the main header too, and we can adjust the length
calculation accordingly.
2013-05-30 20:52:57 +02:00
Jef Driesen
890f5f0b5b Fix the temperature for the Aeris Atmos AI 2.
The temperature sign bit is reversed for this model.
2013-05-16 20:16:03 +02:00
Jef Driesen
d8bc4910b7 Post release version bump to 0.4.1. 2013-05-16 19:39:24 +02:00
Jef Driesen
bdd8e06786 Release version 0.4.0. v0.4.0 2013-05-13 23:50:52 +02:00
Jef Driesen
ee8b4e36ad Merge branch 'release-0.3'
Integrate the bugfixes from the stable branch.
2013-05-13 23:49:37 +02:00
Jef Driesen
8cbfacc3ac Add a devinfo event.
The firmware version and serial number are stored in the final block
of each dive. That makes it very tricky to support the devinfo event
correctly. For an efficient implementation of the fingerprint feature,
the devinfo event should be emitted before downloading the manifests
or the dives. Fortunately it turns out it is actually possible to
retrieve the firmware version and serial number independently, using
the special identifier command.
2013-05-13 19:18:08 +02:00
Jef Driesen
2934c6a618 Shutdown the connection cleanly.
A shutdown command should be send to the device, before the connection
is actually closed. In the absence of this command, the device will
display an error, even if the data transfer itself was successful!
2013-05-13 19:16:46 +02:00
Jef Driesen
1a3c919a82 Fix temperature and tank pressure for the Tusa Element II.
The Tusa Element II is a non air integrated model, and the temperature
is stored at a different location.
2013-05-11 23:00:32 +02:00
Jef Driesen
1572a91f62 Add support for yet another Oceanic OC1 variant.
The only difference with the two other Oceanic OC1 variants is the new
model number. I have absolutely no idea what's the purpose of such a
silly change.
2013-05-11 07:16:25 +02:00
Jef Driesen
50fc64ac59 Limit the memory capacity to 256K.
The Mares Matrix, Puck Pro and Nemo Wide 2 have only 256K of memory,
which is 4 times less compared to the Icon HD. However for some unknown
reason, trying to download 1024K succeeds, and these devices just
repeat the same data 4 times. That's why we never noticed the
difference in memory capacity before.
2013-05-11 07:12:47 +02:00
Jef Driesen
c195404920 Add support for the Suunto DX.
The Suunto DX has support for 8 gas mixes (OC) and 3 diluents (CC).
Because it's still unknown how rebreather dives are stored, we simply
return all 11 gas mixes. For the rest, the DX data format is very
similar to that of the existing Suunto models, with only a few
different offsets here and there.
2013-05-11 07:00:51 +02:00
Jef Driesen
8f3eb48bfb Prevent an infinite loop.
When the number of parameters is zero, there are no sample values, and
the offset variable is never increased. The result is an infinite loop.
In practice this shouldn't happen because there should always be at
least one sample value (e.g. depth). But if a new data format is
available, which is not yet supported by the parser, we might be trying
to interpret the wrong byte.
2013-05-11 07:00:51 +02:00
Jef Driesen
ad0e187c0c Replace the hardcoded constants with a layout descriptor.
A side effect is that the mares_iconhd_extract_dives function now
requires a valid device handle. This shouldn't cause any real problems
because this function will likely become private some day.
2013-05-09 22:30:23 +02:00
Jef Driesen
51d6074bfe Use a new xml element for the gaschange events.
The new xml element makes the the gaschange events stand out more
against the other less important events. At the same time it also
demonstrates the decoding of the packed oxygen and helium percentages.
2013-05-09 21:09:52 +02:00
Jef Driesen
b5f3e30de4 Add a root element to the xml output.
Without the root element the output isn't valid xml. Although the
output is supposed to provide a human readable representation for
internal use only, and thus never really intended for processing by
third-party applications, it doesn't hurt to turn it into valid xml
either.
2013-05-09 21:09:52 +02:00
Jef Driesen
c550685bfc Update the msvc project file. 2013-05-09 21:07:01 +02:00
Jef Driesen
17d46813d8 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).
2013-05-09 21:06:03 +02:00
Jef Driesen
780440dffe Exclude device descriptors for unsupported devices.
Currently all device descriptors are included, regardless of whether
the device is actually supported by the library. If IrDA or USB support
is unavailable, a dummy backend is build which will always fail with
DC_STATUS_UNSUPPORTED. Thus there is no point in listing those devices
as being supported. Doing so will only confuse end-users.
2013-05-09 21:04:53 +02:00
Jef Driesen
5fdb1e9c82 Update the README with the new domain name. 2013-05-09 21:03:38 +02:00
Jef Driesen
b36ed311c5 Add support for the Heinrichs Weikamp OSTC3.
Although the communication protocol of the OSTC3 is nearly identical to
that of the Frog, the different size parameters make it hard to share
the code easily. On top of that, if we ever implement native bluetooth
communication support, we'll need a completely separate backend anyway.
Therefore the Frog backend is simply duplicated, with a few OSTC3
specific changes applied here and there.

The existing ostc parser is upgraded to support the new OSTC3 data
format.
2013-05-07 22:15:53 +02:00
Jef Driesen
86bdf0fbb4 Fix the gas change events for the Heinrichs Weikamp Frog.
The Frog stores the index of the initial gas mix at the same location
as the OSTC, but the gas mix percentages are at a different offset, and
the number of gas mixes is different too. Parsing all the gas mixes in
advance makes the code easier to read and more future proof.
2013-05-06 21:32:51 +02:00
Jef Driesen
c1893e9b0c Replace hardcoded constants with a layout descriptor.
With the layout descriptors, most hardcoded constants are now in a
central place, which will make it easier to add support for new data
format variants.
2013-05-05 08:39:21 +02:00
Jef Driesen
2203163a3a Move duplicated code to a common function. 2013-05-05 07:30:03 +02:00