24 Commits

Author SHA1 Message Date
Jef Driesen
84d997fac6 Fix a build error.
Commit 7a851ccb1b9ed9b8906721cb1872b96b35185883 accidentally broke the
build due to a missing line.
2014-08-16 22:46:53 +02:00
Jef Driesen
7a851ccb1b Add some extra error messages. 2014-08-14 10:20:23 +02:00
Jef Driesen
b0874ea4d9 Disable gas mixes and events in gauge mode.
For a dive in gauge mode, the gas mixes defined in the header should be
ignored, and no gas change event should be emitted. This is done by
hardcoding the number of gas mixes to zero.
2014-08-14 09:52:57 +02:00
Jef Driesen
4f2d71ce49 Cache the parser data internally.
The code to find the offset to the footer and parse the gas mix data is
duplicated in multiple places. Move this code to a single place, and
cache the data in the parser instead.
2014-08-13 16:23:22 +02:00
Tim Wootton
459b1574b8 Add iconhd gas change event
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-27 06:57:18 +01:00
Tim Wootton
734533e4d1 Fix units for atmospheric pressure for iconhd type
Was returning mbar, should have been bar.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-15 11:49:46 +02:00
Tim Wootton
2af365cfb7 Adds support for DC_FIELD_ATMOSPHERIC to the iconhd parser
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
2013-10-12 20:33:52 +02:00
Jef Driesen
5c16b28fb9 Use only 12 bits for the temperature.
When using all 16 bits for the temperature, the resulting values are
clearly wrong in some cases. Most likely the upper 4 bits are used to
store something else. Even with only 12 bits, the resulting temperature
range (0-409.5°C) should still be more than sufficient.
2013-07-16 08:46:49 +02:00
Jef Driesen
ee8b4e36ad Merge branch 'release-0.3'
Integrate the bugfixes from the stable branch.
2013-05-13 23:49:37 +02:00
Olivier Bussier
3ce237eee4 Fix the parsing of the gas mixes.
If the gas model flag is set to air, the individual gas mix definitions
are ignored, and a single mix with air is returned instead. For non-air
dives, only the gas mixes marked as active are returned.
2013-05-03 08:42:43 +02:00
Jef Driesen
6419e189a4 Add a single isinstance function per object type.
Currently, each backend has it's own function to verify whether the
object vtable pointer is the expected one. All these functions can be
removed in favor of a single isintance function in the base class,
which takes the expected vtable pointer as a parameter.

Functions which are called through the vtable, don't need to verify the
vtable pointer, and those checks are removed.
2013-04-16 12:18:54 +02:00
Jef Driesen
007479fc92 Rename the backend structure to vtable.
The term "backend" can be confusing because it can refer to both the
virtual function table and the device/parser backends. The use of the
term "vtable" avoids this.
2013-04-16 12:18:53 +02:00
Jef Driesen
cd31ff9dff Properly store the context pointer internally.
I forgot to update the device and parser initialization functions to
store the context pointer into the objects. As a result, the internal
context pointers were always NULL.
2012-08-28 08:44:47 +02:00
Jef Driesen
53e9d72a40 Integrate the context object in the library.
The public api is changed to require a context object for all
operations. Because other library objects store the context pointer
internally, only the constructor functions need an explicit context
object as a parameter.
2012-08-27 23:08:38 +02:00
Jef Driesen
c821d40144 Introduce a namespace prefix for the high-level public api.
Adding the "dc_" namespace prefix (which is of course an abbreviation
for libdivecomputer) should avoid conflicts with other libraries. For
the time being, only the high-level device and parser layers are
changed.
2012-06-21 21:42:37 +02:00
Jef Driesen
163d383332 Use a common backend type for the device and parser layers. 2012-06-21 21:42:37 +02:00
Jef Driesen
9136a52835 Use common status codes for the device and parser layers. 2012-06-21 21:42:34 +02:00
Jef Driesen
e65025b501 Separate private and public headers.
The public header files are moved to a new subdirectory, to separate
the definition of the public interface from the actual implementation.
Using an identical directory layout as the final installation has the
advantage that the example code can be build outside the project tree
without any modifications to the #include statements.
2012-06-21 21:39:24 +02:00
Jef Driesen
fd8b88891f Add support for the pressure samples. 2011-11-03 20:25:15 +01:00
Jef Driesen
f526cdd3d9 Add support for the Mares Icon HD Net Ready. 2011-09-24 13:49:18 +02:00
Jef Driesen
1ce8dec1d8 Exclude the 4 byte length from the sample data.
Correctly skip the 4 byte length in front of the sample data. The
previous code happened to work by accident, because the header after the
sample data was assumed to be 4 bytes larger, and thus those two errors
cancelled each other out.
2011-09-24 13:49:18 +02:00
Jef Driesen
4bce24e5fa Implement the new field api for the Mares devices. 2011-01-13 22:14:53 +01:00
Jef Driesen
90e60fecee Add a new function to the public api to retrieve the dive metadata. 2011-01-13 22:14:53 +01:00
Jef Driesen
aca36ad344 Add a parser for the Mares Icon HD. 2010-06-29 11:42:00 +02:00