From: Alexandru Gagniuc Date: Thu, 22 Nov 2012 01:33:55 +0000 (-0600) Subject: radioshack-dmm: Be more verbose with packet checks X-Git-Tag: dsupstream~529 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=904735876118f0ff00ae34e1dbdb80dba752bf2d;p=libsigrok.git radioshack-dmm: Be more verbose with packet checks Add sr_spew() messages to state why the packet was found to be invalid. Signed-off-by: Alexandru Gagniuc --- diff --git a/hardware/radioshack-dmm/protocol.c b/hardware/radioshack-dmm/protocol.c index f74e7017..917173fa 100644 --- a/hardware/radioshack-dmm/protocol.c +++ b/hardware/radioshack-dmm/protocol.c @@ -183,11 +183,15 @@ SR_PRIV gboolean rs_22_812_packet_valid(const struct rs_22_812_packet *rs_packet if (!(rs_packet->mode < MODE_INVALID)) return FALSE; - if (!checksum_valid(rs_packet)) + if (!checksum_valid(rs_packet)) { + sr_spew("Packet with invalid checksum. Discarding."); return FALSE; + } - if (!selection_good(rs_packet)) + if (!selection_good(rs_packet)) { + sr_spew("Packet with invalid selection bits. Discarding."); return FALSE; + } return TRUE; }