lib60870-C  2.3.2
C source code library for the IEC 60870-5-101/104 protocols
Typedefs | Functions
cs101_master.h File Reference

Functions for CS101_Master ADT. Can be used to implement a balanced or unbalanced CS 101 master. More...

#include "iec60870_master.h"
#include "link_layer_parameters.h"
Include dependency graph for cs101_master.h:

Go to the source code of this file.

Typedefs

typedef struct sCS101_Master * CS101_Master
 CS101_Master type.
 

Functions

CS101_Master CS101_Master_create (SerialPort port, const LinkLayerParameters llParameters, const CS101_AppLayerParameters alParameters, IEC60870_LinkLayerMode mode)
 Create a new master instance. More...
 
CS101_Master CS101_Master_createEx (SerialPort serialPort, const LinkLayerParameters llParameters, const CS101_AppLayerParameters alParameters, IEC60870_LinkLayerMode linkLayerMode, int queueSize)
 Create a new master instance and specify message queue size (for balanced mode) More...
 
void CS101_Master_run (CS101_Master self)
 Receive a new message and run the protocol state machine(s). More...
 
void CS101_Master_start (CS101_Master self)
 Start a background thread that handles the link layer connections. More...
 
void CS101_Master_stop (CS101_Master self)
 Stops the background thread that handles the link layer connections. More...
 
void CS101_Master_addSlave (CS101_Master self, int address)
 Add a new slave connection. More...
 
void CS101_Master_pollSingleSlave (CS101_Master self, int address)
 Poll a slave (only unbalanced mode) More...
 
void CS101_Master_destroy (CS101_Master self)
 Destroy the master instance and release all resources.
 
void CS101_Master_setDIR (CS101_Master self, bool dir)
 Set the value of the DIR bit when sending messages (only balanced mode) More...
 
void CS101_Master_setOwnAddress (CS101_Master self, int address)
 Set the own link layer address (only balanced mode) More...
 
void CS101_Master_useSlaveAddress (CS101_Master self, int address)
 Set the slave address for the following send functions. More...
 
CS101_AppLayerParameters CS101_Master_getAppLayerParameters (CS101_Master self)
 Returns the application layer parameters object of this master instance. More...
 
LinkLayerParameters CS101_Master_getLinkLayerParameters (CS101_Master self)
 Returns the link layer parameters object of this master instance. More...
 
bool CS101_Master_isChannelReady (CS101_Master self, int address)
 Is the channel ready to transmit an ASDU (only unbalanced mode) More...
 
void CS101_Master_sendLinkLayerTestFunction (CS101_Master self)
 Manually send link layer test function. More...
 
void CS101_Master_sendInterrogationCommand (CS101_Master self, CS101_CauseOfTransmission cot, int ca, QualifierOfInterrogation qoi)
 send an interrogation command More...
 
void CS101_Master_sendCounterInterrogationCommand (CS101_Master self, CS101_CauseOfTransmission cot, int ca, uint8_t qcc)
 send a counter interrogation command More...
 
void CS101_Master_sendReadCommand (CS101_Master self, int ca, int ioa)
 Sends a read command (C_RD_NA_1 typeID: 102) More...
 
void CS101_Master_sendClockSyncCommand (CS101_Master self, int ca, CP56Time2a time)
 Sends a clock synchronization command (C_CS_NA_1 typeID: 103) More...
 
void CS101_Master_sendTestCommand (CS101_Master self, int ca)
 Send a test command (C_TS_NA_1 typeID: 104) More...
 
void CS101_Master_sendProcessCommand (CS101_Master self, CS101_CauseOfTransmission cot, int ca, InformationObject command)
 Send a process command to the controlled (or other) station. More...
 
void CS101_Master_sendASDU (CS101_Master self, CS101_ASDU asdu)
 Send a user specified ASDU. More...
 
void CS101_Master_setASDUReceivedHandler (CS101_Master self, CS101_ASDUReceivedHandler handler, void *parameter)
 Register a callback handler for received ASDUs. More...
 
void CS101_Master_setLinkLayerStateChanged (CS101_Master self, IEC60870_LinkLayerStateChangedHandler handler, void *parameter)
 Set a callback handler for link layer state changes.
 
void CS101_Master_setRawMessageHandler (CS101_Master self, IEC60870_RawMessageHandler handler, void *parameter)
 Set the raw message callback (called when a message is sent or received) More...
 
void CS101_Master_setIdleTimeout (CS101_Master self, int timeoutInMs)
 Set the idle timeout (only for balanced mode) More...
 

Detailed Description

Functions for CS101_Master ADT. Can be used to implement a balanced or unbalanced CS 101 master.