From 5058a56645a9efb6ef883199d4dfe18e36b4dec6 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 28 May 2026 08:50:17 -0400 Subject: [PATCH] refactor(driver-modbus): extract ModbusDriverOptions to .Contracts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move ModbusDriverOptions (and companion option types) to a new Driver.Modbus.Contracts sibling project. The contracts project references only Driver.Modbus.Addressing (itself zero-dep and Admin-safe) because ModbusDriverOptions.Probe/Family/Region properties use enum types that live there. Drop 'using ZB.MOM.WW.OtOpcUa.Core.Abstractions' and replace with IHostConnectivityProbe per the approved decision — the using was doc-comment-only. The runtime Driver.Modbus project gains a ProjectReference back to .Contracts; the .slnx is updated accordingly. --- ZB.MOM.WW.OtOpcUa.slnx | 1 + .../ModbusDriverOptions.cs | 4 +--- ...OM.WW.OtOpcUa.Driver.Modbus.Contracts.csproj | 17 +++++++++++++++++ .../ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj | 1 + 4 files changed, 20 insertions(+), 3 deletions(-) rename src/Drivers/{ZB.MOM.WW.OtOpcUa.Driver.Modbus => ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts}/ModbusDriverOptions.cs (99%) create mode 100644 src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.csproj diff --git a/ZB.MOM.WW.OtOpcUa.slnx b/ZB.MOM.WW.OtOpcUa.slnx index 9faa1112..5cff2221 100644 --- a/ZB.MOM.WW.OtOpcUa.slnx +++ b/ZB.MOM.WW.OtOpcUa.slnx @@ -25,6 +25,7 @@ + diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ModbusDriverOptions.cs b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ModbusDriverOptions.cs similarity index 99% rename from src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ModbusDriverOptions.cs rename to src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ModbusDriverOptions.cs index 06beae23..0daca164 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ModbusDriverOptions.cs +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ModbusDriverOptions.cs @@ -1,5 +1,3 @@ -using ZB.MOM.WW.OtOpcUa.Core.Abstractions; - namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus; /// @@ -26,7 +24,7 @@ public sealed class ModbusDriverOptions /// is true the driver runs a tick loop that issues a cheap FC03 at register 0 every /// and raises OnHostStatusChanged on /// Running ↔ Stopped transitions. The Admin UI / OPC UA clients see the state through - /// . + /// IHostConnectivityProbe. /// public ModbusProbeOptions Probe { get; init; } = new(); diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.csproj new file mode 100644 index 00000000..98b2207c --- /dev/null +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.csproj @@ -0,0 +1,17 @@ + + + + net10.0 + enable + enable + true + + + + + + + + diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj index 74c482a9..9c39c821 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus/ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj @@ -15,6 +15,7 @@ +