As noted earlier, the sigrok-cli command outputs analog values that the
output module chooses not to output for some reason, like that channel is
disabled. The comment says this should happen if the user didn't specify an
output module, which is not quite what the code implements. The current
behavior is annoying and confusing, whereas the behavior implied by the
comment would be neither.
This behavior was added in commit 9216694f9278c653c2567074d3d0546d62390ca3,
and even then the code and comment didn't match. The commit message doesn't
explain why the comment and code behave differently, so I'm guessing it was
a bug.
This patch changes the code's behavior to match the comment.
diff --git a/session.c b/session.c
index 5e096cd..3a2f431 100644
--- a/session.c
+++ b/session.c
@@ -307,9 +307,7 @@ void datafeed_in(const struct sr_dev_inst *sdi,
if (o && !opt_pds) {
if (sr_output_send(o, packet, &out) == SR_OK) {
- if (!out || (out->len == 0
- && !opt_output_format
- && packet->type == SR_DF_ANALOG)) {
+ if (!opt_output_format && packet->type ==
SR_DF_ANALOG) {
/*
* The user didn't specify an output module,
* but needs to see this analog data.
~
------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel