Skip to content

Commit

Permalink
Fix python-can filters
Browse files Browse the repository at this point in the history
  • Loading branch information
SaxElectronics committed Jul 26, 2024
1 parent 9464381 commit 755d390
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyxcp/transport/candriver/python_can.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ def read(self):
except CanError:
return None
else:
if frame is None or frame.arbitration_id != self.parent.can_id_master.id or not len(frame.data):
return None # Timeout condition.
if frame is None:
return None # Timeout or other condition causing a None frame

if frame.arbitration_id not in [self.parent.can_id_master.id] + [id_.id for id_ in self.parent.daq_list_can_ids]:
self.parent.logger.debug("Received frame with unexpected arbitration ID: {}".format(frame.arbitration_id))
return None
extended = frame.is_extended_id
identifier = can.Identifier.make_identifier(frame.arbitration_id, extended)
return can.Frame(
Expand Down

0 comments on commit 755d390

Please sign in to comment.