lib60870-C
2.3.2
C source code library for the IEC 60870-5-101/104 protocols
|
Functions for CS101_Slave ADT. Can be used to implement a balanced or unbalanced CS 101 slave. More...
#include "hal_serial.h"
#include "iec60870_common.h"
#include "iec60870_slave.h"
#include "link_layer_parameters.h"
Go to the source code of this file.
Typedefs | |
typedef struct sCS101_Slave * | CS101_Slave |
CS101_Slave type. | |
Functions | |
CS101_Slave | CS101_Slave_create (SerialPort serialPort, const LinkLayerParameters llParameters, const CS101_AppLayerParameters alParameters, IEC60870_LinkLayerMode linkLayerMode) |
Create a new balanced or unbalanced CS101 slave. More... | |
CS101_Slave | CS101_Slave_createEx (SerialPort serialPort, const LinkLayerParameters llParameters, const CS101_AppLayerParameters alParameters, IEC60870_LinkLayerMode linkLayerMode, int class1QueueSize, int class2QueueSize) |
Create a new balanced or unbalanced CS101 slave. More... | |
void | CS101_Slave_destroy (CS101_Slave self) |
Destroy the slave instance and cleanup all resources. More... | |
void | CS101_Slave_setDIR (CS101_Slave self, bool dir) |
Set the value of the DIR bit when sending messages (only balanced mode) More... | |
void | CS101_Slave_addPlugin (CS101_Slave self, CS101_SlavePlugin plugin) |
Register a plugin instance with this slave instance. More... | |
void | CS101_Slave_setIdleTimeout (CS101_Slave self, int timeoutInMs) |
Set the idle timeout. More... | |
void | CS101_Slave_setLinkLayerStateChanged (CS101_Slave self, IEC60870_LinkLayerStateChangedHandler handler, void *parameter) |
Set a callback handler for link layer state changes. | |
void | CS101_Slave_setLinkLayerAddress (CS101_Slave self, int address) |
Set the local link layer address. More... | |
void | CS101_Slave_setLinkLayerAddressOtherStation (CS101_Slave self, int address) |
Set the link layer address of the remote station. More... | |
bool | CS101_Slave_isClass1QueueFull (CS101_Slave self) |
Check if the class 1 ASDU is full. More... | |
void | CS101_Slave_enqueueUserDataClass1 (CS101_Slave self, CS101_ASDU asdu) |
Enqueue an ASDU into the class 1 data queue. More... | |
bool | CS101_Slave_isClass2QueueFull (CS101_Slave self) |
Check if the class 2 ASDU is full. More... | |
void | CS101_Slave_enqueueUserDataClass2 (CS101_Slave self, CS101_ASDU asdu) |
Enqueue an ASDU into the class 2 data queue. More... | |
void | CS101_Slave_flushQueues (CS101_Slave self) |
Remove all ASDUs from the class 1/2 data queues. More... | |
void | CS101_Slave_run (CS101_Slave self) |
Receive a new message and run the link layer state machines. More... | |
void | CS101_Slave_start (CS101_Slave self) |
Start a background thread that handles the link layer connections. More... | |
void | CS101_Slave_stop (CS101_Slave self) |
Stops the background thread that handles the link layer connections. More... | |
CS101_AppLayerParameters | CS101_Slave_getAppLayerParameters (CS101_Slave self) |
Returns the application layer parameters object of this slave instance. More... | |
LinkLayerParameters | CS101_Slave_getLinkLayerParameters (CS101_Slave self) |
Returns the link layer parameters object of this slave instance. More... | |
void | CS101_Slave_setResetCUHandler (CS101_Slave self, CS101_ResetCUHandler handler, void *parameter) |
Set the handler for the reset CU (communication unit) message. More... | |
void | CS101_Slave_setInterrogationHandler (CS101_Slave self, CS101_InterrogationHandler handler, void *parameter) |
Set the handler for the general interrogation message. More... | |
void | CS101_Slave_setCounterInterrogationHandler (CS101_Slave self, CS101_CounterInterrogationHandler handler, void *parameter) |
Set the handler for the counter interrogation message. More... | |
void | CS101_Slave_setReadHandler (CS101_Slave self, CS101_ReadHandler handler, void *parameter) |
Set the handler for the read message. More... | |
void | CS101_Slave_setClockSyncHandler (CS101_Slave self, CS101_ClockSynchronizationHandler handler, void *parameter) |
Set the handler for the clock synchronization message. More... | |
void | CS101_Slave_setResetProcessHandler (CS101_Slave self, CS101_ResetProcessHandler handler, void *parameter) |
Set the handler for the reset process message. More... | |
void | CS101_Slave_setDelayAcquisitionHandler (CS101_Slave self, CS101_DelayAcquisitionHandler handler, void *parameter) |
Set the handler for the delay acquisition message. More... | |
void | CS101_Slave_setASDUHandler (CS101_Slave self, CS101_ASDUHandler handler, void *parameter) |
Set the handler for a received ASDU. More... | |
void | CS101_Slave_setRawMessageHandler (CS101_Slave self, IEC60870_RawMessageHandler handler, void *parameter) |
Set the raw message callback (called when a message is sent or received) More... | |
Functions for CS101_Slave ADT. Can be used to implement a balanced or unbalanced CS 101 slave.