From e655c0aa44ac56ff66ad98d30a97cf852bdf7048 Mon Sep 17 00:00:00 2001 From: Stefan BrĂ¼ns Date: Mon, 30 Nov 2015 00:00:03 +0100 Subject: usb_packet: handle errors from usb_signalling If a packet had any errors, the usb_signalling PD will not send an EOP but an ERR message. Wait for the next SOP in both cases. --- decoders/usb_packet/pd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'decoders/usb_packet/pd.py') diff --git a/decoders/usb_packet/pd.py b/decoders/usb_packet/pd.py index 7120d52..3e061c9 100644 --- a/decoders/usb_packet/pd.py +++ b/decoders/usb_packet/pd.py @@ -371,7 +371,7 @@ class Decoder(srd.Decoder): (ptype, pdata) = data # We only care about certain packet types for now. - if ptype not in ('SOP', 'BIT', 'EOP'): + if ptype not in ('SOP', 'BIT', 'EOP', 'ERR'): return # State machine. @@ -383,7 +383,7 @@ class Decoder(srd.Decoder): elif self.state == 'GET BIT': if ptype == 'BIT': self.bits.append([pdata, ss, es]) - elif ptype == 'EOP': + elif ptype == 'EOP' or ptype == 'ERR': self.es_packet = es self.handle_packet() self.packet, self.packet_summary = [], '' -- cgit v1.2.3-70-g09d2