namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus;

/// <summary>
///     Operator-visible snapshot of one auto-prohibited coalesced range. Returned in
///     bulk by <see cref="ModbusDriver.GetAutoProhibitedRanges"/>; consumers (Admin UI,
///     dashboards, log-aggregation pipelines) project the list into whatever shape they need.
/// </summary>
/// <param name="UnitId">Modbus unit ID (slave) the prohibition applies to.</param>
/// <param name="Region">Register region (HoldingRegisters / InputRegisters / Coils / DiscreteInputs).</param>
/// <param name="StartAddress">Inclusive start of the prohibited range (zero-based PDU offset).</param>
/// <param name="EndAddress">Inclusive end of the prohibited range. Equals <paramref name="StartAddress"/> when bisection has narrowed to a single register.</param>
/// <param name="LastProbedUtc">Wall-clock time of the most recent failure (record) or re-probe (refresh).</param>
/// <param name="BisectionPending">
///     True when the range still spans &gt; 1 register and the next re-probe will bisect it.
///     False when the range is single-register or has been pinned permanent.
/// </param>
public sealed record ModbusAutoProhibition(
    byte UnitId,
    ModbusRegion Region,
    ushort StartAddress,
    ushort EndAddress,
    DateTime LastProbedUtc,
    bool BisectionPending);
