Fix timestamp offset bug in BLFWriter by pierreluctg · Pull Request #1921 · hardbyte/python-can

@pierreluctg added bug file-io

about reading & writing to files

labels

Feb 20, 2025

zariiii9003

In the BLF files, the frame timestamp are stored as a delta from the "start time". The "start time" stored in the file is the first frame timestamp rounded to 3 decimals. When we calculate the timestamp delta for each frame, we were previously calculating it using the non-rounded "start time".

This new code, use the "start time" as the first frame timestamp truncated to 3 decimals.
Making sure all tests messages contains a timestamp to avoid situation where the first written message have timestamps equal to zero.

@pierreluctg