19 Commits

Author SHA1 Message Date
Jef Driesen
a4cd21b811 Use the GTR mode to detect sidemount tanks
Firmware v84 introduced support for sidemount diving. Users can now
configure the two sidemount tanks as the source for the GTR (Gas Time
Remaining) estimations. We can take advantage of this feature to detect
the sidemount tanks. This is more reliable than using the tank name.
2023-07-18 00:30:06 +02:00
Jef Driesen
86fd58c8c6 Move the sign extension function to a common place 2023-03-23 19:43:16 +01:00
Jef Driesen
86e9cc3443 Add support for the Deepblu Cosmiq+
The Deepblu Cosmiq+ uses a plaintext and line based communication
protocol over BLE, where the binary payload data is encoded as
hexadecimal characters.

Based-on-code-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-01-25 13:32:14 +01:00
Jef Driesen
3ce34a0b6d Add missing functions for accessing big/little endian values
There are functions for reading 8, 16, 24 and 32-bit big and little
endian values, but the corresponding functions for writing such values
are not always available. The 64-bit variants are also missing.
2023-01-25 13:32:14 +01:00
Jef Driesen
8bfb965589 Move the C_ARRAY_SIZE macro to a common place 2022-05-23 12:14:00 +02:00
Jef Driesen
7e3bf7eeb8 Use helper functions to decode multibyte values
Add and use some helper functions for decoding multibyte BCD and binary
encoded values, to remove some code duplication.
2022-05-23 12:00:35 +02:00
Jef Driesen
c6640aa7d3 Read the extra tank information
The latest firmware does store some additional information for each
tank. Right now it's not really used for anything yet, but it's
available for future use.
2022-02-27 11:49:53 +01:00
John Van Ostrand
216e393f43 Add support for Pre-21000 s/n Commander dive computers
This adds support for older Cochran Commander dive computers,
specifically Commanders with serial numbers prior to 21000.

This also renames "Commander" model to "Commander II" and
adds "Commander I" to refer to pre-21000 models.
2017-07-05 13:11:33 +02:00
Jef Driesen
d40cdb4755 Add the devinfo event.
The devinfo event with the device serial number is required for the
fingerprint feature. Without this event, applications won't be able to
load (or save) the correct fingerprint. All necessary information is
already available in the initial handshake packet.
2016-04-26 10:59:02 +02:00
Jef Driesen
311bc85645 Add support for the Tusa IQ-700.
The Tusa IQ-700 is very similar to the other Seiko based models. The
most important change is that due the smaller amount of memory (8K vs
32K), the logbook entries are only 1 byte large instead of two bytes.
2015-04-22 08:25:03 +02:00
Anton Lundin
08dda98c29 Add utility functions to convert uints to bytes
Reviewed-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2014-12-21 15:00:02 +01:00
Florian Klink
fc008312b5 Remove trailing whitespaces
Most of them appear in the disclaimers, but some are in the code as
well.
2014-03-19 09:16:07 +01:00
Jef Driesen
1e4d051b1e Move the bin/hex conversion functions to a common file. 2013-02-04 16:51:30 +01:00
Jef Driesen
97652c6c62 Make the bcd2dec() function available to all backends. 2009-12-08 14:51:32 +00:00
Jef Driesen
421f4ed1d6 Add functions to search for markers in an array. 2009-12-03 12:43:19 +00:00
Jef Driesen
043be07af4 Improve the detection of an empty logbook ringbuffer.
Some devices do not appear to set the ringbuffer pointers to their
normal empty values (e.g. pointing outside the ringbuffer memory). In
that case, there appears to be a single entry. But since that entry
contains uninitialized memory (e.g. all 0xFF bytes), we are able to
detect this special situation.
2009-06-19 08:43:42 +00:00
Jef Driesen
99c3d258d4 Added byte order conversion functions (little and big endian). 2009-03-11 10:18:05 +00:00
Jef Driesen
596af5a17b Add LGPL license headers. 2008-10-05 20:14:18 +00:00
Jef Driesen
5e8d18944a Moved all array reversal functions to a common file. 2008-07-30 09:03:37 +00:00