[abcip] AbCip — Online tag-DB refresh trigger #350

Merged
dohertj2 merged 1 commits from auto/abcip/2.5 into auto/driver-gaps 2026-04-25 18:48:16 -04:00
Owner

Summary

Online tag-DB refresh trigger via new IDriverControl capability interface.

  • Core.Abstractions/IDriverControl.cs (new) — capability interface with single RebrowseAsync(IAddressSpaceBuilder, CancellationToken) hook for operator-triggered symbol-table refresh.
  • AbCipDriver — implements IDriverControl. RebrowseAsync clears the UDT template cache then re-runs the enumerator + builder fan-out. New _discoverySemaphore (SemaphoreSlim(1,1)) also serialises DiscoverAsync so two concurrent triggers don't race. Discovery body extracted to private DiscoverCoreAsync helper to keep the diff tight.
  • Driver.AbCip.Cli — new rebrowse CLI subcommand (mirrors the probe shape — same --gateway / --family / --timeout-ms flags). Builds a transient driver, runs RebrowseAsync against an in-memory ConsoleAddressSpaceBuilder, prints the discovered nodes.

Test plan

  • dotnet build — Core.Abstractions, Driver.AbCip, Driver.AbCip.Cli — all clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests313 / 313 passed (4 new in AbCipRebrowseTests: two consecutive RebrowseAsync calls bump enumerator counts 1→2, discovered tags reach the supplied builder, template cache drops on rebrowse, AbCipDriver is assignable to IDriverControl)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Cli.Tests — 17 / 17
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests — 37 / 37
  • Integration tests — skipped (live PLC required)

🤖 Auto-generated by the Mode-B execution loop. Closes #233.

Closes #233

## Summary Online tag-DB refresh trigger via new `IDriverControl` capability interface. - **`Core.Abstractions/IDriverControl.cs`** (new) — capability interface with single `RebrowseAsync(IAddressSpaceBuilder, CancellationToken)` hook for operator-triggered symbol-table refresh. - **`AbCipDriver`** — implements `IDriverControl`. `RebrowseAsync` clears the UDT template cache then re-runs the enumerator + builder fan-out. New `_discoverySemaphore` (`SemaphoreSlim(1,1)`) also serialises `DiscoverAsync` so two concurrent triggers don't race. Discovery body extracted to private `DiscoverCoreAsync` helper to keep the diff tight. - **`Driver.AbCip.Cli`** — new `rebrowse` CLI subcommand (mirrors the `probe` shape — same `--gateway` / `--family` / `--timeout-ms` flags). Builds a transient driver, runs `RebrowseAsync` against an in-memory `ConsoleAddressSpaceBuilder`, prints the discovered nodes. ## Test plan - [x] `dotnet build` — Core.Abstractions, Driver.AbCip, Driver.AbCip.Cli — all clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests` — **313 / 313 passed** (4 new in `AbCipRebrowseTests`: two consecutive `RebrowseAsync` calls bump enumerator counts 1→2, discovered tags reach the supplied builder, template cache drops on rebrowse, `AbCipDriver` is assignable to `IDriverControl`) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Cli.Tests` — 17 / 17 - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests` — 37 / 37 - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #233. Closes #233
dohertj2 added 1 commit 2026-04-25 18:48:12 -04:00
Add IDriverControl capability interface in Core.Abstractions with a
RebrowseAsync(IAddressSpaceBuilder, CancellationToken) hook so operators
can force a controller-side @tags re-walk without restarting the driver.

AbCipDriver now implements IDriverControl. RebrowseAsync clears the UDT
template cache (so stale shapes from a pre-download program don't
survive) then runs the same enumerator + builder fan-out as
DiscoverAsync, serialised against concurrent discovery / rebrowse via
a new SemaphoreSlim.

Driver.AbCip.Cli ships a `rebrowse` subcommand mirroring the existing
probe / read shape: connects to a single gateway, runs RebrowseAsync
against an in-memory builder, and prints discovered tag names so
operators can sanity-check the controller's symbol table from a shell.

Tests cover: two consecutive RebrowseAsync calls bump the enumerator's
Create / Enumerate counters once each, discovered tags reach the
supplied builder, the template cache is dropped on rebrowse, and the
driver exposes IDriverControl. 313 AbCip unit tests + 17 CLI tests +
37 Core.Abstractions tests pass.

Closes #233
dohertj2 merged commit 177d75784b into auto/driver-gaps 2026-04-25 18:48:16 -04:00
dohertj2 deleted branch auto/abcip/2.5 2026-04-25 18:48:17 -04:00
Sign in to join this conversation.