fix(driver-s7): resolve Medium code-review finding (Driver.S7-012)
Remove the dead ProbeAddress config surface from S7ProbeOptions and the factory DTO. ProbeLoopAsync uses Plc.ReadStatusAsync (CPU-status PDU), not a tag-address read — ProbeAddress was never consumed. The XML doc on Probe is corrected to describe the ReadStatusAsync-based probe. Existing configs that set probeAddress are silently ignored by the JSON deserializer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -64,7 +64,7 @@ public static class S7DriverFactoryExtensions
|
||||
Enabled = dto.Probe?.Enabled ?? true,
|
||||
Interval = TimeSpan.FromMilliseconds(dto.Probe?.IntervalMs ?? 5_000),
|
||||
Timeout = TimeSpan.FromMilliseconds(dto.Probe?.TimeoutMs ?? 2_000),
|
||||
ProbeAddress = dto.Probe?.ProbeAddress ?? "MW0",
|
||||
// Driver.S7-012: ProbeAddress removed — probe uses ReadStatusAsync, not a tag read.
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -131,6 +131,8 @@ public static class S7DriverFactoryExtensions
|
||||
public bool? Enabled { get; init; }
|
||||
public int? IntervalMs { get; init; }
|
||||
public int? TimeoutMs { get; init; }
|
||||
public string? ProbeAddress { get; init; }
|
||||
// Driver.S7-012: ProbeAddress removed from the configurable surface — the probe uses
|
||||
// ReadStatusAsync (CPU status), not a tag-address read. Config documents that previously
|
||||
// set probeAddress are safely ignored (unknown JSON fields are tolerated by the deserialiser).
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user