Skip to content

Comments

Fix/asc writer timestamps format#2032

Open
Ju-Daeng-E wants to merge 4 commits intohardbyte:mainfrom
Ju-Daeng-E:fix/asc-writer-timestamps-format
Open

Fix/asc writer timestamps format#2032
Ju-Daeng-E wants to merge 4 commits intohardbyte:mainfrom
Ju-Daeng-E:fix/asc-writer-timestamps-format

Conversation

@Ju-Daeng-E
Copy link

@Ju-Daeng-E Ju-Daeng-E commented Feb 24, 2026

Summary of Changes

  • Added timestamps_format parameter to ASCWriter.__init__() ("absolute" or "relative", default "absolute")
  • The value is written into the base hex timestamps ... header line so external tools (CANalyzer, CANoe, etc.) can interpret the file correctly
  • Raises ValueError for unsupported values
  • No behaviour change for existing code — default is "absolute"

Related Issues / Pull Requests

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe):

Checklist

  • I have added or updated documentation as appropriate.
  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

Additional Notes

The timestamps_format parameter only affects the header line.
The actual per-message timestamp values written by on_message_received()
are not modified — callers are responsible for passing appropriately scaled timestamps.

Allow callers to choose between 'absolute' (default, existing behaviour)
and 'relative' when creating an ASC log file. The value is written into
the 'base hex  timestamps ...' header line so that other tools
(CANalyzer, CANoe, etc.) can interpret the file correctly.

Closes hardbyte#2022
@zariiii9003
Copy link
Collaborator

You're changing the header, but not the actual timestamps. According to the documentation that is not correct:

timestamps indicates whether the timestamps are written absolute to the start of the measurement
or relative to the preceding event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: ASCWriter should support configurable timestamp format (absolute vs relative)

2 participants