namespace ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
///
/// Writes the OPC UA Server object's ServiceLevel Variable (0–255). Production binds
/// a sink that pokes the SDK's ServiceLevel node; tests + dev mode bind
/// which just records the most recently set level
/// for inspection.
///
public interface IServiceLevelPublisher
{
void Publish(byte serviceLevel);
}
/// No-op default that retains the last-written ServiceLevel in
/// . Used by dev mode + verified by tests.
public sealed class NullServiceLevelPublisher : IServiceLevelPublisher
{
public static readonly NullServiceLevelPublisher Instance = new();
private NullServiceLevelPublisher() { }
public byte LastPublished { get; private set; }
public void Publish(byte serviceLevel) => LastPublished = serviceLevel;
}