UA ANSI C Server Professional  1.4.0.285
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
UaServerModule

Functions

void OpcUa_ProxyStubConfiguration_InitializeDefault (OpcUa_ProxyStubConfiguration *a_pProxyStubConfiguration)
 Initialize UA stack configuration structure with default values. More...
 
OpcUa_StatusCode UaServer_Module_InitializeUaStack (OpcUa_Handle *a_phProxyStubPlatformLayer, OpcUa_ProxyStubConfiguration *a_pProxyStubConfiguration)
 Initialize UA stack. More...
 
OpcUa_StatusCode UaServer_Module_ClearUaStack (OpcUa_Handle *a_phProxyStubPlatformLayer)
 Clear UA stack. More...
 
OpcUa_StatusCode UaServer_SetUserAuthenticationType (UaServer *a_pUaServer, UaServer_UserAuthType a_type, UaServer_pfServer_AuthenticateSession a_pUserAuthFunction)
 Sets the authentication type used in ActivateSession. More...
 
OpcUa_StatusCode UaServer_SetUserAuthenticationTypeEx (UaServer *a_pUaServer, UaServer_UserAuthType a_type, UaServer_pfServer_AuthenticateSessionEx a_pUserAuthFunction)
 Sets the authentication type used in ActivateSession. More...
 
OpcUa_StatusCode UaServer_SetCallback_SessionCreated (UaServer *a_pUaServer, UaServer_pfServer_SessionCreated a_pCallbackFunction)
 Sets the SessionCreated callback function. More...
 
OpcUa_StatusCode UaServer_SetCallback_SessionActivated (UaServer *a_pUaServer, UaServer_pfServer_SessionActivated a_pCallbackFunction)
 Sets the SessionActivated callback function. More...
 
OpcUa_StatusCode UaServer_SetCallback_SessionClosed (UaServer *a_pUaServer, UaServer_pfServer_SessionClosed a_pCallbackFunction)
 Sets the SessionClosed callback function. More...
 
OpcUa_StatusCode UaServer_Initialize (UaServer *a_pUaServer)
 Initialize the UaServer object structure. More...
 
UaServer_ConfigurationUaServer_GetConfiguration (UaServer *a_pUaServer)
 Returns the configuration struct of the server. More...
 
OpcUa_StatusCode UaServer_StartUp (UaServer *a_pUaServer)
 Start the UaServer to enable OPC UA connection establishment from clients. More...
 
OpcUa_StatusCode UaServer_DoCom ()
 The internal main 'event loop' which processes messages and triggers timers. More...
 
OpcUa_StatusCode UaServer_TimedDoCom (OpcUa_UInt32 a_uTimeout)
 The internal main 'event loop' which processes messages and triggers timers. More...
 
OpcUa_StatusCode UaServer_Shutdown (UaServer *a_pUaServer, OpcUa_UInt32 a_uSecondsTillShutdown, OpcUa_LocalizedText *a_pShutdownReason)
 Shut the server down in the given number of seconds. More...
 
OpcUa_Void UaServer_Clear (UaServer *a_pUaServer)
 Cleans up application and used resources. More...
 

Detailed Description

Function Documentation

void OpcUa_ProxyStubConfiguration_InitializeDefault ( OpcUa_ProxyStubConfiguration *  a_pProxyStubConfiguration)

Initialize UA stack configuration structure with default values.

The configuration structure is used to initialize the UA Stack. The default values are set by the stack configuration e.g. in the stack file opcua_config.h

The structure contains the following settings:

Trace settings
bProxyStub_Trace_Enabled - Flag that indicates if the stack trace is activated. This requires that the traces are not disabled with the stack compiler switch. The trace is also used by the Server SDK
uProxyStub_Trace_Level - Tracelevel used if trace is activated. Possible settings are

  • OPCUA_TRACE_OUTPUT_LEVEL_ERROR
  • OPCUA_TRACE_OUTPUT_LEVEL_WARNING
  • OPCUA_TRACE_OUTPUT_LEVEL_SYSTEM
  • OPCUA_TRACE_OUTPUT_LEVEL_INFO
  • OPCUA_TRACE_OUTPUT_LEVEL_DEBUG
  • OPCUA_TRACE_OUTPUT_LEVEL_CONTENT
  • OPCUA_TRACE_OUTPUT_LEVEL_ALL

Serializer settings
This part of the configuration defines the OPC UA Stack serializer settings. These are the security constraints for the serializer. The settings are also relevant for the resource consuption of the UA stack. Set this values carefully.

  • iSerializer_MaxAlloc - The largest size for a memory block the serializer can do when deserializing a message
  • iSerializer_MaxStringLength - The largest string accepted by the serializer
  • iSerializer_MaxByteStringLength - The largest byte string accepted by the serializer
  • iSerializer_MaxArrayLength - Maximum number of elements in an array accepted by the serializer
  • iSerializer_MaxMessageSize - The maximum number of bytes per message in total

The other settings should not be changed since they are set by the SDK and changing them will cause undefined behaviour.

Parameters
a_pProxyStubConfigurationConfiguration structure for the UA Stack.
OpcUa_Void UaServer_Clear ( UaServer a_pUaServer)

Cleans up application and used resources.

Parameters
a_pUaServera pointer to the servers object.
OpcUa_StatusCode UaServer_DoCom ( )

The internal main 'event loop' which processes messages and triggers timers.

Returns
OpcUa_Good if no error occured. OpcUa_BadShutdown if UaServer_Shutdown was called and the shutdown time is reached.
UaServer_Configuration * UaServer_GetConfiguration ( UaServer a_pUaServer)

Returns the configuration struct of the server.

Parameters
[in]a_pUaServerThe server to use
Returns
A pointer to the configuration struct of the server.
OpcUa_StatusCode UaServer_Initialize ( UaServer a_pUaServer)

Initialize the UaServer object structure.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
Returns
OPC UA Status code.
OpcUa_StatusCode UaServer_Module_ClearUaStack ( OpcUa_Handle *  a_phProxyStubPlatformLayer)

Clear UA stack.

If this function was called, no UA stack functionality can be used any more.

Parameters
a_phProxyStubPlatformLayerUA Stack platform layer handle.
Returns
OPC UA Status code.
OpcUa_StatusCode UaServer_Module_InitializeUaStack ( OpcUa_Handle *  a_phProxyStubPlatformLayer,
OpcUa_ProxyStubConfiguration *  a_pProxyStubConfiguration 
)

Initialize UA stack.

This function must be called before any UA stack functionality is used.

Parameters
a_phProxyStubPlatformLayerUA Stack platfrom layer handle.
a_pProxyStubConfigurationConfiguration structure for the UA Stack.
Returns
OPC UA Status code.
OpcUa_StatusCode UaServer_SetCallback_SessionActivated ( UaServer a_pUaServer,
UaServer_pfServer_SessionActivated  a_pCallbackFunction 
)

Sets the SessionActivated callback function.

This function was introduced in version 1.2.1.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_pCallbackFunctionThe function to call if a session was activated.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_SetCallback_SessionClosed ( UaServer a_pUaServer,
UaServer_pfServer_SessionClosed  a_pCallbackFunction 
)

Sets the SessionClosed callback function.

This function was introduced in version 1.2.1.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_pCallbackFunctionThe function to call if a session was closed.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_SetCallback_SessionCreated ( UaServer a_pUaServer,
UaServer_pfServer_SessionCreated  a_pCallbackFunction 
)

Sets the SessionCreated callback function.

This function was introduced in version 1.2.1.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_pCallbackFunctionThe function to call if a session was created.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_SetUserAuthenticationType ( UaServer a_pUaServer,
UaServer_UserAuthType  a_type,
UaServer_pfServer_AuthenticateSession  a_pUserAuthFunction 
)

Sets the authentication type used in ActivateSession.

Deprecated:
This function is deprecated as the passed UaServer_pfServer_AuthenticateSession callback does not support verifying the signature data of X509 tokens. It is recommended to use UaServer_SetUserAuthenticationTypeEx instead.
Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_typeThe authentication type to set.
[in]a_pUserAuthFunctionOptional: If a custom authentication module should be set, the function pointer to the authentication callback function must be set here and a_type to UserAuthType_User. If no custom authentication module is set, this parameter is ignored and can be OpcUa_Null.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_SetUserAuthenticationTypeEx ( UaServer a_pUaServer,
UaServer_UserAuthType  a_type,
UaServer_pfServer_AuthenticateSessionEx  a_pUserAuthFunction 
)

Sets the authentication type used in ActivateSession.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_typeThe authentication type to set.
[in]a_pUserAuthFunctionOptional: If a custom authentication module should be set, the function pointer to the authentication callback function must be set here and a_type to UserAuthType_User. If no custom authentication module is set, this parameter is ignored and can be OpcUa_Null.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_Shutdown ( UaServer a_pUaServer,
OpcUa_UInt32  a_uSecondsTillShutdown,
OpcUa_LocalizedText *  a_pShutdownReason 
)

Shut the server down in the given number of seconds.

After a_uSecondsTillShutdown have passed, UaServer_DoCom will return with status OpcUa_BadShutdown.

Parameters
a_pUaServerA pointer to the server object.
a_uSecondsTillShutdownThe number of seconds to wait until shutdown.
a_pShutdownReasonThe reason for shutdown.
Returns
OpcUa_Good if no error occured.
OpcUa_StatusCode UaServer_StartUp ( UaServer a_pUaServer)

Start the UaServer to enable OPC UA connection establishment from clients.

Parameters
a_pUaServera pointer to the UaServer object.
Returns
OPC UA Status code.
OpcUa_StatusCode UaServer_TimedDoCom ( OpcUa_UInt32  a_uTimeout)

The internal main 'event loop' which processes messages and triggers timers.

Parameters
a_uTimeoutThe timeout for the OpcUa_SocketManager_Loop call issued by this function.
Returns
OpcUa_Good if no error occured. OpcUa_BadShutdown if UaServer_Shutdown was called and the shutdown time is reached.