lib60870-C  2.3.2
C source code library for the IEC 60870-5-101/104 protocols
Data Structures | Typedefs | Functions
Collaboration diagram for IMasterConnection interface:

Data Structures

struct  sIMasterConnection
 

Typedefs

typedef struct sIMasterConnectionIMasterConnection
 Interface to send messages to the master (used by slave)
 

Functions

bool IMasterConnection_isReady (IMasterConnection self)
 
bool IMasterConnection_sendASDU (IMasterConnection self, CS101_ASDU asdu)
 Send an ASDU to the client/master. More...
 
bool IMasterConnection_sendACT_CON (IMasterConnection self, CS101_ASDU asdu, bool negative)
 Send an ACT_CON ASDU to the client/master. More...
 
bool IMasterConnection_sendACT_TERM (IMasterConnection self, CS101_ASDU asdu)
 Send an ACT_TERM ASDU to the client/master. More...
 
int IMasterConnection_getPeerAddress (IMasterConnection self, char *addrBuf, int addrBufSize)
 Get the peer address of the master (only for CS 104) More...
 
void IMasterConnection_close (IMasterConnection self)
 Close the master connection (only for CS 104) More...
 
CS101_AppLayerParameters IMasterConnection_getApplicationLayerParameters (IMasterConnection self)
 Get the application layer parameters used by this connection.
 

Detailed Description

Function Documentation

◆ IMasterConnection_close()

void IMasterConnection_close ( IMasterConnection  self)

Close the master connection (only for CS 104)

Allows the slave to actively close a master connection (e.g. when some exception occurs)

◆ IMasterConnection_getPeerAddress()

int IMasterConnection_getPeerAddress ( IMasterConnection  self,
char *  addrBuf,
int  addrBufSize 
)

Get the peer address of the master (only for CS 104)

Parameters
addrBufbuffer where to store the IP address as string
addrBufSizethe size of the buffer where to store the IP address
Returns
the number of bytes written to the buffer, 0 if function not supported

◆ IMasterConnection_sendACT_CON()

bool IMasterConnection_sendACT_CON ( IMasterConnection  self,
CS101_ASDU  asdu,
bool  negative 
)

Send an ACT_CON ASDU to the client/master.

ACT_CON is used for a command confirmation (positive or negative)

Parameters
asduthe ASDU to send to the client/master
negativevalue of the negative flag
Returns
true when the ASDU has been sent or queued for transmission, false otherwise

◆ IMasterConnection_sendACT_TERM()

bool IMasterConnection_sendACT_TERM ( IMasterConnection  self,
CS101_ASDU  asdu 
)

Send an ACT_TERM ASDU to the client/master.

ACT_TERM is used to indicate that the command execution is complete.

Parameters
asduthe ASDU to send to the client/master
Returns
true when the ASDU has been sent or queued for transmission, false otherwise

◆ IMasterConnection_sendASDU()

bool IMasterConnection_sendASDU ( IMasterConnection  self,
CS101_ASDU  asdu 
)

Send an ASDU to the client/master.

NOTE: ASDU instance has to be released by the caller!

Parameters
selfthe connection object (this is usually received as a parameter of a callback function)
asduthe ASDU to send to the client/master
Returns
true when the ASDU has been sent or queued for transmission, false otherwise