using MessagePack; namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Shared.Contracts; /// /// Wire shape for a parsed FOCAS address. Mirrors FocasAddress in the driver /// package but lives in Shared so the Host (.NET 4.8) can decode without taking a /// reference to the .NET 10 driver assembly. The Proxy serializes from its own /// FocasAddress; the Host maps back to its local equivalent. /// [MessagePackObject] public sealed class FocasAddressDto { /// 0 = Pmc, 1 = Parameter, 2 = Macro. Matches FocasAreaKind enum order. [Key(0)] public int Kind { get; set; } /// PMC letter — null for Parameter / Macro. [Key(1)] public string? PmcLetter { get; set; } [Key(2)] public int Number { get; set; } /// Optional bit index (0-7 for PMC, 0-31 for Parameter). [Key(3)] public int? BitIndex { get; set; } } /// /// 0 = Bit, 1 = Byte, 2 = Int16, 3 = Int32, 4 = Float32, 5 = Float64, 6 = String. /// Matches FocasDataType enum order so both sides can cast (int). /// public static class FocasDataTypeCode { public const int Bit = 0; public const int Byte = 1; public const int Int16 = 2; public const int Int32 = 3; public const int Float32 = 4; public const int Float64 = 5; public const int String = 6; }