64e3fbe035
v2-ci / build (push) Failing after 1m43s
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>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
30 lines
1.3 KiB
C#
30 lines
1.3 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; }
|
||
|
||
/// <summary>Records the service level value without publishing.</summary>
|
||
/// <param name="serviceLevel">The service level value (0-255).</param>
|
||
public void Publish(byte serviceLevel) => LastPublished = serviceLevel;
|
||
}
|