Auto: abcip-5.1 — HSBY paired-IP role probing

Closes #242
This commit is contained in:
Joseph Doherty
2026-04-26 07:51:44 -04:00
parent 349aa5c6f4
commit 561b0f9ea9
12 changed files with 1260 additions and 9 deletions

View File

@@ -43,7 +43,15 @@ public static class AbCipDriverFactoryExtensions
"AddressingMode", fallback: AddressingMode.Auto),
ReadStrategy: ParseEnum<ReadStrategy>(d.ReadStrategy, "device", driverInstanceId,
"ReadStrategy", fallback: ReadStrategy.Auto),
MultiPacketSparsityThreshold: d.MultiPacketSparsityThreshold ?? 0.25))]
MultiPacketSparsityThreshold: d.MultiPacketSparsityThreshold ?? 0.25,
// PR abcip-5.1 — HSBY paired-IP knobs. Both null / absent = no HSBY.
PartnerHostAddress: d.PartnerHostAddress,
Hsby: d.Hsby is null ? null : new AbCipHsbyOptions
{
Enabled = d.Hsby.Enabled ?? false,
RoleTagAddress = d.Hsby.RoleTagAddress ?? "WallClockTime.SyncStatus",
ProbeInterval = TimeSpan.FromMilliseconds(d.Hsby.ProbeIntervalMs ?? 2_000),
}))]
: [],
Tags = dto.Tags is { Count: > 0 }
? [.. dto.Tags.Select(t => BuildTag(t, driverInstanceId))]
@@ -163,6 +171,32 @@ public static class AbCipDriverFactoryExtensions
/// resolves to <c>Auto</c>. Default <c>0.25</c>; clamped to <c>[0..1]</c>.
/// </summary>
public double? MultiPacketSparsityThreshold { get; init; }
/// <summary>
/// PR abcip-5.1 — canonical AB CIP gateway URI of the partner chassis in a
/// ControlLogix HSBY pair. <c>null</c> = no HSBY partner; the driver behaves
/// exactly like every pre-5.1 build. When set together with
/// <see cref="Hsby"/> <c>.Enabled = true</c>, the driver runs a second probe loop
/// against the partner + reports the active chassis through driver diagnostics.
/// </summary>
public string? PartnerHostAddress { get; init; }
/// <summary>
/// PR abcip-5.1 — HSBY (Hot-Standby) sub-options. Defaults to
/// <c>Enabled = false</c> when omitted; pre-5.1 deployments are unaffected.
/// </summary>
public AbCipHsbyDto? Hsby { get; init; }
}
/// <summary>
/// PR abcip-5.1 — JSON-mirror of <see cref="AbCipHsbyOptions"/>. Off by default; enabled
/// by setting <c>Enabled = true</c> + the parent device's <c>PartnerHostAddress</c>.
/// </summary>
internal sealed class AbCipHsbyDto
{
public bool? Enabled { get; init; }
public string? RoleTagAddress { get; init; }
public int? ProbeIntervalMs { get; init; }
}
internal sealed class AbCipTagDto