Skip to content

gsdml: configurable submodules (--plug-submodule, gsdml config); go-profinet v0.24.0 - #54

Merged
boeboe merged 2 commits into
mainfrom
gsdml/configuration
Nov 24, 2026
Merged

boeboe merged 2 commits into
mainfrom
gsdml/configuration

Conversation

@boeboe

@boeboe boeboe commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Builds on go-profinet v0.24.0's gsdml.Configuration, so profinetctl can configure configurable GSDML submodules (UseableSubmodules).

When the configuration is used

profinetctl builds the model with gsdml.Configuration in three cases:

  • --plug-submodule is given.
  • ToModel refuses the device access point because its defaults need configurable submodules.
  • A --plug names a module that has configurable submodules.

Otherwise the model is ToModel's, exactly as before. That matters because a file from gsdml generate writes FixedInSlots for every plugged module. Today --plug replaces those modules, and --plug-any-slot bypasses the slot lists; the configuration allows neither.

Changes

  • --plug-submodule SLOT:SUBSLOT=SUBMODULE, for connect, the AR commands and gsdml plan:
    • Repeatable, applied after --plug; slot 0 is the DAP.
    • SUBMODULE is a SubmoduleItem ID, or an ident number when only one submodule has it, or - to leave the subslot empty.
  • gsdml config FILE shows:
    • the resolved slots and submodules, with each configurable submodule marked by its ID;
    • the configurable submodules of the DAP and of each plugged module, with the subslots the file allows, fixes and uses them in.
  • gsdml modules:
    • Modules with configurable submodules are now listed as usable, with a new configurable_submodules count.
    • omitted_modules keeps only the modules go-profinet cannot place.
  • --gsdml, gsdml modules, submodules, inspect and check use the default configuration for a DAP that v0.21.0 refused with unsupported_gsdml.
    • A default that needs a choice (two submodules used in one subslot) gives invalid_input with a hint.
    • check reports it as unvalidated, rule model.

Exit codes and JSON are documented in docs/exitcodes.md and docs/json-output.md. RELEASE.md has a v0.22.0 section, including a Breaking list.

Tests

Tests are in cmd/omitted_test.go. The fixture is the test model's generated GSDML with a SubmoduleList (SM_WIDE and SM_ALT), and module 0x40 allowed in slots 3–5 with configurable submodules in subslots 2–3. The tests cover:

  • gsdml config: the default; --plug; choosing by ID and by ident number; clearing a subslot; text and table output; nine error cases.
  • An ident number two submodules share.
  • connect against a device that serves the resolved model: it reaches Running with no module diff.
  • gsdml plan with configurable submodules.
  • --plug-any-slot and --model combinations, and the unchanged ToModel path.
  • A DAP ToModel refuses, through modules, submodules, inspect, check and connect.
  • A default that needs a choice.
  • A module whose SubmoduleItem the file doesn't define.

Results: make check passes (coverage 94.9%), and so do make e2e and make cross.

🤖 Generated with Claude Code

…; go-profinet v0.24.0

go-profinet v0.24.0's gsdml.Configuration configures configurable
submodules. profinetctl builds the model with it for --plug-submodule,
for a device access point whose defaults need configurable submodules
(ToModel refuses it), and for a --plug of a module that has them;
otherwise the model is ToModel's, as before, so --plug-any-slot and the
replacement of a module a generated file fixes keep working.

- --plug-submodule SLOT:SUBSLOT=SUBMODULE (AR commands, gsdml plan): a
  SubmoduleItem ID, an ident number only one submodule has, or - to
  leave the subslot empty.
- gsdml config: the resolved configuration and the configurable
  submodules of the DAP and of each plugged module.
- gsdml modules lists modules with configurable submodules (with their
  number); omitted_modules keeps those go-profinet cannot place.
- --gsdml, inspect and check take the default configuration of a DAP
  ToModel refuses; a default that needs a choice is invalid_input, and
  unvalidated in check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Tests for a malformed configurable submodule (listed with why in gsdml
config, invalid_gsdml for --plug-submodule), an ident number no
configurable submodule has, --plug with --model, and the reasons gsdml
modules gives: the module's own error, and two submodules used in one
subslot by default, which the reason now names. slotOptions and gsdml
modules lose their unreachable branches; gsdml config no longer checks
for cancellation before a local, bounded step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boeboe
boeboe merged commit 003609b into main Nov 24, 2026
19 checks passed
@boeboe
boeboe deleted the gsdml/configuration branch November 24, 2026 15:03
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