open62541 1.3.12
Open source implementation of OPC UA
|
#include <open62541/types.h>
#include <open62541/types_generated.h>
#include <open62541/plugin/nodestore.h>
#include "ua_session.h"
#include "ua_timer.h"
#include "ua_util_internal.h"
Go to the source code of this file.
Data Structures | |
struct | UA_Notification |
struct | UA_NotificationMessageEntry |
struct | UA_MonitoredItem |
struct | UA_Subscription |
Typedefs | |
typedef struct UA_Notification | UA_Notification |
typedef struct UA_NotificationMessageEntry | UA_NotificationMessageEntry |
typedef struct UA_ConditionSource | UA_ConditionSource |
Enumerations | |
enum | UA_MonitoredItemSamplingType |
enum | UA_SubscriptionState |
#define UA_SUBSCRIPTION_QUEUE_SENTINEL ((UA_Notification*)0x01) |
This Source Code Form is subject to the terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright 2015-2018, 2021-2022 (c) Fraunhofer IOSB (Author: Julius Pfrommer) Copyright 2015 (c) Chris Iatrou Copyright 2015-2016 (c) Sten GrĂ¼ner Copyright 2015 (c) Oleksiy Vasylyev Copyright 2017 (c) Florian Palm Copyright 2017 (c) Stefan Profanter, fortiss GmbH Copyright 2017 (c) Mattias Bornhager Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green) Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart (for VDW and umati) Copyright 2021 (c) Fraunhofer IOSB (Author: Andreas Ebner) MonitoredItems create Notifications. Subscriptions collect Notifications from (several) MonitoredItems and publish them to the client.
Notifications are put into two queues at the same time. One for the MonitoredItem that generated the notification. Here we can remove it if the space reserved for the MonitoredItem runs full. The second queue is the "global" queue for all Notifications generated in a Subscription. For publication, the notifications are taken out of the "global" queue in the order of their creation. Notifications Set to the TAILQ_NEXT pointer of a notification, the sentinel that the notification was not added to the global queue
Definition at line 48 of file ua_subscription.h.
#define UA_BOUNDEDVALUE_SETWBOUNDS | ( | BOUNDS, | |
SRC, | |||
DST ) |
Setting an integer value within bounds.
Definition at line 379 of file ua_subscription.h.
#define UA_LOG_SUBSCRIPTION_INTERNAL | ( | LOGGER, | |
LEVEL, | |||
SUB, | |||
MSG, | |||
... ) |
Logging See a description of the tricks used in ua_session.h.
Definition at line 387 of file ua_subscription.h.
#define UA_LOG_TRACE_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, TRACE, SUB, __VA_ARGS__, "")) |
Definition at line 401 of file ua_subscription.h.
#define UA_LOG_DEBUG_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, DEBUG, SUB, __VA_ARGS__, "")) |
Definition at line 408 of file ua_subscription.h.
#define UA_LOG_INFO_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, INFO, SUB, __VA_ARGS__, "")) |
Definition at line 415 of file ua_subscription.h.
#define UA_LOG_WARNING_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, WARNING, SUB, __VA_ARGS__, "")) |
Definition at line 422 of file ua_subscription.h.
#define UA_LOG_ERROR_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, ERROR, SUB, __VA_ARGS__, "")) |
Definition at line 429 of file ua_subscription.h.
#define UA_LOG_FATAL_SUBSCRIPTION | ( | LOGGER, | |
SUB, | |||
... ) UA_MACRO_EXPAND(UA_LOG_SUBSCRIPTION_INTERNAL(LOGGER, FATAL, SUB, __VA_ARGS__, "")) |
Definition at line 436 of file ua_subscription.h.
typedef struct UA_Notification UA_Notification |
typedef struct UA_NotificationMessageEntry UA_NotificationMessageEntry |
A NotificationMessage contains an array of notifications.
Sent NotificationMessages are stored for the republish service.
typedef struct UA_ConditionSource UA_ConditionSource |
Definition at line 363 of file ua_subscription.h.
MonitoredItem.
The type of sampling for MonitoredItems depends on the sampling interval.
>0: Cyclic callback =0: Attached to the node. Sampling is triggered after every "write". <0: Attached to the subscription. Triggered just before every "publish".
Enumerator | |
---|---|
UA_MONITOREDITEMSAMPLINGTYPE_NONE | |
UA_MONITOREDITEMSAMPLINGTYPE_CYCLIC | |
UA_MONITOREDITEMSAMPLINGTYPE_EVENT | |
UA_MONITOREDITEMSAMPLINGTYPE_PUBLISH |
Definition at line 108 of file ua_subscription.h.
enum UA_SubscriptionState |
Subscription.
We use only a subset of the states defined in the standard
Enumerator | |
---|---|
UA_SUBSCRIPTIONSTATE_NORMAL | |
UA_SUBSCRIPTIONSTATE_LATE | |
UA_SUBSCRIPTIONSTATE_KEEPALIVE |
Definition at line 245 of file ua_subscription.h.
UA_Notification * UA_Notification_new | ( | void | ) |
Initializes and sets the sentinel pointers.
void UA_Notification_enqueueAndTrigger | ( | UA_Server * | server, |
UA_Notification * | n ) |
Notifications are always added to the queue of the MonitoredItem.
That queue can overflow. If Notifications are reported, they are also added to the global queue of the Subscription. There they are picked up by the publishing callback.
There are two ways Notifications can be put into the global queue of the Subscription: They are added because the MonitoringMode of the MonitoredItem is "reporting". Or the MonitoringMode is "sampling" and a link is trigered that puts the last Notification into the global queue.
void UA_Notification_delete | ( | UA_Notification * | n | ) |
Dequeue and delete the notification.
typedef TAILQ_HEAD | ( | NotificationQueue | , |
UA_Notification | ) |
Queue Definitions.
typedef TAILQ_HEAD | ( | NotificationMessageQueue | , |
UA_NotificationMessageEntry | ) |
void UA_MonitoredItem_init | ( | UA_MonitoredItem * | mon | ) |
void UA_MonitoredItem_delete | ( | UA_Server * | server, |
UA_MonitoredItem * | monitoredItem ) |
void UA_MonitoredItem_removeOverflowInfoBits | ( | UA_MonitoredItem * | mon | ) |
void UA_Server_registerMonitoredItem | ( | UA_Server * | server, |
UA_MonitoredItem * | mon ) |
UA_StatusCode UA_MonitoredItem_registerSampling | ( | UA_Server * | server, |
UA_MonitoredItem * | mon ) |
Register sampling.
Either by adding a repeated callback or by adding the MonitoredItem to a linked list in the node.
void UA_MonitoredItem_unregisterSampling | ( | UA_Server * | server, |
UA_MonitoredItem * | mon ) |
UA_StatusCode UA_MonitoredItem_setMonitoringMode | ( | UA_Server * | server, |
UA_MonitoredItem * | mon, | ||
UA_MonitoringMode | monitoringMode ) |
void UA_MonitoredItem_sampleCallback | ( | UA_Server * | server, |
UA_MonitoredItem * | monitoredItem ) |
UA_StatusCode sampleCallbackWithValue | ( | UA_Server * | server, |
UA_Subscription * | sub, | ||
UA_MonitoredItem * | mon, | ||
UA_DataValue * | value ) |
UA_StatusCode UA_MonitoredItem_removeLink | ( | UA_Subscription * | sub, |
UA_MonitoredItem * | mon, | ||
UA_UInt32 | linkId ) |
UA_StatusCode UA_MonitoredItem_addLink | ( | UA_Subscription * | sub, |
UA_MonitoredItem * | mon, | ||
UA_UInt32 | linkId ) |
UA_StatusCode UA_MonitoredItem_createDataChangeNotification | ( | UA_Server * | server, |
UA_Subscription * | sub, | ||
UA_MonitoredItem * | mon, | ||
const UA_DataValue * | value ) |
UA_StatusCode UA_Event_addEventToMonitoredItem | ( | UA_Server * | server, |
const UA_NodeId * | event, | ||
UA_MonitoredItem * | mon ) |
UA_StatusCode UA_Event_generateEventId | ( | UA_ByteString * | generatedId | ) |
void UA_Event_staticSelectClauseValidation | ( | UA_Server * | server, |
const UA_EventFilter * | eventFilter, | ||
UA_StatusCode * | result ) |
UA_StatusCode UA_Event_staticWhereClauseValidation | ( | UA_Server * | server, |
const UA_ContentFilter * | filter, | ||
UA_ContentFilterResult * | ) |
void UA_MonitoredItem_ensureQueueSpace | ( | UA_Server * | server, |
UA_MonitoredItem * | mon ) |
Remove entries until mon->maxQueueSize is reached.
Sets infobits for lost data if required.
UA_Subscription * UA_Subscription_new | ( | void | ) |
void UA_Subscription_delete | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
UA_StatusCode Subscription_registerPublishCallback | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
void Subscription_unregisterPublishCallback | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
UA_MonitoredItem * UA_Subscription_getMonitoredItem | ( | UA_Subscription * | sub, |
UA_UInt32 | monitoredItemId ) |
void UA_Subscription_sampleAndPublish | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
UA_Boolean UA_Subscription_publishOnce | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
void UA_Subscription_publish | ( | UA_Server * | server, |
UA_Subscription * | sub ) |
UA_StatusCode UA_Subscription_removeRetransmissionMessage | ( | UA_Subscription * | sub, |
UA_UInt32 | sequenceNumber ) |
UA_Boolean UA_Session_reachedPublishReqLimit | ( | UA_Server * | server, |
UA_Session * | session ) |
UA_StatusCode UA_Server_evaluateWhereClauseContentFilter | ( | UA_Server * | server, |
UA_Session * | session, | ||
const UA_NodeId * | eventNode, | ||
const UA_ContentFilter * | contentFilter, | ||
UA_ContentFilterResult * | contentFilterResult ) |
Helpers.
Evaluate content filter, Only for unit testing