C++ Based OPC UA Client/Server SDK  1.5.5.355
UaClientSdk::UaSessionCallback Class Referenceabstract

UaSessionCallback defines the callback interface for the UaSession class. More...

#include <uaclientsdk.h>

Inherited by UaClientSdk::UaDiscoveryPrivate.

Public Member Functions

virtual void connectionStatusChanged (OpcUa_UInt32 clientConnectionId, UaClient::ServerStatus serverStatus)=0
 Send changed status. More...
 
virtual bool connectError (OpcUa_UInt32 clientConnectionId, UaClient::ConnectServiceType serviceType, const UaStatus &error, bool clientSideError)
 Callback for reporting errors during connection establishment to the application. More...
 
virtual bool sslCertificateValidationFailed (OpcUa_UInt32 clientConnectionId, const UaStatusCode &uaStatus, const UaByteString &bsSSLCertificate)
 Callback for verifying the server's SSL certificate. More...
 
virtual void readComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaDataValues &values, const UaDiagnosticInfos &diagnosticInfos)
 Send read results. More...
 
virtual void writeComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &results, const UaDiagnosticInfos &diagnosticInfos)
 Send write results. More...
 
virtual void callComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const CallOut &callResponse)
 Send call result. More...
 
virtual void addNodesComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaAddNodesResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send addNodes result. More...
 
virtual void addReferencesComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &results, const UaDiagnosticInfos &diagnosticInfos)
 Send addReferences result. More...
 
virtual void deleteNodesComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &results, const UaDiagnosticInfos &diagnosticInfos)
 Send deleteNodes result. More...
 
virtual void deleteReferencesComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &results, const UaDiagnosticInfos &diagnosticInfos)
 Send deleteReferences result. More...
 
virtual void historyReadRawModifiedComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const HistoryReadDataResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyReadRawModified result. More...
 
virtual void historyReadProcessedComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const HistoryReadDataResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyReadProcessed result. More...
 
virtual void historyReadAtTimeComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const HistoryReadDataResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyReadAtTime result. More...
 
virtual void historyReadEventComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const HistoryReadEventResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyReadEvent result. More...
 
virtual void historyUpdateDataComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaHistoryUpdateResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyUpdateData result. More...
 
virtual void historyDeleteRawModifiedComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaHistoryUpdateResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyDeleteRawModified result. More...
 
virtual void historyDeleteAtTimeComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaHistoryUpdateResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyDeleteAtTime result. More...
 
virtual void historyUpdateEventsComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaHistoryUpdateResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyUpdateEvents result. More...
 
virtual void historyDeleteEventsComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaHistoryUpdateResults &results, const UaDiagnosticInfos &diagnosticInfos)
 Send historyDeleteEvents result. More...
 

Detailed Description

UaSessionCallback defines the callback interface for the UaSession class.

This callback interface needs to be implemented by the user of the UaSession class to receive connection status change callbacks from the Client SDK. The interface provides also the callback functions for the asynchronous service calls. Only the callbacks for used asynchronous calls need to be implemented by the user of the SDK.

Callbacks from the SDK APIs are coming from worker threads and not from the thread that was used to connect to the server. It is in the responsibility of the user of the client API to synchronize the data provided by the callbacks with a GUI main thread if this is necessary.

After UaSession::disconnect() is called, no more callbacks will be sent for this UaSession object. The disconnect blocks until all outstanding service calls are finished and results are returned. This includes any asynchronous service calls and outstanding callbacks to the client application.

It is not allowed to block the execution of callbacks when UaSession::disconnect() is called. This will lead to a deadlock of the client application.

Member Function Documentation

void UaClientSdk::UaSessionCallback::addNodesComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaAddNodesResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send addNodes result.

This is the callback function for calls to UaSession::beginAddNodes.

Parameters
[in]transactionIdClient defined transaction id for the addNodes
[in]resultOverall addNodes service result
[in]resultsList of add nodes operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::addReferencesComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send addReferences result.

This is the callback function for calls to UaSession::beginAddReferences.

Parameters
[in]transactionIdClient defined transaction id for the addReferences
[in]resultOverall addReferences service result
[in]resultsList of add references operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::callComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const CallOut callResponse 
)
virtual

Send call result.

This is the callback function for calls to UaSession::beginCall.

Parameters
[in]transactionIdClient defined transaction id for the call
[in]resultOverall call result
[in]callResponseOutput arguments and input argument results. See CallOut for more details
bool UaClientSdk::UaSessionCallback::connectError ( OpcUa_UInt32  clientConnectionId,
UaClient::ConnectServiceType  serviceType,
const UaStatus error,
bool  clientSideError 
)
virtual

Callback for reporting errors during connection establishment to the application.

The callback UaSessionCallback::connectionStatusChanged indicates the overall status of the connection but does not report detailed error information. The connectError callback can be used to get more information about the error scenario. This includes errors during reconnect attempts after a connection interruption.

Most of the errors are returned from the communication stack or the OPC UA server but some of the errors like server certificate validation errors are reported by the client SDK. If clientSideError is true, the error was created inside the Client SDK, these errors can be overridden by returning true. The default implementation always returns false.

Returns
true if a Client SDK error should be skipped, false otherwise. The return code is ignored by the SDK if the error was not created by the Client SDK
Parameters
[in]clientConnectionIdClient defined handle of the affected session
[in]serviceTypeThe failing connect step
[in]errorStatus code for the error situation
[in]clientSideErrorFlag indicating if the bad status was created in the Client SDK
virtual void UaClientSdk::UaSessionCallback::connectionStatusChanged ( OpcUa_UInt32  clientConnectionId,
UaClient::ServerStatus  serverStatus 
)
pure virtual

Send changed status.

This callback function is called by the SDK whenever the connection status changes. This is typically the case if UaSession::connect() or UaSession::disconnect() are called or if the connection monitoring detects a connection interruption or was able to re-establish the connection.

There is normally no action necessary by the application using the UaSession object other than not calling services if the status is not connected. The only case that may require special actions is the status NewSessionCreated. In these cases the SDK was not able to reuse the old session and created a new session during reconnect. This requires to redo register nodes for the new session or to read the namespace array.

Parameters
[in]clientConnectionIdClient defined handle of the affected session
[in]serverStatusNew connection status. See UaClient::ServerStatus for more details.
void UaClientSdk::UaSessionCallback::deleteNodesComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send deleteNodes result.

This is the callback function for calls to UaSession::beginDeleteNodes.

Parameters
[in]transactionIdClient defined transaction id for the deleteNodes
[in]resultOverall deleteNodes service result
[in]resultsList of delete nodes operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::deleteReferencesComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send deleteReferences result.

This is the callback function for calls to UaSession::beginDeleteReferences.

Parameters
[in]transactionIdClient defined transaction id for the deleteReferences
[in]resultOverall deleteReferences service result
[in]resultsList of delete references operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyDeleteAtTimeComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaHistoryUpdateResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyDeleteAtTime result.

This is the callback function for calls to UaSession::beginHistoryDeleteAtTime.

Parameters
[in]transactionIdClient defined transaction id for the historyDeleteAtTime
[in]resultOverall historyDeleteAtTime service result
[in]resultsThe list of delete operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyDeleteEventsComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaHistoryUpdateResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyDeleteEvents result.

This is the callback function for calls to UaSession::beginHistoryDeleteEvents.

Parameters
[in]transactionIdClient defined transaction id for the historyDeleteEvents
[in]resultOverall historyDeleteEvents service result
[in]resultsThe list of delete operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyDeleteRawModifiedComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaHistoryUpdateResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyDeleteRawModified result.

This is the callback function for calls to UaSession::beginHistoryDeleteRawModified.

Parameters
[in]transactionIdClient defined transaction id for the historyDeleteRawModified
[in]resultOverall historyDeleteRawModified service result
[in]resultsThe list of delete operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyReadAtTimeComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const HistoryReadDataResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyReadAtTime result.

This is the callback function for calls to UaSession::beginHistoryReadAtTime.

Parameters
[in]transactionIdClient defined transaction id for the historyReadAtTime
[in]resultOverall historyReadAtTime service result
[in]resultsResult data for the requested nodes and timestamps
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyReadEventComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const HistoryReadEventResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyReadEvent result.

This is the callback function for calls to UaSession::beginHistoryReadEvent.

Parameters
[in]transactionIdClient defined transaction id for the historyReadEvent
[in]resultOverall historyReadEvent service result
[in]resultsThe event history for each notifier
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyReadProcessedComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const HistoryReadDataResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyReadProcessed result.

This is the callback function for calls to UaSession::beginHistoryReadProcessed.

Parameters
[in]transactionIdClient defined transaction id for the historyReadProcessed
[in]resultOverall historyReadProcessed service result
[in]resultsResult data for the requested nodes, time domain and aggregates. A continuation point is included for a node if not all results could be returned or processed before the timeout expired.
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyReadRawModifiedComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const HistoryReadDataResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyReadRawModified result.

This is the callback function for calls to UaSession::beginHistoryReadRawModified.

Parameters
[in]transactionIdClient defined transaction id for the historyReadRawModified
[in]resultOverall historyReadRawModified service result
[in]resultsResult data for the requested nodes and time interval. A continuation point is included for a node if not all results could be returned.
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyUpdateDataComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaHistoryUpdateResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyUpdateData result.

This is the callback function for calls to UaSession::beginHistoryUpdateData.

Parameters
[in]transactionIdClient defined transaction id for the historyUpdateData
[in]resultOverall historyUpdateData service result
[in]resultsThe list of update operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::historyUpdateEventsComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaHistoryUpdateResults results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send historyUpdateEvents result.

This is the callback function for calls to UaSession::beginHistoryUpdateEvents.

Parameters
[in]transactionIdClient defined transaction id for the historyUpdateEvents
[in]resultOverall historyUpdateEvents service result
[in]resultsThe list of update operation results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSessionCallback::readComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaDataValues values,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send read results.

This is the callback function for calls to UaSession::beginRead.

Parameters
[in]transactionIdClient defined transaction id for the read
[in]resultOverall read service result
[in]valuesList of read operation results contained in OpcUa_DataValue structures
[in]diagnosticInfosList of diagnostic information
bool UaClientSdk::UaSessionCallback::sslCertificateValidationFailed ( OpcUa_UInt32  clientConnectionId,
const UaStatusCode uaStatus,
const UaByteString bsSSLCertificate 
)
virtual

Callback for verifying the server's SSL certificate.

The application must return true if the certificate is trusted. The application must return false if the certificate is not trusted.

Parameters
[in]clientConnectionIdClient defined handle of the affected session
[in]uaStatusStatus code for the error situation
[in]bsSSLCertificateThe SSL certificate that failed verification
void UaClientSdk::UaSessionCallback::writeComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray results,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send write results.

This is the callback function for calls to UaSession::beginWrite.

Parameters
[in]transactionIdClient defined transaction id for the write
[in]resultOverall write service result
[in]resultsList of write operation results
[in]diagnosticInfosList of diagnostic information

The documentation for this class was generated from the following files: