Skip to content

Fix ASCReader CANoe 7 CAN FD layouts - #2154

Open
zhaojiale2021 wants to merge 4 commits into
hardbyte:mainfrom
zhaojiale2021:canoe7-asc-fd
Open

zhaojiale2021 wants to merge 4 commits into
hardbyte:mainfrom
zhaojiale2021:canoe7-asc-fd

Conversation

@zhaojiale2021

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Add native ASCReader support for CANoe 7.x CAN FD records whose field order is <channel> <id> <Rx|Tx>.
  • Resolve CANoe decimal DLC codes against the authoritative data-length field while preserving python-can hexadecimal DLC spellings.
  • Add a CANoe 7.0.0 regression fixture and a 32-byte CAN FD DLC regression; add a towncrier changelog fragment.

Related Issues / Pull Requests

  • Related to the existing CANoe ASC compatibility work.

Type of Change

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

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • The targeted ASC test class passes: 37 passed, 1 skipped.

Additional Notes

This fix also removes the need for an application-level CANoe 7.x fallback in CanVouch.

zhaojiale2021 and others added 3 commits November 25, 2026 05:51
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@zariiii9003

Copy link
Copy Markdown
Collaborator

AI Review: ASCReader support for CANoe 7.x CAN FD layout (#2154)

Context

  • Vector "CAN, Log & Trigger ASC Logging Format" specifies CAN FD records "since v8.1" as <Channel> <Dir> <ID> … (§3.3). The older <Channel> <ID> <Dir> <BRS> <ESI> d|r <DLC> <DataLength> … order ("CANoe 7 layout") appears only in the §3.1.4 example log.
  • On main, every CANoe 7 layout line raises ValueError and stops reading. This PR fixes data frames, which is an improvement.

Findings

  • CANoe 7 layout remote frames crash the reader (can/io/asc.py, new fields[1] not in ("Rx", "Tx") block): the §3.1.4 line CANFD 1 100 Tx 1 0 r 8 Length = … raises ValueError and every later message is lost. Fix: on r, set is_remote_frame=True and dlc=dlc2len(<DLC>), and skip <DataLength>.
  • The result of _parse_fd_dlc is never used (can/io/asc.py): msg_kwargs["dlc"] = data_length overrides it. Fix: delete the method and its call, and drop the decimal-DLC claim from the changelog fragment.
  • Short CANoe 7 layout lines produce fake messages (if len(rest) < 4, if index + 1 >= len(rest)): CANFD 1 1e3 Rx 1 0 d comes out as an empty frame. Fix: raise ValueError, like the existing path.
  • The CANoe 7 layout error-frame check is untested (rest[0].lower() == "errorframe"): the specification doesn't document this form. Fix: remove it, or add a test with a real log line.
  • The changelog fragment name produces a broken link (doc/changelog.d/canoe7.fixed.rst): towncrier renders it as :issue:`canoe7` . Fix: rename it to 2154.fixed.rst, as doc/development.rst requires.

Tests

  • test_read_canoe_7_decimal_fd_dlc goes through the same path as test_read_canoe_7_can_fd_layout and passes without the DLC code. Fix: merge them into one test that reads a data frame and a remote frame.

Verdict

request changes

Handle remote and error frames, reject malformed short records, merge the CANoe regressions, and use the PR-number changelog filename.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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.

2 participants