namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests.DL205;
///
/// Tag map for the AutomationDirect DL205 device class. Mirrors what the ModbusPal
/// .xmpp profile in ModbusPal/DL205.xmpp exposes (or the real PLC, when
/// is pointed at one).
///
///
/// This is the scaffold — each tag is deliberately generic so the smoke test has stable
/// addresses to read. Device-specific quirk tests (word order, max-register, register-zero
/// access, etc.) will land in their own test classes alongside this profile as the user
/// validates each behavior in ModbusPal; see docs/v2/modbus-test-plan.md §per-device
/// quirk catalog for the checklist.
///
public static class DL205Profile
{
/// Holding register the smoke test reads. Address 100 sidesteps the DL205
/// register-zero quirk (pending confirmation) — see modbus-test-plan.md.
public const ushort SmokeHoldingRegister = 100;
/// Expected value the ModbusPal profile seeds into register 100. When running
/// against a real DL205 (or a ModbusPal profile where this register is writable), the smoke
/// test seeds this value first, then reads it back.
public const short SmokeHoldingValue = 1234;
public static ModbusDriverOptions BuildOptions(string host, int port) => new()
{
Host = host,
Port = port,
UnitId = 1,
Timeout = TimeSpan.FromSeconds(2),
Tags =
[
new ModbusTagDefinition(
Name: "DL205_Smoke_HReg100",
Region: ModbusRegion.HoldingRegisters,
Address: SmokeHoldingRegister,
DataType: ModbusDataType.Int16,
Writable: true),
],
// Disable the background probe loop — integration tests drive reads explicitly and
// the probe would race with assertions.
Probe = new ModbusProbeOptions { Enabled = false },
};
}