|
@@ -5,19 +5,22 @@
|
|
#include "ua_session.h"
|
|
#include "ua_session.h"
|
|
#include "ua_util.h"
|
|
#include "ua_util.h"
|
|
|
|
|
|
-#define COPY_STANDARDATTRIBUTES do { \
|
|
|
|
- if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_DISPLAYNAME) { \
|
|
|
|
- vnode->displayName = attr.displayName; \
|
|
|
|
- UA_LocalizedText_init(&attr.displayName); \
|
|
|
|
- } \
|
|
|
|
- if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_DESCRIPTION) { \
|
|
|
|
- vnode->description = attr.description; \
|
|
|
|
- UA_LocalizedText_init(&attr.description); \
|
|
|
|
- } \
|
|
|
|
- if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_WRITEMASK) \
|
|
|
|
- vnode->writeMask = attr.writeMask; \
|
|
|
|
- if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_USERWRITEMASK) \
|
|
|
|
- vnode->userWriteMask = attr.userWriteMask; \
|
|
|
|
|
|
+#define COPY_STANDARDATTRIBUTES do { \
|
|
|
|
+ if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_DISPLAYNAME) { \
|
|
|
|
+ vnode->displayName = attr.displayName; \
|
|
|
|
+ UA_LocalizedText_copy(&attr.displayName, &(vnode->displayName)); \
|
|
|
|
+ UA_LocalizedText_init(&attr.displayName); \
|
|
|
|
+ } \
|
|
|
|
+ if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_DESCRIPTION) { \
|
|
|
|
+ UA_LocalizedText_copy(&attr.description, &(vnode->description)); \
|
|
|
|
+ UA_LocalizedText_init(&attr.description); \
|
|
|
|
+ } \
|
|
|
|
+ if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_WRITEMASK) \
|
|
|
|
+ vnode->writeMask = attr.writeMask; \
|
|
|
|
+ if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_USERWRITEMASK) \
|
|
|
|
+ vnode->userWriteMask = attr.userWriteMask; \
|
|
|
|
+ if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_EVENTNOTIFIER) \
|
|
|
|
+ vnode->eventNotifier = attr.eventNotifier; \
|
|
} while(0)
|
|
} while(0)
|
|
|
|
|
|
static UA_StatusCode parseVariableNode(UA_ExtensionObject *attributes, UA_Node **new_node) {
|
|
static UA_StatusCode parseVariableNode(UA_ExtensionObject *attributes, UA_Node **new_node) {
|
|
@@ -93,9 +96,7 @@ static UA_StatusCode parseObjectNode(UA_ExtensionObject *attributes, UA_Node **n
|
|
}
|
|
}
|
|
|
|
|
|
// now copy all the attributes. This potentially removes them from the decoded attributes.
|
|
// now copy all the attributes. This potentially removes them from the decoded attributes.
|
|
- COPY_STANDARDATTRIBUTES;
|
|
|
|
- if(attr.specifiedAttributes & UA_NODEATTRIBUTESMASK_EVENTNOTIFIER)
|
|
|
|
- vnode->eventNotifier = attr.eventNotifier;
|
|
|
|
|
|
+ COPY_STANDARDATTRIBUTES
|
|
UA_ObjectAttributes_deleteMembers(&attr);
|
|
UA_ObjectAttributes_deleteMembers(&attr);
|
|
*new_node = (UA_Node*) vnode;
|
|
*new_node = (UA_Node*) vnode;
|
|
return UA_STATUSCODE_GOOD;
|
|
return UA_STATUSCODE_GOOD;
|