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.
(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.
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 = [], ''