fix(canopen): restart the block-download request timer per confirmed segment, ignore heartbeats with the reserved bit 7 - #267
Conversation
…segment, ignore heartbeats with the reserved bit 7 C12: the block-download client restarted its request timer only when the server answered, so a sub-block that took longer to send than SdoTimeout (127 segments at 10 kbit/s) timed out before its ACK could be asked for, and the healthy server's ACK was then discarded. The timer now restarts at every confirmed segment; after the last one it measures the wait for the ACK. #266: a heartbeat that sets the reserved bit 7 (a bystander's guarding reply, or a malformed frame) is no longer reported as HeartbeatReceived; it still counts as a sign of life. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Block download (C12): The SDO client timer used to measure only server silence after a sub-block was fully sent. A slow bus could exhaust Heartbeats (#266): Tests cover cumulative segment timing vs timeout, late confirmation after timeout, and stricter heartbeat reporting expectations. Reviewed by Cursor Bugbot for commit ba1f28d. Bugbot is set up for automated code reviews on this repo. Configure here. |
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…t block download; drop a redundant guard Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 650957c2f2
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… document the approximated-confirmation limit Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
What does this change?
SdoTimeout(127 segments at 10 kbit/s is over a second against the 1 s default) therefore timed out before the ACK could even be asked for, and the timeout that fired during the batch made the client discard the healthy server's ACK. The timer now restarts at every confirmed segment (SendOrderedControlFramesgained anonFrameConfirmedcallback); after the last segment it measures the wait for the ACK alone.SdoTimeout's documentation says so.HeartbeatReceived; CiA 301 §7.2.8.3.2.2 makes the bit reserved and always 0. It still counts as a sign of life and is still recorded for the NMT master, as before. This also covers0x80, the case fix(canopen): report a short classic upload, refuse a long one, stop reporting reserved heartbeat states as boot-up #265 fixed for state 0 only.Not in this PR, on purpose:
Closes #266.
Type of change
feat— new behaviour (minor release)fix/perf— bug or performance fix (patch release)docs/test/refactor/chore/ci— no release!in the title, plus aBREAKING CHANGE:footer explaining the migration)Checklist
dotnet build CanKit.Pro.sln -c Releasesucceeds (with-p:CI=true)dotnet test CanKit.Pro.sln -c Releasepasses (net10.0; net48 only runs in CI)Mutation checks: removing the per-segment restart fails the new C12 test (three segments confirmed 600 ms apart on a virtual clock against a 1 s timeout: no gap reaches the timeout, their sum does); removing the bit-7 condition fails the
0x80and0x84rows.🤖 Generated with Claude Code