doc: update sigrok-cli(1) for channel assignment to decoder inputs Extend the sigrok-cli manpage section which discusses the -P option. Mention the assignment of logic channels to decoder inputs by index or by name. Automatic assignment by position in the absence of user specs seems to not have been recent implementations' default behaviour. Remove that outdated or incorrect comment.
decode: assign logic channels to PD inputs (by name or by index) Add support for the -P <name>:assign_channels=auto_index or =auto_names keywords. Which assigns sigrok logic channels to decoder input signals, but requires explicit initiation by users. The default behaviour remains backwards compatible, exclusively assigns individual channels as mapped by user specs, assigns nothing by default. Name matching is implemented as a simple case insensitive comparison. Neither weaker name checks (optional separators) nor advanced heuristics are supported as seen in the Pulseview GUI application. Future versions could implement these once the set of transformation rules has settled.
manpage: add environment variables section (firmware, decoders path) Add the SIGROK_FIRMWARE_DIR, SIGROK_FIRMWARE_PATH, SIGROKDECODE_DIR, and SIGROKDECODE_PATH environment variables to the sigrok-cli(1) manpage. Strictly speaking these are the libraries' environment variables, when libsigrok looks up device firmware, and libsigrokdecode searches for Python scripts. But the libraries don't have individual manpages. So let's put them here for better perception, and to have them _somewhere_ and not lose this information.
decode: Optionally print annotation class with PD annotations Introduce the "--protocol-decoder-ann-class" command line option (no short form available), which emits annotation class names with textual output from protocol decoder annotations, regardless of a log level value. Based on commit 08e9378bf68a by Gerhard Sittig <redacted>
parsers: avoid NULL dereference when option strings are empty When colon separated options are scanned (like "-P ps2: --show") then the empty list item which results from the trailing colon resulted in key/value pairs becoming NULL. Handle that situation, skip empty list elements. Reported-By: Peter Mortensen via IRC
parsers: use proper conversion routine for PD option data types The generic_arg_to_opt() routine converted text input to protocol decoder option values, but might have lost significant information. Use a signed conversion routine for the int32 data, use a long long routine for uint64 data. This shall unbreak negative values (like UART packet separators), and improve compatibility with 32bit targets (like for large sample numbers or high frequency values).
input: emit diagnostics when file import fails fatally The previous implementation did terminate the file import upon fatal errors, but did so silently. Add diagnostics to the code paths where input module's .send() calls or channel selection fail. This raises awareness when an individual input module would fail and not warn.
input: minor robustness improvement, close fd leak Eliminate redundant CHUNK_SIZE references, just fill the GString buffer as far as it was allocated no matter how. Call an input related free routine for options, not the output routine (which happened to work by coincidence, thus went unnoticed). Close the input file descriptor after the read loop, the caller has got no reference to it.
input: unbreak automatic format detection when reading from stdin The combination of reading from stdin and automatic file format match could result in the execution of an input module's .end() callback before its .receive() ever executed. Which then suffers from an sdi which is not yet ready, and no data was sent to the sigrok session. Fix that. Unfortunately the input module's accumulator is hidden behind the libsigrok API. That's why applications cannot defer the forwarding of the first data chunk from the input file. Insert a .receive() call with a zero length instead before more file content is consumed. All existing input modules are prepared to handle this call sequence.
show: use getter result to determine "current" presence (voltage range) Improve the condition which presents the "(current)" decoration when voltage ranges are listed in --show output. Use an explicit boolean which is derived from the config getter's return code. Avoid "forcing" a comparison against a zero value, which can be a valid item in the list of supported voltages. This is similar to commit 0171a4a7a49f. See more context (-U10) for the motivation of the change. Was observed with the kingst-la2016 driver.