9cad9ed0fc
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.
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
namespace ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
|
||
|
||
/// <summary>
|
||
/// Writes the OPC UA Server object's <c>ServiceLevel</c> Variable (0–255). Production binds
|
||
/// a sink that pokes the SDK's ServiceLevel node; tests + dev mode bind
|
||
/// <see cref="NullServiceLevelPublisher"/> which just records the most recently set level
|
||
/// for inspection.
|
||
/// </summary>
|
||
public interface IServiceLevelPublisher
|
||
{
|
||
/// <summary>Publishes the service level value to the OPC UA Server object.</summary>
|
||
/// <param name="serviceLevel">The service level value (0-255).</param>
|
||
void Publish(byte serviceLevel);
|
||
}
|
||
|
||
/// <summary>No-op default that retains the last-written ServiceLevel in
|
||
/// <see cref="LastPublished"/>. Used by dev mode + verified by tests.</summary>
|
||
public sealed class NullServiceLevelPublisher : IServiceLevelPublisher
|
||
{
|
||
public static readonly NullServiceLevelPublisher Instance = new();
|
||
private NullServiceLevelPublisher() { }
|
||
|
||
/// <summary>Gets the last published service level value.</summary>
|
||
public byte LastPublished { get; private set; }
|
||
|
||
/// <inheritdoc />
|
||
public void Publish(byte serviceLevel) => LastPublished = serviceLevel;
|
||
}
|