C# Class Gurux.DLMS.Internal.GXCommon

Reserved for internal use.
ファイルを表示 Open project: Gurux/Gurux.DLMS.Net Class Usage Examples

Public Methods

Method Description
AddString ( string value, GXByteBuffer bb ) : void

Add string to byte buffer.

Compare ( byte arr1, byte arr2 ) : bool

Compares, whether two given arrays are similar.

GetData ( GXDLMSSettings settings, GXByteBuffer data, GXDataInfo info ) : object

Get data from DLMS frame.

GetHDLCAddress ( GXByteBuffer buff ) : int

Get HDLC address from byte array.

GetObjectCount ( GXByteBuffer data ) : int

Get object count. If first byte is 0x80 or higger it will tell bytes count.

GetSize ( Object value ) : byte
GetValueType ( object value ) : DataType
SetData ( GXDLMSSettings settings, GXByteBuffer buff, DataType type, object value ) : void

Convert object to DLMS bytes.

Private Methods

Method Description
GetArray ( GXByteBuffer buff, GXDataInfo info, int index ) : object

Get array from DLMS data.

GetBcd ( GXByteBuffer buff, GXDataInfo info, bool knownType ) : object

Get BCD value from DLMS data.

GetBitString ( GXByteBuffer buff, GXDataInfo info ) : string

Get bit string value from DLMS data.

GetBits ( byte value, int BitMask ) : bool

Is bit set.

GetBoolean ( GXByteBuffer buff, GXDataInfo info ) : object

Get boolean value from DLMS data.

GetDate ( GXByteBuffer buff, GXDataInfo info ) : object

Get date from DLMS data.

GetDateTime ( GXDLMSSettings settings, GXByteBuffer buff, GXDataInfo info ) : object

Get date and time from DLMS data.

GetDouble ( GXByteBuffer buff, GXDataInfo info ) : object

Get double value from DLMS data.

GetEnum ( GXByteBuffer buff, GXDataInfo info ) : object

Get enumeration value from DLMS data.

GetInt16 ( GXByteBuffer buff, GXDataInfo info ) : object

Get Int16 value from DLMS data.

GetInt32 ( GXByteBuffer buff, GXDataInfo info ) : object

Get Int32 value from DLMS data.

GetInt64 ( GXByteBuffer buff, GXDataInfo info ) : object

Get Int64 value from DLMS data.

GetInt8 ( GXByteBuffer buff, GXDataInfo info ) : object

Get Int8 value from DLMS data.

GetLogicalName ( string logicalName ) : byte[]
GetObjectCountSizeInBytes ( int count ) : int

Return how many bytes object count takes.

GetOctetString ( GXByteBuffer buff, GXDataInfo info, bool knownType ) : object

Get octect string value from DLMS data.

GetString ( GXByteBuffer buff, GXDataInfo info, bool knownType ) : object

Get string value from DLMS data.

GetTime ( GXByteBuffer buff, GXDataInfo info ) : object

Get time from DLMS data.

GetUInt16 ( GXByteBuffer buff, GXDataInfo info ) : object

Get UInt16 value from DLMS data.

GetUInt32 ( GXByteBuffer buff, GXDataInfo info ) : object

Get UInt32 value from DLMS data.

GetUInt64 ( GXByteBuffer buff, GXDataInfo info ) : object

Get UInt64 value from DLMS data.

GetUInt8 ( GXByteBuffer buff, GXDataInfo info ) : object

Get UInt8 value from DLMS data.

GetUtfString ( GXByteBuffer buff, GXDataInfo info, bool knownType ) : object

Get UTF string value from DLMS data.

GetValue ( byte c ) : byte
Getfloat ( GXByteBuffer buff, GXDataInfo info ) : object

Get float value from DLMS data.

HexToBytes ( string value ) : byte[]
IsHex ( byte c ) : bool
SetArray ( GXDLMSSettings settings, GXByteBuffer buff, object value ) : void

Convert Array to DLMS bytes.

SetBcd ( GXByteBuffer buff, object value ) : void

Convert BCD to DLMS bytes.

SetBitString ( GXByteBuffer buff, object value ) : void

Convert Bit string to DLMS bytes.

SetBits ( byte &value, byte BitMask, bool val ) : void

Reserved for internal use.

SetDate ( GXByteBuffer buff, object value ) : void

Convert date to DLMS bytes.

SetDateTime ( GXDLMSSettings settings, GXByteBuffer buff, object value ) : void

Convert date time to DLMS bytes.

SetObjectCount ( int count, GXByteBuffer buff ) : void

Set item count.

SetOctetString ( GXByteBuffer buff, object value ) : void

Convert Octet string to DLMS bytes.

SetString ( GXByteBuffer buff, object value ) : void

Convert ASCII string to DLMS bytes.

SetTime ( GXByteBuffer buff, object value ) : void

Convert time to DLMS bytes.

SetUtcString ( GXByteBuffer buff, object value ) : void

Convert UTC string to DLMS bytes.

ToBitString ( StringBuilder sb, byte value, int count ) : void

Append bitstring to string.

ToHex ( byte bytes, bool addSpace ) : string
ToHex ( byte bytes, bool addSpace, int index, int count ) : string

Method Details

AddString() public static method

Add string to byte buffer.
public static AddString ( string value, GXByteBuffer bb ) : void
value string String to add.
bb GXByteBuffer Byte buffer where string is added.
return void

Compare() public static method

Compares, whether two given arrays are similar.
public static Compare ( byte arr1, byte arr2 ) : bool
arr1 byte First array to compare.
arr2 byte Second array to compare.
return bool

GetData() public static method

Get data from DLMS frame.
public static GetData ( GXDLMSSettings settings, GXByteBuffer data, GXDataInfo info ) : object
settings GXDLMSSettings DLMS settings.
data GXByteBuffer Received data.
info GXDataInfo Data info.
return object

GetHDLCAddress() public static method

Get HDLC address from byte array.
public static GetHDLCAddress ( GXByteBuffer buff ) : int
buff GXByteBuffer
return int

GetObjectCount() public static method

Get object count. If first byte is 0x80 or higger it will tell bytes count.
public static GetObjectCount ( GXByteBuffer data ) : int
data GXByteBuffer Received data.
return int

GetSize() public static method

public static GetSize ( Object value ) : byte
value Object
return byte

GetValueType() public static method

public static GetValueType ( object value ) : DataType
value object
return DataType

SetData() public static method

Convert object to DLMS bytes.
public static SetData ( GXDLMSSettings settings, GXByteBuffer buff, DataType type, object value ) : void
settings GXDLMSSettings DLMS settings.
buff GXByteBuffer Byte buffer where data is write.
type DataType
value object Added Value.
return void