Repository navigation
isotp: separate m 8000 inimum padding from maximum frame length - #91
Merged
Merged
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PadFramespads 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 withTransmitMinDataLengthon 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: truewith a minimum equal to the resolvedTransmitDataLengthto preserve full padding, or useTransmitMinDataLength: 8for eight-byte minimum padding. Zero disables optional padding and preserves the existing zero-value behaviour.Validation:
go test -race ./...,go vet ./...,gofmt -l .andgit diff --checkpassed 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.