summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorStefan Brüns <stefan.bruens@rwth-aachen.de>2015-11-30 00:00:03 +0100
committerStefan Brüns <stefan.bruens@rwth-aachen.de>2015-11-30 00:03:01 +0100
commite655c0aa44ac56ff66ad98d30a97cf852bdf7048 (patch)
tree65f28cb6b7884b80d60f8064f19364bb10c648c5 /decoders
parent72b2a50cc23388ba3568fc96deda79a7e39cbfc5 (diff)
downloadlibsigrokdecode-e655c0aa44ac56ff66ad98d30a97cf852bdf7048.tar.gz
libsigrokdecode-e655c0aa44ac56ff66ad98d30a97cf852bdf7048.zip
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.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/usb_packet/pd.py4
1 files changed, 2 insertions, 2 deletions
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 = [], ''