Skip to content

Fix payload lengths when reading CAN FD and J1939 TRC logs - #2135

Open
timothyanderson096-ocdealcheck wants to merge 1 commit into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/trc-recorded-payload-length
Open

timothyanderson096-ocdealcheck wants to merge 1 commit into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/trc-recorded-payload-length

Conversation

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown
Contributor

Summary of Changes

The PEAK TRC 2.x reader returned a CAN FD length code as Message.dlc, which python-can defines in bytes. A recorded 64-byte frame could therefore report 15 bytes. The lowercase l field already contains bytes, including for long J1939 messages. For the uppercase L field, translate valid wire codes only on CAN FD records. Keep the existing interpretation of other record types.

Related Issues / Pull Requests

The field definitions and worked examples are in the PEAK TRC file specification, pages 13 and 15–18.

Type of Change

  • Bug fix

Checklist

  • Followed the contribution guide.
  • Updated tests and documentation.
  • Added a towncrier news fragment.
  • All checks and tests pass (tox). The 28 local UDP multicast initialization failures also reproduced on pristine main.

Additional Notes

Five new regression cases failed on main. In an offline TRC-to-BLF conversion, the fix preserved both the 64-byte payload and its reported length. On Linux CPython 3.14, the test suite excluding the unavailable multicast fixtures passed 529 tests and 36 subtests. The file-format suite, lint, configured type checks, strict docs and doctests, and packaging checks passed locally. No physical CAN interface was required for the file conversion.

Prepared and tested with OpenAI Codex.

Timothy Anderson · Spotted Ridge Engineering / OC Labs · GDN (Global Decision Network)
timothyanderson096@gmail.com · Engineering evidence

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T02:04:26.856955Z
We couldn’t complete this review. Comment @codex review to try again.
e98173b PR opened
🔒 Security Review ❌ Failed 2026-11-18T02:04:30.795755Z
We couldn’t complete this review. Comment @codex security review to try again.
e98173b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

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.

1 participant