ASNeG / OpcUaStack

Open Source OPC UA Application Server and OPC UA Client/Server C++ Libraries
https://asneg.github.io/projects/opcuastack
Apache License 2.0
119 stars 41 forks source link

How do clients subscribe to events? #572

Closed sixhj closed 1 year ago

sixhj commented 1 year ago

Through the client can subscribe to the server properties, but I want to subscribe to events, but did not find the relevant interface, where is the documentation? Or instance

huebl commented 1 year ago

Currently there are only examples for the use of monitored items (Branch Release4 in git repository). https://github.com/ASNeG/OpcUaStack/blob/Release4/tst/OpcUaStackClient/ServiceSet/ServiceSetManagerSyncReal_MonitoredItem_t.cpp https://github.com/ASNeG/OpcUaStack/blob/Release4/tst/OpcUaStackClient/ServiceSet/ServiceSetManagerAsyncReal_MonitoredItem_t.cpp

Monitored items are also used for events. Event fields are also passed in addition.

We will include an example of Event in the Examples.

huebl commented 1 year ago

There are now two examples for monitoring events in the Git repository.

https://github.com/ASNeG/OpcUaStack/blob/Release4/tst/OpcUaStackClient/ServiceSet/ServiceSetManagerSyncReal_EventItem_t.cpp https://github.com/ASNeG/OpcUaStack/blob/Release4/tst/OpcUaStackClient/ServiceSet/ServiceSetManagerAsyncReal_EventItem_t.cpp