1933 Commits

Author SHA1 Message Date
Linus Torvalds
39dbb275cc Merge git://github.com/libdivecomputer/libdivecomputer into Subsurface-DS9
Merge Jef's upstream into the Subsurface branch:

 - support for new dive computers: Mares Pick Pro+, Deep Six Excursion,
   Crest CR-4, Genesis Centauri and Tusa TC1.

 - support freedive mode on Mares Smart Air

 - work with Oceanic dive computers regardless of whether they need the
   BLE handshake or not

 - OSTC updates: support bigger BLE packets in newer versions, fix
   setpoint in SCR mode

 - Shearwater updates: full dive mode parsing, correct timezone handling
   on Teric, support up to four transmitters on newer log versions.

* git://github.com/libdivecomputer/libdivecomputer: (26 commits)
  Read the extra tank information
  Add support for transmitter T3 and T4
  Limit the number of records for the Predator
  Report the timezone offset for the Teric
  Use the correct model number from the final block
  Use the dive mode stored in the header
  Report the correct dive mode for SCR dives
  Increase the size of the BLE packet cache
  Add support for the Genesis Centauri and Tusa TC1
  Read the hardware and software version
  Report the initial setpoint in SCR mode
  Add the divemode to the layout descriptor
  Re-order the fields in the layout descriptor
  Show the correct help message for the scan command
  Add support for the Crest CR-4
  Add udev rule for the Suunto EON Steel Black
  Ignore unsupported BLE handshake
  Detect NAK response packets
  Remove the initial gas switch
  Restore the original standard gravity factor
  ...
v5.0.8 v5.0.7
2022-02-27 12:20:09 -08:00
Jef Driesen
bedd6180f1 Merge branch 'shearwater' 2022-02-27 11:55:10 +01: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
Jef Driesen
7a650f940c Add support for transmitter T3 and T4
In recent firmware versions (log version 13), Shearwater added support
for two more tank transmittors: T3 and T4.
2022-02-27 11:48:41 +01:00
Jef Driesen
86e1d59a6a Limit the number of records for the Predator
In the older Predator-like data format, the 4th opening/closing record
is the last one. To avoid accidental use of the higher ones, leave them
undefined.
2022-02-27 11:47:13 +01:00
Jef Driesen
54fa676e75 Report the timezone offset for the Teric
The Shearwater Teric supports a UTC offset and DST setting.
2022-02-27 11:46:51 +01:00
Jef Driesen
d1242a28cf Use the correct model number from the final block
During the download, the model number is obtained from the hardware type
because the model number isn't available before downloading the first
dive. Since the list with available hardware types is incomplete, the
correct model number is not always available. However, during parsing
the correct model number is available in the final block.
2022-02-27 11:45:26 +01:00
Jef Driesen
ccd37d4fa3 Use the dive mode stored in the header
Starting with log version 8, the dive mode is stored in one of the
opening records. For backwards compatibility with older firmware
versions, the autodetection based on the status field in the sample data
is kept as a fallback mechanism.
2022-02-27 11:44:58 +01:00
Jef Driesen
811a9b4f89 Report the correct dive mode for SCR dives
The status field contains an extra bit for SCR dives, so there is no
reason to report them as CCR dives.
2022-02-18 13:54:22 +01:00
Jef Driesen
2794f96e47 Increase the size of the BLE packet cache
In the latest OSTC hardware, the Telit/Stollman bluetooth module has
been replaced with a u-Blox Nina B2 bluetooth module. This new module
supports BLE data packets of up to 244 bytes (corresponding to an ATT
MTU of 247 bytes and a LL PDU payload size of 251 bytes).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-14 12:39:40 -08:00
Jef Driesen
d960a37e12 Increase the size of the BLE packet cache
In the latest OSTC hardware, the Telit/Stollman bluetooth module has
been replaced with a u-Blox Nina B2 bluetooth module. This new module
supports BLE data packets of up to 244 bytes (corresponding to an ATT
MTU of 247 bytes and a LL PDU payload size of 251 bytes).
2022-01-31 14:06:17 +01:00
Jef Driesen
17bc0faa51 Restore the original standard gravity factor
The Uwatec/Scubapro dive computers are confirmed to internally use the
approximated standard gravity (10.0 m/s²) for the depth conversion.
Allthough this is technically wrong, users expect to get the same depth
values as their dive computer shows.

This partially reverts commit cfc9ddc380bdc5616893fc2af4e05204b5500ea2.
v5.0.6
2022-01-10 13:40:13 -08:00
Jef Driesen
f6df075d51 Add support for the Genesis Centauri and Tusa TC1
Both models are compatible with the Deep Six Excursion.
2022-01-03 16:09:37 +01:00
Jef Driesen
c5dced237a Read the hardware and software version 2022-01-03 15:58:33 +01:00
Jef Driesen
c9c441b8bb Merge branch 'ostc' 2022-01-03 15:55:40 +01:00
Jef Driesen
5e2d376627 Report the initial setpoint in SCR mode 2022-01-03 15:54:49 +01:00
Jef Driesen
16e49eee6d Add the divemode to the layout descriptor 2022-01-03 15:54:49 +01:00
Jef Driesen
70411048e5 Re-order the fields in the layout descriptor
The new order of the fields matches the physical memory layout more
closely.
2022-01-03 15:54:39 +01:00
Jef Driesen
331bcbdaf7 Show the correct help message for the scan command 2021-12-13 08:46:09 +01:00
Jef Driesen
af03e39383 Add support for the Crest CR-4
The Crest CR-4 is compatible with the Deep Six Excursion.
2021-11-19 08:26:19 +01:00
Michael Andreen
93fe31eef5 Garmin: Fix gas change event parsing
The gas mixes are numbered from 0 and up and the gas change event uses
this number directly, so no need to subtract one.

Signed-off-by: Michael Andreen <michael@andreen.dev>
2021-11-17 11:58:14 +01:00
Jef Driesen
b2040d9adb Add udev rule for the Suunto EON Steel Black 2021-11-16 14:04:45 +01:00
Jef Driesen
cadbffe416 Merge branch 'oceanic-ble-handshake' 2021-10-20 15:04:26 +02:00
Jef Driesen
cd0f42804a Ignore unsupported BLE handshake
For some BLE enabled models, like the Oceanic Pro Plus X, Aqualung
i750TC, Sherwood Sage and Sherwood Beacon, the BLE handshake command
is not supported and therefore disabled.

However, based on a bug report by a user with two Aqualung i770R dive
computers, this detection mechanism based on the dive computer model
number isn't sufficient. Allthough the two devices have the exact same
firmware version (2A), the handshake command only works on the newest
unit, and fails with a NAK response on the oldest unit.

Remove the model based detection and always try to send the handshake
command and rely on the NAK response to ignore the failure instead. An
additional advantage is that we no longer have to (manually) maintain a
list with the model numbers where the handshaking is known to fail.
2021-10-20 15:02:57 +02:00
Jef Driesen
ba4a119a4f Detect NAK response packets
When the dive computer receives a command it doesn't support, it sends
back a single byte NAK (0xA5) packet instead of the expected ACK byte
(0x5A) at the start of the packet. Retrying is pointless in this case,
because the next attempt will also fail. Instead, return immediately
with an appropriate error code, and let the upper layers handle the
unsupported command.

Note that the detection is currently only enabled for BLE communication.
2021-10-20 15:02:34 +02:00
Jef Driesen
9ff6e5caad Remove the initial gas switch
The Cressi Drake is a freedive computer and does not support gas
switches.
2021-10-13 11:06:26 +02:00
Jef Driesen
a8bcfb998b Restore the original standard gravity factor
The Uwatec/Scubapro dive computers are confirmed to internally use the
approximated standard gravity (10.0 m/s²) for the depth conversion.
Allthough this is technically wrong, users expect to get the same depth
values as their dive computer shows.

This partially reverts commit cfc9ddc380bdc5616893fc2af4e05204b5500ea2.
2021-10-03 11:37:59 +02:00
Jef Driesen
1c39c68203 Add support for the Mares Puck Pro +
The Mares Puck Pro + is compatible with the previous Puck Pro. Both
models can't even be distinguished because they share the same model
number and use the same product name in the version packet.
2021-09-28 12:14:10 +02:00
Jef Driesen
0a9b8b1318 Merge branch 'smartair-freedives' 2021-09-14 21:34:01 +02:00
Jef Driesen
7e075eb959 Add support for Mares Smart Air freedives
The Mares Smart Air supports a freedive mode, which uses a different
data format compared to the scuba dives.
2021-09-14 21:33:47 +02:00
Jef Driesen
e52468e0c3 Use a layout descriptor
Replace hardcoded constants with a layout descriptor. This reduces the
amount of model specific conditions, and makes it easier to add support
for new models.
2021-09-14 21:32:48 +02:00
Jef Driesen
1a4798792e Use the divetime stored in the header
There is no need to calculate the total time from the pseudo profile,
because the dive time is also stored in the header.
2021-09-14 21:32:48 +02:00
Jef Driesen
c4b694fdb1 Fix the salinity parsing
The parser->mode field is only initialized at the end of the function.
The result is that the current code always used the default value
(zero). Inside the function itself, the local variable should be used
instead.
2021-09-14 21:32:31 +02:00
Linus Torvalds
b6df353752 Merge branch 'master' of git://github.com/libdivecomputer/libdivecomputer into Subsurface-DS9
Merge upstream libdivecomputer updates by Jef Driesen.

Minor fixups, and add ID for Cressi Neon.

* git://github.com/libdivecomputer/libdivecomputer:
  Add support for the Cressi Neon
  Use symbolic constant for invalid value
  Remove duplicate macro definition
  Add BLE support for the Aqualung i750TC
  Exclude the surface time from the dive time
v5.0.5 v5.0.4 v5.0.3
2021-08-20 18:28:23 -07:00
Linus Torvalds
6e40a457f3 Remove MSVC build instructions from github workflows
MSVC isn't a supported target for subsurface - the Windows build is
cross-compiled, not native.  And MSVC is actively user-hostile, with
insane errors and warnings.

In particular, MSVC doesn't like "strdup()", and suggests you use the
nonstandard _strdup() instead.  Which is all kinds of wrong, and seems
to be a "let's use strict POSIX namespace rules as an excuse to make
people write less portable code".

There is probably some flag to make the MSVC compiler happy with sane
code, but it's easier to just disable the insanity entirely.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-20 18:20:18 -07:00
Linus Torvalds
a282ae0b29
Merge pull request #29 from subsurface/moreSerial
Add more serial numbers
2021-08-20 17:08:52 -07:00
Dirk Hohndel
3057ac79c2 Mares Icon HD protocol: add serial as string
I verified that the unsigned integer in the devinfo header actually matches the
serial number shown in the "About" dialog on the device - so let's add this as
extra data string and make it user visible (and also allow Mares Icon HD style
devices to be reliably distinguished in Subsurface).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 11:03:12 -07:00
Dirk Hohndel
f2cc4ab7ef Suunto Vyper protocol: add serial as string
I verified that the unsigned integer in the devinfo header actually matches the
serial number printed on the device - so let's add this as extra data string
and make it user visible (and also allow Suunto Vyper style devices to be
reliably distinguished in Subsurface).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 11:01:30 -07:00
Ryan Gardner
75f260a941 Add support for the Deep Six Excursion
Based on original work and code by Ryan Gardner, with some additional
improvements and integration into libdivecomputer by Jef Driesen.
2021-08-17 22:38:53 +02:00
Linus Torvalds
643b4271f6 EON Steel: support new gas change data from newer firmware
It seems that Suunto extended the gas change information in FW 2.5, and
added events and fields for when you create and delete gas mixes under
water.

The parses the relevant new information to get gas switches working
again, and to also add the information about gas creation and deletion
events.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-17 08:14:40 -10:00
Jef Driesen
e0409a9496 Add support for the Cressi Neon
The Cressi Neon appears to be compatible with the Goa and Cartesio, with
just a different model number.
2021-08-17 17:53:16 +02:00
Jef Driesen
70d3cdcc08 Use symbolic constant for invalid value 2021-08-16 15:26:45 +02:00
Linus Torvalds
e7da5acff3 Garmin: add extra-info for serial number and firmware version
In proper string format that matches what the Garmin reports on the
"About" screen.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-15 16:40:02 -10:00
Jef Driesen
03974481b0 Remove duplicate macro definition 2021-08-09 10:04:17 +02:00
Jef Driesen
58d410b1a2 Add BLE support for the Aqualung i750TC
The Aqualung i750TC supports BLE, but the BLE handshaking fails and
needs to be disabled.
2021-08-08 20:34:49 +02:00
Jef Driesen
38bd51e63a Exclude the surface time from the dive time
Like most dive commputers, the Mares Genius uses a surface timeout to
detect the end of the dive. But since there is no explicit dive time
field stored, the total dive time is based on the number of samples,
which includes this surface time at the end of the dive. However, the
dive time displayed by the dive computer (and also the Mares
DiveOrganizer application) does not include this surface time.

For older firmware versions the value is hardcoded to 3 minutes, but
starting with the newer v01.02.00 firmware the value is configurable and
stored in the settings. To detect whether the setting is available, we
need to check the profile version instead of the header version. That's
because the header appears to be generated on-the-fly during the
download, and thus the header version also changes for dives recorded
prior to the firmware update.

For all other models, also take into account a hardcoded timeout of 3
minutes.
2021-07-26 17:20:16 +02:00
Linus Torvalds
2ef285faf3 Merge branch 'crashFix' of https://github.com/subsurface/libdc into Subsurface-DS9
Merge mtp_device cleanup from Dirk Hohndel.

* 'crashFix' of https://github.com/subsurface/libdc:
  cleanup: ensure mtp_device field is 0
2021-07-19 14:37:46 -07:00
Linus Torvalds
3e87ed050c Merge branch 'master' of git://github.com/libdivecomputer/libdivecomputer into Subsurface-DS9
Merge upstream libdivecomputer updates by Jef Driesen:

 - fix HW Sport and Mares Genius firmware update

 - Windows Visual Studio build updates

 - Various parser updates:
    - sporasub depth, salinity and sample rate parsing
    - Atomics Cobalt atmospheric pressure parsing
    - unit cleanups (Uwatec, McLean Extreme)

* git://github.com/libdivecomputer/libdivecomputer:
  Some more fixes for the new Mares Genius firmware
  Implement the salinity field
  Fix the sample rate parsing
  Add support for the new Mares Genius firmware
  Use the correct standard gravity factor
  Use SI units internally
  Fix negative depth values
  Move the unit conversion to the last moment
  Implement the atmospheric pressure field
  Always use the stored atmospheric pressure
  Add a CI job to build with Visual Studio
  Migrate to Visual Studio 2013 (or newer)
  Emit events when downloading a memory dump
  Fix the depth decoding
  Add library dependencies in windows build
  Fix the hwOS Sport firmware upgrade
  Post release version bump to 0.8.0
2021-07-19 14:30:55 -07:00
Jef Driesen
927362354d Some more fixes for the new Mares Genius firmware
The changes in commit 5cb527d53ca88ac692beb55288172fc1003975fa to
support the new Mares Genius firmware v01.02.00 were incomplete.

For dives recorded prior to the firmware upgrade, only the header
version changed from 0.0 to 1.1, while the profile version remained the
same. But for dives recorded after the firmware upgrade, the profile
version also changed from 0.2 to 1.0.

The known header and profile object versions (indicated as
type.major.minor) are now:

  Model   | Firmware | Header | Profile
  ========|==========|========|=========
  Genius  | 1.0.x    | 1.0.0  | 0.0.2
  Genius  | 1.2.0    | 1.1.1  | 0.1.0
  Horizon | 1.7.28   | 1.0.1  | 1.0.2

To simplify the object version check, all versions below a certain upper
limit are now considered supported.
2021-07-13 22:45:40 +02:00
Jef Driesen
5bb6257acb Implement the salinity field
The 4th bit of the settings byte contains the salinity setting (salt or
fresh water).
2021-07-13 00:00:26 +02:00