Example #1
0
 ///<summary>
 ///Get double value from DLMS data.
 ///</summary>
 ///<param name="buff">
 ///Received DLMS data.
 ///</param>
 ///<param name="info">
 ///Data info.
 ///</param>
 ///<returns>
 ///Parsed double value.
 ///</returns>
 private static object GetDouble(GXByteBuffer buff, GXDataInfo info)
 {
     // If there is not enough data available.
     if (buff.Size - buff.Position < 8)
     {
         info.Complete = false;
         return null;
     }
     double value = buff.GetDouble();
     if (info.xml != null)
     {
         GXByteBuffer tmp = new GXByteBuffer();
         SetData(null, tmp, DataType.Float64, value);
         info.xml.AppendLine(info.xml.GetDataType(info.Type), "Value", GXCommon.ToHex(tmp.Data, false, 1, tmp.Size - 1));
     }
     return value;
 }