Gurux.DLMS.GXDLMSTranslator.GetDlmsFraming C# (CSharp) Méthode

GetDlmsFraming() public static méthode

Identify used DLMS framing type.
public static GetDlmsFraming ( GXByteBuffer value ) : InterfaceType
value GXByteBuffer Input data.
Résultat InterfaceType
        public static InterfaceType GetDlmsFraming(GXByteBuffer value)
        {
            for (int pos = value.Position; pos != value.Size; ++pos)
            {
                if (value.GetUInt8(pos) == 0x7e)
                {
                    return InterfaceType.HDLC;
                }
                if (value.GetUInt16(pos) == 1)
                {
                    return InterfaceType.WRAPPER;
                }
            }
            throw new ArgumentException("Invalid DLMS framing.");
        }