High Performance OPC UA Server SDK  1.2.0.193
eventnotifier

Register/Unregister eventnotifiers and fire events. More...

Data Structures

struct  uaserver_eventnotifier
 

Functions

int uaserver_eventnotifier_init (void)
 Initialize the eventnotifier handling. More...
 
void uaserver_eventnotifier_clear (void)
 Clear resources allocated by the eventnotifier handling. More...
 
int uaserver_eventnotifier_register (ua_node_t event_notifier, ua_node_t parent_notifier, bool is_event_source)
 Register an event notifier or event source. More...
 
int uaserver_eventnotifier_register_all (uint16_t nsidx)
 Register all eventnotifiers and eventsources from the namespace with index nsidx. More...
 
int uaserver_eventnotifier_unregister (ua_node_t event_notifier)
 Unregister an eventnotifier or eventsource. More...
 
int uaserver_eventnotifier_unregister_all (uint16_t nsidx)
 Unregister all eventnotifiers from the namespace with index nsidx. More...
 
bool uaserver_eventnotifier_exists (const struct ua_nodeid *event_notifier)
 Check if the event_notifier is registered. More...
 
int uaserver_eventnotifier_add_item (struct ua_monitoreditem *item)
 
int uaserver_eventnotifier_remove_item (struct ua_monitoreditem *item)
 
int uaserver_eventnotifier_fire_event (struct uaserver_event *e)
 Distribute an event created with uaserver_event_create to all subscribed monitored items. More...
 

Detailed Description

Register/Unregister eventnotifiers and fire events.

Function Documentation

void uaserver_eventnotifier_clear ( void  )

Clear resources allocated by the eventnotifier handling.

This is done automatically by the SDK at server shutdown.

bool uaserver_eventnotifier_exists ( const struct ua_nodeid event_notifier)

Check if the event_notifier is registered.

Returns true only for eventnotfiers, not for eventsources.

int uaserver_eventnotifier_fire_event ( struct uaserver_event e)

Distribute an event created with uaserver_event_create to all subscribed monitored items.

The eventnotifier is determined by the SourceNode field set at creation.

The event is not modified by this function, but its fields may need to be resorted, so it cannot be const.

Returns
Zero on success or negative errorcode on failure.
int uaserver_eventnotifier_init ( void  )

Initialize the eventnotifier handling.

This is done automatically by the SDK at server initializiation.

Returns
Zero on success or errorcode on failure.
int uaserver_eventnotifier_register ( ua_node_t  event_notifier,
ua_node_t  parent_notifier,
bool  is_event_source 
)

Register an event notifier or event source.

This will build up an internal hierarchy of event notifiers and event sources as leaf elements. It is required to efficiently distribute events to registered monitored items.

Parameters
event_notifierNode handle of the notifier or source.
parent_notifierNode handle of the parent of the notifier or source, this must always be a notifier and not a source. This is optional for the Server object, but all other notifiers and sources should have a parent.
is_event_sourcefalse to register a notifier, true to register a source.
Returns
Zero on success or negative errorcode on failure.
int uaserver_eventnotifier_register_all ( uint16_t  nsidx)

Register all eventnotifiers and eventsources from the namespace with index nsidx.

Traverse the addressspace and register all eventnotifiers and eventsource where the nodeid matches the given nsidx. In case of error already registered eventnotifiers and eventsources are not unregistered.

The traversal starts at the server object, all eventnotifiers must be reachable from there with hasnotifer references. Eventsources must be reference from their notifiers with the haseventsource reference.

Returns
Zero on success or negative errorcode on failure.
int uaserver_eventnotifier_unregister ( ua_node_t  event_notifier)

Unregister an eventnotifier or eventsource.

Only eventnotifiers without children can be unregistered, so first eventsources must be unregistered and then eventnotifiers from bottom to top.

Returns
Zero on success or negative errorcode on failure.
int uaserver_eventnotifier_unregister_all ( uint16_t  nsidx)

Unregister all eventnotifiers from the namespace with index nsidx.

See also
uaserver_eventnotifier_register_all
Returns
Zero on success or negative errorcode on failure.