Skip to content

feat: migrate routing to Essentials v3-routing.21 API - #36

Draft
anthony-lopez-pd wants to merge 10 commits into
feature/add-essentials-v3-compatibilityfrom
feature/routing21-migration
Draft

feat: migrate routing to Essentials v3-routing.21 API#36
anthony-lopez-pd wants to merge 10 commits into
feature/add-essentials-v3-compatibilityfrom
feature/routing21-migration

Conversation

@anthony-lopez-pd

Copy link
Copy Markdown

Migrates the DM plugin off the routing-interface family that 3.0.0-dev-v3-routing.21 removed, onto the consolidated replacements, without changing hardware-switching behavior. 43 controllers + the matrix slot types.

Mapping applied

  • IRoutingInputSlot/IRoutingOutputSlot → plugin-local IDmInputSlot/IDmOutputSlot (slot model is plugin-internal).
  • IRoutingInputsOutputsIRoutingMidpoint (endpoint/passthrough controllers — pure rename).
  • IRoutingNumeric(WithFeedback) / IRouting / IMatrixRoutingIRoutingMidpointWithFeedback (chassis/midpoints), adding the now-required ClearRoute / CurrentRoutes / RouteChanged, populated from existing switch feedback.
  • ITxRouting(WithFeedback) / IRmcRoutingWithFeedback → plugin-local interfaces extending IRoutingMidpointWithFeedback; shared TX members implemented once in DmTxControllerBase.
  • DmChassisController: dropped IMatrixRouting (kept IRoutingMidpointWithFeedback); InputSlots/OutputSlots retyped to the plugin-local slot interfaces (retained as public members; nothing external consumed the IMatrixRouting type).

Crestron switching logic (DMOutput.VideoOut/AudioOut/USBRoutedTo, off-timers, feedback wiring) is unchanged.

Status

  • ✅ Builds clean against routing.21 (0 warnings); all 84 plugin-validation tests pass.
  • Draft — hardware validation pending (shared testing task with the Wyrestorm routing migration). Focus areas:
    • CurrentRoutes / RouteChanged population after switch and after clear (Mobile Control / route-feedback consumers).
    • ClearRoute semantics per device family (chassis/matrix issue a real hardware route-off; source-style devices select "no source"; AirMedia & the two no-feedback controllers drop the tracked route only).
    • Note: DmMatrixOutput.IsOnline was previously declared-but-never-initialized (latent NRE); now initialized to match DmMatrixInput.

Same pattern as the Wyrestorm routing migration (PepperDash/epi-wyrestorm-networkHD#3).

🤖 Generated with Claude Code

anthony-lopez-pd and others added 10 commits June 18, 2026 16:13
routing.21 removed the routing-interface family this plugin used. Migrate onto
the consolidated replacements without changing hardware-switching behavior:

- Bump PepperDashEssentials to 3.0.0-dev-v3-routing.21.
- Add plugin-local IDmInputSlot / IDmOutputSlot (replace removed
  IRoutingInputSlot / IRoutingOutputSlot; slot model is plugin-internal) and
  plugin-local ITxRouting(WithFeedback) / IRmcRouting(WithFeedback)
  : IRoutingMidpointWithFeedback.
- IRoutingInputsOutputs -> IRoutingMidpoint on endpoint/passthrough controllers.
- IRoutingNumeric(WithFeedback) / IRouting / IMatrixRouting -> consolidated
  IRoutingMidpointWithFeedback on chassis/midpoint controllers; add the
  newly-required ClearRoute / CurrentRoutes / RouteChanged members, populated
  from existing switch feedback. Shared TX members implemented once in
  DmTxControllerBase.
- DmChassisController: drop IMatrixRouting (kept IRoutingMidpointWithFeedback);
  retype InputSlots/OutputSlots to the plugin-local slot interfaces.

Crestron switching logic (DMOutput.VideoOut/AudioOut/USBRoutedTo, off-timers,
feedback wiring) is unchanged. Builds clean against routing.21; all 84 plugin
validation tests pass. Hardware validation pending.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… Wyrestorm)

Brings the DM routing-feedback surface in line with the reviewed
Wyrestorm NetworkHD migration:

- IDmOutputSlot/DmMatrixOutput.CurrentRoutes now exposed as
  IReadOnlyDictionary so route state can't be mutated outside
  SetInputRoute (which raises OutputSlotChanged).
- DmMatrixClearInput (the "none"/route-off sentinel) caches a single
  IsOnline BoolFeedback reporting online, instead of allocating a new
  offline feedback on every access.
- Removed the dead VideoSyncDetected/VideoSyncChanged surface from
  IDmInputSlot (no consumers); kept concrete on DmMatrixInput only.
  Drops the CS0067 pragma from the sentinel.
- DmMatrixOutput ctor no longer swallows exceptions into a half-built,
  still-registered slot; it validates/throws and the chassis call site
  skips-and-logs a failed slot so one bad card can't poison startup.

Build clean (0 warnings); 84 tests pass. Hardware-switching logic
unchanged. The chassis breakaway CurrentRoutes clobber (output-only
removal key) is tracked separately and not addressed here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Log a warning when chassis video/audio route feedback can't resolve a
  matching output/input port (distinguishes a genuine route-off from a
  lookup miss that would otherwise silently report no source).
- Drop the dead Usb seed from DmMatrixOutput.currentRoutes (never set;
  the output only tracks Video/Audio from hardware feedback).
- Null-guard the DmMatrixInput constructor (device/videoSyncfeedback).
- Comment accuracy: document the known output-only keying limitation on
  UpdateCurrentRoute (breakaway A/V clobber, tracked separately); correct
  the "plugin-private" slot-dictionary claim (they're public members, just
  no longer part of a core routing contract); fix the orphaned doc block
  on Chassis_DMOutputChange.

Build clean (0 warnings); 84 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t tests

Fixes the breakaway-routing clobber in the new IRoutingMidpointWithFeedback
surface (#1) and adds the first laptop unit tests of the route-feedback
bookkeeping (#10).

Problem: the chassis recorded CurrentRoutes keyed on the output port only.
DM output/input ports are typed Audio|Video and the same RoutingOutputPort
instance is reported for both the video and audio feedback events, so an
audio route and a video route to the same output overwrote each other — DM
breakaway (independent A/V) routes could not be represented, and RouteChanged
reported the wrong/missing signal.

Change:
- New DmRouteFeedbackTracker maintains CurrentRoutes keyed on the explicit
  (output port, signal type) pair — signal type from the feedback event is
  the only reliable discriminator since the ports are AudioVideo-typed. Pure
  bookkeeping over Crestron-free Essentials.Core routing types.
- DmChassisController, DmTxControllerBase, and DmRmc4kZScalerCController now
  delegate to the shared tracker, replacing three near-duplicate, divergent
  implementations (the chassis keyed output-only; the TX keyed on InputPort
  .Type, which also fails when input ports are AudioVideo).
- Tests: tests/DmRouteFeedbackTrackerTests.cs links the production helper and
  exercises breakaway coexistence, per-signal replace, per-signal route-off,
  multi-output isolation, null-output guard, Clear(), and list-instance
  stability. Required referencing PepperDash.Essentials.Core in the test
  project (the routing port/descriptor types are Crestron-free, so they load
  in the test host even though the plugin itself is reflection-only).

Build clean (0 warnings); 91 tests pass (84 existing + 7 new).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

3 participants