578 Commits

Author SHA1 Message Date
Jef Driesen
c3ea5a16e4 Release version 0.1.0 v0.1.0 2012-04-27 23:33:57 +02:00
Jef Driesen
b567f0774c Add a README file. 2012-04-27 23:28:42 +02:00
Jef Driesen
ec6795cbf3 Fix the Oceanic Veo 1.0 layout descriptor. 2012-04-24 19:31:39 +02:00
Jef Driesen
94b4ee368a Add partial support for the Oceanic Veo 1.0
The Veo 1.0 has very limited memory and doesn't have a logbook and
profile ringbuffer. Hence downloading dives isn't really supported, but
even this limited amount of data might be useful for someone.
2012-04-23 22:04:23 +02:00
Jef Driesen
0a6e0d93a8 Add support for the Aeris F10. 2012-04-23 21:37:02 +02:00
Jef Driesen
5ae0e37d1f Remove the hardcoded logbook entry size. 2012-04-23 21:37:02 +02:00
Jef Driesen
1faea84b5b Fix the gas mix parsing for the Oceanic VT 4.x. 2012-04-23 21:37:02 +02:00
Jef Driesen
2fe695d38e Adjust the header size calculations. 2012-04-23 21:37:01 +02:00
Jef Driesen
414a8053d5 Allow easier disabling of the tank switch and surface samples. 2012-04-23 21:37:01 +02:00
Jef Driesen
2897d1079a Allow easier disabling of the individual sample types. 2012-04-23 21:36:52 +02:00
Jef Driesen
6c2014732a Fix the gas mix parsing for the Aeris CompuMask. 2012-04-22 22:33:52 +02:00
Jef Driesen
5126ef389a Add support for the Oceanic Atom 3.1 2012-04-15 09:45:31 +02:00
Jef Driesen
a5f8c8cfff Add a small delay before flushing the serial line.
Sometimes there are a few garbages bytes received before the preamble
bytes. This typically happens when trying to download again after a
failed attempt. However trying to flush them immediately after opening
the serial port doesn't work.
2012-04-14 07:48:13 +02:00
Jef Driesen
8cec4d0a42 Increase the read timeout to 4 seconds.
When the OSTC receives the download dives command, it responds
immediately with the preamble bytes. But then it does a linear search
through its internal memory to locate the end-of-profile marker. As a
result the response time increases when the marker is located near the
end of the memory area. In the worst case scenario, the response time
can exceed the 3 second read timeout with a few milliseconds.

Since the required timeout depends on the total amount of profile
memory, this problem was indirectly introduced with firmware v1.91,
which doubled the amount of profile memory from 32K to 64K.
2012-04-14 07:46:50 +02:00
Jef Driesen
a2f4f1cd3f Replace the fixed delay with the new half-duplex emulation code. 2012-04-10 21:31:46 +02:00
Jef Driesen
b6d24e72e2 Add support for half-duplex emulation.
When using half-duplex communication (e.g. only a single wire for both
Tx and Rx) a data packet needs to be transmitted entirely before
attempting to switch into receiving mode.

For legacy serial hardware, the tcdrain() probably works as advertised,
and waits until the data has been transmitted. However for common
usb-serial converters, the hardware doesn't provide any feedback to the
driver, and the tcdrain() function can only wait until the data has been
transmitted to the usb-serial chip. There is no guarantee that the data
has actually been transmitted by the usb-serial chip.

As a workaround, we wait at least the minimum amount of time required to
transmit the data packet over a serial line, taking into account the
current configuration.
2012-04-10 21:31:31 +02:00
Jef Driesen
3c07a3017f Integrate the tcdrain() call into the write function. 2012-04-10 21:30:39 +02:00
Jef Driesen
060cc95d5c Substract the dive time from the date/time value.
The OSTC doesn't store the start of the dive, but the exit time. Hence
the dive time needs to be substracted.

For dives with format version 0x21, we prefer the total dive time in
seconds stored in the extended header. This time value also includes the
shallow parts of the dive, and therefore yields the most accurate start
time. The dive time is rounded down towards the nearest minute, to match
the value displayed by the ostc. For dives with the older format version
0x20, this value isn't available and we default to the normal dive time.
2012-04-10 21:21:52 +02:00
Jef Driesen
90a8452788 Add a wrapper for the mktime function. 2012-04-10 21:21:52 +02:00
Jef Driesen
bb4a498302 Fix the freedive mode detection for the Mares Puck Air. 2012-04-10 20:53:38 +02:00
Khalid El Fathi
3882827736 Spelling correction. 2012-04-05 20:21:23 +02:00
Björn Spruck
0f83d6ae23 Add support for parsing the events.
The event bits have been verified for a Mares M1 only.
2012-03-30 20:36:21 +02:00
Björn Spruck
407c40ed38 Fix the oxygen percentage for air dives.
When the dive mode setting is set to air, the oxygen percentage stored
in the header is different from the expected 21%. It might be the last
used nitrox percentage.
2012-03-29 21:41:41 +02:00
Jef Driesen
45c0750631 Adjust the profile ringbuffer to exclude the last 512 bytes. 2012-03-22 22:22:59 +01:00
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