///<summary> ///Get Int64 value from DLMS data. ///</summary> ///<param name="buff"> ///Received DLMS data. ///</param> ///<param name="info"> ///Data info. ///</param> ///<returns> ///Parsed Int64 value. ///</returns> private static object GetInt64(GXByteBuffer buff, GXDataInfo info) { // If there is not enough data available. if (buff.Size - buff.Position < 8) { info.Complete = false; return null; } Int64 value = buff.GetInt64(); if (info.xml != null) { info.xml.AppendLine(info.xml.GetDataType(info.Type), "Value", info.xml.IntegerToHex(value, 16)); } return value; }
/// <returns> /// Get integer value as long. /// </returns> public long ToLong() { GXByteBuffer bb = new GXByteBuffer(Value); return(bb.GetInt64()); }