Planned changes to the I/O layer

Jef Driesen jef at libdivecomputer.org
Fri Jan 3 19:45:19 CET 2020


Hi,

In the next few days, I'm planning to commit some non-backwards compatible 
changes to the I/O layer:


A new dc_iostream_ioctl function will be introduced to perform I/O specific 
requests. This allows to extend the I/O layer with some driver specific 
features, without having to modify the api. The first candidate to use this 
feature will be the Oceanic BLE communication.

The dc_iostream_set_latency function will be removed, and re-implemented as an 
ioctl. This function isn't used anywhere in libdivecomputer, and is only 
relevant for the serial communication. Hence it's a perfect example of a feature 
than can be implemented as an ioctl.

A new dc_iostream_poll function will be added. This provides a more efficient 
alternative to using using a combination of the dc_iostream_get_available and 
dc_iostream_sleep functions.


For all the built-in I/O transports, these changes will be completely 
transparent. But users of the custom I/O will need to update their code because 
the corresponding function pointers will be added/removed to/from the 
dc_custom_cbs_t structure.

Jef


More information about the devel mailing list