ANSI C Based OPC UA Client/Server/PubSub SDK  1.9.1.442
UaServerModule

Functions

OpcUa_StatusCode UaServer_PubSub_SetCallback (UaServer *a_pUaServer, UaServer_PubSubCallbackInterface *a_pPubSubCallbackInterface)
 Sets the PubSub callback interface. More...
 
OpcUa_StatusCode UaServer_PubSub_RegisterBackend (struct pubsub_backend *a_pPubSubBackend)
 Registers a custom network backend. More...
 
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Sample (pubsub_handle a_hWriterGroup)
 Creates a network message for a WriterGroup. More...
 
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Publish (pubsub_handle a_hWriterGroup)
 Sends the network message for a WriterGroup. More...
 
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Get (pubsub_handle a_hWriterGroup, const struct ua_writergroupdatatype **a_ppWriterGroup)
 Get the configuration structure for a WriterGroup. More...
 
OpcUa_StatusCode UaServer_PubSub_DataSetWriter_Get (pubsub_handle a_hDataSetWriter, const struct ua_datasetwriterdatatype **a_ppDataSetWriter)
 Get the configuration structure for a DataSetWriter. More...
 
OpcUa_StatusCode UaServer_PubSub_DataSetReader_Get (pubsub_handle a_hDataSetReader, const struct ua_datasetreaderdatatype **a_ppDataSetReader)
 Get the configuration structure for a DataSetReader. More...
 
OpcUa_StatusCode UaServer_PubSub_PublishedDataSet_Get (pubsub_handle a_hDataSetWriter, const struct ua_publisheddatasetdatatype **a_ppPublishedDataSet)
 Get the configuration structure of a PublishedDataSet for a DataSetWriter. More...
 
OpcUa_StatusCode UaServer_SetUserAuthenticationTypeEx (UaServer *a_pUaServer, UaServer_UserAuthType a_type, UaServer_AuthCallbackInterface *a_pAuthCallbackInterface)
 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_SetCallback_TranslateEventField (UaServer *a_pUaServer, UaServer_pfServer_TranslateEventField a_pCallbackFunction)
 Sets the TranslateEventField callback function. More...
 
OpcUa_StatusCode UaServer_GetUserId (OpcUa_String *a_sUsername, OpcUa_uid_t *a_pUID, OpcUa_gid_t *a_pGID)
 Returns user identity information. More...
 
OpcUa_StatusCode UaServer_GetGroupId (OpcUa_String *a_sGroupname, OpcUa_gid_t *a_pGID)
 Returns the GID for the given groupname. More...
 
OpcUa_StatusCode UaServer_GetUserGroups (OpcUa_String *a_sUsername, OpcUa_UInt16 *a_piNoGroups, OpcUa_gid_t a_pGroups[])
 Returns list of groups to which a user belongs. 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_Shutdown (UaServer *a_pUaServer, OpcUa_UInt32 a_uSecondsTillShutdown, OpcUa_LocalizedText *a_pShutdownReason, OpcUa_Boolean a_bRestart)
 Shut the server down in the given number of seconds. More...
 
OpcUa_Void UaServer_SetShutdownDelay (OpcUa_UInt32 a_uShutdownDelay)
 Sets the shutdown delay to use if the server gets shut down via shutdown keystrokes or signals. More...
 
OpcUa_Void UaServer_Clear (UaServer *a_pUaServer)
 Cleans up application and used resources. More...
 
OpcUa_StatusCode UaServer_DumpServerDiagnostics (OpcUa_ServerStatusDataType *a_pServerStatus, OpcUa_ServerDiagnosticsSummaryDataType *a_pServerDiagnosticsSummary, OpcUa_UInt32 *a_pNoOfSessionDiagnostics, OpcUa_SessionDiagnosticsDataType **a_ppSessionDiagnostics, OpcUa_UInt32 *a_pNoOfSessionSecurityDiagnostics, OpcUa_SessionSecurityDiagnosticsDataType **a_ppSessionSecurityDiagnostics, OpcUa_UInt32 *a_pNoOfSubscriptionDiagnostics, OpcUa_SubscriptionDiagnosticsDataType **a_ppSubscriptionDiagnostics)
 Fills the passed structures with the current diagnostic information of the server. More...
 
OpcUa_StatusCode UaServer_Settings_GetConfigurationFromSettings (UaBase_Settings *pSettings, UaServer_Configuration *pServerConfiguration, const char *szHostname)
 Fill the server configuration object using the provided settings structure. More...
 

Detailed Description

Function Documentation

OpcUa_Void UaServer_Clear ( UaServer a_pUaServer)

Cleans up application and used resources.

Parameters
a_pUaServera pointer to the servers object.
OpcUa_StatusCode UaServer_DumpServerDiagnostics ( OpcUa_ServerStatusDataType a_pServerStatus,
OpcUa_ServerDiagnosticsSummaryDataType a_pServerDiagnosticsSummary,
OpcUa_UInt32 *  a_pNoOfSessionDiagnostics,
OpcUa_SessionDiagnosticsDataType **  a_ppSessionDiagnostics,
OpcUa_UInt32 *  a_pNoOfSessionSecurityDiagnostics,
OpcUa_SessionSecurityDiagnosticsDataType **  a_ppSessionSecurityDiagnostics,
OpcUa_UInt32 *  a_pNoOfSubscriptionDiagnostics,
OpcUa_SubscriptionDiagnosticsDataType **  a_ppSubscriptionDiagnostics 
)

Fills the passed structures with the current diagnostic information of the server.

Pass NULL for all structures that should not be filled.

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_GetGroupId ( OpcUa_String a_sGroupname,
OpcUa_gid_t *  a_pGID 
)

Returns the GID for the given groupname.

Parameters
a_sGroupnameName of the group.
a_pGIDNumeric group ID to return.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetUserGroups ( OpcUa_String a_sUsername,
OpcUa_UInt16 *  a_piNoGroups,
OpcUa_gid_t  a_pGroups[] 
)

Returns list of groups to which a user belongs.

Parameters
a_sUsernameThe username.
a_piNoGroupsNumber of groups.
a_pGroupsArray of group IDs.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetUserId ( OpcUa_String a_sUsername,
OpcUa_uid_t *  a_pUID,
OpcUa_gid_t *  a_pGID 
)

Returns user identity information.

Parameters
a_sUsernameThe username to lookup.
a_pUIDThe user id.
a_pGIDThe user's group id.
Returns
OpcUa_Good on success.
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_PubSub_DataSetReader_Get ( pubsub_handle  a_hDataSetReader,
const struct ua_datasetreaderdatatype **  a_ppDataSetReader 
)

Get the configuration structure for a DataSetReader.

Parameters
[in]a_hDataSetReaderHandle of the DataSetReader.
[out]a_ppDataSetReaderConfiguration structure for the DataSetReader.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_DataSetWriter_Get ( pubsub_handle  a_hDataSetWriter,
const struct ua_datasetwriterdatatype **  a_ppDataSetWriter 
)

Get the configuration structure for a DataSetWriter.

Parameters
[in]a_hDataSetWriterHandle of the DataSetWriter.
[out]a_ppDataSetWriterConfiguration structure for the DataSetWriter.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_PublishedDataSet_Get ( pubsub_handle  a_hDataSetWriter,
const struct ua_publisheddatasetdatatype **  a_ppPublishedDataSet 
)

Get the configuration structure of a PublishedDataSet for a DataSetWriter.

Parameters
[in]a_hDataSetWriterHandle of the DataSetWriter.
[out]a_ppPublishedDataSetConfiguration structure for the PublishedDataSet.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_RegisterBackend ( struct pubsub_backend *  a_pPubSubBackend)

Registers a custom network backend.

Parameters
[in]a_pPubSubBackendInterface of the custom network backend.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_SetCallback ( UaServer a_pUaServer,
UaServer_PubSubCallbackInterface a_pPubSubCallbackInterface 
)

Sets the PubSub callback interface.

The callback interface provides callbacks for custom DataSetWriter message creation, custom DataSetReader message processing and custom WriterGroup timing handling.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_pPubSubCallbackInterfaceThe callback interface.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Get ( pubsub_handle  a_hWriterGroup,
const struct ua_writergroupdatatype **  a_ppWriterGroup 
)

Get the configuration structure for a WriterGroup.

Parameters
[in]a_hWriterGroupHandle of the WriterGroup.
[out]a_ppWriterGroupConfiguration structure for the WriterGroup.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Publish ( pubsub_handle  a_hWriterGroup)

Sends the network message for a WriterGroup.

Parameters
[in]a_hWriterGroupHandle of the WriterGroup.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_PubSub_WriterGroup_Sample ( pubsub_handle  a_hWriterGroup)

Creates a network message for a WriterGroup.

Parameters
[in]a_hWriterGroupHandle of the WriterGroup.
Returns
OpcUa_Good on success.
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_SetCallback_TranslateEventField ( UaServer a_pUaServer,
UaServer_pfServer_TranslateEventField  a_pCallbackFunction 
)

Sets the TranslateEventField callback function.

This function was introduced in version 1.7.0.

Parameters
[in]a_pUaServerA pointer to the UaServer object.
[in]a_pCallbackFunctionThe function to call if an EventField needs to be translated.
Returns
OpcUa_Good on success.
OpcUa_Void UaServer_SetShutdownDelay ( OpcUa_UInt32  a_uShutdownDelay)

Sets the shutdown delay to use if the server gets shut down via shutdown keystrokes or signals.

By default, the shutdown delay is 3 seconds.

OpcUa_StatusCode UaServer_Settings_GetConfigurationFromSettings ( UaBase_Settings pSettings,
UaServer_Configuration pServerConfiguration,
const char *  szHostname 
)

Fill the server configuration object using the provided settings structure.

The provided settings object is expected to contain settings described above.

Parameters
pSettingsThe settings to use.
pServerConfigurationThe server configuration to set.
szHostnameOptional: the string to replace [gethostname] placeholders with.
Returns
OpcUa_StatusCode
OpcUa_StatusCode UaServer_SetUserAuthenticationTypeEx ( UaServer a_pUaServer,
UaServer_UserAuthType  a_type,
UaServer_AuthCallbackInterface *  a_pAuthCallbackInterface 
)

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_pAuthCallbackInterfaceOptional: If a custom authentication module should be set, a_type must be set to UserAuthType_User and the authentication callback interface containing the custom auth function pointers must be passed. If a_type is not set to UserAuthType_User, this parameter is ignored.
Returns
OpcUa_Good on success.
OpcUa_StatusCode UaServer_Shutdown ( UaServer a_pUaServer,
OpcUa_UInt32  a_uSecondsTillShutdown,
OpcUa_LocalizedText a_pShutdownReason,
OpcUa_Boolean  a_bRestart 
)

Shut the server down in the given number of seconds.

After a_uSecondsTillShutdown have passed, UaServer_DoCom will return with status OpcUa_BadShutdown or OpcUa_BadContinue, depending on the value of a_bRestart.

Parameters
a_pUaServerA pointer to the server object.
a_uSecondsTillShutdownThe number of seconds to wait until shutdown.
a_pShutdownReasonThe reason for shutdown.
a_bRestartShould the server restart after shutting down. If true, UaBase_DoCom will return OpcUa_BadContinue to inform the application that a restart is requested.
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.