open62541pp 0.15.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
CreateSubscription service
Collaboration diagram for CreateSubscription service:

Detailed Description

Create subscriptions.

Subscriptions monitor a set of monitored items for notifications and return them to the client.

See also
https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.2

Typedefs

using opcua::services::DeleteSubscriptionCallback = std::function<void(uint32_t subId)>
 
using opcua::services::StatusChangeNotificationCallback
 

Functions

CreateSubscriptionResponse opcua::services::createSubscription (Client &connection, const CreateSubscriptionRequest &request, StatusChangeNotificationCallback statusChangeCallback={}, DeleteSubscriptionCallback deleteCallback={})
 
Result< uint32_t > opcua::services::createSubscription (Client &connection, SubscriptionParameters &parameters, bool publishingEnabled=true, StatusChangeNotificationCallback statusChangeCallback={}, DeleteSubscriptionCallback deleteCallback={}) noexcept
 

Typedef Documentation

◆ DeleteSubscriptionCallback

using opcua::services::DeleteSubscriptionCallback = std::function<void(uint32_t subId)>

Subscription deletion callback.

Parameters
subIdSubscription identifier

Definition at line 63 of file subscription.hpp.

◆ StatusChangeNotificationCallback

Initial value:
std::function<void(uint32_t subId, StatusChangeNotification& notification)>

s Subscription status change notification callback.

Parameters
subIdSubscription identifier
notificationStatus change notification

Definition at line 70 of file subscription.hpp.

Function Documentation

◆ createSubscription() [1/2]

CreateSubscriptionResponse opcua::services::createSubscription ( Client & connection,
const CreateSubscriptionRequest & request,
StatusChangeNotificationCallback statusChangeCallback = {},
DeleteSubscriptionCallback deleteCallback = {} )

Create a subscription.

Parameters
connectionInstance of type Client
requestCreate subscription request
statusChangeCallbackInvoked when the status of a subscription is changed
deleteCallbackInvoked when the subscription is deleted

◆ createSubscription() [2/2]

Result< uint32_t > opcua::services::createSubscription ( Client & connection,
SubscriptionParameters & parameters,
bool publishingEnabled = true,
StatusChangeNotificationCallback statusChangeCallback = {},
DeleteSubscriptionCallback deleteCallback = {} )
nodiscardnoexcept

Create a subscription.

Parameters are passed by reference because illegal parameters can be revised by the server. The updated parameters reflect the actual values that the server will use.

Parameters
connectionInstance of type Client
parametersSubscription parameters, may be revised by server
publishingEnabledEnable/disable publishing of the subscription
statusChangeCallbackInvoked when the status of a subscription is changed
deleteCallbackInvoked when the subscription is deleted
Returns
Server-assigned identifier of the subscription