554 Commits

Author SHA1 Message Date
Jef Driesen
a3f674913d Skip gaps between two consecutive dive profiles.
The assumption that two consecutive dive profiles are stored without any
gaps in between them, appears to be incorrect in some cases. Instead of
failing with an error we just skip those gaps now.
2012-03-16 22:53:57 +01:00
Jef Driesen
2b0ef8c0f1 Disable pressure samples for the Oceanic Veo 3.0. 2012-03-15 21:44:25 +01:00
Jef Driesen
4afa8ad1ef Mark the last memory page on an Oceanic Veo 3.0 as unreadable. 2012-03-15 21:44:25 +01:00
Jef Driesen
dea1fe358d Add support for the Darwin Air tank pressure. 2012-03-10 10:20:23 +01:00
Jef Driesen
d4b94cb77c Improve the communication with Darwin Air devices.
We received a report of a Darwin Air device which has a very high error
rate. The majority of the echo packets is incorrect, but since this
doesn't seem to have any effect on the actual data packet, we can just
ignore this error. If there happens to be a more serious error, it will
be detect in the data packet.

Sometimes there were also a some garbage bytes received at startup.
Adding a small delay seems to fix this.
2012-03-05 21:20:07 +01:00
Sam Calhoun
1ccd786493 Fix the temperature for the Oceanic ProPlus 2.1. 2012-03-01 22:05:35 +01:00
Jef Driesen
605cb37c23 Add support for the Oceanic OC1 Pioneer. 2012-02-24 20:36:28 +01:00
Jef Driesen
ee4f105a94 Revert back to a standard baudrate on Unix.
The linux USB CDC-ACM driver, which is used by the Mares Icon HD
interface, doesn't support the ioctl's to configure a custom baudrate.
But since the actual baudrate doesn't seem to matter at all, we revert
back to the nearest standard baudrate.

Because custom baudrates are confirmed to be supported on Windows and
Mac OS X, those platforms can keep using the non-standard baudrate.
2012-01-20 22:44:45 +01:00
Jef Driesen
87397a4ea1 Add support for the Oceanic VT4.1 2012-01-14 06:37:26 +01:00
Jef Driesen
2abd5164f4 Add a delay between sending the commands.
When trying to send the commands as fast as possible, without any delay,
the failure rate is very high. Almost every single packet fails with a
timeout at first. Retrying the packet works, but those many timeouts
make the download extremely slow. Adding a small delay avoids the much
more expensive timeout and speeds up the transfer significantly.
2012-01-02 08:01:08 +01:00
Jef Driesen
fa348c0d04 Rename the example application too. 2011-12-31 09:09:40 +01:00
Jef Driesen
48f6b1eec7 Add a command line parameter to specify the model code. 2011-12-31 07:52:07 +01:00
Jef Driesen
3d78282cde Rename the backend from darwinair to darwin.
The name change makes it more obvious the backend supports both the
Darwin and the Darwin Air, and it's a shorter name too.
2011-12-31 07:51:52 +01:00
Jef Driesen
ca56b5932a Add support for the Mares Darwin.
The Darwin and Darwin Air share a very similar layout, but with a few
differences here and there. Unfortunately, there seems to be no way to
autodetect the exact model during the download. Therefore, an extra
model parameter is added to select the appropriate model manually.
2011-12-31 07:47:43 +01:00
Jef Driesen
f062623323 Replace the hardcoded constants with a layout descriptor.
A side effect is that the mares_darwinair_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.
2011-12-31 06:25:38 +01:00
Denny Page
c4f62d9410 Remove the init command from the initialization sequence.
The init command appears to behave more like a hard reset. If the
command is sent during the communication, the device immediately closes
the connection and no further communication is possible without
disconnecting and reconnecting the device.

Sending the command at the start of the communication seems to require a
long delay before sending the next command. However the communication
works equally well without sending this command. For some devices it
even improves the success rate of the initialization sequence, and thus
there is no reason to keep it.
2011-11-22 21:51:50 +01:00
Jef Driesen
069797a082 Add a devinfo event for the Dacor Darwin Air. 2011-11-13 06:27:37 +01:00
Jef Driesen
b22df8d26c Add the example application for the Dacor Darwin Air. 2011-11-11 16:59:52 +01:00
Jef Driesen
5ef0398c42 Add support for the Dacor Darwin Air. 2011-11-11 11:13:03 +01:00
Jef Driesen
64d3a99052 Remove unnecessary checks. 2011-11-11 10:42:39 +01:00
Jef Driesen
99881d6250 Redefine the packet size explicitly.
The packet size for the nemo and puck backends happens to be identical.
But the value for the nemo backend is truly fixed, while the value for
the puck backend can be adjusted. To avoid breaking the nemo backend
when changing the default value, we redefine the packet size explicitly
to the correct value.
2011-11-11 10:42:39 +01:00
Jef Driesen
474336a587 Move the low-level communication to the common layer. 2011-11-11 10:42:39 +01:00
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