Skip to content

Avoid padding CAN_FD_MESSAGE_64 objects to 4 bytes #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2019
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
6 changes: 4 additions & 2 deletions can/io/blf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ def __iter__(self):
raise BLFParseError()

obj_size = header[3]
obj_type = header[4]
# Calculate position of next object
next_pos = pos + obj_size + (obj_size % 4)
next_pos = pos + obj_size
if obj_type != CAN_FD_MESSAGE_64:
next_pos += obj_size % 4
if next_pos > len(data):
# Object continues in next log container
break
Expand Down Expand Up @@ -239,7 +242,6 @@ def __iter__(self):
factor = 1e-9
timestamp = timestamp * factor + self.start_timestamp

obj_type = header[4]
# Both CAN message types have the same starting content
if obj_type in (CAN_MESSAGE, CAN_MESSAGE2):
(
Expand Down