namespace ZB.MOM.WW.OtOpcUa.Driver.AbCip;

/// <summary>
///     Logix atomic + string data types, plus a <c>Structure</c> marker used when a tag
///     references a UDT / predefined structure (Timer, Counter, Control). The concrete UDT
///     shape is resolved via the CIP Template Object at discovery time.
/// </summary>
/// <remarks>
///     Mirrors the shape of <c>ModbusDataType</c>. Atomic Logix names (BOOL / SINT / INT / DINT /
///     LINT / REAL / LREAL / STRING / DT) map one-to-one; BIT + BOOL-in-DINT collapse into
///     <c>Bool</c> with the <c>.N</c> bit-index carried on the <c>AbCipTagPath</c>
///     rather than the data type itself.
/// </remarks>
public enum AbCipDataType
{
    Bool,
    SInt,   // signed 8-bit
    Int,    // signed 16-bit
    DInt,   // signed 32-bit
    LInt,   // signed 64-bit
    USInt,  // unsigned 8-bit (Logix 5000 post-V21)
    UInt,   // unsigned 16-bit
    UDInt,  // unsigned 32-bit
    ULInt,  // unsigned 64-bit
    Real,   // 32-bit IEEE-754
    LReal,  // 64-bit IEEE-754
    String, // Logix STRING (DINT Length + SINT[82] DATA — flattened to .NET string by libplctag)
    Dt,     // Logix DATE (0xCD — 4-byte unsigned days since 1984-01-01) or DATE_AND_TIME / DT
            // (0xCF — 8-byte unsigned microseconds since 1970-01-01). The driver reads 4 bytes
            // via GetInt32; DATE decodes correctly, DATE_AND_TIME is truncated to the low 4 bytes.
    /// <summary>
    ///     UDT / Predefined Structure (Timer / Counter / Control / Message / Axis). Shape is
    ///     resolved at discovery time; reads + writes fan out to member Variables unless the
    ///     caller has explicitly opted into whole-UDT decode.
    /// </summary>
    Structure,
}
