8000 isotp: separate minimum padding from maximum frame length by tomrford · Pull Request #91 · tomrford/gocan · GitHub
[go: up one dir, main page]

Skip to content

isotp: separate m 8000 inimum padding from maximum frame length - #91

Merged
tomrford merged 1 commit into
mainfrom
isotp/min-transmit-length
Sep 29, 2026
Merged

tomrford merged 1 commit into
mainfrom
isotp/min-transmit-length

Conversation

@tomrford
Copy link
Copy Markdown
Owner

PadFrames pads every ISO-TP frame to the configured maximum, so a 64-byte CAN FD configuration cannot pad short frames to eight bytes while allowing larger frames to use their smallest legal length. Replace it with TransmitMinDataLength on physical and functional configurations. Single Frames, final Consecutive Frames and Flow Control frames honour the minimum and mandatory CAN FD rounding; full segmented frames retain the configured maximum.

This is a source-level API change. Replace PadFrames: true with a minimum equal to the resolved TransmitDataLength to preserve full padding, or use TransmitMinDataLength: 8 for eight-byte minimum padding. Zero disables optional padding and preserves the existing zero-value behaviour.

Validation: go test -race ./..., go vet ./..., gofmt -l . and git diff --check passed on macOS. Wire-byte tests cover classical and FD Single Frames through both transmit paths, configuration rejection, Flow Control and segmented tails. Temporary test overlays also verified short payloads padded to 12 and 64 bytes; no source changes were made during review. Hardware interoperability remains unverified.

Read-only review found no blocking correctness or simplification issues. Production changes: +36/−25 (net +11); tests: +145/−5 (net +140).

References: python-can-isotp minimum transmit length, Linux ISO-TP link-layer options.

Replace PadFrames with TransmitMinDataLength on physical and functional
transmit configurations. A zero minimum leaves optional padding disabled;
an eight-byte minimum pads short frames without forcing every FD frame to
the configured maximum. Validate the minimum against legal CAN lengths
and the resolved maximum, and choose Single Frame headers from the payload
and minimum length.

This is a source-level API change: callers using PadFrames must select an
explicit minimum. Existing zero-value configurations remain unpadded. The
maximum remains available for full segmented frames; shorter final frames
and Flow Control use the minimum and mandatory CAN FD length rounding.

Check emitted bytes across classical and FD Single Frame boundaries,
physical and functional paths, Flow Control and segmented-transfer tails.
Tests and documentation describe generic transport behaviour.

Design references for external review:
https://can-isotp.readthedocs.io/en/latest/isotp/implementation.html#parameters
https://docs.kernel.org/networking/iso15765-2.html

Validation on Windows: go test -race ./..., go vet ./..., gofmt -l .
Hardware interoperability remains to be validated before release.
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T08:28:49.897308Z f3da4a3 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.

@tomrford
tomrford merged commit f168890 into main Sep 29, 2026
1 check passed
@tomrford
tomrford deleted the isotp/min-transmit-length branch September 29, 2026 08:33
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

0