Merge upstream libdivecomputer updates from Jef:
- Add support for the Aqualung i550C
- Update Ratio iX3M GPS naming and note that they support rfcomm
- misc cleanups
* 'master' of git://github.com/libdivecomputer/libdivecomputer:
Add support for the Aqualung i550C
Enable bluetooth support for the Ratio iX3M GPS
Update the naming of the Ratio iX3M GPS range
Mark the string tables as constant
Refactor the filter functions
Merge upstream libdivecomputer updates from Jef:
- Support the new versions of the Mares Genius with more memory
- misc small fixes (Pelagic/atom2 tank pressure fix, proper error
codes, license info for AES code)
* git://github.com/libdivecomputer/libdivecomputer:
Fix the tank pressure reporting
Return the correct error code
Add support for the Mares Genius
Simplify the detection of air integrated models
Refactor the gas mix and tank parsing
Refactor the date/time parsing
Replace the header offset with the header size
Use symbolic constants for the commands
Add license information to the AES code
Update the udev rules
A small typo introduced with the Tusa Talis support in commit
b188c414206daaa5b6de464ced98d78f6da7cde1 accidentally disabled the tank
pressure reporting for all models.
The Mares Genius supports a new command to download different types of
objects (e.g. dive header, dive profiles, etc) directly, without needing
to manually read and parse the contents of the flash memory.
The data structure also changed significantly. The profile data is now
organized into different records. Each record starts and ends with a 4
byte ascii marker:
DSTR: Dive start record
TISS: Tissue record
DPRS: Sample record
AIRS: Air integration record
DEND: Dive end record
and contains a CRC checksum. The contents of the records remains very
similar to the existing iconhd data format.
Based-on-code-by: Janice McLaughlin <janice@moremobilesoftware.com>
Split the offset calculation in two steps: first the offset to the
header data, and then the date/time field. The main advantage is that
the resulting code now follows the same logic as in the other functions.
The Mares Genius dive header is no longer located at the end of the data
(after the dive profile), but at the start. Therefore we don't need the
offset to the dive header anymore. Replace with the size of the header
instead.
The two byte commands are in fact a single byte command. The second byte
is some kind of checksum, containing the command byte xor'ed with the
value 0xA5.
It turns out that it's fairly common that people pass in the wrong
directory for the Garmin downloader, and we then just silently fail to
parse any dives because we don't find anything. The resulting logs
don't make it obvious what went wrong.
So add some informational messages about what directory we actually
tried to open, and what files we've found (and why we possibly ignored
them).
We already had this for some cases (like "This doesn't look lik ea dive
file"), but not for the more fundamental issues of not finding files to
begin with.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There's a new dive computer in town: the Oceanic Geo 4.0. It looks like
it should support BLE, and is probably fairly similar to the Pro Plus X.
Or so this initial support trial just assumes.
I don't have the version string for this device yet, so that hasn't been
added at all. A full dump is required, the initial report only (almost
accidentally) gave the model numbers thanks to the BLE scan data.
Reported-by: George Rocks <jrroques2004@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge Jef's upstream updates.
Trivial conflicts just because of whitespace differences and a comment
difference in our Suunto D5 support changes.
* git://github.com/libdivecomputer/libdivecomputer:
Add support for the Suunto D5
Add support for the Tusa Talis
Add the G2 HUD bluetooth device name
Detect Mares Quad with more flash memory
Fix the limit for an invalid sample temperature
Fix a buffer overflow
The latest variant of the Mares Quad has 4 times more flash memory
compared to the original variant (1M vs 256K). Therefore this variant
supports a new command to read the size of the flash memory.
At the moment, it's unknown whether the previous variant also supports
this new command or not. Probably not, because none of the other
compatible models seems to support it either. Hence we only attempt to
read the flash memory size for the Quad, and a failure is not considered
a fatal error. The disadvantage of this approach is that a temporary
communication problem can result in a misdetection of the flash memory
size.
Reported-by: Janice McLaughlin <janice@moremobilesoftware.com>
In the EON Steel descriptor for the temperature field, the "nillable"
value is -3000:
int16,precision=2,nillable=-3000
So the missing equals sign is just a small oversight.
It looks just like a small-form-factor EON Steel/Core, just with new
device IDs.
I haven't been able to pair over BLE yet, but that may be the usual
"Suunto wants to do a private bonded pairing" thing that makes it a pain
on the desktop.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The length field in the data is checked for the maximum size (e.g. the
size of the buffer), but there is no such check on the minimum size
(e.g. the size of the header). If the length is smaller, the code
accessed data before the start of the buffer.
I incorrectly thought it was already sorted in the directory listing,
but once the dive list start overflowing, it looks like the ordering
goes away.
So sort the dives explicitly by date, rather than depend on any existing
ordering when reading the list of dives.
Reported-by: PM <boesch76@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We used to require that we have one of the documented dive types in the
'sub_sport' type field. But apparently Garmin added a new type number
for CCR diving, so CCR dives weren't recognized at all.
Add the new CCR case, but also say that if we have seen a DIVE_SUMMARY
record with average depth information, we'll just assume it's a dive
even for unrecognized sub_sport numbers.
Reported-by: Thomas Jacob <opiffe@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Pull upstream updates from Jef Driesen.
This adds ID entries for the Scubapro G2 HUD (but no GPS parsing support
yet) and the Aladin H Matric.
Also fix ndl/deco parsing for for Aqualung i450T.
* git://github.com/libdivecomputer/libdivecomputer:
Fix the ndl/deco sample for the Aqualung i450T
Add support for the Scubapro G2 HUD
Add support for the Scubapro Aladin H Matrix
Merge upstream updates from Jef:
- better Mares Bluelink Pro downloading
- Suunto DX CCR and gas mix fixes
* 'master' of git://github.com/libdivecomputer/libdivecomputer:
Add support for the Mares Bluelink Pro interface
Check the correct vtable pointer
Report the setpoint data
Take the CCR diluents into account
Implement the initial gas mix
Get the gas mix index directly from the event data
The main difference with the serial communication is that the BLE
communication uses data packets (with a maximum size of 20 bytes)
instead of a continuous data stream.
Occasionally, the device responds with an empty packet (with just the
ACK and EOF byte) or with a short packet where one or more payload bytes
are missing. The empty packet is most likely caused because the device
didn't receive the second part of the command (with the parameters) in
time. The missing bytes might be caused by a buffer overflow on the
Bluelink Pro, when the data from the dive computer arrives faster over
the serial link than the device can forward it over the slower bluetooth
link to the host system.
One way to address this problem is to lower the packet size from 256 bytes
to only 128 bytes. The main disadvantage is that this also impacts the
download speed considerably. In one particular example, the total
download time increased from about 135 to 210 seconds (which is already
slow compared to the 62 seconds the same download takes over usb)!
An alternative solution is to simply retry the failed command. That way
there is only a performance penalty for the few bad packets, and not for
every single packet. In the above example, only two packets needed a
retransmission.
Note that the iconhd communication protocol uses no checksums. Hence
it's not possible to detect corrupt data packets. Only short packets can
be detected, because they result in a timeout.
The Suunto DX supports 3 CCR diluents and 8 OC gas mixes. Since the gas
mix index in the data is relative to either the set of CCR diluents or
OC gas mixes (depending on the dive mode) and libdivecomputer reports
both sets, the index needs to be adjusted.
There is no need to lookup the gas mix index, because the number is
stored directly in the event data, right next to the oxygen and helium
values. This actually removes an ambiguity in cases where the user has
configured two or more identical gas mixes. In that case, the lookup
would always find the first gas mix.
This logs every INFO_EVENT record and provides a SAMPLE_EVENT_BOOKMARK event for
the only INFO_EVENT we can parse so far, the TAG event. Three bits in the flag
value in that event structure are now used to hold the tag type, and if a
non-zero type has been set, then the value is the heading in degress.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge with upstream from Jef:
- ignore empty pressure samples from OSTC
- skip empty Oceanic logbook entries
- update Ratio parsing
* 'master' of git://github.com/libdivecomputer/libdivecomputer:
Ignore zero tank pressure values
Add filters for BLE communication
Skip empty logbook entries
Add clock synchronization support
Use symbolic constants for the commands
Don't pass a NULL pointer to memcpy
Update the list of the Ratio dive computers
This re-applied commit 902dbf4d6d24 ("shearwater: Fallback to
average/voted ppo2") which got lost in the last merge with upstream when
I synced with Jef's rewrite of the PNF parser.
Reported-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
On certain devices, for example the Aeris Elite T3, the logbook
ringbuffer can sometimes contain an empty logbook entry in between the
valid entries. Because the presence of such an empty entry is currently
being interpreted as having reached the last valid entry, the download
is aborted. The result is that all remaining valid entries, located
after the empty entry, can't be downloaded.
This can be avoided by skipping the empty entry instead of aborting the
download.
The Ratio dive computers support synchronizing the internal clock. One
complication is that recent firmware versions (4.0.56 or 4.1.10) support
two timezones (home and abroad), while the libdivecomputer api only
supports one timezone. To deal with this, the most recent firmware
versions (4.0.58 or 4.1.12) will interprete an invalid timezone index
(0xFF) as leaving the timezone unchanged.
If the firmware doesn't support the dual timezone command, or if the
firmware doesn't have the invalid timezone index modification yet, then
a fallback to the single timezone command is provided. Note that in the
latter case the side effect is that both timezones will be changed!