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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.