C# Class Gurux.DLMS.GXDLMSServer

GXDLMSServer implements methods to implement DLMS/COSEM meter/proxy.
Afficher le fichier Open project: Gurux/Gurux.DLMS.Net Class Usage Examples

Private Properties

Свойство Type Description
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[]

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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[]

Method Details

Action() protected abstract méthode

Action is occurred.
protected abstract Action ( ValueEventArgs args ) : void
args ValueEventArgs Handled action requests.
Résultat void

Connected() protected abstract méthode

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.
Résultat void

Disconnected() protected abstract méthode

Server has close the connection. All clean up is made here.
protected abstract Disconnected ( GXDLMSConnectionEventArgs connectionInfo ) : void
connectionInfo GXDLMSConnectionEventArgs Connection information.
Résultat void

FindObject() protected abstract méthode

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.
Résultat Gurux.DLMS.Objects.GXDLMSObject

GXDLMSServer() public méthode

Constructor.
public GXDLMSServer ( ) : System
Résultat System

GXDLMSServer() public méthode

Constructor.
public GXDLMSServer ( bool logicalNameReferencing, InterfaceType type ) : System
logicalNameReferencing bool
type InterfaceType
Résultat System

HandleRequest() public méthode

Handles client request.
public HandleRequest ( byte buff ) : byte[]
buff byte /// Received data from the client.
Résultat byte[]

HandleRequest() public méthode

Handles client request.
public HandleRequest ( byte buff, GXDLMSConnectionEventArgs connectionInfo ) : byte[]
buff byte /// Received data from the client.
connectionInfo GXDLMSConnectionEventArgs
Résultat byte[]

Initialize() public méthode

Initialize server.
This must call after server objects are set.
public Initialize ( ) : void
Résultat void

InvalidConnection() protected abstract méthode

Client has try to made invalid connection. Password is incorrect.
protected abstract InvalidConnection ( GXDLMSConnectionEventArgs connectionInfo ) : void
connectionInfo GXDLMSConnectionEventArgs Connection information.
Résultat void

IsTarget() protected abstract méthode

Check is data sent to this server.
protected abstract IsTarget ( int serverAddress, int clientAddress ) : bool
serverAddress int Server address.
clientAddress int Client address.
Résultat bool

Read() protected abstract méthode

Read selected item.
protected abstract Read ( ValueEventArgs args ) : void
args ValueEventArgs Handled read requests.
Résultat void

Reset() public méthode

Reset after connection is closed.
public Reset ( ) : void
Résultat void

Reset() public méthode

Reset settings when connection is made or close.
public Reset ( bool connected ) : void
connected bool
Résultat void

Update() public abstract méthode

Get selected value.
public abstract Update ( UpdateType type, ValueEventArgs e ) : void
type UpdateType
e ValueEventArgs Handle get request.
Résultat void

ValidateAuthentication() protected abstract méthode

Check whether the authentication and password are correct.
protected abstract ValidateAuthentication ( Authentication authentication, byte password ) : SourceDiagnostic
authentication Authentication Authentication level.
password byte Password
Résultat SourceDiagnostic

Write() protected abstract méthode

Write selected item.
protected abstract Write ( ValueEventArgs args ) : void
args ValueEventArgs Handled write requests.
Résultat void