|
@@ -2,7 +2,7 @@
|
|
#include "ua_statuscodes.h"
|
|
#include "ua_statuscodes.h"
|
|
#include "ua_nodestore.h"
|
|
#include "ua_nodestore.h"
|
|
#include "ua_namespace_0.h"
|
|
#include "ua_namespace_0.h"
|
|
-#include "util/ua_util.h"
|
|
|
|
|
|
+#include "ua_util.h"
|
|
|
|
|
|
enum UA_AttributeId {
|
|
enum UA_AttributeId {
|
|
UA_ATTRIBUTEID_NODEID = 1,
|
|
UA_ATTRIBUTEID_NODEID = 1,
|
|
@@ -52,39 +52,39 @@ static UA_DataValue service_read_node(UA_Server *server, const UA_ReadValueId *i
|
|
switch(id->attributeId) {
|
|
switch(id->attributeId) {
|
|
case UA_ATTRIBUTEID_NODEID:
|
|
case UA_ATTRIBUTEID_NODEID:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_NODEID], &node->nodeId);
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID], &node->nodeId);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_NODECLASS:
|
|
case UA_ATTRIBUTEID_NODECLASS:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_INT32], &node->nodeClass);
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32], &node->nodeClass);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_BROWSENAME:
|
|
case UA_ATTRIBUTEID_BROWSENAME:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_QUALIFIEDNAME], &node->browseName);
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_QUALIFIEDNAME], &node->browseName);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_DISPLAYNAME:
|
|
case UA_ATTRIBUTEID_DISPLAYNAME:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_LOCALIZEDTEXT],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
|
|
&node->displayName);
|
|
&node->displayName);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_DESCRIPTION:
|
|
case UA_ATTRIBUTEID_DESCRIPTION:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_LOCALIZEDTEXT],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
|
|
&node->description);
|
|
&node->description);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_WRITEMASK:
|
|
case UA_ATTRIBUTEID_WRITEMASK:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_UINT32], &node->writeMask);
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32], &node->writeMask);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_USERWRITEMASK:
|
|
case UA_ATTRIBUTEID_USERWRITEMASK:
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_UINT32], &node->userWriteMask);
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32], &node->userWriteMask);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_ISABSTRACT:
|
|
case UA_ATTRIBUTEID_ISABSTRACT:
|
|
@@ -93,35 +93,35 @@ static UA_DataValue service_read_node(UA_Server *server, const UA_ReadValueId *i
|
|
UA_NODECLASS_DATATYPE);
|
|
UA_NODECLASS_DATATYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
retval |=
|
|
retval |=
|
|
- UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_ReferenceTypeNode *)node)->isAbstract);
|
|
&((UA_ReferenceTypeNode *)node)->isAbstract);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_SYMMETRIC:
|
|
case UA_ATTRIBUTEID_SYMMETRIC:
|
|
CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
|
|
CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_ReferenceTypeNode *)node)->symmetric);
|
|
&((UA_ReferenceTypeNode *)node)->symmetric);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_INVERSENAME:
|
|
case UA_ATTRIBUTEID_INVERSENAME:
|
|
CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
|
|
CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_LOCALIZEDTEXT],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
|
|
&((UA_ReferenceTypeNode *)node)->inverseName);
|
|
&((UA_ReferenceTypeNode *)node)->inverseName);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
|
|
case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
|
|
CHECK_NODECLASS(UA_NODECLASS_VIEW);
|
|
CHECK_NODECLASS(UA_NODECLASS_VIEW);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_ViewNode *)node)->containsNoLoops);
|
|
&((UA_ViewNode *)node)->containsNoLoops);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_EVENTNOTIFIER:
|
|
case UA_ATTRIBUTEID_EVENTNOTIFIER:
|
|
CHECK_NODECLASS(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT);
|
|
CHECK_NODECLASS(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BYTE],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
|
|
&((UA_ViewNode *)node)->eventNotifier);
|
|
&((UA_ViewNode *)node)->eventNotifier);
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -134,21 +134,21 @@ static UA_DataValue service_read_node(UA_Server *server, const UA_ReadValueId *i
|
|
case UA_ATTRIBUTEID_DATATYPE:
|
|
case UA_ATTRIBUTEID_DATATYPE:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_NODEID],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID],
|
|
&((UA_VariableTypeNode *)node)->dataType);
|
|
&((UA_VariableTypeNode *)node)->dataType);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_VALUERANK:
|
|
case UA_ATTRIBUTEID_VALUERANK:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_INT32],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32],
|
|
&((UA_VariableTypeNode *)node)->valueRank);
|
|
&((UA_VariableTypeNode *)node)->valueRank);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
|
|
case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- UA_Variant_copySetArray(&v.value, &UA_.types[UA_UINT32],
|
|
|
|
|
|
+ UA_Variant_copySetArray(&v.value, &UA_[UA_UINT32],
|
|
((UA_VariableTypeNode *)node)->arrayDimensionsSize,
|
|
((UA_VariableTypeNode *)node)->arrayDimensionsSize,
|
|
&((UA_VariableTypeNode *)node)->arrayDimensions);
|
|
&((UA_VariableTypeNode *)node)->arrayDimensions);
|
|
break;
|
|
break;
|
|
@@ -156,42 +156,42 @@ static UA_DataValue service_read_node(UA_Server *server, const UA_ReadValueId *i
|
|
case UA_ATTRIBUTEID_ACCESSLEVEL:
|
|
case UA_ATTRIBUTEID_ACCESSLEVEL:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BYTE],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
|
|
&((UA_VariableNode *)node)->accessLevel);
|
|
&((UA_VariableNode *)node)->accessLevel);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_USERACCESSLEVEL:
|
|
case UA_ATTRIBUTEID_USERACCESSLEVEL:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BYTE],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
|
|
&((UA_VariableNode *)node)->userAccessLevel);
|
|
&((UA_VariableNode *)node)->userAccessLevel);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
|
|
case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_DOUBLE],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_DOUBLE],
|
|
&((UA_VariableNode *)node)->minimumSamplingInterval);
|
|
&((UA_VariableNode *)node)->minimumSamplingInterval);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_HISTORIZING:
|
|
case UA_ATTRIBUTEID_HISTORIZING:
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_VariableNode *)node)->historizing);
|
|
&((UA_VariableNode *)node)->historizing);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_EXECUTABLE:
|
|
case UA_ATTRIBUTEID_EXECUTABLE:
|
|
CHECK_NODECLASS(UA_NODECLASS_METHOD);
|
|
CHECK_NODECLASS(UA_NODECLASS_METHOD);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_MethodNode *)node)->executable);
|
|
&((UA_MethodNode *)node)->executable);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_ATTRIBUTEID_USEREXECUTABLE:
|
|
case UA_ATTRIBUTEID_USEREXECUTABLE:
|
|
CHECK_NODECLASS(UA_NODECLASS_METHOD);
|
|
CHECK_NODECLASS(UA_NODECLASS_METHOD);
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
|
|
- retval |= UA_Variant_copySetValue(&v.value, &UA_.types[UA_BOOLEAN],
|
|
|
|
|
|
+ retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
|
|
&((UA_MethodNode *)node)->userExecutable);
|
|
&((UA_MethodNode *)node)->userExecutable);
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -387,7 +387,7 @@ UA_Int32 Service_Write(UA_Server *server, UA_Session *session, const UA_WriteReq
|
|
return UA_ERROR; // TODO: Return error message
|
|
return UA_ERROR; // TODO: Return error message
|
|
response->resultsSize = request->nodesToWriteSize;
|
|
response->resultsSize = request->nodesToWriteSize;
|
|
//TODO evalutate diagnostic info within the request
|
|
//TODO evalutate diagnostic info within the request
|
|
- UA_Array_new((void **)&response->results, response->resultsSize, &UA_.types[UA_STATUSCODE]);
|
|
|
|
|
|
+ UA_Array_new((void **)&response->results, response->resultsSize, &UA_[UA_STATUSCODE]);
|
|
for(i = 0;i < request->nodesToWriteSize;i++)
|
|
for(i = 0;i < request->nodesToWriteSize;i++)
|
|
retval |= Service_Write_writeNode(server, &request->nodesToWrite[i], &response->results[i]);
|
|
retval |= Service_Write_writeNode(server, &request->nodesToWrite[i], &response->results[i]);
|
|
|
|
|