소스 검색

Added monitoredNodeId to UA_MonitoredItem struct.

ichrispa 10 년 전
부모
커밋
11b9e4ec85
1개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 12 2
      src/server/ua_subscription.h

+ 12 - 2
src/server/ua_subscription.h

@@ -1,3 +1,7 @@
+#ifndef ENABLE_SUBSCRIPTIONS
+#define ENABLE_SUBSCRIPTIONS
+#endif
+
 #ifdef  ENABLE_SUBSCRIPTIONS
 #ifndef UA_SUBSCRIPTION_H_
 #define UA_SUBSCRIPTION_H_
@@ -7,6 +11,7 @@
 #include "ua_types_generated.h"
 #include "ua_nodes.h"
 
+
 #define LIST_INITENTRY(item,entry) \
   (item)->entry.le_next = NULL; \
   (item)->entry.le_prev = NULL;
@@ -18,6 +23,10 @@
 /* MonitoredItem */
 /*****************/
 
+// This will force the monitored UA_Node* to be retrieved from the
+// Nodestore based on its UA_NodeId on each PushQueueValue call.
+#define MONITOREDITEM_FORCE_NODEPOINTER_VERIFY
+
 typedef struct {
     UA_Int32 currentValue;
     UA_Int32 minValue;
@@ -46,7 +55,8 @@ typedef struct UA_MonitoredItem_s {
     MONITOREDITEM_TYPE		    MonitoredItemType;
     UA_UInt32                       TimestampsToReturn;
     UA_UInt32                       MonitoringMode;
-    const UA_Node                   *monitoredNode; // Pointer to a node of any type
+    const UA_Node                  *monitoredNode; // Pointer to a node of any type
+    UA_NodeId                       monitoredNodeId; 
     UA_UInt32                       AttributeID;
     UA_UInt32                       ClientHandle;
     UA_UInt32                       SamplingInterval;
@@ -62,7 +72,7 @@ typedef struct UA_MonitoredItem_s {
 
 UA_MonitoredItem *UA_MonitoredItem_new(void);
 void MonitoredItem_delete(UA_MonitoredItem *monitoredItem);
-void MonitoredItem_QueuePushDataValue(UA_MonitoredItem *monitoredItem);
+void MonitoredItem_QueuePushDataValue(UA_Server *server, UA_MonitoredItem *monitoredItem);
 void MonitoredItem_ClearQueue(UA_MonitoredItem *monitoredItem);
 UA_Boolean MonitoredItem_CopyMonitoredValueToVariant(UA_UInt32 AttributeID, const UA_Node *src,
                                                      UA_Variant *dst);