157 Commits

Author SHA1 Message Date
Linus Torvalds
f107d7c0d8 Add initial Scubapro G2 frontend
The back-end parser seems to be the same as for the Uwatec Smart (aka
Galileo Sol).  At least that's the assumption right now.

The downloader just uses USB HID (very similar to EON Steel) rather than
the horrible IrDA thing.

There's also eventually a BLE thing, but that's for the future.

This is an unholy mixture of the Uwatec Smart downloader logic and the
EON Steel usbhid transfer code.  The back-end is pure Uwatec Smart
(model 0x11, same as Galileo Sol).

I'm not at all sure this gets everything right, but it downloads
*something*.

[Jef Driesen: Renamed the backend to uwatec, and made some smaller
              cosmetic changes to match the existing coding style.]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-06-28 15:32:39 +02:00
Jef Driesen
8952ad0c29 Remove unnecessary include statements 2017-04-13 08:02:11 +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
c8b2d89354 Set the default model number.
When the device family is provided without an explicit model number, we
simply choose the first available model. But since new models are being
added all the time, this default model is not guaranteed to remain the
same. That's not desirable because it can alter the behaviour of the
application.

The introduction of the Aeris 500AI is an example of this problem. The
default model in the vtpro family used to be the Oceanic Versa Pro. But
because the Aeris 500AI has a lower model number, it automatically
became the new default model. Since both use a different protocol
variant (MOD vs INTR) they are not interchangable.

The default model is now hardcoded. The best option is of course to
provide the model number explicitly!
2016-07-11 21:49:16 +02:00
Jef Driesen
b41ecd0c15 Add a parameter with the model number. 2016-07-11 21:47:29 +02:00
Jef Driesen
469717a2a1 Add support for imperial units in the xml output.
Libdivecomputer always uses metric units internally. But when reverse
engineering a device that stores everything using imperial units, it's
very convenient to be able to switch the output to imperial units too.
2016-03-29 16:34:27 +02:00
Jef Driesen
8ab3fb0542 Always close the xml tags.
The dive and sample xml tags were not closed properly if an error
occurred during parsing.
2016-03-27 22:02:52 +02:00
John Van Ostrand
9a4e2b75a5 Add support for the Cochran Commander and EMC. 2016-03-22 20:09:45 +01:00
Jef Driesen
83e54d84a2 Add support for the parse command. 2016-02-26 08:24:11 +01:00
Jef Driesen
e8b9e88171 Integrate the new output formats.
The existing output code is removed and replaced with the new XML and
RAW output formats. The desired output format can be selected with a new
command-line option. The XML format remains the default output format.
2016-02-26 08:24:11 +01:00
Jef Driesen
5d9ddafc41 Add support for the raw output format.
The RAW output format exports each dive to a raw (binary) file. To
output multiple files, the filename is interpreted as a template and
should contain one or more placeholders.
2016-02-26 08:23:55 +01:00
Jef Driesen
e35f0a3ff4 Add support for the xml output format.
The XML output format exports all dives to a single xml file.
2016-02-26 08:23:45 +01:00
Jef Driesen
195702046c Add a new abstract output interface.
The new output interface provides the necessary infrastructure to add
support for multiple output formats. Due to the abstract interface, each
new format will require only minimal changes in the application itself.
2016-02-26 07:55:40 +01:00
Jef Driesen
67a3697a4d Disable the getopt argument permutation on BSD systems.
On BSD based operating systems (which includes Mac OS X), the getopt()
function is posix compliant and thus the option processing stops when
the first non-option is found. But the getopt_long() function permutes
the argument vector, just like the GNU implementation.

Using a leading '+' character in the option string disables the
permutation again.
2016-01-30 23:00:17 +01:00
Jef Driesen
5add68b2d5 Use the optreset variable on BSD systems.
On BSD based operating systems the optreset variable should be used to
reset the internal getopt state. Setting optind to zero is a GNU
extension.
2016-01-30 23:00:17 +01:00
Jef Driesen
013882f3f2 Add the fwupdate command. 2016-01-05 20:38:47 +01:00
Jef Driesen
ce472ffa19 Add the read and write commands. 2016-01-05 20:38:47 +01:00
Jef Driesen
195c4c7a7e Add the download command. 2016-01-05 20:38:47 +01:00
Jef Driesen
bfbb56c781 Add the dump command. 2016-01-04 19:50:51 +01:00
Jef Driesen
ff7c3f6901 Add the list command. 2016-01-04 19:50:51 +01:00
Jef Driesen
4dee95d352 Add the version command. 2016-01-04 19:50:51 +01:00
Jef Driesen
38c9ebc74e Add the help command. 2016-01-04 19:50:51 +01:00
Jef Driesen
57a54f824c Add helper functions for converting hexadecimal data. 2016-01-04 19:50:51 +01:00
Jef Driesen
8f61648a39 Add helper functions for reading/writing binary files. 2016-01-04 19:50:51 +01:00
Jef Driesen
5188f5c25f Add a helper function for translating status codes. 2016-01-04 19:50:51 +01:00
Jef Driesen
655e9ad312 Add a default event handler. 2016-01-04 19:50:51 +01:00
Jef Driesen
28d8759294 Setup the cancel signal handler. 2016-01-04 19:50:51 +01:00
Jef Driesen
f0e5edc50b Setup the device descriptor. 2016-01-04 19:50:51 +01:00
Jef Driesen
3c57060d95 Setup the library context. 2016-01-04 19:50:51 +01:00
Jef Driesen
689e1f1f55 Change the format for error and warning messages.
Use the same format as used for printing the error and warning messages
from libdivecomputer itself.
2016-01-04 19:50:51 +01:00
Jef Driesen
b5503e53fd Add a more modular example application.
The universal application works well, but is quite difficult to extend
with more functionality. Therefore a new and more modular application is
needed. The new dctool application will support multiple sub-commands,
to carry out specific actions. Extending the application will be as easy
as adding new commands.
2016-01-04 19:50:51 +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
fb5f7ad971 Use the GCC printf format attribute.
This enables the compiler to check the arguments against a printf style
format string in all calls to the logging functions.
2015-11-06 07:52:27 +01:00
Jef Driesen
d5eaa979d0 Convert the CNS value to a percentage. 2015-05-12 19:54:15 +02:00
Jef Driesen
87e6940572 Add support for the DiveSystem iDive and Orca. 2014-12-29 10:09:34 +01:00
Anton Lundin
c6486444d3 Teach examples/ostc-fwupdate about OSTC3
This teaches the example firmware upgrader about how to upgrade the
OSTC3's.

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
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
651123de53 Add support for parsing the dive mode. 2014-11-07 22:04:16 +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
Jef Driesen
77d53813bd Remove the device specific example applications.
These device specific applications became obsolete long time ago with
the introduction of the universal application.
2014-07-02 17:06:27 +02: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
886884ab60 Use higher resolution timestamps on Windows.
The resolution of the GetTickCount function is limited to the resolution
of the system timer, which is typically in the range of 10 to 16
milliseconds. This is unsufficient for measuring very short time
intervals in the milliseconds range. The QueryPerformanceCounter
function provides much higher resolution timestamps. We already use it
for the half-duplex workaround.
2014-03-13 15:49:15 +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
8e1a8c14a3 Add a small example application. 2013-08-23 13:42: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