17 Commits

Author SHA1 Message Date
Jef Driesen
63f5a4d652 Remove the dc_parser_set_data function
The dc_parser_set_data() function allows to re-use a parser object for
multiple dives. The advantages of this feature are actually very limited
in practice. The reduction in memory consumption is almost negligible,
because the amount of internal state in the parser is typically very
small. But the implementation requires some additional complexity
because each backend needs code to reset its internal state. Therefore,
the function is removed and the data and size needs to be passed
directly to the dc_parser_new() and dc_parser_new2() functions instead.

Because keeping a reference to the data has also caused issues in the
past, especially for applications implemented in a garbage collected
language, the data will now also get copied internally.
2023-05-15 22:19:37 +02:00
Jef Driesen
ef2402eff5 Integrate the new I/O interface in the public api
Currently the dive computer backends are responsible for opening (and
closing) the underlying I/O stream internally. The consequence is that
each backend is hardwired to a specific transport type (e.g. serial,
irda or usbhid). In order to remove this dependency and support more
than one transport type in the same backend, the opening (and closing)
of the I/O stream is moved to the application.

The dc_device_open() function is modified to accept a pointer to the I/O
stream, instead of a string with the device node (which only makes sense
for serial communication). The dive computer backends only depend on the
common I/O interface.
2018-04-03 21:11:06 +02:00
Jef Driesen
c5f089b4a6 Remove unnecessary helper functions
The second variant of the open or create functions were introduced to
maintain backwards compatibility. But after being removed from the
public api, these functions serve no purpose anymore, and can be removed
completely.
2017-04-19 11:33:17 +02:00
Jef Driesen
d1a06e784c Remove deprecated functions from the public api
The vendor_product_parser_create() and vendor_product_device_open()
functions should be called indirectly, through the generic
dc_device_open() and dc_parser_new() functions. And the
vendor_product_extract_dives() functions are internal functions that
should never have been part of the public api in the first place.
2017-04-18 08:41:10 +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
a8116a0aec Add datetime support to the parsers. 2010-02-02 15:04:46 +00:00
Jef Driesen
45f51fedfb Store the layout descriptor in the device handle. 2010-01-15 10:16:49 +00:00
Jef Driesen
32fd37df2c Keep only a single PAGESIZE macro. 2010-01-15 09:51:15 +00:00
Jef Driesen
bf0dd700c1 Add a parser for the Oceanic Atom 2. 2009-10-15 09:14:33 +00:00
Jef Driesen
f477defbf8 Increase the total memory size to 64KB. 2009-05-15 10:13:03 +00:00
Jef Driesen
7195c000e4 Added a new function for the keepalive command. 2008-12-27 16:17:49 +00:00
Jef Driesen
56b52f8fad Take care of the init and quit command internally. 2008-12-27 16:17:35 +00:00
Jef Driesen
596af5a17b Add LGPL license headers. 2008-10-05 20:14:18 +00:00
Jef Driesen
8a90c18a06 Port the Oceanic Atom 2 to the new api. 2008-07-08 10:11:14 +00:00
Jef Driesen
16f12123a3 Moved the handshaking to a new function and added the quit sequence. 2008-06-30 07:50:36 +00:00
Jef Driesen
734d0cede5 Added a function to read individual dives from the Oceanic Atom 2. 2008-06-24 12:28:44 +00:00
Jef Driesen
209aa53894 Added the initial implementation for the Oceanic Atom 2. 2008-06-11 15:23:12 +00:00