libIEC61850  0.8.2
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
IEC 61850 GOOSE subscriber API

Typedefs

typedef struct sGooseSubscriber * GooseSubscriber
 
typedef void(* GooseListener )(GooseSubscriber subscriber, void *parameter)
 user provided callback function that will be invoked when a GOOSE message is received. More...
 

Functions

GooseSubscriber GooseSubscriber_create (char *goCbRef, MmsValue *dataSetValues)
 create a new GOOSE subscriber instance. More...
 
void GooseSubscriber_setAppId (GooseSubscriber self, uint16_t appId)
 set the APPID used by the subscriber to filter relevant messages. More...
 
bool GooseSubscriber_isValid (GooseSubscriber self)
 Check if subscriber state is valid. More...
 
void GooseSubscriber_setGoId (GooseSubscriber self, const char *goId)
 
void GooseSubscriber_destroy (GooseSubscriber self)
 
void GooseSubscriber_setListener (GooseSubscriber self, GooseListener listener, void *parameter)
 set a callback function that will be invoked when a GOOSE message has been received. More...
 
uint32_t GooseSubscriber_getStNum (GooseSubscriber self)
 
uint32_t GooseSubscriber_getSqNum (GooseSubscriber self)
 
bool GooseSubscriber_isTest (GooseSubscriber self)
 
bool GooseSubscriber_needsCommission (GooseSubscriber self)
 
uint32_t GooseSubscriber_getTimeAllowedToLive (GooseSubscriber self)
 
uint64_t GooseSubscriber_getTimestamp (GooseSubscriber self)
 
MmsValueGooseSubscriber_getDataSetValues (GooseSubscriber self)
 get the data set values received with the last report More...
 

Detailed Description

Typedef Documentation

typedef void(* GooseListener)(GooseSubscriber subscriber, void *parameter)

user provided callback function that will be invoked when a GOOSE message is received.

Parameters
subscriberthe subscriber object that invoked the callback function,
parametera user provided parameter that will be passed to the callback function
typedef struct sGooseSubscriber* GooseSubscriber

Function Documentation

GooseSubscriber GooseSubscriber_create ( char *  goCbRef,
MmsValue dataSetValues 
)

create a new GOOSE subscriber instance.

A new GOOSE subscriber will be created and connected to a specific GOOSE control block reference.

The parameter goCbRef has to be given in MMS like notation (as it also will appear in the GOOSE message sent by the publisher). An example could be "simpleIOGenericIO/LLN0$GO$gcbEvents".

The data set values contained in a GOOSE message will be written to the optionally provided MmsValue instance. The MmsValue object has to be of type MMS_ARRAY. The array elements need to be of the same type as the data set elements. It is intended that the provided MmsValue instance has been created by the IedConnection_getDataSet() method before.

If NULL is given as dataSetValues it will be created the first time when a appropriate GOOSE message is recevied.

Parameters
goCbRefa string containing the object reference of the GOOSE Control Block (GoCB) in MMS notation the GOOSE publisher uses.
dataSetValuesthe MmsValue object where the data set values will be written or NULL.
void GooseSubscriber_destroy ( GooseSubscriber  self)
MmsValue* GooseSubscriber_getDataSetValues ( GooseSubscriber  self)

get the data set values received with the last report

Note: To prevent data corruption. The MmsValue instance received should only be used inside of the callback function, when the GOOSE receiver is running in a separate thread.

Parameters
selfGooseSubscriber instance to operate on.
Returns
MmsValue instance of the report data set
uint32_t GooseSubscriber_getSqNum ( GooseSubscriber  self)
uint32_t GooseSubscriber_getStNum ( GooseSubscriber  self)
uint32_t GooseSubscriber_getTimeAllowedToLive ( GooseSubscriber  self)
uint64_t GooseSubscriber_getTimestamp ( GooseSubscriber  self)
bool GooseSubscriber_isTest ( GooseSubscriber  self)
bool GooseSubscriber_isValid ( GooseSubscriber  self)

Check if subscriber state is valid.

A GOOSE subscriber is valid if TimeAllowedToLive timeout is not elapsed and GOOSE message were received with correct state and sequence ID.

bool GooseSubscriber_needsCommission ( GooseSubscriber  self)
void GooseSubscriber_setAppId ( GooseSubscriber  self,
uint16_t  appId 
)

set the APPID used by the subscriber to filter relevant messages.

If APPID is set the subscriber will ignore all messages with other APPID values.

Parameters
selfGooseSubscriber instance to operate on.
theAPPID value the subscriber should use to filter messages
void GooseSubscriber_setGoId ( GooseSubscriber  self,
const char *  goId 
)
void GooseSubscriber_setListener ( GooseSubscriber  self,
GooseListener  listener,
void *  parameter 
)

set a callback function that will be invoked when a GOOSE message has been received.

Parameters
selfGooseSubscriber instance to operate on.
listeneruser provided callback function
parametera user provided parameter that will be passed to the callback function