@@ -83,8 +83,7 @@ def handle_responses(self):
8383 response = self .queue .get (
8484 timeout = self .COMMAND_RESPONSE_TIMEOUT_S )
8585 if self ._response_matches_request (response ):
86- if type (self ) == DiagnosticResponseReceiver :
87- if self ._response_is_multiframe (response ):
86+ if type (self ) == DiagnosticResponseReceiver and self ._response_is_multiframe (response ):
8887 if response ['id' ] in self .diag_dict :
8988 self .diag_dict [response ['id' ]].addFrame (response )
9089 else :
@@ -135,7 +134,6 @@ def _response_matches_request(self, response):
135134 original request.
136135 """
137136 return response .get ('command_response' , None ) == self .request ['command' ]
138- ##return True
139137
140138class DiagnosticResponseReceiver (ResponseReceiver ):
141139 """A receiver that matches the bus, ID, mode and PID from a
@@ -174,11 +172,8 @@ def _response_matches_request(self, response):
174172 return response .get ('mode' , None ) == self .diagnostic_request ['mode' ]
175173
176174 def _response_is_multiframe (self , response ):
177- #if 'frame' in response:
178- # return True
179175 print (response )
180- if 'total_size' in response .keys ():
181- if response ["total_size" ] > 0 :
176+ if 'total_size' in response .keys () and response ["total_size" ] > 0 :
182177 return True
183178 return False
184179
0 commit comments