docs(xmldoc): fill missing XML docs + strip tracking-ID comments across src
v2-ci / build (push) Failing after 41s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 41s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>/<param>/<returns>/<inheritdoc> where missing and removes project bookkeeping IDs (task/tracking refs) from shipped code comments, so the docs read cleanly and CommentChecker is quiet except for known false positives (PLC/protocol terms, event/IEqualityComparer inheritdoc). Doc/comment-only; no logic changed; solution builds clean.
This commit is contained in:
@@ -43,7 +43,7 @@ public sealed class ProbeCommand : ModbusCommandBase
|
||||
var snapshot = await driver.ReadAsync(["__probe"], ct);
|
||||
var health = driver.GetHealth();
|
||||
|
||||
// Driver.Modbus.Cli-006: derive the headline verdict from BOTH the driver state
|
||||
// Derive the headline verdict from BOTH the driver state
|
||||
// AND the probe-read StatusCode so the operator never sees the previous
|
||||
// contradictory pair (`Health: Healthy` over a Bad snapshot line). The bare
|
||||
// driver state is still printed below for diagnostics, but the verdict is what
|
||||
@@ -61,21 +61,21 @@ public sealed class ProbeCommand : ModbusCommandBase
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
{
|
||||
// Driver.Modbus.Cli-005: Ctrl+C during InitializeAsync — exit quietly so CliFx
|
||||
// Ctrl+C during InitializeAsync — exit quietly so CliFx
|
||||
// does not render a full stack trace for a user-initiated cancellation.
|
||||
await console.Output.WriteLineAsync("Cancelled.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
await driver.ShutdownAsync(CancellationToken.None);
|
||||
// Driver.Modbus.Cli-009: flush Serilog before process exit so buffered log lines
|
||||
// Flush Serilog before process exit so buffered log lines
|
||||
// emitted during driver shutdown are not lost. Matches Driver.AbCip.Cli pattern.
|
||||
FlushLogging();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Driver.Modbus.Cli-006: combine the driver-side <see cref="DriverState"/> with the
|
||||
/// Combine the driver-side <see cref="DriverState"/> with the
|
||||
/// probe snapshot's OPC UA <c>StatusCode</c> into a single headline verdict. Order
|
||||
/// of precedence:
|
||||
/// <list type="number">
|
||||
|
||||
@@ -79,15 +79,15 @@ public sealed class ReadCommand : ModbusCommandBase
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
{
|
||||
// Driver.Modbus.Cli-005: Ctrl+C during driver connect/read — exit quietly so
|
||||
// CliFx does not render a full stack trace for a user-initiated cancellation.
|
||||
// Ctrl+C during driver connect/read — exit quietly so CliFx does not render a
|
||||
// full stack trace for a user-initiated cancellation.
|
||||
await console.Output.WriteLineAsync("Cancelled.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
await driver.ShutdownAsync(CancellationToken.None);
|
||||
// Driver.Modbus.Cli-009: flush Serilog before process exit so buffered log lines
|
||||
// emitted during driver shutdown are not lost. Matches Driver.AbCip.Cli pattern.
|
||||
// Flush Serilog before process exit so buffered log lines emitted during driver
|
||||
// shutdown are not lost. Matches Driver.AbCip.Cli pattern.
|
||||
FlushLogging();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
"BigEndian (default) or WordSwap.")]
|
||||
public ModbusByteOrder ByteOrder { get; init; } = ModbusByteOrder.BigEndian;
|
||||
|
||||
// Driver.Modbus.Cli-001: subscribe previously lacked these three options that read and
|
||||
// subscribe previously lacked these three options that read and
|
||||
// write both expose. Without them, BitInRegister always watches bit 0 and String runs with
|
||||
// StringLength=0, silently producing wrong results for any subscriber using those types.
|
||||
/// <summary>Gets or sets the bit index for type=BitInRegister (0-15, LSB-first).</summary>
|
||||
@@ -63,7 +63,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
{
|
||||
ConfigureLogging();
|
||||
ValidateEndpoint();
|
||||
// Driver.Modbus.Cli-010: reject non-positive interval before opening the driver so
|
||||
// Reject non-positive interval before opening the driver so
|
||||
// the operator gets a clean error instead of a confusing PollGroupEngine failure.
|
||||
ValidateInterval(IntervalMs);
|
||||
var ct = console.RegisterCancellationHandler();
|
||||
@@ -82,7 +82,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
var options = BuildOptions([tag]);
|
||||
|
||||
await using var driver = new ModbusDriver(options, DriverInstanceId);
|
||||
// Driver.Modbus.Cli-004: serialize console writes from the PollGroupEngine background
|
||||
// Serialize console writes from the PollGroupEngine background
|
||||
// thread so overlapping poll ticks can't interleave partial lines.
|
||||
var writeLock = new object();
|
||||
ISubscriptionHandle? handle = null;
|
||||
@@ -90,7 +90,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
{
|
||||
await driver.InitializeAsync("{}", ct);
|
||||
|
||||
// Driver.Modbus.Cli-011: emit the banner BEFORE wiring OnDataChange so the
|
||||
// Emit the banner BEFORE wiring OnDataChange so the
|
||||
// main-thread WriteLineAsync cannot interleave with poll-thread change-event
|
||||
// writes. TextWriter.WriteLine is not guaranteed thread-safe; once the handler
|
||||
// is attached and SubscribeAsync starts, change events run on the poll thread.
|
||||
@@ -102,7 +102,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
// analyzer flags it + IConsole is the testable abstraction).
|
||||
driver.OnDataChange += (_, e) =>
|
||||
{
|
||||
// Driver.Modbus.Cli-004: swallow + log write failures so a transient stdout
|
||||
// Swallow + log write failures so a transient stdout
|
||||
// error (closed pipe, IO exception on a redirected stream) cannot tear down
|
||||
// the poll-engine background loop. Without this guard the unhandled
|
||||
// exception would fault the long-running subscribe.
|
||||
@@ -142,7 +142,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
catch { /* teardown best-effort */ }
|
||||
}
|
||||
await driver.ShutdownAsync(CancellationToken.None);
|
||||
// Driver.Modbus.Cli-009: flush Serilog before process exit so buffered log lines
|
||||
// Flush Serilog before process exit so buffered log lines
|
||||
// emitted just before Ctrl+C (e.g. during UnsubscribeAsync / ShutdownAsync) are
|
||||
// not lost. Matches the pattern in Driver.AbCip.Cli commands.
|
||||
FlushLogging();
|
||||
@@ -150,7 +150,7 @@ public sealed class SubscribeCommand : ModbusCommandBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Driver.Modbus.Cli-010: guards <c>--interval-ms</c> against zero or negative values.
|
||||
/// Guards <c>--interval-ms</c> against zero or negative values.
|
||||
/// A non-positive interval would produce a non-positive <see cref="TimeSpan"/> into
|
||||
/// <c>SubscribeAsync</c>; the CLI should fail fast with an actionable error rather
|
||||
/// than relying on the downstream <c>PollGroupEngine</c> to clamp the value.
|
||||
|
||||
@@ -59,7 +59,6 @@ public sealed class WriteCommand : ModbusCommandBase
|
||||
"For type=String: HighByteFirst (standard) or LowByteFirst (DirectLOGIC).")]
|
||||
public ModbusStringByteOrder StringByteOrder { get; init; } = ModbusStringByteOrder.HighByteFirst;
|
||||
|
||||
/// <summary>Executes the write command.</summary>
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
@@ -71,11 +70,6 @@ public sealed class WriteCommand : ModbusCommandBase
|
||||
throw new CliFx.Exceptions.CommandException(
|
||||
$"Region '{Region}' is read-only in the Modbus spec; writes require Coils or HoldingRegisters.");
|
||||
|
||||
// Driver.Modbus.Cli-002: coils are single-bit outputs — only Bool makes sense. A
|
||||
// non-boolean type (e.g. --region Coils --type UInt16) would silently coerce the value
|
||||
// to a boolean via Convert.ToBoolean, landing as ON for any non-zero value, with no
|
||||
// diagnostic. Reject it early so the operator sees a clear error rather than a silent
|
||||
// type-mismatch coerce.
|
||||
if (Region == ModbusRegion.Coils && DataType != ModbusDataType.Bool)
|
||||
throw new CliFx.Exceptions.CommandException(
|
||||
$"Region 'Coils' only supports boolean values (--type Bool). " +
|
||||
@@ -105,15 +99,11 @@ public sealed class WriteCommand : ModbusCommandBase
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
{
|
||||
// Driver.Modbus.Cli-005: Ctrl+C during driver connect/write — exit quietly so
|
||||
// CliFx does not render a full stack trace for a user-initiated cancellation.
|
||||
await console.Output.WriteLineAsync("Cancelled.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
await driver.ShutdownAsync(CancellationToken.None);
|
||||
// Driver.Modbus.Cli-009: flush Serilog before process exit so buffered log lines
|
||||
// emitted during driver shutdown are not lost. Matches Driver.AbCip.Cli pattern.
|
||||
FlushLogging();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ public abstract class ModbusCommandBase : DriverCommandBase
|
||||
/// command against its own keep-alive reads.
|
||||
/// </summary>
|
||||
/// <param name="tags">The tag definitions to include in the options.</param>
|
||||
/// <returns>A <see cref="ModbusDriverOptions"/> ready to hand to the driver constructor.</returns>
|
||||
protected ModbusDriverOptions BuildOptions(IReadOnlyList<ModbusTagDefinition> tags) => new()
|
||||
{
|
||||
Host = Host,
|
||||
@@ -66,7 +67,7 @@ public abstract class ModbusCommandBase : DriverCommandBase
|
||||
protected string DriverInstanceId => $"modbus-cli-{Host}:{Port}";
|
||||
|
||||
/// <summary>
|
||||
/// Driver.Modbus.Cli-003: validate the endpoint flags at parse time so the operator
|
||||
/// Validate the endpoint flags at parse time so the operator
|
||||
/// gets a clear CliFx error instead of an opaque socket / argument exception thrown
|
||||
/// deep inside the driver. Ranges:
|
||||
/// <list type="bullet">
|
||||
|
||||
Reference in New Issue
Block a user