From b677e536891fc19d949217023df622e30531220c Mon Sep 17 00:00:00 2001 From: Stefan BrĂ¼ns Date: Sat, 22 Jul 2017 20:17:10 +0200 Subject: usb_request: Remove code duplication, save end sample in central location --- decoders/usb_request/pd.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/decoders/usb_request/pd.py b/decoders/usb_request/pd.py index 76e015b..1bd2878 100644 --- a/decoders/usb_request/pd.py +++ b/decoders/usb_request/pd.py @@ -196,18 +196,17 @@ class Decoder(srd.Decoder): request = self.request[(addr,ep)] if request_end: + request['es'] = self.es_transaction request['handshake'] = self.handshake # BULK or INTERRUPT transfer if request['type'] in (None, 'BULK IN') and self.transaction_type == 'IN': request['type'] = 'BULK IN' request['data'] += self.transaction_data - request['es'] = self.es_transaction self.handle_request(request_started, request_end) elif request['type'] in (None, 'BULK OUT') and self.transaction_type == 'OUT': request['type'] = 'BULK OUT' request['data'] += self.transaction_data - request['es'] = self.es_transaction self.handle_request(request_started, request_end) # CONTROL, SETUP stage @@ -233,11 +232,9 @@ class Decoder(srd.Decoder): # CONTROL, STATUS stage elif request['type'] == 'SETUP IN' and self.transaction_type == 'OUT': - request['es'] = self.es_transaction self.handle_request(0, request_end) elif request['type'] == 'SETUP OUT' and self.transaction_type == 'IN': - request['es'] = self.es_transaction self.handle_request(0, request_end) else: -- cgit v1.2.3-70-g09d2