Skip to content

BLF padding/alignment incorrect for CAN_FD_MESSAGE_64 #786

Closed
@MartinStellmacher

Description

@MartinStellmacher

In blf.py all messages are padded by obj_size % 4. This assumption doesn't hold for all types of messages. I experienced a parsing error while reading a file which contained CAN_FD_MESSAGE_64 items. They are not padded at all, as you can see in Toby Lorenz C++ implementation.

Issue #459 is closed, but the problem still persists. Solution might be as simple as:

                if header[4] == CAN_FD_MESSAGE_64 or header[4] == ETHERNET_FRAME_EX: 
                    next_pos = pos + obj_size #no padding
                else:
                    next_pos = pos + obj_size + (obj_size % 4)  #weird padding

In Toby Lorenz implementation the padding is handled separately for each frame type...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions