UA Server SDK C++ Bundle  1.3.2.200
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
UaClientSdk::UaSubscriptionCallback Class Reference

UaSubscriptionCallback defines the callback interface for the UaSubscription class. More...

#include <uaclientsdk.h>

Public Member Functions

virtual void subscriptionStatusChanged (OpcUa_UInt32 clientSubscriptionHandle, const UaStatus &status)=0
 Send subscription state change.
virtual void keepAlive (OpcUa_UInt32 clientSubscriptionHandle)
 Send subscription keep alive.
virtual void notificationsMissing (OpcUa_UInt32 clientSubscriptionHandle, OpcUa_UInt32 previousSequenceNumber, OpcUa_UInt32 newSequenceNumber)
 Informs the client about missing notification messages.
virtual void dataChange (OpcUa_UInt32 clientSubscriptionHandle, const UaDataNotifications &dataNotifications, const UaDiagnosticInfos &diagnosticInfos)=0
 Send changed data.
virtual void newEvents (OpcUa_UInt32 clientSubscriptionHandle, UaEventFieldLists &eventFieldList)=0
 Send new events.
virtual void createMonitoredItemsComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaMonitoredItemCreateResults &createResults, const UaDiagnosticInfos &diagnosticInfos)
 Send createMonitoredItems results.
virtual void modifyMonitoredItemsComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaMonitoredItemModifyResults &modifyResults, const UaDiagnosticInfos &diagnosticInfos)
 Send modifyMonitoredItems results.
virtual void setMonitoringModeComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &setModeResults, const UaDiagnosticInfos &diagnosticInfos)
 Send setMonitoringMode results.
virtual void deleteMonitoredItemsComplete (OpcUa_UInt32 transactionId, const UaStatus &result, const UaStatusCodeArray &deleteResults, const UaDiagnosticInfos &diagnosticInfos)
 Send deleteMonitoredItems results.

Detailed Description

UaSubscriptionCallback defines the callback interface for the UaSubscription class.

This callback interface needs to be implemented by the user of the UaSubscription class to receive data change, event and subscription status change callbacks from the Client SDK. The interface provides also a callback function for keep alive calls from the server. This function need to be implemented only by users of the SDK interested in the keep alive callbacks. The status of the subscription is normally monitored by the SDK and changes are indicated by sending subscription status changed callbacks. In cases of Subscription errors the user of the SDK is responsible for creating a new subscription since the SDK does not keep the information to recreate the Subscription to not increase memory consumption. The necessary information needs to be kept also by the client application anyway. To duplicate this information in the SDK consumes too much memory.
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.

Member Function Documentation

void UaClientSdk::UaSubscriptionCallback::createMonitoredItemsComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaMonitoredItemCreateResults &  createResults,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send createMonitoredItems results.

Parameters
[in]transactionIdClient defined transction id for the createMonitoredItems
[in]resultOverall createMonitoredItems result
[in]createResultsList of createMonitoredItems results
[in]diagnosticInfosList of diagnostic information
virtual void UaClientSdk::UaSubscriptionCallback::dataChange ( OpcUa_UInt32  clientSubscriptionHandle,
const UaDataNotifications &  dataNotifications,
const UaDiagnosticInfos &  diagnosticInfos 
)
pure virtual

Send changed data.

This callback function provides the data notification for a subscription.

Parameters
[in]clientSubscriptionHandleClient defined handle of the affected subscription
[in]dataNotificationsList of data notifiations sent by the server
[in]diagnosticInfosList of diagnostic info related to the data notifications. This list can be empty.
void UaClientSdk::UaSubscriptionCallback::deleteMonitoredItemsComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray &  deleteResults,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send deleteMonitoredItems results.

Parameters
[in]transactionIdClient defined transction id for the deleteMonitoredItems
[in]resultOverall deleteMonitoredItems result
[in]deleteResultsList of deleteMonitoredItems results
[in]diagnosticInfosList of diagnostic information
void UaClientSdk::UaSubscriptionCallback::keepAlive ( OpcUa_UInt32  clientSubscriptionHandle)
virtual

Send subscription keep alive.

This callback function provides the keep alive messages sent by the server if no changed data or events are available.

Parameters
[in]clientSubscriptionHandleClient defined handle of the affected subscription
void UaClientSdk::UaSubscriptionCallback::modifyMonitoredItemsComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaMonitoredItemModifyResults &  modifyResults,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send modifyMonitoredItems results.

Parameters
[in]transactionIdClient defined transction id for the modifyMonitoredItems
[in]resultOverall modifyMonitoredItems result
[in]modifyResultsList of modifyMonitoredItems results
[in]diagnosticInfosList of diagnostic information
virtual void UaClientSdk::UaSubscriptionCallback::newEvents ( OpcUa_UInt32  clientSubscriptionHandle,
UaEventFieldLists &  eventFieldList 
)
pure virtual

Send new events.

This callback function provides the event notification for a subscription.

Parameters
[in]clientSubscriptionHandleClient defined handle of the affected subscription
[in]eventFieldListList of event notifiations sent by the server
void UaClientSdk::UaSubscriptionCallback::notificationsMissing ( OpcUa_UInt32  clientSubscriptionHandle,
OpcUa_UInt32  previousSequenceNumber,
OpcUa_UInt32  newSequenceNumber 
)
virtual

Informs the client about missing notification messages.

The client SDK monitors the sequence numbers of the received data and event notifications and reports gaps in the sequence numbers using this callback method. The client can use the UaSubscription::republish method to request the missing notifications.

Parameters
[in]clientSubscriptionHandleClient defined handle of the affected subscription
[in]previousSequenceNumberSequence number of the previously received notification
[in]newSequenceNumberSequence number of the new notification
void UaClientSdk::UaSubscriptionCallback::setMonitoringModeComplete ( OpcUa_UInt32  transactionId,
const UaStatus result,
const UaStatusCodeArray &  setModeResults,
const UaDiagnosticInfos &  diagnosticInfos 
)
virtual

Send setMonitoringMode results.

Parameters
[in]transactionIdClient defined transction id for the setMonitoringMode
[in]resultOverall setMonitoringMode result
[in]setModeResultsList of setMonitoringMode results
[in]diagnosticInfosList of diagnostic information
virtual void UaClientSdk::UaSubscriptionCallback::subscriptionStatusChanged ( OpcUa_UInt32  clientSubscriptionHandle,
const UaStatus status 
)
pure virtual

Send subscription state change.

This callback function informs the client if the status of a subscription changes. This can happen after a connection error that was longer than the lifetime of the subscription. The lifetime is calculated from PublishingInterval x MaxKeepAliveCount x LifetimeCount. A client must create a new subscription to continue data or event monitoring if this callback indicates a bad status for the subscripiton. UaSession::deleteSubscription should be called even if the subscription is not longer valid in the server to clear the client side subscription object.

Parameters
[in]clientSubscriptionHandleClient defined handle of the affected subscription
[in]statusChanges status for the subscription

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