]> sigrok.org Git - libsigrok.git/commit - src/hardware/serial-dmm/api.c
serial-dmm: more DMM parser callbacks (open, var length, config, start)
authorGerhard Sittig <redacted>
Thu, 24 Sep 2020 14:33:20 +0000 (16:33 +0200)
committerGerhard Sittig <redacted>
Thu, 22 Oct 2020 19:25:34 +0000 (21:25 +0200)
commit070668a0fd0876485ea6867eb60010da0ef1c304
treef8d3ab69bd6b85894fc3d3bf42b231faba61c652
parent1a7adeac29d6331b53a2c78fc9c70429b32da0bd
serial-dmm: more DMM parser callbacks (open, var length, config, start)

Extend the serial-dmm driver's common infrastructure to support more
per-parser (per-model) specific extensions. Add support for variable
length packets (motivated by BM85x), and pass the packet length to
parsers which accept it. Add callbacks which run after the COM port got
opened (motivated by BM85x). Add support for additional configuration
get/set/list properties (motivated by BM52x), including a hook into the
acquisition start and a state container which is owned by the parser.

Device specific acquisition start can check its local state which can
store the result of previous config get/set requests, and can arrange
for a different receive routine to execute (motivated by BM52x). The
default code path will execute serial-dmm's receive routine which keeps
invoking the DMM's packet parser for each registered display.

Prefer double precision values in the new parser callbacks. Also fixup
some data type issues: Use unsigned types for length and size specs as
well as timeouts, don't promote false booleans to NULL pointers, reduce
malloc() argument redundancy. Rephrase some instruction grouping and
update comments to simplify future maintenance. Get the current time
just once for improved consistency in the packet re-request code path.
Rename identifiers in the data reception path to improve readability.
src/hardware/serial-dmm/api.c
src/hardware/serial-dmm/protocol.c
src/hardware/serial-dmm/protocol.h