libIEC61850
Open-source IEC 61850 MMS server and client library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Functions
IEC 61850 server API

Data Structures

struct  sMmsDomain
 
struct  sMmsNamedVariableList
 

Typedefs

typedef struct sIedServer * IedServer
 
typedef bool(* ControlHandler )(void *parameter, MmsValue *ctlVal)
 

Functions

IedServer IedServer_create (IedModel *iedModel)
 
void IedServer_destroy (IedServer self)
 
void IedServer_start (IedServer self, int tcpPort)
 
void IedServer_stop (IedServer self)
 
bool IedServer_isRunning (IedServer self)
 
MmsValue * IedServer_getAttributeValue (IedServer self, ModelNode *node)
 
void IedServer_updateAttributeValue (IedServer self, DataAttribute *node, MmsValue *value)
 
void IedServer_setControlHandler (IedServer self, DataObject *node, ControlHandler handler, void *parameter)
 
void IedServer_lockDataModel (IedServer self)
 
void IedServer_unlockDataModel (IedServer self)
 
MmsDomain * MmsDomain_create (char *domainName)
 
char * MmsDomain_getName (MmsDomain *self)
 
void MmsDomain_destroy (MmsDomain *self)
 
bool MmsDomain_addNamedVariableList (MmsDomain *self, MmsNamedVariableList variableList)
 
void MmsDomain_deleteNamedVariableList (MmsDomain *self, char *variableListName)
 
MmsNamedVariableList MmsDomain_getNamedVariableList (MmsDomain *self, char *variableListName)
 
LinkedList MmsDomain_getNamedVariableLists (MmsDomain *self)
 
LinkedList MmsDomain_getNamedVariableListValues (MmsDomain *self, char *variableListName)
 
LinkedList MmsDomain_createNamedVariableListValues (MmsDomain *self, char *variableListName)
 
MmsTypeSpecification * MmsDomain_getNamedVariable (MmsDomain *domain, char *nameId)
 
MmsNamedVariableListEntry MmsNamedVariableListEntry_create (MmsAccessSpecifier accessSpecifier)
 
void MmsNamedVariableListEntry_destroy (MmsNamedVariableListEntry self)
 
MmsDomain * MmsNamedVariableListEntry_getDomain (MmsNamedVariableListEntry self)
 
char * MmsNamedVariableListEntry_getVariableName (MmsNamedVariableListEntry self)
 
MmsNamedVariableList MmsNamedVariableList_create (char *name, bool deletable)
 
char * MmsNamedVariableList_getName (MmsNamedVariableList self)
 
bool MmsNamedVariableList_isDeletable (MmsNamedVariableList self)
 
void MmsNamedVariableList_addVariable (MmsNamedVariableList self, MmsNamedVariableListEntry variable)
 
LinkedList MmsNamedVariableList_getVariableList (MmsNamedVariableList self)
 
void MmsNamedVariableList_destroy (MmsNamedVariableList self)
 

Detailed Description

Typedef Documentation

typedef bool(* ControlHandler)(void *parameter, MmsValue *ctlVal)

User provided callback function for the control model. It will be invoked when a control operation happens (Oper, SBOw).

Parameters
parameterthe parameter that was specified when setting the control handler
ctlValthe control value of the control operation.
typedef struct sIedServer* IedServer

Function Documentation

IedServer IedServer_create ( IedModel *  iedModel)

Create a new IedServer instance

Parameters
iedModelreference to the IedModel data structure to be used as IEC 61850 model of the device
Returns
the newly generated IedServer instance
void IedServer_destroy ( IedServer  self)

Destroy an IedServer instance and release all resources (memory, TCP sockets)

Parameters
selfthe instance of IedServer to operate on.
MmsValue* IedServer_getAttributeValue ( IedServer  self,
ModelNode *  node 
)

Get the MmsValue object of an MMS Named Variable that is part of the device model. You should not manipulate the received object directly. Instead you should use the IedServer_updateValue method.

Parameters
selfthe instance of IedServer to operate on.
nodethe data attribute handle
Returns
MmsValue object of the MMS Named Variable or NULL if the value does not exist.
bool IedServer_isRunning ( IedServer  self)

Check if IedServer instance is listening for client connections

Parameters
selfthe instance of IedServer to operate on.
Returns
true if IedServer instance is listening for client connections
void IedServer_lockDataModel ( IedServer  self)

Lock the MMS server data model. Client requests will be postponed until the lock is removed

Parameters
selfthe instance of IedServer to operate on.
void IedServer_setControlHandler ( IedServer  self,
DataObject *  node,
ControlHandler  handler,
void *  parameter 
)

Set control handler for controllable data object

This functions sets a user provided control handler for a data object. The data object has to be an instance of a controllable CDC (Common Data Class) like e.g. SPC, DPC or APC. The control handler is a callback function that will be called by the IEC server when a client invokes a control operation on the data object.

Parameters
selfthe instance of IedServer to operate on.
nodethe controllable data object handle
handlera callback function of type ControlHandler
parametera user provided parameter that is passed to the control handler.
void IedServer_start ( IedServer  self,
int  tcpPort 
)

Start handling client connections

Parameters
selfthe instance of IedServer to operate on.
tcpPortthe TCP port the server is listening
void IedServer_stop ( IedServer  self)

Stop handling client connections

Parameters
selfthe instance of IedServer to operate on.
void IedServer_unlockDataModel ( IedServer  self)

Unlock the MMS server data model and process pending client requests.

Parameters
selfthe instance of IedServer to operate on.
void IedServer_updateAttributeValue ( IedServer  self,
DataAttribute *  node,
MmsValue *  value 
)

Update the MmsValue object of an IEC 61850 data attribute.

The data attribute handle of type ModelNode* are imported with static_model.h. You should use this function instead of directly operating on the MmsValue instance that is hold by the MMS server. Otherwise the IEC 61850 server is not aware of the changed value and will e.g. not generate a report.

Parameters
selfthe instance of IedServer to operate on.
nodethe data attribute handle
valueMmsValue object used to update the value cached by the server.
Returns
MmsValue object of the MMS Named Variable or NULL if the value does not exist.
bool MmsDomain_addNamedVariableList ( MmsDomain *  self,
MmsNamedVariableList  variableList 
)

Add a new MMS Named Variable List (Data set) to a MmsDomain instance

The passed MmsNamedVariableList instance will be handled by the MmsDomain instance and will be destroyed if the MmsDomain_destroy function on this MmsDomain instance is called.

Parameters
selfinstance of MmsDomain to operate on
variableListnew named variable list that will be added to this MmsDomain

if operation was successful.

MmsDomain* MmsDomain_create ( char *  domainName)

Create a new MmsDomain instance

This method should not be invoked by client code!

LinkedList MmsDomain_createNamedVariableListValues ( MmsDomain *  self,
char *  variableListName 
)
void MmsDomain_deleteNamedVariableList ( MmsDomain *  self,
char *  variableListName 
)

Delete a MMS Named Variable List from this MmsDomain instance

A call to this function will also destroy the MmsNamedVariableList instance.

Parameters
selfinstance of MmsDomain to operate on
variableListNamethe name of the variable list to delete.
void MmsDomain_destroy ( MmsDomain *  self)

Delete a MmsDomain instance

This method should not be invoked by client code!

char* MmsDomain_getName ( MmsDomain *  self)
MmsTypeSpecification* MmsDomain_getNamedVariable ( MmsDomain *  domain,
char *  nameId 
)

Get the MmsTypeSpecification instance of a MMS named variable

Parameters
selfinstance of MmsDomain to operate on
nameIdname of the named variable
Returns
MmsTypeSpecification instance of the named variable
MmsNamedVariableList MmsDomain_getNamedVariableList ( MmsDomain *  self,
char *  variableListName 
)
LinkedList MmsDomain_getNamedVariableLists ( MmsDomain *  self)
LinkedList MmsDomain_getNamedVariableListValues ( MmsDomain *  self,
char *  variableListName 
)
void MmsNamedVariableList_addVariable ( MmsNamedVariableList  self,
MmsNamedVariableListEntry  variable 
)
MmsNamedVariableList MmsNamedVariableList_create ( char *  name,
bool  deletable 
)
void MmsNamedVariableList_destroy ( MmsNamedVariableList  self)
char* MmsNamedVariableList_getName ( MmsNamedVariableList  self)
LinkedList MmsNamedVariableList_getVariableList ( MmsNamedVariableList  self)
bool MmsNamedVariableList_isDeletable ( MmsNamedVariableList  self)
MmsNamedVariableListEntry MmsNamedVariableListEntry_create ( MmsAccessSpecifier  accessSpecifier)
void MmsNamedVariableListEntry_destroy ( MmsNamedVariableListEntry  self)
MmsDomain* MmsNamedVariableListEntry_getDomain ( MmsNamedVariableListEntry  self)
char* MmsNamedVariableListEntry_getVariableName ( MmsNamedVariableListEntry  self)