64 Commits

Author SHA1 Message Date
Jef Driesen
8735071fac Use a more efficient download algorithm
The current algorithm always downloads a full memory dump, and extracts
the dives afterwards. For the typical scenario where only a few dives
are being downloaded, this is inefficient because most of the data isn't
needed. This can easily be avoided by downloading the data on the fly.
2017-02-27 08:20:49 +01:00
Jef Driesen
07dcc8998b Add support for the Cressi Drake
The Cressi Drake is a mainly a freedive computer. The data format is
almost identical to the Leonardo. The main difference is that a single
dive now contains an entire freedive session. Each freedive in the
session is delimited with a 4 byte header containing the surface
interval and a special marker.
2016-12-30 22:25:14 +01:00
Jef Driesen
7714a57c44 Add missing header files to the Makefiles.
To be able to generate a distribution tarball, all files need to be
listed explicitely.
2016-09-28 14:49:52 +02:00
Jef Driesen
2829f7ebf9 Add an ostc3 specific function with the model number.
To be able to pass the OSTC 3 model number to the parser, and preserve
backwards compatibility, we need a new function. The new function should
also be used for the Frog, by passing zero as the model number.

Using the hw_ostc_parser_create() function with the hwos parameter set
to one, is now deprecated but will remain supported for backwards
compatibility.
2016-07-23 23:14:13 +02:00
Jef Driesen
29caab0673 Rename the frog parameter and field to hwos.
The frog parameter and field are not only used for the Frog, but also
for all hwOS based models. Therefore, using the more generic hwos as the
name is more meaningful.
2016-07-23 23:11:30 +02:00
Jef Driesen
ad2257569c Add a new dc_parser_new2 convenience function.
For applications supporting offline parsing (like libdivecomputer's own
dctool application), some device specific knowledge is still required in
order to map a particular model to the corresponding backend. The new
convenience function will take care of that internally.

The already existing dc_parser_new() function does the same, but
requires an open device handle, which makes it unsuitable for offline
parsing.
2016-07-22 21:14:33 +02:00
Jef Driesen
b41ecd0c15 Add a parameter with the model number. 2016-07-11 21:47:29 +02:00
John Van Ostrand
9a4e2b75a5 Add support for the Cochran Commander and EMC. 2016-03-22 20:09:45 +01:00
Jef Driesen
06e0de6712 Add a new sample with the active gas mix.
The new gasmix sample contains the index of the active gas mix.

This new sample is intended as a replacement for the existing gas change
events (SAMPLE_EVENT_GASCHANGE and SAMPLE_EVENT_GASCHANGE2). To maintain
backwards compatibility, the legacy events are marked as deprecated but
not removed yet.
2015-12-21 14:03:39 +01:00
Jef Driesen
5c6c4cccc7 Add support for the DiveSystem iX3M series.
The protocol of the iX3M series is almost identical to the protocol of
the iDive series. The main difference is that the command bytes and the
size of the response packets have been changed. In order to be able to
communicate with the correct set of commands, the user needs to supply
the correct number now. To maintain backwards compatibility, a new
variant of the open function is added.
2015-12-14 12:23:31 +01:00
Anton Lundin
ab92043dc3 Remove removed function from public header
reefnet_sensusultra_device_set_maxretries was killed off back in v0.3,
but was still lying around in the public header.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2015-06-26 09:59:24 +02:00
Jef Driesen
3b264d9cfd Add support for the new hardware descriptor.
The latest firmware v1.75 introduced a new hardware descriptor byte to
identify the different models based on their hardware features. This new
hardware descriptor is now used as the libdivecomputer model number. For
older firmware versions, which do not support the descriptor yet, there
is an automatic fallback to the previous method based on the serial
number.
2015-03-06 21:45:02 +01:00
Jef Driesen
4dfca21a2b Pass the model number to the open function.
This change will be necessary for the Oceanic VTX, because it uses a
higher baudrate.

To maintain backwards compatibility, the existing function remains
unchanged and a new function is introduced instead.
2015-02-19 13:47:25 +01:00
Jef Driesen
87e6940572 Add support for the DiveSystem iDive and Orca. 2014-12-29 10:09:34 +01:00
Anton Lundin
02d8c0f04a Firmware upgrade for OSTC3
This connects the bits and implements firmware upgrade for the OSTC3.

This code is inspired by JeanDo ostc-companion.

Reviewed-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2014-12-21 15:02:08 +01:00
Jef Driesen
598377ec44 Add support for the Citizen Hyper Aqualand. 2014-11-30 15:30:16 +01:00
Jef Driesen
686500d51b Follow the libdivecomputer naming conventions.
All entry point functions (e.g. public functions or functions called
through the vtable) use the backend name as the prefix. The same applies
to the main device and parser structures.
2014-11-24 11:37:24 +01:00
Linus Torvalds
5c967f3382 Suunto EON Steel: support downloading of core dive profile data
Basic Suunto EON Steel downloading copied from my test application.
This parses all the core dive data, including sample data (time, depth,
cylinder pressure, deco information etc).

The deco information returns ceiling and TTS rather than ceiling and
"time at ceiling", because that's what the dive computer has, and I
don't see any other way to return the information.

We don't report any events yet, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-11-24 11:37:23 +01:00
Jef Driesen
b2bc231cb4 Convert imperial tank volume to the metric system.
There are two different ways to specify the volume of a tank. In the
metric system, the tank volume is specified as the water capacity, while
in the imperial system the tank volume is specified as the air capacity
at the surface (1 ATM) when the tank is filled at its working pressure.

To avoid mistakes, the tank volume is now always returned as the metric
volume. For imperial tanks, the tank volume is converted to the metric
representation.
2014-11-13 13:13:07 +01:00
Jef Driesen
651123de53 Add support for parsing the dive mode. 2014-11-07 22:04:16 +01:00
Jef Driesen
11cafbaf5f Implement tank support for the Atomic Cobalt. 2014-11-07 22:00:07 +01:00
Jef Driesen
8f9878a1c0 Add support for parsing tank data in the dive header. 2014-11-07 22:00:07 +01:00
Jef Driesen
693a452250 Extend temperature with surface, min and max values. 2014-11-07 21:58:49 +01:00
Calle Gunnarsson
cdbc0cd9bd Added support for parsing temperature in the dive header
Devices that only reports a single temperature in the header
will now be able to report it as well when they implement this.

Signed-off-by: Calle Gunnarsson <calle.gunnarsson@gmail.com>
2014-11-07 21:58:49 +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
56e2dec726 Add support for configuring the OSTC3 settings.
Starting with firmware v1.23, the OSTC3 settings can be configured
through the USB interface. There are new commands for reading, writing
and restoring the settings to their default values.
2014-03-04 20:10:43 +01:00
Jef Driesen
56aa3b6669 Merge branch 'release-0.4'
Integrate the bugfixes from the stable branch.
2014-02-06 20:31:27 +01:00
Jef Driesen
3f7af8c349 Add support for the Dive Rite NiTek Q. 2014-02-06 09:42:06 +01:00
Jef Driesen
c524986175 Add support for the Scubapro/Uwatec Meridian.
The Uwatec Meridian protocol is identical to the Uwatec Smart/Galileo
protocol, except for some additional framing around each data packet,
and the switch from IrDA to usb-serial communication. For parsing, the
data format appears to be identical to the Galileo data format.
2013-10-19 10:11:15 +02:00
Jef Driesen
14286e8236 Add support for updating the HW OSTC firmware.
Only the bootloader V2 protocol is supported for now.
2013-08-22 09:15:55 +02:00
Michael Andreen
5f8da384e6 Identify event 0x07 on Suunto d9-style computers as Below Floor.
This event is on when accumulating deco time. Once you reach the floor
deco time will start decreasing and the event will stop. Going below the
floor again will re-activate the event.

Signed-off-by: Michael Andreen <harv@ruin.nu>
2013-08-05 23:02:19 +02:00
Jef Driesen
9b65159a57 Mark the dc_datetime_mktime parameter as const.
Unlike the corresponding mktime C library function, the libdivecomputer
function will never modify its argument. By marking the parameter as
const this is made more explicit.
2013-05-23 14:17:41 +02:00
Jef Driesen
b36ed311c5 Add support for the Heinrichs Weikamp OSTC3.
Although the communication protocol of the OSTC3 is nearly identical to
that of the Frog, the different size parameters make it hard to share
the code easily. On top of that, if we ever implement native bluetooth
communication support, we'll need a completely separate backend anyway.
Therefore the Frog backend is simply duplicated, with a few OSTC3
specific changes applied here and there.

The existing ostc parser is upgraded to support the new OSTC3 data
format.
2013-05-07 22:15:53 +02:00
Jef Driesen
4b541d124f Add support for the native Shearwater Petrel protocol.
The Petrel (with updated firmware) supports an enhanced communication
protocol, which is more efficient and powerfull than the legacy Predator
compatibility mode. The new protocol uses data compression for faster
transfers and supports the ability to selectively download individual
dives. Last but not least, the new protocol isn't limited to the last
128kB of logbook data, but can access the full logbook capacity (16MB).
2013-04-19 21:31:28 +02:00
Jef Driesen
d4a8f2eb40 Add support for retrieving the transport type.
With the new interface, an application can easily retrieve the
underlying transport type from the device descriptors and present a
custom user interface element to the end-user for supplying transport
specific parameters. For example the serial port for devices using
serial communcication.

For devices using a usb-serial chipset or the bluetooth Serial Port
Profile (SPP/rfcomm), the transport type is DC_TRANSPORT_SERIAL, because
internally the serial emulation layer is used for the communication.
2013-04-16 20:54:25 +02:00
Jef Driesen
0b20855d56 Add support for the Cressi Leonardo.
This is only a preliminary version. There is certainly some room for
improvement, but the basic functionality is already in place. That
should be sufficient for daily use, and possibles issues can always be
fixed when discovered.
2013-02-04 17:20:23 +01:00
Jef Driesen
380eaadf83 Hardcode the delay between packets.
The application shouldn't have to deal with the delay between packets.
If the default value isn't good enough, that should be fixed internally
and not on the application side.
2013-01-05 10:12:04 +01:00
Jef Driesen
cab84fa2f8 Re-order the constants in the dc_deco_type_t enum.
The SAFETYSTOP is conceptually somewhere in between the NDL and the
DECOSTOP, so it makes sense to re-order the constants in the enum to
reflect this order.
2013-01-02 15:45:06 +01:00
Jef Driesen
56b7730773 Add a new vendor event.
The new vendor event provides a mechanism to deliver auxiliary data,
which is automatically retrieved during the data transfer, but not
accessible through the library interface otherwise. Possible examples
include handshake data and/or device identification data.

This event is mainly intended for diagnostic purposes, in combination
with the memory dumping support. Very few applications will actually
need it for anything else.
2012-12-27 12:10:45 +01:00
Jef Driesen
e9036674e0 Remove the obsolete timestamp functions.
These timestamp functions offer no real advantage and applications
should be using the device independent fingerprint feature instead.
2012-12-23 09:55:29 +01:00
Jef Driesen
3d3c3f6039 Add support for the Mares Nemo Wide 2.
The Nemo Wide 2 uses the same communication protocol as the Icon HD,
except for two differences:

The Nemo Wide 2 requires a different baudrate and parity setting.
Unfortunately it doesn't seem possible to autodetect the correct
protocol variant at runtime. Attempting to proceed with incorrect
settings will render the device unresponsive and requires a battery
reset to recover.Therefore the model code needs to be provided as an
extra parameter, when opening the connection.

The Nemo Wide 2 also appears to have trouble downloading the entire
memory with a single request. Therefore the single large request is
split into many smaller ones. The offical Mares application uses 256
byte packets, and so do we. The Icon HD keeps using the large packets
because they are significant faster.

The extra model parameter breaks backwards compatibility!
2012-12-22 13:46:24 +01:00
Dirk Hohndel
3917ae15b9 Convert decostop / ndl to samples
Having these as events seems less useful since for many dive computers
there are data with every sample - so it makes much more sense to have
these as part of the sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-12-11 20:38:08 +01:00
Dirk Hohndel
f2a656246d Add support for setpoint, ppO2 and CNS
So far only OSTC and Shearwater Predator are supported. For the OSTC we
support CNS and setpoint changes in the samples (the current hardware
doesn't actually support ppO2 sensors and for the older hw that does I
don't have the correct encoding information).

For the Predator we support only the "average ppO2 during the sample".

The Predator also gives us a CNS value at the end of the dive - I don't
quite know yet how to deliver that back to the consumer. Possibly as CNS
value in the very last sample? That would at least be consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-12-10 21:23:48 +01:00
Jef Driesen
500fb1e16b Add support for the Shearwater Predator. 2012-12-05 16:08:47 +01:00
Jef Driesen
e7d5afb1e4 Remove the version function for the Uwatec Smart.
The Uwatec Smart protocol supports reading individual settings. However
the version functions only reads those three values that we use
internally (model, serial number and device clock). That's a very
arbitrary subset and it would be much better to support reading
specific values. But that's something for later...
2012-12-05 16:07:32 +01:00
Jef Driesen
985323eefb Move the version function to the device specific api.
The version function requires device specific knowledge to use it (at
least the required buffer size), it is already called internally when
necessary, and only a few backends support it. Thus there is no good
reason to keep it in the high-level public api.
2012-12-05 16:07:32 +01:00
Jef Driesen
2a9e8c0023 Add some missing size macros.
These size macros are required to use the device specific functions
correctly and should therfore be exposed in the public api.
2012-12-05 16:07:32 +01:00
Jef Driesen
550e37d0b5 Remove the page, packet and memory size macros from the public api.
These macros are used internally and don't need to be exposed. In some
cases, the actual values are not even constant, but dependant on the
model and/or the firmware version.
2012-12-05 16:07:32 +01:00
Jef Driesen
e4b66048a6 Add some documentation for the event values.
For the new packed 16bit event values, some minimal documentation is
required to interpret the value correctly.
2012-11-24 11:44:08 +01:00
Dirk Hohndel
1d360d3a1e This adds support for a subset of the events the OSTC provides.
- PO2 warnings (high and low both mapped to the same SAMPLE_EVENT_PO2
  event)
- SPEED warning (which according to hw isn't emitted at this point)
- Deco stop violations (both deep and regular mapped to same
  SAMPLE_EVENT_CEILING event)
- Deco ceiling and time (this is reported as a series of
  SAMPLE_EVENT_DECOSTOP events with packed deco stop depth (in m) and
  time (in seconds)
  A SAMPLE_EVENT_NDL event (with an optional value indicating the non-stop
  time remaining) indicates that the ceiling has been resolved
- Gas change (reported as SAMPLE_EVENT_GASCHANGE2, using another
  unfortunate O2% / He% semantic that is used in the
  SAMPLE_EVENT_GASCHANGE
  This also covers the manual gas set event of the OSTC
- Manual Marker (reported as SAMPLE_EVENT_BOOKMARK)

The two new events (SAMPLE_EVENT_GASCHANGE2 and SAMPLE_EVENT_NDL are added
to the universal app as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-11-24 11:43:59 +01:00