support multiple firmware revisions per terminal in YAML#62
Open
gilesknap wants to merge 1 commit into
Open
Conversation
Some Beckhoff terminals rename PDOs across revisions while keeping the same (vendor, product). EP2338-0002 renames RxPDOs Channel 1..8 → Channel 9..16 at revision 0x00120002, so rigs at that firmware that loose-matched the 0x00100002 YAML fabricated wrong ADS symbol names and AO writes silently failed. Lookup change in get_terminal_type_by_identity: 1. Exact (vendor, product, revision) match. 2. Highest (vendor, product) candidate with revision ≤ rig. 3. Lowest-revision (vendor, product) candidate (degraded fallback) with a warning. 4. None. Multi-revision entries use the suffix `__rev<8 hex>` (lowercase `rev`, no `@` — that character would flow into GUI DOM IDs). The bare-id entry stays the lowest cached revision, so existing deployments don't need a key rename. service_file.merge_xml_for_terminal strips the suffix before fetching the ESI XML and threads the entry's pinned revision through as target_revision so the parser picks the right <Device>. Adds EP2338-0002__rev00120002, picking up the renamed Channel 9..16 RxPDOs from the cached XML. The bare EP2338-0002 entry is unchanged. GUI rework and the merge-idempotency follow-up are deferred to later slices. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
==========================================
+ Coverage 75.26% 75.28% +0.01%
==========================================
Files 19 19
Lines 4096 4098 +2
==========================================
+ Hits 3083 3085 +2
Misses 1013 1013 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Fixes #60. Some Beckhoff terminals rename PDOs across revisions while keeping the same (vendor, product). EP2338-0002 renames RxPDOs Channel 1..8 → Channel 9..16 at revision
0x00120002, so rigs at that firmware that loose-matched the0x00100002YAML fabricated wrong ADS symbol names and AO writes silently failed.Lookup change in
get_terminal_type_by_identity:(vendor, product, revision)match.(vendor, product)candidate with revision ≤ rig.(vendor, product)candidate (degraded fallback) with a warning.Schema: Multi-revision entries use the suffix
__rev<8 hex>(lowercaserev, no@— that character would flow into GUI DOM IDs). The bare-id entry stays the lowest cached revision, so existing deployments don't need a key rename.service_file.merge_xml_for_terminalstrips the suffix before fetching the ESI XML and threads the entry's pinned revision through astarget_revisionso the parser picks the right<Device>.Adds
EP2338-0002__rev00120002, picking up the renamed Channel 9..16 RxPDOs from the cached XML. The bareEP2338-0002entry is unchanged.GUI rework and the merge-idempotency follow-up are deferred to later slices.
Test plan
tests/test_symbol_expansion.pyexercises exact/highest-≤/degraded-fallback paths.0x00120002(AO writes land at the right Channel 9..16 symbols) — pending.🤖 Generated with Claude Code