libiec61850
1.2.0
|
Data Structures | |
struct | LastApplError |
Typedefs | |
typedef struct sIedConnection * | IedConnection |
typedef void(* | IedConnectionClosedHandler) (void *parameter, IedConnection connection) |
Functions | |
IedConnection | IedConnection_create (void) |
create a new IedConnection instance More... | |
IedConnection | IedConnection_createWithTlsSupport (TLSConfiguration tlsConfig) |
create a new IedConnection instance that has support for TLS More... | |
void | IedConnection_destroy (IedConnection self) |
destroy an IedConnection instance. More... | |
void | IedConnection_setConnectTimeout (IedConnection self, uint32_t timeoutInMs) |
set the connect timeout in ms More... | |
void | IedConnection_connect (IedConnection self, IedClientError *error, const char *hostname, int tcpPort) |
Connect to a server. More... | |
void | IedConnection_abort (IedConnection self, IedClientError *error) |
Abort the connection. More... | |
void | IedConnection_release (IedConnection self, IedClientError *error) |
Release the connection. More... | |
void | IedConnection_close (IedConnection self) |
Close the connection. More... | |
IedConnectionState | IedConnection_getState (IedConnection self) |
return the state of the connection. More... | |
LastApplError | IedConnection_getLastApplError (IedConnection self) |
Access to last application error received by the client connection. More... | |
void | IedConnection_installConnectionClosedHandler (IedConnection self, IedConnectionClosedHandler handler, void *parameter) |
Install a handler function that will be called when the connection is lost. More... | |
MmsConnection | IedConnection_getMmsConnection (IedConnection self) |
get a handle to the underlying MmsConnection More... | |
typedef struct sIedConnection* IedConnection |
An opaque handle to the instance data of the IedConnection object
typedef void(* IedConnectionClosedHandler) (void *parameter, IedConnection connection) |
enum IedClientError |
used to describe the error reason for most client side service functions
enum IedConnectionState |
void IedConnection_abort | ( | IedConnection | self, |
IedClientError * | error | ||
) |
Abort the connection.
This will close the MMS association by sending an ACSE abort message to the server. After sending the abort message the connection is closed immediately. The client can assume the connection to be closed when the function returns and the destroy method can be called. If the connection is not in "connected" state an IED_ERROR_NOT_CONNECTED error will be reported.
self | the connection object |
error | the error code if an error occurs |
void IedConnection_close | ( | IedConnection | self | ) |
Close the connection.
This will close the MMS association and the underlying TCP connection.
self | the connection object |
void IedConnection_connect | ( | IedConnection | self, |
IedClientError * | error, | ||
const char * | hostname, | ||
int | tcpPort | ||
) |
Connect to a server.
self | the connection object |
error | the error code if an error occurs |
hostname | the host name or IP address of the server to connect to |
tcpPort | the TCP port number of the server to connect to |
IedConnection IedConnection_create | ( | void | ) |
create a new IedConnection instance
This function creates a new IedConnection instance that is used to handle a connection to an IED. It allocated all required resources. The new connection is in the "idle" state. Before it can be used the connect method has to be called.
IedConnection IedConnection_createWithTlsSupport | ( | TLSConfiguration | tlsConfig | ) |
create a new IedConnection instance that has support for TLS
This function creates a new IedConnection instance that is used to handle a connection to an IED. It allocated all required resources. The new connection is in the "idle" state. Before it can be used the connect method has to be called. The connection will use TLS when a TLSConfiguration object is provided.
tlsConfig | the TLS configuration to be used |
void IedConnection_destroy | ( | IedConnection | self | ) |
destroy an IedConnection instance.
The connection will be closed if it is in "connected" state. All allocated resources of the connection will be freed.
self | the connection object |
LastApplError IedConnection_getLastApplError | ( | IedConnection | self | ) |
Access to last application error received by the client connection.
self | the connection object |
MmsConnection IedConnection_getMmsConnection | ( | IedConnection | self | ) |
get a handle to the underlying MmsConnection
Get access to the underlying MmsConnection instance used by this IedConnection. This can be used to set/change specific MmsConnection parameters or to call low-level MMS services/functions.
self | the connection object |
IedConnectionState IedConnection_getState | ( | IedConnection | self | ) |
return the state of the connection.
This function can be used to determine if the connection is established or closed.
self | the connection object |
void IedConnection_installConnectionClosedHandler | ( | IedConnection | self, |
IedConnectionClosedHandler | handler, | ||
void * | parameter | ||
) |
Install a handler function that will be called when the connection is lost.
self | the connection object |
handler | that callback function |
parameter | the user provided parameter that is handed over to the callback function |
void IedConnection_release | ( | IedConnection | self, |
IedClientError * | error | ||
) |
Release the connection.
This will release the MMS association by sending an MMS conclude message to the server. The client can NOT assume the connection to be closed when the function returns, It can also fail if the server returns with a negative response. To be sure that the connection will be close the close or abort methods should be used. If the connection is not in "connected" state an IED_ERROR_NOT_CONNECTED error will be reported.
self | the connection object |
error | the error code if an error occurs |
void IedConnection_setConnectTimeout | ( | IedConnection | self, |
uint32_t | timeoutInMs | ||
) |
set the connect timeout in ms
Set the connect timeout for this connection. This function has to be called before IedConnection_connect is called.
self | the connection object |
timoutInMs | the connection timeout in ms |