Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions openxc/controllers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def handle_responses(self):
response = self.queue.get(
timeout=self.COMMAND_RESPONSE_TIMEOUT_S)
if self._response_matches_request(response):
if type(self) == DiagnosticResponseReceiver:
if self._response_is_multiframe(response):
if type(self) == DiagnosticResponseReceiver and self._response_is_multiframe(response):
if response['id'] in self.diag_dict:
self.diag_dict[response['id']].addFrame(response)
else:
Expand Down Expand Up @@ -135,7 +134,6 @@ def _response_matches_request(self, response):
original request.
"""
return response.get('command_response', None) == self.request['command']
##return True

class DiagnosticResponseReceiver(ResponseReceiver):
"""A receiver that matches the bus, ID, mode and PID from a
Expand Down Expand Up @@ -174,11 +172,8 @@ def _response_matches_request(self, response):
return response.get('mode', None) == self.diagnostic_request['mode']

def _response_is_multiframe(self, response):
#if 'frame' in response:
# return True
print(response)
if 'total_size' in response.keys():
if response["total_size"] > 0:
if 'total_size' in response.keys() and response["total_size"] > 0:
return True
return False

Expand Down