732 Commits

Author SHA1 Message Date
Jef Driesen
5410378849 Remove the common device structure for the Mares Nemo.
The common device structure was used only for sharing the fingerprint
and layout descriptor, but the nemo backend doesn't even store a layout
descriptor, and the fingerprint can equally well be passed around as a
function argument.
2011-11-11 07:09:59 +01:00
Denny Page
22686d6fe9 Add a delay between sending the init and version command.
Some devices are having problems during the initialization sequence. The
extra delay appears to improve the success rate for the affected
devices. There is obviously a small performance penalty, but being able
to establish a reliable connection with all devices is more important.
2011-11-04 22:25:55 +01:00
Jef Driesen
0ea9f5e8ca Try to correct an invalid model code.
We received data from an Icon HD Net Ready with a model code equal to
0xFF, which is an invalid value. Fortunately we can figure out the
correct model code from the data in the version packet.
2011-11-03 21:17:30 +01:00
Jef Driesen
fd8b88891f Add support for the pressure samples. 2011-11-03 20:25:15 +01:00
Jef Driesen
bb32b13b09 Don't use asserts for parameter validation. 2011-10-23 08:12:34 +02:00
Jef Driesen
8f2e3265fe Add read support for the Mares Icon HD. 2011-10-23 08:11:57 +02:00
Jef Driesen
eda03255a8 Add the libusb dependency to the pkg-config file.
When linking dynamically, the shared library contains a reference to all
external dependencies, and the linker can easily resolve them. However
when linking statically, all external dependencies have to be specified
explicitly. This rule also applies to dependencies that are not exposed
through the public api.

The pkg-config Requires.private field is used to support both static and
dynamic linking correctly.
2011-10-23 00:03:58 +02:00
Steve Buie
b7a6be15ca Skip incomplete dives.
We received an interesting case of a dive computer whose battery died
during a dive. Apparantly the device recorded some samples, but failed
to terminate the dive properly. In the linked list, the next pointer of
this dive points to itself, which is obviously an invalid value.

I suspect the device initializes the next pointer to point to itself at
the start of a new dive, and updates it again with the correct value
once the dive has finished. But due to the battery failure, that last
step never happened.

Anyway, since we are traversing the linked list backwards, we don't need
the next pointer, and we can simply skip the incomplete dive. The error
is not returned immediately anymore, but delayed until the end of the
download.
2011-10-10 21:24:07 +02:00
Jef Driesen
649d5e28df Validate the ringbuffer pointers before using them. 2011-10-09 21:15:18 +02:00
Jef Driesen
2a0defe30d Adjust the total amount of memory for the newer Suunto's.
The D9tx, D6i and D4i have twice the amount of memory compared to the
previous versions (64K versus 32K). To support both variants, a new
layout descriptor is introduced.
2011-10-07 22:02:54 +02:00
Jef Driesen
76ab46304b Store the version packet internally. 2011-10-07 21:45:07 +02:00
Jef Driesen
b57423cc54 Fix the depth decoding for the Mares Nemo Wide.
The depth is reduced to a 11 bit value. The meaning of the now unused
bit is still unknown.
2011-10-04 21:08:11 +02:00
Jef Driesen
f526cdd3d9 Add support for the Mares Icon HD Net Ready. 2011-09-24 13:49:18 +02:00
Jef Driesen
4ed8a6963c Store the version packet internally. 2011-09-24 13:49:18 +02:00
Jef Driesen
1ce8dec1d8 Exclude the 4 byte length from the sample data.
Correctly skip the 4 byte length in front of the sample data. The
previous code happened to work by accident, because the header after the
sample data was assumed to be 4 bytes larger, and thus those two errors
cancelled each other out.
2011-09-24 13:49:18 +02:00
Jef Driesen
786e4a7ae4 Initialize memory before use. 2011-09-24 13:49:13 +02:00
Jef Driesen
2a26da3737 Add support for the Oceanic Atom 3.0 and VT 4.0. 2011-08-22 23:27:43 +02:00
Jef Driesen
d560e8e1ca Fix the tank pressure for the Tusa Zen Air. 2011-08-22 22:06:38 +02:00
Jef Driesen
d6de181662 Update the parser to support the Suunto D4i, D6i and D9tx. 2011-08-12 22:47:40 +02:00
Jef Driesen
ada569faf3 Autodetect the baudrate for the Suunto D4i, D6i and D9tx.
These new models use a faster baudrate. The correct baudrate is detected
by probing with the version command. To speedup the detection, the model
code can be supplied by the caller as a hint, which is then used to
start the autodetection directly with the correct baudrate.

To maintain backwards compatibility, the model hint is not enabled yet.
2011-08-12 22:47:40 +02:00
Jef Driesen
533e033b88 Use the sample configuration data to parse the sample data.
The sample configuration data describes which sample data is available
and how it is stored. Using this data should be more reliable than using
a hardcoded configuration.
2011-08-12 22:47:40 +02:00
Jef Driesen
bc756d7663 Use the same baudrate on Unix and Windows.
With the support for custom baudrates on all systems, there is no need
anymore to use the nearest standard baudrate. Using the exact baudrate
should make the communication more reliable on Unix systems.
2011-08-12 22:47:07 +02:00
Jef Driesen
088ea6d054 Add support for non standard baudrates. 2011-08-12 22:47:07 +02:00
Jef Driesen
d3e522b070 Add support for the OSTC screenshot feature. 2011-07-24 23:24:20 +02:00
Jef Driesen
57615abc0c Add support for some additinal OSTC features. 2011-07-20 22:08:24 +02:00
Jef Driesen
5942215cda Select the correct memory layout for the Mares Puck Air. 2011-07-09 12:19:46 +02:00
Jef Driesen
608008cd33 Use symbolic constants for the model numbers. 2011-07-09 12:19:10 +02:00
Jef Driesen
7a238281f6 Fix the SetPoint change event. 2011-07-07 20:30:37 +02:00
Jef Driesen
2401731720 Add support for the new data format. 2011-06-23 20:13:51 +02:00
Jef Driesen
b492715ff2 Support firmware versions with 64K of profile data. 2011-06-23 20:13:51 +02:00
Jef Driesen
a10fc9d85e Move duplicated code into a common file. 2011-06-19 14:59:15 +02:00
Jef Driesen
0517a640bf Log a warning message for errors. 2011-05-07 22:21:45 +02:00
Jef Driesen
36e5a75f8e Drop support for older firmware versions.
Some of the older firmware versions contain a critical bug that can
possibly crash the device when trying to download dives, and also a bug
in the checksum calculation. To avoid these problems we simply refuse to
download when an old firmware is detected and require the user to
upgrade the firmware first.

The detection is performed by means of a new version command which
allows to retrieve the device information prior to downloading the
dives, but is only supported by recent firmware versions.

As a side effect, we gain access to the current firmware version, which
may be different from the one recorded during the last dive. And we can
get the info even if there are no dives present.
2011-05-07 22:21:45 +02:00
Jef Driesen
2b77a52e89 Use symbolic constants for the model numbers. 2011-05-06 18:04:40 +02:00
Jef Driesen
6467f6353d Fixed a mistake in the type detection code. 2011-05-05 20:53:08 +02:00
Jef Driesen
a217a0fb80 Fix the datetime parsing for the Aeris Elite T3. 2011-04-29 21:32:23 +02:00
Jef Driesen
ce9459039c Add support for the Aeris Atmos AI (metal buttons). 2011-04-16 08:53:58 +02:00
Jef Driesen
b288e82960 Adjust the profile ringbuffer to exclude the last 512 bytes.
For the devices in the list below, the last 512 bytes of the memory area
are not part of the profile ringbuffer. The real purpose of these bytes
is currently unknown.

Oceanic Atom 2.0 (firmware 3I or greater)
Oceanic Geo 2.0
Oceanic OC1
Oceanic ProPlus 2.1
Oceanic Veo 2.0
Oceanic Veo 3.0
Sherwood Insight
Sherwood Wisdom2
Tusa Element II
Tusa Zen
Tusa Zen Air

Some but not all of these devices also have an unreadable last page,
making the autodetection code even more complex.
2011-04-15 20:06:27 +02:00
Jef Driesen
417e7b3894 Use symbolic constants for the model numbers. 2011-03-19 23:07:17 +01:00
Jef Driesen
8c947bd6f7 Fix the parsing of HelO2 dives lacking the additional 12 byte block. 2011-03-19 22:57:10 +01:00
Jef Driesen
75e29a6a8c Fix the pressure decoding for the Aeris Compumask. 2011-03-17 20:35:09 +01:00
Jef Driesen
5588211b7f Add progress and device info events. 2011-03-12 10:37:56 +01:00
Jef Driesen
dcfbcfbb9b Allow building on systems that don't have pkg-config. 2011-03-12 10:37:56 +01:00
Jef Driesen
8fa63eb4a2 Add an option to adjust the depth calibration constants.
When the atmospheric pressure is set to zero (the default value), the
atmosperic pressure stored in the header is used.
2011-03-12 10:37:55 +01:00
Jef Driesen
c15b964b26 Add an option to switch between real and simulated dives. 2011-03-12 10:37:55 +01:00
Jef Driesen
5614aff3ee Add a libusb based implementation. 2011-03-12 10:37:50 +01:00
Jef Driesen
4b887341f3 Add support for the Atomics Cobalt. 2011-03-12 10:31:32 +01:00
Jef Driesen
7fbff73c6b Ignore samples with all 0xFF bytes. 2011-03-08 23:13:22 +01:00
Jef Driesen
c1d05cd8ba Fix the pressure decoding for the Aeris Epic. 2011-03-08 23:01:01 +01:00
Jef Driesen
63f3f6de06 Add support for the Sherwood Insight. 2011-02-24 20:59:52 +01:00