C# Класс Gurux.DLMS.GXDLMSServer

GXDLMSServer implements methods to implement DLMS/COSEM meter/proxy.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GenerateConfirmedServiceError byte[]
GenerateDisconnectRequest void
HandleAarqRequest void
HandleCommand byte[]
HandleSnrmRequest void
NotifyAction void
NotifyFindObject Gurux.DLMS.Objects.GXDLMSObject
NotifyInvalidConnection void
NotifyRead void
NotifyWrite void
ReportError byte[]

Открытые методы

Метод Описание
GXDLMSServer ( ) : System

Constructor.

GXDLMSServer ( bool logicalNameReferencing, InterfaceType type ) : System

Constructor.

HandleRequest ( byte buff ) : byte[]

Handles client request.

HandleRequest ( byte buff, GXDLMSConnectionEventArgs connectionInfo ) : byte[]

Handles client request.

Initialize ( ) : void

Initialize server.

This must call after server objects are set.

Reset ( ) : void

Reset after connection is closed.

Reset ( bool connected ) : void

Reset settings when connection is made or close.

Update ( UpdateType type, ValueEventArgs e ) : void

Get selected value.

Защищенные методы

Метод Описание
Action ( ValueEventArgs args ) : void

Action is occurred.

Connected ( GXDLMSConnectionEventArgs connectionInfo ) : void

Accepted connection is made for the server.

All initialization is done here. Example access level of the COSEM objects is good to update here.

Disconnected ( GXDLMSConnectionEventArgs connectionInfo ) : void

Server has close the connection. All clean up is made here.

FindObject ( ObjectType objectType, int sn, String ln ) : GXDLMSObject

Find object.

InvalidConnection ( GXDLMSConnectionEventArgs connectionInfo ) : void

Client has try to made invalid connection. Password is incorrect.

IsTarget ( int serverAddress, int clientAddress ) : bool

Check is data sent to this server.

Read ( ValueEventArgs args ) : void

Read selected item.

ValidateAuthentication ( Authentication authentication, byte password ) : SourceDiagnostic

Check whether the authentication and password are correct.

Write ( ValueEventArgs args ) : void

Write selected item.

Приватные методы

Метод Описание
GenerateConfirmedServiceError ( ConfirmedServiceError service, ServiceError type, byte code ) : byte[]

Generate confirmed service error.

GenerateDisconnectRequest ( ) : void

Generates disconnect request.

HandleAarqRequest ( GXByteBuffer data, GXDLMSConnectionEventArgs connectionInfo ) : void

Parse AARQ request that client send and returns AARE request.

HandleCommand ( Command cmd, GXByteBuffer data, GXDLMSConnectionEventArgs connectionInfo ) : byte[]

Handle received command.

HandleSnrmRequest ( ) : void

Parse SNRM Request. If server do not accept client empty byte array is returned.

NotifyAction ( ValueEventArgs args ) : void

Action is occurred.

NotifyFindObject ( ObjectType objectType, int sn, String ln ) : GXDLMSObject

Find object.

NotifyInvalidConnection ( GXDLMSConnectionEventArgs connectionInfo ) : void

Client has try to made invalid connection. Password is incorrect.

NotifyRead ( ValueEventArgs args ) : void

Read selected item.

NotifyWrite ( ValueEventArgs args ) : void

Write selected item.

ReportError ( Command cmd, ErrorCode error ) : byte[]

Описание методов

Action() защищенный абстрактный Метод

Action is occurred.
protected abstract Action ( ValueEventArgs args ) : void
args ValueEventArgs Handled action requests.
Результат void

Connected() защищенный абстрактный Метод

Accepted connection is made for the server.
All initialization is done here. Example access level of the COSEM objects is good to update here.
protected abstract Connected ( GXDLMSConnectionEventArgs connectionInfo ) : void
connectionInfo GXDLMSConnectionEventArgs Connection information.
Результат void

Disconnected() защищенный абстрактный Метод

Server has close the connection. All clean up is made here.
protected abstract Disconnected ( GXDLMSConnectionEventArgs connectionInfo ) : void
connectionInfo GXDLMSConnectionEventArgs Connection information.
Результат void

FindObject() защищенный абстрактный Метод

Find object.
protected abstract FindObject ( ObjectType objectType, int sn, String ln ) : GXDLMSObject
objectType ObjectType Object type. In Short Name referencing this is not used.
sn int Short Name. In Logical name referencing this is not used.
ln String Logical Name. In Short Name referencing this is not used.
Результат Gurux.DLMS.Objects.GXDLMSObject

GXDLMSServer() публичный Метод

Constructor.
public GXDLMSServer ( ) : System
Результат System

GXDLMSServer() публичный Метод

Constructor.
public GXDLMSServer ( bool logicalNameReferencing, InterfaceType type ) : System
logicalNameReferencing bool
type InterfaceType
Результат System

HandleRequest() публичный Метод

Handles client request.
public HandleRequest ( byte buff ) : byte[]
buff byte /// Received data from the client.
Результат byte[]

HandleRequest() публичный Метод

Handles client request.
public HandleRequest ( byte buff, GXDLMSConnectionEventArgs connectionInfo ) : byte[]
buff byte /// Received data from the client.
connectionInfo GXDLMSConnectionEventArgs
Результат byte[]

Initialize() публичный Метод

Initialize server.
This must call after server objects are set.
public Initialize ( ) : void
Результат void

InvalidConnection() защищенный абстрактный Метод

Client has try to made invalid connection. Password is incorrect.
protected abstract InvalidConnection ( GXDLMSConnectionEventArgs connectionInfo ) : void
connectionInfo GXDLMSConnectionEventArgs Connection information.
Результат void

IsTarget() защищенный абстрактный Метод

Check is data sent to this server.
protected abstract IsTarget ( int serverAddress, int clientAddress ) : bool
serverAddress int Server address.
clientAddress int Client address.
Результат bool

Read() защищенный абстрактный Метод

Read selected item.
protected abstract Read ( ValueEventArgs args ) : void
args ValueEventArgs Handled read requests.
Результат void

Reset() публичный Метод

Reset after connection is closed.
public Reset ( ) : void
Результат void

Reset() публичный Метод

Reset settings when connection is made or close.
public Reset ( bool connected ) : void
connected bool
Результат void

Update() публичный абстрактный Метод

Get selected value.
public abstract Update ( UpdateType type, ValueEventArgs e ) : void
type UpdateType
e ValueEventArgs Handle get request.
Результат void

ValidateAuthentication() защищенный абстрактный Метод

Check whether the authentication and password are correct.
protected abstract ValidateAuthentication ( Authentication authentication, byte password ) : SourceDiagnostic
authentication Authentication Authentication level.
password byte Password
Результат SourceDiagnostic

Write() защищенный абстрактный Метод

Write selected item.
protected abstract Write ( ValueEventArgs args ) : void
args ValueEventArgs Handled write requests.
Результат void