Skip to content

Commit

Permalink
Merge branch 'master' of github.com:libdivecomputer/libdivecomputer i…
Browse files Browse the repository at this point in the history
…nto Subsurface-DS9

This updates to Jef's current master.

* 'master' of github.com:libdivecomputer/libdivecomputer: (48 commits)
  Fix the React Pro White memory layout
  Add support for the Shearwater Tern
  Exclude O2 sensors without calibration data
  Add support for the Scubapro G3 and Luna 2.0
  Add support for parsing the compass bearings
  Remove disabled gas mixes
  Skip all non-sample records
  Allow a zero timestamp for the first sample
  Fix the Mares Bluelink Pro communication
  Setup the 2 byte command header internally
  Fix a potential buffer overflow
  Use a symbolic constant for the header size
  Use plain ascii text in the code comments
  Document the device descriptor functions
  Export the filter function in the public api
  Use separate data structures for USB and USB HID
  Replace the filter parameters with an alternative
  Pass the descriptor to the filter function
  Remove support for the Tusa TC1
  Remove disabled gas mixes
  ...
  • Loading branch information
torvalds committed Jan 30, 2024
2 parents 78710ab + 1d0aeec commit c2dfd16
Show file tree
Hide file tree
Showing 123 changed files with 1,576 additions and 1,996 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Versioning.
m4_define([dc_version_major],[0])
m4_define([dc_version_minor],[8])
m4_define([dc_version_minor],[9])
m4_define([dc_version_micro],[0])
m4_define([dc_version_suffix],[devel-Subsurface-NG])
m4_define([dc_version],dc_version_major.dc_version_minor.dc_version_micro[]m4_ifset([dc_version_suffix],-[dc_version_suffix]))
Expand Down
1 change: 0 additions & 1 deletion contrib/msvc/libdivecomputer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@
<ClInclude Include="..\..\src\cressi_leonardo.h" />
<ClInclude Include="..\..\src\deepblu_cosmiq.h" />
<ClInclude Include="..\..\src\deepsix_excursion.h" />
<ClInclude Include="..\..\src\descriptor-private.h" />
<ClInclude Include="..\..\src\device-private.h" />
<ClInclude Include="..\..\src\diverite_nitekq.h" />
<ClInclude Include="..\..\src\divesoft_freedom.h" />
Expand Down
1 change: 0 additions & 1 deletion doc/man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ MANPAGES = \
dc_parser_get_field.3 \
dc_parser_new.3 \
dc_parser_samples_foreach.3 \
dc_parser_set_data.3 \
dc_bluetooth_open.3 \
dc_bluetooth_iterator_new.3 \
dc_bluetooth_device_get_address.3 \
Expand Down
4 changes: 2 additions & 2 deletions doc/man/dc_device_foreach.3
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ with
Each dive invokes
.Fa callback
with the dive data, which should be parsed with
.Xr dc_parser_set_data 3 ,
.Xr dc_parser_new 3 ,
and the binary fingerprint of the dive.
The fingerprint can be used to record the newest dive and stop
processing (on subsequent invocations) when the same dive fingerprint is
Expand All @@ -72,7 +72,7 @@ If
returns zero, this will not be reflected in the return value (usually
.Dv DC_STATUS_SUCCESS ) .
.Sh SEE ALSO
.Xr dc_parser_set_data 3
.Xr dc_parser_new 3
.Sh AUTHORS
The
.Lb libdivecomputer
Expand Down
4 changes: 2 additions & 2 deletions doc/man/dc_parser_get_datetime.3
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Extract the date and time of a dive,
.Fa parser ,
previously initialised with
.Xr dc_parser_set_data 3 .
.Xr dc_parser_new 3 .
This returns the broken-down time-stamp of the dive in the local time of
the dive.
.Pp
Expand All @@ -57,7 +57,7 @@ messages on further failure.
.Sh SEE ALSO
.Xr dc_datetime_gmtime 3 ,
.Xr dc_datetime_localtime 3 ,
.Xr dc_parser_set_data 3
.Xr dc_parser_new 3
.Sh AUTHORS
The
.Lb libdivecomputer
Expand Down
4 changes: 2 additions & 2 deletions doc/man/dc_parser_get_field.3
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Extract a field from a dive,
.Fa parser ,
previously initialised with
.Xr dc_parser_set_data 3 .
.Xr dc_parser_new 3 .
The
.Fa value
field type depends upon the
Expand Down Expand Up @@ -187,7 +187,7 @@ if the field was retrieved,
if the field is not supported by the device, or other error messages on
further failure.
.Sh SEE ALSO
.Xr dc_parser_set_data 3
.Xr dc_parser_new 3
.Sh AUTHORS
The
.Lb libdivecomputer
Expand Down
6 changes: 0 additions & 6 deletions doc/man/dc_parser_new.3
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
.Fa "dc_parser_t **parser"
.Fa "dc_context_t *context"
.Fa "dc_descriptor_t *descriptor"
.Fa "unsigned int devtime"
.Fa "dc_ticks_t systime"
.Fc
.Sh DESCRIPTION
Creates a parser for a single dive extracted from the dive computer with
Expand All @@ -55,10 +53,6 @@ parameter; and
.Nm dc_parser_new2 ,
which is given device values (model, etc.) directly.
.Pp
After filling in the
.Fa parser
parameter, one usually sets parser data with
.Xr dc_parser_set_data 3 .
The pointer must later be freed with
.Xr dc_parser_destroy 3 .
.Sh RETURN VALUES
Expand Down
8 changes: 4 additions & 4 deletions doc/man/dc_parser_samples_foreach.3
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
.Ft "typedef void"
.Fo "(*dc_sample_callback_t)"
.Fa "dc_sample_type_t type"
.Fa "dc_sample_value_t value"
.Fa "const dc_sample_value_t *value"
.Fa "void *userdata"
.Fc
.Ft dc_status_t
Expand All @@ -42,7 +42,7 @@
.Fc
.Sh DESCRIPTION
Extract the samples taken during a dive as previously initialised with
.Xr dc_parser_set_data 3 .
.Xr dc_parser_new 3 .
Each sample is passed to
.Fa callback
with the
Expand All @@ -63,7 +63,7 @@ closed.
The following sample types may be raised:
.Bl -tag -width Ds
.It Dv DC_SAMPLE_TIME
The time of the sample taken in seconds after the dive began.
The time of the sample taken in milliseconds after the dive began.
Set in the
.Fa time
field.
Expand Down Expand Up @@ -184,7 +184,7 @@ Returns
.Dv DC_STATUS_OK
on success and another code on failure.
.Sh SEE ALSO
.Xr dc_parser_set_data 3
.Xr dc_parser_new 3
.Sh AUTHORS
The
.Lb libdivecomputer
Expand Down
65 changes: 0 additions & 65 deletions doc/man/dc_parser_set_data.3

This file was deleted.

4 changes: 1 addition & 3 deletions doc/man/libdivecomputer.3
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ Iterate over all dives with
.Xr dc_device_foreach 3 .
.It
For each iterated dive, create a new parser with
.Xr dc_parser_new 3
and set the parsed data with
.Xr dc_parser_set_data 3 .
.Xr dc_parser_new 3 .
.It
Get attributes of the parsed dive with
.Xr dc_parser_get_field 3 .
Expand Down
10 changes: 1 addition & 9 deletions examples/dctool_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,12 @@ dive_cb (const unsigned char *data, unsigned int size, const unsigned char *fing

// Create the parser.
message ("Creating the parser.\n");
rc = dc_parser_new (&parser, divedata->device);
rc = dc_parser_new (&parser, divedata->device, data, size);
if (rc != DC_STATUS_SUCCESS) {
ERROR ("Error creating the parser.");
goto cleanup;
}

// Register the data.
message ("Registering the data.\n");
rc = dc_parser_set_data (parser, data, size);
if (rc != DC_STATUS_SUCCESS) {
ERROR ("Error registering the data.");
goto cleanup;
}

// Parse the dive data.
message ("Parsing the dive data.\n");
rc = dctool_output_write (divedata->output, parser, data, size, fingerprint, fsize);
Expand Down
12 changes: 6 additions & 6 deletions examples/dctool_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ parse (dc_buffer_t *buffer, dc_context_t *context, dc_descriptor_t *descriptor,

// Create the parser.
message ("Creating the parser.\n");
rc = dc_parser_new2 (&parser, context, descriptor, devtime, systime);
rc = dc_parser_new2 (&parser, context, descriptor, data, size);
if (rc != DC_STATUS_SUCCESS) {
ERROR ("Error creating the parser.");
goto cleanup;
}

// Register the data.
message ("Registering the data.\n");
rc = dc_parser_set_data (parser, data, size);
if (rc != DC_STATUS_SUCCESS) {
ERROR ("Error registering the data.");
// Set the clock.
message ("Setting the clock.\n");
rc = dc_parser_set_clock (parser, devtime, systime);
if (rc != DC_STATUS_SUCCESS && rc != DC_STATUS_UNSUPPORTED) {
ERROR ("Error setting the clock.");
goto cleanup;
}

Expand Down

0 comments on commit c2dfd16

Please sign in to comment.