]> sigrok.org Git - libsigrok.git/commitdiff
radioshack-dmm: Be more verbose with packet checks
authorAlexandru Gagniuc <redacted>
Thu, 22 Nov 2012 01:33:55 +0000 (19:33 -0600)
committerAlexandru Gagniuc <redacted>
Thu, 22 Nov 2012 01:33:55 +0000 (19:33 -0600)
Add sr_spew() messages to state why the packet was found to be invalid.

Signed-off-by: Alexandru Gagniuc <redacted>
hardware/radioshack-dmm/protocol.c

index f74e7017a473515d366b142a104bdf77a59dd273..917173fa2c4a526f70456d99e2cc127f121736a6 100644 (file)
@@ -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;
 }