]> sigrok.org Git - libsigrok.git/commit - src/hardware/serial-dmm/api.c
serial: extend stream detect for variable length packet checkers
authorGerhard Sittig <redacted>
Thu, 24 Sep 2020 14:29:06 +0000 (16:29 +0200)
committerGerhard Sittig <redacted>
Thu, 22 Oct 2020 19:25:02 +0000 (21:25 +0200)
commit1a7adeac29d6331b53a2c78fc9c70429b32da0bd
tree8c75182e1b1b5f5cd0507c9876c100eced84bb6c
parent2cb4204c6f31b58a4713ce39b77d37b95f0b20f5
serial: extend stream detect for variable length packet checkers

The previous implementation of the packet detection in a serial stream
assumed that all packets are of equal length which is known in advance.
Extend the packet validity check interface such that caller provided
callbacks can either decide that the input is valid or invalid (terminal
decision), or request more receive data before a decision can be made
(deferral, coverring variable length packets, with a minimum size to
cover the header before a length becomes available and the total packet
length is known).

This commit extends the API, and adjusts the call sites to not break the
compilation. Actual variable length checkers are yet to be done. Improve
readability while we are here: Better reflect the purpose and units of
variables in their identifiers. Tweak diagnostics messages, update
inline and doxygen comments.
include/libsigrok/libsigrok.h
src/hardware/appa-55ii/api.c
src/hardware/kern-scale/api.c
src/hardware/mastech-ms6514/api.c
src/hardware/serial-dmm/api.c
src/hardware/serial-lcr/api.c
src/hardware/teleinfo/api.c
src/libsigrok-internal.h
src/serial.c