S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
libs2opc_common_config.h File Reference

High level interface to configure an OPC UA client and/or server. More...

#include <stdbool.h>
#include "sopc_common.h"
#include "sopc_encodeabletype.h"
#include "sopc_types.h"
#include "sopc_user_app_itf.h"

Go to the source code of this file.

Enumerations

enum  SOPC_SecurityPolicy_URI {
  SOPC_SecurityPolicy_None , SOPC_SecurityPolicy_Basic256 , SOPC_SecurityPolicy_Basic256Sha256 , SOPC_SecurityPolicy_Aes128Sha256RsaOaep ,
  SOPC_SecurityPolicy_Aes256Sha256RsaPss
}
 Enumerated values authorized for use with SOPC_EndpointConfig_AddSecurityConfig or SOPC_ClientConfigHelper_CreateSecureConnection. Values are limited to the security policies supported by client/server. More...
 

Functions

SOPC_ReturnStatus SOPC_CommonHelper_Initialize (SOPC_Log_Configuration *optLogConfig)
 Initializes the S2OPC Client/Server frontend library (start threads, initialize configuration, etc.) and define a custom log configuration. Call to SOPC_CommonHelper_Initialize is required before any other operation.
 
void SOPC_CommonHelper_Clear (void)
 Clears the S2OPC Client/Server frontend library (stop threads, clear common configuration, etc.) Call to SOPC_CommonHelper_Clear shall be done after any Client/Server wrapper Clear operations.
 
SOPC_Toolkit_Build_Info SOPC_CommonHelper_GetBuildInfo (void)
 Retrieves the S2OPC Client/Server frontend library build info (version, date, etc.). Shortcut to SOPC_ToolkitConfig_GetBuildInfo.
 
SOPC_S2OPC_ConfigSOPC_CommonHelper_GetConfiguration (void)
 Retrieves the S2OPC Client/Server configuration. It should be called after call to SOPC_CommonHelper_Initialize and before call to SOPC_CommonHelper_Clear.
 
bool SOPC_CommonHelper_GetInitialized (void)
 Retrieves the S2OPC Client/Server frontend "initialized" state.
 
const char * SOPC_SecurityPolicyUriToCstring (SOPC_SecurityPolicy_URI secuUri)
 Returns the C string matching the security policy URI enum value.
 

Detailed Description

High level interface to configure an OPC UA client and/or server.

Enumeration Type Documentation

◆ SOPC_SecurityPolicy_URI

Enumerated values authorized for use with SOPC_EndpointConfig_AddSecurityConfig or SOPC_ClientConfigHelper_CreateSecureConnection. Values are limited to the security policies supported by client/server.

Enumerator
SOPC_SecurityPolicy_None 

http://opcfoundation.org/UA/SecurityPolicy#None

SOPC_SecurityPolicy_Basic256 

http://opcfoundation.org/UA/SecurityPolicy#Basic256

SOPC_SecurityPolicy_Basic256Sha256 

http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256

SOPC_SecurityPolicy_Aes128Sha256RsaOaep 

http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep

SOPC_SecurityPolicy_Aes256Sha256RsaPss 

http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss

Function Documentation

◆ SOPC_CommonHelper_Initialize()

SOPC_ReturnStatus SOPC_CommonHelper_Initialize ( SOPC_Log_Configuration * optLogConfig)

Initializes the S2OPC Client/Server frontend library (start threads, initialize configuration, etc.) and define a custom log configuration. Call to SOPC_CommonHelper_Initialize is required before any other operation.

Note
This function and SOPC_CommonHelper_Clear function are not thread-safe and shall be called in the same thread.
Parameters
optLogConfigthe custom log configuration or NULL to keep default configuration
Returns
SOPC_STATUS_OK in case of success, otherwise SOPC_STATUS_INVALID_STATE in case of double initialization.

◆ SOPC_CommonHelper_Clear()

void SOPC_CommonHelper_Clear ( void )

Clears the S2OPC Client/Server frontend library (stop threads, clear common configuration, etc.) Call to SOPC_CommonHelper_Clear shall be done after any Client/Server wrapper Clear operations.

Note
This function and SOPC_CommonHelper_Initialize function are not thread-safe and shall be called in the same thread.

◆ SOPC_CommonHelper_GetBuildInfo()

SOPC_Toolkit_Build_Info SOPC_CommonHelper_GetBuildInfo ( void )

Retrieves the S2OPC Client/Server frontend library build info (version, date, etc.). Shortcut to SOPC_ToolkitConfig_GetBuildInfo.

Returns
Toolkit build information

◆ SOPC_CommonHelper_GetConfiguration()

SOPC_S2OPC_Config * SOPC_CommonHelper_GetConfiguration ( void )

Retrieves the S2OPC Client/Server configuration. It should be called after call to SOPC_CommonHelper_Initialize and before call to SOPC_CommonHelper_Clear.

Returns
The returned value is ensured to be a non-NULL pointer to Helper configuration

◆ SOPC_CommonHelper_GetInitialized()

bool SOPC_CommonHelper_GetInitialized ( void )

Retrieves the S2OPC Client/Server frontend "initialized" state.

Returns
True if the Helper is initialized (when SOPC_CommonHelper_Initialize is called)

◆ SOPC_SecurityPolicyUriToCstring()

const char * SOPC_SecurityPolicyUriToCstring ( SOPC_SecurityPolicy_URI secuUri)

Returns the C string matching the security policy URI enum value.

Parameters
secuUriThe security policy URI enum value
Returns
The C string matching the security policy URI enum value or NULL if value invalid