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

Data Structures

struct  UaServer_PubSubCallbackInterface
 Callback interface for custom PubSub message handling. More...
 

Typedefs

typedef OpcUa_StatusCode(* UaServer_pfServer_SessionCreated )(UaServer_PublicSession *a_pSession)
 Callback function to inform the application that a session was created. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_SessionActivated )(UaServer_PublicSession *a_pSession)
 Callback function to inform the application that a session was activated. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_SessionClosed )(UaServer_PublicSession *a_pSession)
 Callback function to inform the application that a session was closed. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_TranslateEventField )(UaServer_PublicSession *a_pSession, UaServer_Event *a_pEvent, OpcUa_Int a_localIndex, OpcUa_Variant *a_pTarget)
 Callback function that allows the application to translate EventFields. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_AuthenticateSessionEx )(UaServer_PublicSession *a_pSession, OpcUa_ExtensionObject *a_pUserIdentityToken, OpcUa_SignatureData *a_pUserTokenSignature)
 Callback function for authenticating a session user. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_GetUserId )(OpcUa_String *a_sUsername, OpcUa_uid_t *a_pUID, OpcUa_gid_t *a_pGID)
 Callback function for getting the numeric identifier of a session user. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_GetGroupId )(OpcUa_String *a_sGroupname, OpcUa_gid_t *a_pGID)
 Callback function for getting the numeric identifier of a group. More...
 
typedef OpcUa_StatusCode(* UaServer_pfServer_GetUserGroups )(OpcUa_String *a_sUsername, OpcUa_UInt16 *a_piNoGroups, OpcUa_gid_t a_pGroups[])
 Callback function for getting the list of groups to which a user belongs. More...
 
typedef int(* UaServer_pfServer_PubSub_WriterDataCB )(struct ua_encoder_context *a_pEncoder, struct pubsub_datasetmsg_ctx *a_pContextDataSetMessage, void *a_pUserData)
 Callback which allows the application to write the DataSet message for a DataSetWriter. More...
 
typedef int(* UaServer_pfServer_PubSub_WriterData )(pubsub_handle a_hDatasetWriter, UaServer_pfServer_PubSub_WriterDataCB *a_pCallback, void **a_ppUserData)
 Callback which allows the application to decide if it wants to write a DataSetWriter data itself. More...
 
typedef int(* UaServer_pfServer_PubSub_ReaderDataCB )(struct ua_decoder_context *a_pDecoder, struct pubsub_datasetmsg_ctx *a_pContextDataSetMessage, void *a_pUserData)
 Callback which allows the application to process the DataSet message for a DataSetReader. More...
 
typedef int(* UaServer_pfServer_PubSub_ReaderData )(pubsub_handle a_hDatasetReader, UaServer_pfServer_PubSub_ReaderDataCB *a_pCallback, void **a_ppUserData)
 Callback which allows the application to decide if it wants to read a DataSetReaders data itself. More...
 
typedef int8_t(* UaServer_pfServer_PubSub_WriterGroupProcessingCB )(void *arg)
 Callback for checking if the application is doing the WriterGroup timing handling. More...
 
typedef int(* UaServer_pfServer_PubSub_WriterGroupProcessing )(pubsub_handle a_hWriterGroup, UaServer_pfServer_PubSub_WriterGroupProcessingCB *a_pCallback, void **a_ppUserData)
 Callback which allows the application to decide if it wants to call sample/publish for a WriterGroup by itself. More...
 

Detailed Description

Typedef Documentation

typedef OpcUa_StatusCode(* UaServer_pfServer_AuthenticateSessionEx)(UaServer_PublicSession *a_pSession, OpcUa_ExtensionObject *a_pUserIdentityToken, OpcUa_SignatureData *a_pUserTokenSignature)

Callback function for authenticating a session user.

This function will be called for every ActivateSession call of a client.

Parameters
[in,out]a_pSessionThe session to be activated. If authorization is enabled, the UserIdentityData member of a_pSession points to a UaServer_UserCtx structure that has to be filled by this function.
[in]a_pUserIdentityTokenThe user token passed by the client.
[in]a_pUserTokenSignatureThe user token signature passed by the client.
Returns
Return OpcUa_Good if the session user could be authenticated; return a bad status code to let the ActivateSession call fail.
typedef OpcUa_StatusCode(* UaServer_pfServer_GetGroupId)(OpcUa_String *a_sGroupname, OpcUa_gid_t *a_pGID)

Callback function for getting the numeric identifier of a group.

Parameters
[in]a_sGroupnameThe group name.
[out]a_pGIDThe numeric identifier of the group.
Returns
The status of the operation.
typedef OpcUa_StatusCode(* UaServer_pfServer_GetUserGroups)(OpcUa_String *a_sUsername, OpcUa_UInt16 *a_piNoGroups, OpcUa_gid_t a_pGroups[])

Callback function for getting the 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.
typedef OpcUa_StatusCode(* UaServer_pfServer_GetUserId)(OpcUa_String *a_sUsername, OpcUa_uid_t *a_pUID, OpcUa_gid_t *a_pGID)

Callback function for getting the numeric identifier of a session user.

Parameters
[in]a_sUsernameThe user name.
[out]a_pUIDThe numeric identifier of the user.
[out]a_pGIDThe numeric identifier of the user's main group.
Returns
The status of the operation.
typedef int(* UaServer_pfServer_PubSub_ReaderData)(pubsub_handle a_hDatasetReader, UaServer_pfServer_PubSub_ReaderDataCB *a_pCallback, void **a_ppUserData)

Callback which allows the application to decide if it wants to read a DataSetReaders data itself.

If the DataSetReader should be handled by the application, the a_pCallback must be set. The callback is called each time of a PubSub network message was received for the DataSetReader. The application must create a management object and return it as a_ppUserData. This user data is passed to the callback when called for processing of received messages.

Parameters
[in]a_hDatasetReaderHandle of the DataSetReader object in the stack. Use UaServer_PubSub_DataSetReader_Get for access to the corresponding configuration structures.
[out]a_pCallbackCallback used when a network message is received that includes a DataSet message for the DataSetReader.
[out]a_ppUserDataUser data passed to the callback for message processing for the DataSetReader.
Returns
0 to keep the default handling, 1 if the application want to handle the DataSetReader messages.
typedef int(* UaServer_pfServer_PubSub_ReaderDataCB)(struct ua_decoder_context *a_pDecoder, struct pubsub_datasetmsg_ctx *a_pContextDataSetMessage, void *a_pUserData)

Callback which allows the application to process the DataSet message for a DataSetReader.

Parameters
[in]a_pDecoderDecoder used to read the DataSet message payload from the network message buffer
[in,out]a_pContextDataSetMessageHeader and status fields for the DataSet message received
[in]a_pUserDataUser data provided for the processing of the DataSetReader in UaServer_pfServer_PubSub_ReaderData
Returns
0 on success, -1 otherwise.
typedef int(* UaServer_pfServer_PubSub_WriterData)(pubsub_handle a_hDatasetWriter, UaServer_pfServer_PubSub_WriterDataCB *a_pCallback, void **a_ppUserData)

Callback which allows the application to decide if it wants to write a DataSetWriter data itself.

If the DataSetWriter should be handled by the application, the a_pCallback must be set. The callback is called at each sampling of a PubSub network message. The application must create a management object and return it as a_ppUserData. This user data is passed to the callback when called for sampling.

Parameters
[in]a_hDatasetWriterHandle of the DataSetWriter object in the stack. Use UaServer_PubSub_DataSetWriter_Get and UaServer_PubSub_PublishedDataSet_Get for access to the corresponding configuration structures.
[out]a_pCallbackCallback used when a network message is created that includes a DataSet message for the DataSetWriter.
[out]a_ppUserDataUser data passed to the callback for message creation for the DataSetWriter.
Returns
0 to keep the default handling, 1 if the application want to handle the DataSetWriter messages.
typedef int(* UaServer_pfServer_PubSub_WriterDataCB)(struct ua_encoder_context *a_pEncoder, struct pubsub_datasetmsg_ctx *a_pContextDataSetMessage, void *a_pUserData)

Callback which allows the application to write the DataSet message for a DataSetWriter.

Parameters
[in]a_pEncoderEncoder used to write the DataSet message payload into the network message buffer
[in,out]a_pContextDataSetMessageHeader and status fields for the DataSet message. The callback may modify fields, especially the valid flag and the status
[in]a_pUserDataUser data provided for the processing of the DataSetWriter in UaServer_pfServer_PubSub_WriterData
Returns
0 on success, -1 otherwise.
typedef int(* UaServer_pfServer_PubSub_WriterGroupProcessing)(pubsub_handle a_hWriterGroup, UaServer_pfServer_PubSub_WriterGroupProcessingCB *a_pCallback, void **a_ppUserData)

Callback which allows the application to decide if it wants to call sample/publish for a WriterGroup by itself.

Parameters
[in]a_hWriterGroupHandle of the WriterGroup object in the stack. Use UaServer_PubSub_WriterGroup_Get for access to the corresponding configuration structures.
[out]a_pCallbackCallback used to check the timing behaviour. If the callback is set, the callback implementation should return 1.
[out]a_ppUserDataUser data passed to the callback.
Returns
0 to keep the default handling, 1 if the application want to handle the timing for the WriterGroup.
typedef int8_t(* UaServer_pfServer_PubSub_WriterGroupProcessingCB)(void *arg)

Callback for checking if the application is doing the WriterGroup timing handling.

If the application handles the timing for a WriterGroup, the application is responsible for the cyclic call of UaServer_PubSub_WriterGroup_Sample and UaServer_PubSub_WriterGroup_Publish for each handled WriterGroup.

Parameters
[in]a_ppUserDataUser data provided for the WriterGroup.
Returns
0 to keep the default handling, 1 if the application want to handle the timing for the WriterGroup.
typedef OpcUa_StatusCode(* UaServer_pfServer_SessionActivated)(UaServer_PublicSession *a_pSession)

Callback function to inform the application that a session was activated.

Parameters
[in]a_pSessionThe session.
Returns
The return value will be ignored.
typedef OpcUa_StatusCode(* UaServer_pfServer_SessionClosed)(UaServer_PublicSession *a_pSession)

Callback function to inform the application that a session was closed.

Parameters
[in]a_pSessionThe session.
Returns
The return value will be ignored.
typedef OpcUa_StatusCode(* UaServer_pfServer_SessionCreated)(UaServer_PublicSession *a_pSession)

Callback function to inform the application that a session was created.

Parameters
[in]a_pSessionThe session.
Returns
The return value will be ignored.
typedef OpcUa_StatusCode(* UaServer_pfServer_TranslateEventField)(UaServer_PublicSession *a_pSession, UaServer_Event *a_pEvent, OpcUa_Int a_localIndex, OpcUa_Variant *a_pTarget)

Callback function that allows the application to translate EventFields.

The passed a_pEvent should not be modified, instead the translated value should be stored in a_pTarget. This function will be called for all EventFields of data type LocalizedText and ExtensionObject.

Parameters
[in]a_pSessionThe session for which the EventField shall be translated.
[in]a_pEventThe event containing the EventField.
[in]a_localIndexThe local index of the EventField, can be used for getting the current value using UaServer_Events_GetEventField.
[out]a_pTargetThe variant the translation should be written to.
Returns
The return value will be ignored.