C# Class Gurux.DLMS.GXDLMSTranslator

This class is used to translate DLMS frame or PDU to xml.
Afficher le fichier Open project: Gurux/Gurux.DLMS.Net

Private Properties

Свойство Type Description
AddTag void
ErrorCodeToString String
GetAllDataNodes void
GetCommand void
GetFloat32 void
GetFloat64 void
GetFrame bool
GetOctetString void
GetTags void
GetUa void
GetValue string
HandleAarqAare void
HexToBytes byte[]
PduToXml string
ReadAllNodes void
ReadNode void
ToHex string
ToHex string
ToHex string
UpdateDataType GXByteBuffer
UpdateDateTime GXByteBuffer
ValueOfConformance Conformance
ValueOfErrorCode ErrorCode

Méthodes publiques

Méthode Description
FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu ) : bool

Find next frame from the string.

Position of data is set to the begin of new frame. If Pdu is null it is not updated.

FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu, InterfaceType type ) : bool

Find next frame from the string.

Position of data is set to the begin of new frame. If Pdu is null it is not updated.

GXDLMSTranslator ( TranslatorOutputType type ) : System

Constructor.

GetDlmsFraming ( GXByteBuffer value ) : InterfaceType

Identify used DLMS framing type.

GetPdu ( GXByteBuffer value ) : byte[]
GetPdu ( byte value ) : byte[]
MessageToXml ( GXByteBuffer value ) : string

Convert message to xml.

MessageToXml ( byte value ) : string

Convert message to xml.

PduToXml ( GXByteBuffer value ) : string

Convert bytes to xml.

PduToXml ( byte value ) : string

Convert bytes to xml.

PduToXml ( string hex ) : string

Convert hex string to xml.

XmlToData ( string xml ) : byte[]

Convert XML data fo bytes.

XmlToHexPdu ( string xml ) : string

Convert xml to hex string.

XmlToPdu ( string xml ) : byte[]

Convert xml to byte array.

Private Methods

Méthode Description
AddTag ( string>.SortedList list, Enum value, string text ) : void
ErrorCodeToString ( TranslatorOutputType type, ErrorCode value ) : String
GetAllDataNodes ( XmlNodeList nodes, GXDLMSXmlSettings s ) : void
GetCommand ( XmlNode node, GXDLMSXmlSettings s, int tag ) : void

Get command from XML.

GetFloat32 ( XmlNode node, GXDLMSXmlSettings s ) : void
GetFloat64 ( XmlNode node, GXDLMSXmlSettings s ) : void
GetFrame ( XmlNode node, GXDLMSXmlSettings s, int tag ) : bool
GetOctetString ( XmlNode node, GXDLMSXmlSettings s ) : void
GetTags ( TranslatorOutputType type, string>.SortedList list, int>.SortedList tagsByName ) : void

Get all tags.

GetUa ( GXByteBuffer data, GXDLMSTranslatorStructure xml ) : void
GetValue ( XmlNode node, GXDLMSXmlSettings s ) : string
HandleAarqAare ( XmlNode node, GXDLMSXmlSettings s, int tag ) : void

Handle AARE and AARQ XML tags.

HexToBytes ( string value ) : byte[]
PduToXml ( GXByteBuffer value, bool omitDeclaration, bool omitNameSpace ) : string
ReadAllNodes ( XmlDocument doc, GXDLMSXmlSettings s ) : void
ReadNode ( XmlNode node, GXDLMSXmlSettings s ) : void
ToHex ( byte bytes ) : string
ToHex ( byte bytes, bool addSpace ) : string
ToHex ( byte bytes, bool addSpace, int index, int count ) : string
UpdateDataType ( XmlNode node, GXDLMSXmlSettings s, int tag ) : GXByteBuffer
UpdateDateTime ( XmlNode node, GXDLMSXmlSettings s, GXByteBuffer preData ) : GXByteBuffer
ValueOfConformance ( string value ) : Conformance
ValueOfErrorCode ( TranslatorOutputType type, String value ) : ErrorCode

Method Details

FindNextFrame() public méthode

Find next frame from the string.
Position of data is set to the begin of new frame. If Pdu is null it is not updated.
public FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu ) : bool
data GXByteBuffer Data where frame is search.
pdu GXByteBuffer Pdu of received frame is set here.
Résultat bool

FindNextFrame() public méthode

Find next frame from the string.
Position of data is set to the begin of new frame. If Pdu is null it is not updated.
public FindNextFrame ( GXByteBuffer data, GXByteBuffer pdu, InterfaceType type ) : bool
data GXByteBuffer Data where frame is search.
pdu GXByteBuffer Pdu of received frame is set here.
type InterfaceType
Résultat bool

GXDLMSTranslator() public méthode

Constructor.
public GXDLMSTranslator ( TranslatorOutputType type ) : System
type TranslatorOutputType Translator output type.
Résultat System

GetDlmsFraming() public static méthode

Identify used DLMS framing type.
public static GetDlmsFraming ( GXByteBuffer value ) : InterfaceType
value GXByteBuffer Input data.
Résultat InterfaceType

GetPdu() public méthode

public GetPdu ( GXByteBuffer value ) : byte[]
value GXByteBuffer
Résultat byte[]

GetPdu() public méthode

public GetPdu ( byte value ) : byte[]
value byte
Résultat byte[]

MessageToXml() public méthode

Convert message to xml.
public MessageToXml ( GXByteBuffer value ) : string
value GXByteBuffer Bytes to convert.
Résultat string

MessageToXml() public méthode

Convert message to xml.
public MessageToXml ( byte value ) : string
value byte Bytes to convert.
Résultat string

PduToXml() public méthode

Convert bytes to xml.
public PduToXml ( GXByteBuffer value ) : string
value GXByteBuffer Bytes to convert.
Résultat string

PduToXml() public méthode

Convert bytes to xml.
public PduToXml ( byte value ) : string
value byte Bytes to convert.
Résultat string

PduToXml() public méthode

Convert hex string to xml.
public PduToXml ( string hex ) : string
hex string Converted hex string.
Résultat string

XmlToData() public méthode

Convert XML data fo bytes.
public XmlToData ( string xml ) : byte[]
xml string XML data.
Résultat byte[]

XmlToHexPdu() public méthode

Convert xml to hex string.
public XmlToHexPdu ( string xml ) : string
xml string
Résultat string

XmlToPdu() public méthode

Convert xml to byte array.
public XmlToPdu ( string xml ) : byte[]
xml string Converted xml.
Résultat byte[]