From: Gerhard Sittig Date: Sun, 27 Sep 2020 06:01:44 +0000 (+0200) Subject: serial: lower severity of failed stream detect message X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0c52026459de91cf61e80e35bd0b8b9dff3bd9a4;p=libsigrok.git serial: lower severity of failed stream detect message Reduce the message's log level from ERR to INFO when the serial stream detect routine cannot find a valid packet. Although an error code gets returned, the condition need not be fatal (can be the result of trying several peers before success or finally giving up). Let callers decide on the severity of failure to detect a specific device's presence, and provide more context in their message which is more helpful to users. Interested readers still get the message at slightly raised log levels. This avoids confusing user perceivable situations like these: $ sigrok-cli --scan sr: serial: Didn't find a valid packet (read 0 bytes). sr: serial: Didn't find a valid packet (read 0 bytes). The following devices were found: demo - Demo device with 13 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4 --- diff --git a/src/serial.c b/src/serial.c index 34d7cbea..1b76c935 100644 --- a/src/serial.c +++ b/src/serial.c @@ -867,7 +867,7 @@ SR_PRIV int serial_stream_detect(struct sr_serial_dev_inst *serial, *buflen = ibuf; - sr_err("Didn't find a valid packet (read %zu bytes).", *buflen); + sr_info("Didn't find a valid packet (read %zu bytes).", *buflen); return SR_ERR; }