瀏覽代碼

fixed service_read, (namespaceindex based nodestore calls)

FlorianPalm 10 年之前
父節點
當前提交
2870213154
共有 3 個文件被更改,包括 478 次插入407 次删除
  1. 41 0
      Makefile
  2. 7 6
      examples/opcuaClient.c
  3. 430 401
      src/server/ua_services_attribute.c

+ 41 - 0
Makefile

@@ -102,6 +102,19 @@ depend:
 	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 .PHONY : depend
 
 
+#=============================================================================
+# Target rules for targets named exampleClient
+
+# Build rule for target.
+exampleClient: cmake_check_build_system
+	$(MAKE) -f CMakeFiles/Makefile2 exampleClient
+.PHONY : exampleClient
+
+# fast build rule for target.
+exampleClient/fast:
+	$(MAKE) -f CMakeFiles/exampleClient.dir/build.make CMakeFiles/exampleClient.dir/build
+.PHONY : exampleClient/fast
+
 #=============================================================================
 #=============================================================================
 # Target rules for targets named exampleServer
 # Target rules for targets named exampleServer
 
 
@@ -213,6 +226,30 @@ examples/nodestoreAccessExample.c.s:
 	$(MAKE) -f CMakeFiles/exampleServer.dir/build.make CMakeFiles/exampleServer.dir/examples/nodestoreAccessExample.c.s
 	$(MAKE) -f CMakeFiles/exampleServer.dir/build.make CMakeFiles/exampleServer.dir/examples/nodestoreAccessExample.c.s
 .PHONY : examples/nodestoreAccessExample.c.s
 .PHONY : examples/nodestoreAccessExample.c.s
 
 
+examples/opcuaClient.o: examples/opcuaClient.c.o
+.PHONY : examples/opcuaClient.o
+
+# target to build an object file
+examples/opcuaClient.c.o:
+	$(MAKE) -f CMakeFiles/exampleClient.dir/build.make CMakeFiles/exampleClient.dir/examples/opcuaClient.c.o
+.PHONY : examples/opcuaClient.c.o
+
+examples/opcuaClient.i: examples/opcuaClient.c.i
+.PHONY : examples/opcuaClient.i
+
+# target to preprocess a source file
+examples/opcuaClient.c.i:
+	$(MAKE) -f CMakeFiles/exampleClient.dir/build.make CMakeFiles/exampleClient.dir/examples/opcuaClient.c.i
+.PHONY : examples/opcuaClient.c.i
+
+examples/opcuaClient.s: examples/opcuaClient.c.s
+.PHONY : examples/opcuaClient.s
+
+# target to generate assembly for a file
+examples/opcuaClient.c.s:
+	$(MAKE) -f CMakeFiles/exampleClient.dir/build.make CMakeFiles/exampleClient.dir/examples/opcuaClient.c.s
+.PHONY : examples/opcuaClient.c.s
+
 examples/opcuaServer.o: examples/opcuaServer.c.o
 examples/opcuaServer.o: examples/opcuaServer.c.o
 .PHONY : examples/opcuaServer.o
 .PHONY : examples/opcuaServer.o
 
 
@@ -917,6 +954,7 @@ help:
 	@echo "... depend"
 	@echo "... depend"
 	@echo "... edit_cache"
 	@echo "... edit_cache"
 	@echo "... rebuild_cache"
 	@echo "... rebuild_cache"
+	@echo "... exampleClient"
 	@echo "... open62541"
 	@echo "... open62541"
 	@echo "... exampleServer"
 	@echo "... exampleServer"
 	@echo "... open62541-objects"
 	@echo "... open62541-objects"
@@ -929,6 +967,9 @@ help:
 	@echo "... examples/nodestoreAccessExample.o"
 	@echo "... examples/nodestoreAccessExample.o"
 	@echo "... examples/nodestoreAccessExample.i"
 	@echo "... examples/nodestoreAccessExample.i"
 	@echo "... examples/nodestoreAccessExample.s"
 	@echo "... examples/nodestoreAccessExample.s"
+	@echo "... examples/opcuaClient.o"
+	@echo "... examples/opcuaClient.i"
+	@echo "... examples/opcuaClient.s"
 	@echo "... examples/opcuaServer.o"
 	@echo "... examples/opcuaServer.o"
 	@echo "... examples/opcuaServer.i"
 	@echo "... examples/opcuaServer.i"
 	@echo "... examples/opcuaServer.s"
 	@echo "... examples/opcuaServer.s"

+ 7 - 6
examples/opcuaClient.c

@@ -402,11 +402,11 @@ int main(int argc, char *argv[]) {
 	UA_NodeId messageType;
 	UA_NodeId messageType;
 	recvOffset = 24;
 	recvOffset = 24;
 	UA_NodeId_decodeBinary(reply,&recvOffset,&messageType);
 	UA_NodeId_decodeBinary(reply,&recvOffset,&messageType);
-	UA_CreateSessionResponse *createSessionResponse;
-	createSessionResponse = (UA_CreateSessionResponse*)&(reply->data[recvOffset]);
-	//UA_CreateSessionResponse_decodeBinary(reply,&recvOffset,&createSessionResponse);
+	UA_CreateSessionResponse createSessionResponse;
+	//createSessionResponse = (UA_CreateSessionResponse*)&(reply->data[recvOffset]);
+	UA_CreateSessionResponse_decodeBinary(reply,&recvOffset,&createSessionResponse);
 
 
-	sendActivateSession(sock, secureChannelId, openSecChannelRsp.securityToken.tokenId, 53, 3,createSessionResponse->authenticationToken);
+	sendActivateSession(sock, secureChannelId, openSecChannelRsp.securityToken.tokenId, 53, 3,createSessionResponse.authenticationToken);
 	received = recv(sock, reply->data, reply->length, 0);
 	received = recv(sock, reply->data, reply->length, 0);
 
 
     UA_NodeId *nodesToRead;
     UA_NodeId *nodesToRead;
@@ -420,9 +420,10 @@ int main(int argc, char *argv[]) {
 		}
 		}
 		else{
 		else{
 			nodesToRead[i].identifier.numeric = 19000 +i;
 			nodesToRead[i].identifier.numeric = 19000 +i;
+			nodesToRead[i].namespaceIndex = i;
 		}
 		}
 		nodesToRead[i].identifierType = UA_NODEIDTYPE_NUMERIC;
 		nodesToRead[i].identifierType = UA_NODEIDTYPE_NUMERIC;
-		nodesToRead[i].namespaceIndex = 0;
+
 	}
 	}
 
 
 	UA_DateTime tic, toc;
 	UA_DateTime tic, toc;
@@ -435,7 +436,7 @@ int main(int argc, char *argv[]) {
 
 
 	for (UA_UInt32 i = 0; i < tries; i++) {
 	for (UA_UInt32 i = 0; i < tries; i++) {
 
 
-		tic = sendReadRequest(sock, secureChannelId, openSecChannelRsp.securityToken.tokenId, 54+i, 4+i,createSessionResponse->authenticationToken,nodesToReadSize,nodesToRead);
+		tic = sendReadRequest(sock, secureChannelId, openSecChannelRsp.securityToken.tokenId, 54+i, 4+i,createSessionResponse.authenticationToken,nodesToReadSize,nodesToRead);
 
 
 		received = recv(sock, reply->data, 2000, 0);
 		received = recv(sock, reply->data, 2000, 0);
 		toc = UA_DateTime_now() - tic;
 		toc = UA_DateTime_now() - tic;

+ 430 - 401
src/server/ua_services_attribute.c

@@ -6,7 +6,6 @@
 #include "ua_namespace_0.h"
 #include "ua_namespace_0.h"
 #include "ua_util.h"
 #include "ua_util.h"
 
 
-
 #define CHECK_NODECLASS(CLASS)                                 \
 #define CHECK_NODECLASS(CLASS)                                 \
     if(!(node->nodeClass & (CLASS))) {                         \
     if(!(node->nodeClass & (CLASS))) {                         \
         v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE; \
         v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE; \
@@ -14,417 +13,447 @@
         break;                                                 \
         break;                                                 \
     }                                                          \
     }                                                          \
 
 
-static UA_DataValue service_read_node(UA_Server *server, const UA_ReadValueId *id) {
-    UA_DataValue v;
-    UA_DataValue_init(&v);
-
-    UA_Node const *node   = UA_NULL;
-    UA_Int32       result = UA_NodeStoreExample_get(server->nodestore, &(id->nodeId), &node);
-    if(result != UA_STATUSCODE_GOOD || node == UA_NULL) {
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
-        v.status       = UA_STATUSCODE_BADNODEIDUNKNOWN;
-        return v;
-    }
-    UA_StatusCode retval = UA_STATUSCODE_GOOD;
-
-    switch(id->attributeId) {
-    case UA_ATTRIBUTEID_NODEID:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID], &node->nodeId);
-        break;
-
-    case UA_ATTRIBUTEID_NODECLASS:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32], &node->nodeClass);
-        break;
-
-    case UA_ATTRIBUTEID_BROWSENAME:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_QUALIFIEDNAME], &node->browseName);
-        break;
-
-    case UA_ATTRIBUTEID_DISPLAYNAME:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
-                                          &node->displayName);
-        break;
-
-    case UA_ATTRIBUTEID_DESCRIPTION:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
-                                          &node->description);
-        break;
-
-    case UA_ATTRIBUTEID_WRITEMASK:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32], &node->writeMask);
-        break;
-
-    case UA_ATTRIBUTEID_USERWRITEMASK:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32], &node->userWriteMask);
-        break;
-
-    case UA_ATTRIBUTEID_ISABSTRACT:
-        CHECK_NODECLASS(
-            UA_NODECLASS_REFERENCETYPE | UA_NODECLASS_OBJECTTYPE | UA_NODECLASS_VARIABLETYPE |
-            UA_NODECLASS_DATATYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |=
-            UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                    &((UA_ReferenceTypeNode *)node)->isAbstract);
-        break;
-
-    case UA_ATTRIBUTEID_SYMMETRIC:
-        CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                          &((UA_ReferenceTypeNode *)node)->symmetric);
-        break;
-
-    case UA_ATTRIBUTEID_INVERSENAME:
-        CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
-                                          &((UA_ReferenceTypeNode *)node)->inverseName);
-        break;
-
-    case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
-        CHECK_NODECLASS(UA_NODECLASS_VIEW);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                          &((UA_ViewNode *)node)->containsNoLoops);
-        break;
-
-    case UA_ATTRIBUTEID_EVENTNOTIFIER:
-        CHECK_NODECLASS(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
-                                          &((UA_ViewNode *)node)->eventNotifier);
-        break;
-
-    case UA_ATTRIBUTEID_VALUE:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copy(&((UA_VariableNode *)node)->value, &v.value); // todo: zero-copy
-        break;
-
-    case UA_ATTRIBUTEID_DATATYPE:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID],
-                                          &((UA_VariableTypeNode *)node)->dataType);
-        break;
-
-    case UA_ATTRIBUTEID_VALUERANK:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32],
-                                          &((UA_VariableTypeNode *)node)->valueRank);
-        break;
-
-    case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        UA_Variant_copySetArray(&v.value, &UA_[UA_UINT32],
-                                ((UA_VariableTypeNode *)node)->arrayDimensionsSize,
-                                &((UA_VariableTypeNode *)node)->arrayDimensions);
-        break;
-
-    case UA_ATTRIBUTEID_ACCESSLEVEL:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
-                                          &((UA_VariableNode *)node)->accessLevel);
-        break;
-
-    case UA_ATTRIBUTEID_USERACCESSLEVEL:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
-                                          &((UA_VariableNode *)node)->userAccessLevel);
-        break;
-
-    case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_DOUBLE],
-                                          &((UA_VariableNode *)node)->minimumSamplingInterval);
-        break;
-
-    case UA_ATTRIBUTEID_HISTORIZING:
-        CHECK_NODECLASS(UA_NODECLASS_VARIABLE);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                          &((UA_VariableNode *)node)->historizing);
-        break;
-
-    case UA_ATTRIBUTEID_EXECUTABLE:
-        CHECK_NODECLASS(UA_NODECLASS_METHOD);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                          &((UA_MethodNode *)node)->executable);
-        break;
-
-    case UA_ATTRIBUTEID_USEREXECUTABLE:
-        CHECK_NODECLASS(UA_NODECLASS_METHOD);
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
-        retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
-                                          &((UA_MethodNode *)node)->userExecutable);
-        break;
-
-    default:
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
-        v.status       = UA_STATUSCODE_BADATTRIBUTEIDINVALID;
-        break;
-    }
-
-    UA_NodeStoreExample_releaseManagedNode(node);
-
-    if(retval != UA_STATUSCODE_GOOD) {
-        v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
-        v.status       = UA_STATUSCODE_BADNOTREADABLE;
-    }
-
-
-    return v;
+static UA_DataValue service_read_node(UA_Server *server,
+		const UA_ReadValueId *id) {
+	UA_DataValue v;
+	UA_DataValue_init(&v);
+
+	UA_Node const *node = UA_NULL;
+	UA_Int32 result = UA_NodeStoreExample_get(server->nodestore, &(id->nodeId),
+			&node);
+	if (result != UA_STATUSCODE_GOOD || node == UA_NULL) {
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
+		v.status = UA_STATUSCODE_BADNODEIDUNKNOWN;
+		return v;
+	}
+	UA_StatusCode retval = UA_STATUSCODE_GOOD;
+
+	switch (id->attributeId) {
+	case UA_ATTRIBUTEID_NODEID:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID],
+				&node->nodeId);
+		break;
+
+	case UA_ATTRIBUTEID_NODECLASS:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32],
+				&node->nodeClass);
+		break;
+
+	case UA_ATTRIBUTEID_BROWSENAME:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_QUALIFIEDNAME],
+				&node->browseName);
+		break;
+
+	case UA_ATTRIBUTEID_DISPLAYNAME:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
+				&node->displayName);
+		break;
+
+	case UA_ATTRIBUTEID_DESCRIPTION:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
+				&node->description);
+		break;
+
+	case UA_ATTRIBUTEID_WRITEMASK:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32],
+				&node->writeMask);
+		break;
+
+	case UA_ATTRIBUTEID_USERWRITEMASK:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_UINT32],
+				&node->userWriteMask);
+		break;
+
+	case UA_ATTRIBUTEID_ISABSTRACT:
+		CHECK_NODECLASS(
+				UA_NODECLASS_REFERENCETYPE | UA_NODECLASS_OBJECTTYPE
+						| UA_NODECLASS_VARIABLETYPE | UA_NODECLASS_DATATYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_ReferenceTypeNode *) node)->isAbstract);
+		break;
+
+	case UA_ATTRIBUTEID_SYMMETRIC:
+		CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_ReferenceTypeNode *) node)->symmetric);
+		break;
+
+	case UA_ATTRIBUTEID_INVERSENAME:
+		CHECK_NODECLASS(UA_NODECLASS_REFERENCETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_LOCALIZEDTEXT],
+				&((UA_ReferenceTypeNode *) node)->inverseName);
+		break;
+
+	case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
+		CHECK_NODECLASS(UA_NODECLASS_VIEW)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_ViewNode *) node)->containsNoLoops);
+		break;
+
+	case UA_ATTRIBUTEID_EVENTNOTIFIER:
+		CHECK_NODECLASS(UA_NODECLASS_VIEW | UA_NODECLASS_OBJECT)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
+				&((UA_ViewNode *) node)->eventNotifier);
+		break;
+
+	case UA_ATTRIBUTEID_VALUE:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copy(&((UA_VariableNode *) node)->value, &v.value); // todo: zero-copy
+		break;
+
+	case UA_ATTRIBUTEID_DATATYPE:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_NODEID],
+				&((UA_VariableTypeNode *) node)->dataType);
+		break;
+
+	case UA_ATTRIBUTEID_VALUERANK:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_INT32],
+				&((UA_VariableTypeNode *) node)->valueRank);
+		break;
+
+	case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE | UA_NODECLASS_VARIABLETYPE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		UA_Variant_copySetArray(&v.value, &UA_[UA_UINT32],
+				((UA_VariableTypeNode *) node)->arrayDimensionsSize,
+				&((UA_VariableTypeNode *) node)->arrayDimensions);
+		break;
+
+	case UA_ATTRIBUTEID_ACCESSLEVEL:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
+				&((UA_VariableNode *) node)->accessLevel);
+		break;
+
+	case UA_ATTRIBUTEID_USERACCESSLEVEL:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BYTE],
+				&((UA_VariableNode *) node)->userAccessLevel);
+		break;
+
+	case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_DOUBLE],
+				&((UA_VariableNode *) node)->minimumSamplingInterval);
+		break;
+
+	case UA_ATTRIBUTEID_HISTORIZING:
+		CHECK_NODECLASS(UA_NODECLASS_VARIABLE)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_VariableNode *) node)->historizing);
+		break;
+
+	case UA_ATTRIBUTEID_EXECUTABLE:
+		CHECK_NODECLASS(UA_NODECLASS_METHOD)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_MethodNode *) node)->executable);
+		break;
+
+	case UA_ATTRIBUTEID_USEREXECUTABLE:
+		CHECK_NODECLASS(UA_NODECLASS_METHOD)
+		;
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_VARIANT;
+		retval |= UA_Variant_copySetValue(&v.value, &UA_[UA_BOOLEAN],
+				&((UA_MethodNode *) node)->userExecutable);
+		break;
+
+	default:
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
+		v.status = UA_STATUSCODE_BADATTRIBUTEIDINVALID;
+		break;
+	}
+
+	UA_NodeStoreExample_releaseManagedNode(node);
+
+	if (retval != UA_STATUSCODE_GOOD) {
+		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
+		v.status = UA_STATUSCODE_BADNOTREADABLE;
+	}
+
+	return v;
 }
 }
 
 
 void Service_Read(UA_Server *server, UA_Session *session,
 void Service_Read(UA_Server *server, UA_Session *session,
-                  const UA_ReadRequest *request, UA_ReadResponse *response) {
-    UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
-
-    if(request->nodesToReadSize <= 0) {
-        response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;
-        return;
-    }
-
-    if(UA_Array_new((void **)&response->results, request->nodesToReadSize, &UA_[UA_DATAVALUE]) != UA_STATUSCODE_GOOD) {
-        response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-        return;
-    }
-
-    if(UA_Array_new((void **)&response->diagnosticInfos, request->nodesToReadSize, &UA_[UA_DIAGNOSTICINFO]) != UA_STATUSCODE_GOOD) {
-        response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-        return;
-    }
-    response->resultsSize = request->nodesToReadSize;
-
-    UA_Int32 *numberOfFoundIndices;
-    UA_UInt16 *associatedIndices;
-    UA_UInt32 differentNamespaceIndexCount = 0;
-    if(UA_Array_new((void **)&numberOfFoundIndices,request->nodesToReadSize,&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD){
-    	response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-    	return ;
-    }
-
-    if(UA_Array_new((void **)&associatedIndices,request->nodesToReadSize,&UA_[UA_UINT16]) != UA_STATUSCODE_GOOD){
-    	response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-    	return ;
-    }
-    // find out count of different namespace indices
-
-   for(UA_Int32 i = 0; i<request->nodesToReadSize; i++){
-
-    	for(UA_UInt32 j = 0; j <= differentNamespaceIndexCount; j++){
-    		if(associatedIndices[j] == request->nodesToRead[i].nodeId.namespaceIndex){
-    			if(j==0){
-    				differentNamespaceIndexCount++;
-    			}
+		const UA_ReadRequest *request, UA_ReadResponse *response) {
+	UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
+
+	if (request->nodesToReadSize <= 0) {
+		response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;
+		return;
+	}
+
+	if (UA_Array_new((void **) &response->results, request->nodesToReadSize,
+			&UA_[UA_DATAVALUE]) != UA_STATUSCODE_GOOD) {
+		response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+		return;
+	}
+
+	if (UA_Array_new((void **) &response->diagnosticInfos,
+			request->nodesToReadSize, &UA_[UA_DIAGNOSTICINFO])
+			!= UA_STATUSCODE_GOOD) {
+		response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+		return;
+	}
+	response->resultsSize = request->nodesToReadSize;
+
+	UA_Int32 *numberOfFoundIndices;
+	UA_UInt16 *associatedIndices;
+	UA_UInt32 differentNamespaceIndexCount = 0;
+	if (UA_Array_new((void **) &numberOfFoundIndices, request->nodesToReadSize,
+			&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD) {
+		response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+		return;
+	}
+
+	if (UA_Array_new((void **) &associatedIndices, request->nodesToReadSize,
+			&UA_[UA_UINT16]) != UA_STATUSCODE_GOOD) {
+		response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+		return;
+	}
+	// find out count of different namespace indices
+
+	for (UA_Int32 i = 0; i < request->nodesToReadSize; i++) {
+		//for(UA_UInt32 j = 0; j <= differentNamespaceIndexCount; j++){
+		UA_UInt32 j = 0;
+		do {
+			if(associatedIndices[j] == request->nodesToRead[i].nodeId.namespaceIndex) {
+				if(differentNamespaceIndexCount == 0){
+					differentNamespaceIndexCount++;
+				}
 				numberOfFoundIndices[j]++;
 				numberOfFoundIndices[j]++;
 				break;
 				break;
-    		}
-    		else if(j == (differentNamespaceIndexCount - 1)){
-    			associatedIndices[j] = request->nodesToRead[i].nodeId.namespaceIndex;
-    			associatedIndices[j] = 1;
-    			differentNamespaceIndexCount++;
-    		}
-    	}
-    }
-
-	UA_UInt32 *readValueIdIndices;
-    if(UA_Array_new((void **)&readValueIdIndices,request->nodesToReadSize,&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD){
-    	response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-    	return ;
-    }
-
-    for(UA_UInt32 i = 0; i < differentNamespaceIndexCount; i++){
-    	UA_Namespace *tmpNamespace;
-    	UA_NamespaceManager_getNamespace(server->namespaceManager,associatedIndices[i],&tmpNamespace);
-    	if(tmpNamespace != UA_NULL){
-
-    	    //build up index array for each read operation onto a different namespace
-    	    UA_UInt32 n = 0;
-    	    for(UA_Int32 j = 0; j < request->nodesToReadSize; j++){
-    	    	if(request->nodesToRead[j].nodeId.namespaceIndex == associatedIndices[i]){
-    	    		readValueIdIndices[n] = j;
-    	    	}
-    	    }
-    	    //call read for every namespace
-    		tmpNamespace->nodeStore->readNodes(request->nodesToRead,
-    				readValueIdIndices,
-    				numberOfFoundIndices[i],
-    				response->results,
-    				request->timestampsToReturn,
-    				response->diagnosticInfos);
-
-			//	response->results[i] = service_read_node(server, &request->nodesToRead[i]);
-    	}
-    }
-    UA_free(readValueIdIndices);
-    UA_free(numberOfFoundIndices);
-    UA_free(associatedIndices);
-    /*
-    for(UA_Int32 i = 0;i < response->resultsSize;i++){
-				response->results[i] = service_read_node(server, &request->nodesToRead[i]);
-    	}
-    }
-    */
+			}
+			else if(j == (differentNamespaceIndexCount - 1)) {
+				associatedIndices[j+1] = request->nodesToRead[i].nodeId.namespaceIndex;
+				associatedIndices[j+1] = 1;
+				differentNamespaceIndexCount++;
+				break;
+			}
+			j++;
+		}while(j<=differentNamespaceIndexCount);
+	}
+
+UA_UInt32 *readValueIdIndices;
+if (UA_Array_new((void **) &readValueIdIndices, request->nodesToReadSize,
+		&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD) {
+	response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+	return;
+}
+
+for (UA_UInt32 i = 0; i < differentNamespaceIndexCount; i++) {
+	UA_Namespace *tmpNamespace;
+	UA_NamespaceManager_getNamespace(server->namespaceManager,
+			associatedIndices[i], &tmpNamespace);
+	if (tmpNamespace != UA_NULL) {
+
+		//build up index array for each read operation onto a different namespace
+		UA_UInt32 n = 0;
+		for (UA_Int32 j = 0; j < request->nodesToReadSize; j++) {
+			if (request->nodesToRead[j].nodeId.namespaceIndex
+					== associatedIndices[i]) {
+				readValueIdIndices[n] = j;
+			}
+		}
+		//call read for every namespace
+		tmpNamespace->nodeStore->readNodes(request->nodesToRead,
+				readValueIdIndices, numberOfFoundIndices[i], response->results,
+				request->timestampsToReturn, response->diagnosticInfos);
+
+		//	response->results[i] = service_read_node(server, &request->nodesToRead[i]);
+	}
+}
+UA_free(readValueIdIndices);
+UA_free(numberOfFoundIndices);
+UA_free(associatedIndices);
+/*
+ for(UA_Int32 i = 0;i < response->resultsSize;i++){
+ response->results[i] = service_read_node(server, &request->nodesToRead[i]);
+ }
+ }
+ */
 
 
+}
 
 
+static UA_StatusCode Service_Write_writeNode(UA_Server *server,
+UA_WriteValue *writeValue) {
+UA_StatusCode retval = UA_STATUSCODE_GOOD;
+const UA_Node *node;
+retval = UA_NodeStoreExample_get(server->nodestore, &writeValue->nodeId, &node);
+if (retval)
+return retval;
+
+switch (writeValue->attributeId) {
+case UA_ATTRIBUTEID_NODEID:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){ } */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_NODECLASS:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){ } */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_BROWSENAME:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_DISPLAYNAME:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_DESCRIPTION:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_WRITEMASK:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_USERWRITEMASK:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_ISABSTRACT:
+
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_SYMMETRIC:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_INVERSENAME:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_EVENTNOTIFIER:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_VALUE:
+if (writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT) {
+	retval |= UA_Variant_copy(&writeValue->value.value,
+			&((UA_VariableNode *) node)->value); // todo: zero-copy
+}
+break;
+
+case UA_ATTRIBUTEID_DATATYPE:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_VALUERANK:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_ACCESSLEVEL:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_USERACCESSLEVEL:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_HISTORIZING:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_EXECUTABLE:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+case UA_ATTRIBUTEID_USEREXECUTABLE:
+/* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
+retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
+break;
+
+default:
+retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID;
+break;
 }
 }
 
 
-static UA_StatusCode Service_Write_writeNode(UA_Server *server, UA_WriteValue *writeValue) {
-    UA_StatusCode retval = UA_STATUSCODE_GOOD;
-    const UA_Node *node;
-    retval = UA_NodeStoreExample_get(server->nodestore, &writeValue->nodeId, &node);
-    if(retval)
-        return retval;
-
-    switch(writeValue->attributeId) {
-    case UA_ATTRIBUTEID_NODEID:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){ } */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_NODECLASS:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){ } */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_BROWSENAME:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_DISPLAYNAME:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_DESCRIPTION:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_WRITEMASK:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_USERWRITEMASK:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_ISABSTRACT:
-
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_SYMMETRIC:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_INVERSENAME:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_CONTAINSNOLOOPS:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_EVENTNOTIFIER:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_VALUE:
-        if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT) {
-            retval |= UA_Variant_copy(&writeValue->value.value, &((UA_VariableNode *)node)->value); // todo: zero-copy
-        }
-        break;
-
-
-    case UA_ATTRIBUTEID_DATATYPE:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_VALUERANK:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_ARRAYDIMENSIONS:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_ACCESSLEVEL:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_USERACCESSLEVEL:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_HISTORIZING:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_EXECUTABLE:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    case UA_ATTRIBUTEID_USEREXECUTABLE:
-        /* if(writeValue->value.encodingMask == UA_DATAVALUE_ENCODINGMASK_VARIANT){} */
-        retval = UA_STATUSCODE_BADWRITENOTSUPPORTED;
-        break;
-
-    default:
-        retval = UA_STATUSCODE_BADATTRIBUTEIDINVALID;
-        break;
-    }
-
-    UA_NodeStoreExample_releaseManagedNode(node);
-    return retval;
+UA_NodeStoreExample_releaseManagedNode(node);
+return retval;
 
 
 }
 }
 
 
 void Service_Write(UA_Server *server, UA_Session *session,
 void Service_Write(UA_Server *server, UA_Session *session,
-                   const UA_WriteRequest *request, UA_WriteResponse *response) {
-    UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
-
-    if(UA_Array_new((void **)&response->results, request->nodesToWriteSize, &UA_[UA_STATUSCODE])) {
-        response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
-        return;
-    }
-    
-    response->resultsSize = request->nodesToWriteSize;
-    for(UA_Int32 i = 0;i < request->nodesToWriteSize;i++)
-        response->results[i] = Service_Write_writeNode(server, &request->nodesToWrite[i]);
+const UA_WriteRequest *request, UA_WriteResponse *response) {
+UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
+
+if (UA_Array_new((void **) &response->results, request->nodesToWriteSize,
+	&UA_[UA_STATUSCODE])) {
+response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
+return;
+}
+
+response->resultsSize = request->nodesToWriteSize;
+for (UA_Int32 i = 0; i < request->nodesToWriteSize; i++)
+response->results[i] = Service_Write_writeNode(server,
+		&request->nodesToWrite[i]);
 }
 }