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.");
}