Repository navigation
feat(canopen): add opt-in guarding error EMCYs - #486
Conversation
PR SummaryMedium Risk Overview When enabled, those lapses join the existing FR-CO-011 communication-error model: SRS FR-CO-011, README, public API approval, and wire-level Reviewed by Cursor Bugbot for commit 5f76359. 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! |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What does this change?
Applications can opt into EMCY 8130h for heartbeat-consumer and local life-guarding timeouts with
CanOpenNodeOptions.EmitGuardingErrorEmcy. It defaults to false, preserving the existing timeout-event-only behavior. Existing options-copy signatures remain binary-compatible and preserve the new setting; the generated API approval adds only this property.An enabled lapse uses the existing communication-error aggregation: bits 4/0 of 1001h while active, one EMCY per error event, and 0000h only when the last communication cause ends, retaining application bits. Heartbeat reception, watch removal/change, a guarding poll, disabling life guarding and NMT reset retire the appropriate state. Re-enabling an EMCY producer reports only faults that remain active; toggling it does not duplicate a reported lapse. Reset ends the causes without an error-reset EMCY. No new event subscriptions or controller polling are introduced.
Refs #423 (not Closes). This PR implements 8130h only. Optional controller-state EMCYs remain separate: 8120h can use the observed passive state; overrun clear semantics and the 8140h bus-off-recovery/reset sequence require their explicit evidence/scope decision. Node-guarding-consumer timeout behavior remains unchanged.
Type of change
feat— new opt-in behaviour (minor release)Validation
19 new clocked wire-level cases cover default opt-out with existing events, repeated lapses, multiple producers, application-bit preservation, guarded-reply recovery, unchanged/changed/removed watches, disabled/re-enabled producer, life-guard recovery/mode changes, reset with restored watch, and existing copy methods.
Nine actual source mutations were runtime-red and restored: enable by default; duplicate a lapse; omit heartbeat recovery; clear another producer's cause; omit watch reconciliation; omit life-guard disable reset; omit reporting on re-enable; retain pre-reset heartbeat lapse history; incorrectly clear an unchanged watch when another is added. Runners:
/private/tmp/cankit-423-guarding-mutations.pyand/private/tmp/cankit-423-guarding-filter-mutation.py.Full local gates passed: 3062 net10 tests with coverage, net48 compilation, CI build, formatting, nine verified packages, 50 engineering tests and traceability. All 36 changed executable Cobertura entries across every class/nested type are covered with no missing/partials. The API received file was generated by PublicApiSurfaceTests, its one-property diff reviewed, then copied to the approval. README and FR-CO-011 describe the opt-in and its boundaries.
Checklist
-p:CI=true, test (net10.0),dotnet format --verify-no-changes, and pack +eng/verify-packages.pyall pass locally