Forráskód Böngészése

extended minimum types list

FlorianPalm 10 éve
szülő
commit
614e4eb594

+ 9 - 9
examples/networklayer_tcp.c

@@ -53,12 +53,12 @@ typedef struct TCPConnectionHandle {
 
 NetworklayerTCP *NetworklayerTCP_new(UA_ConnectionConfig localConf, UA_UInt32 port) {
     NetworklayerTCP *newlayer = malloc(sizeof(NetworklayerTCP));
-    if(newlayer == UA_NULL)
-        return UA_NULL;
+    if(newlayer == NULL)
+        return NULL;
 	newlayer->localConf = localConf;
 	newlayer->port = port;
 	newlayer->connectionsSize = 0;
-	newlayer->connections = UA_NULL;
+	newlayer->connections = NULL;
 	return newlayer;
 }
 
@@ -75,7 +75,7 @@ static UA_StatusCode NetworklayerTCP_remove(NetworklayerTCP *layer, UA_Int32 soc
         return UA_STATUSCODE_BADINTERNALERROR;
 
     if(layer->connections[index].connection.channel)
-        layer->connections[index].connection.channel->connection = UA_NULL;
+        layer->connections[index].connection.channel->connection = NULL;
 
 	UA_Connection_deleteMembers(&layer->connections[index].connection);
 
@@ -94,7 +94,7 @@ void NetworklayerTCP_delete(NetworklayerTCP *layer) {
 	for(UA_UInt32 index = 0;index < layer->connectionsSize;index++) {
 		shutdown(layer->connections[index].sockfd, 2);
         if(layer->connections[index].connection.channel)
-            layer->connections[index].connection.channel->connection = UA_NULL;
+            layer->connections[index].connection.channel->connection = NULL;
         UA_Connection_deleteMembers(&layer->connections[index].connection);
 		CLOSESOCKET(layer->connections[index].sockfd);
 	}
@@ -124,7 +124,7 @@ void writeCallback(TCPConnectionHandle *handle, UA_ByteStringArray gather_buf) {
 	while (nWritten < total_len) {
 		UA_UInt32 n=0;
 		do {
-			result = WSASend(handle->sockfd, buf, gather_buf.stringsSize , (LPDWORD)&n, 0, UA_NULL, UA_NULL);
+			result = WSASend(handle->sockfd, buf, gather_buf.stringsSize , (LPDWORD)&n, 0, NULL, NULL);
 			if(result != 0)
 				printf("NL_TCP_Writer - Error WSASend, code: %d \n", WSAGetLastError());
 		} while (errno == EINTR);
@@ -138,8 +138,8 @@ void writeCallback(TCPConnectionHandle *handle, UA_ByteStringArray gather_buf) {
 		iov[i].iov_len = gather_buf.strings[i].length;
 		total_len += gather_buf.strings[i].length;
 	}
-	struct msghdr message = {.msg_name = UA_NULL, .msg_namelen = 0, .msg_iov = iov,
-							 .msg_iovlen = gather_buf.stringsSize, .msg_control = UA_NULL,
+	struct msghdr message = {.msg_name = NULL, .msg_namelen = 0, .msg_iov = iov,
+							 .msg_iovlen = gather_buf.stringsSize, .msg_control = NULL,
 							 .msg_controllen = 0, .msg_flags = 0};
 	while (nWritten < total_len) {
 		UA_Int32 n = 0;
@@ -302,7 +302,7 @@ UA_StatusCode NetworkLayerTCP_run(NetworklayerTCP *layer, UA_Server *server, str
 	while (*running) {
 		setFDSet(layer);
 		struct timeval tmptv = tv;
-		UA_Int32 resultsize = select(layer->highestfd, &layer->fdset, UA_NULL, UA_NULL, &tmptv);
+		UA_Int32 resultsize = select(layer->highestfd, &layer->fdset, NULL, NULL, &tmptv);
 		if (resultsize <= 0) {
 #ifdef WIN32
 			UA_Int32 err = (resultsize == SOCKET_ERROR) ? WSAGetLastError() : 0;

+ 1 - 1
examples/opcuaServer.c

@@ -33,7 +33,7 @@ void serverCallback(UA_Server *server) {
 
 UA_ByteString loadCertificate() {
     UA_ByteString certificate = UA_STRING_NULL;
-	FILE *fp = UA_NULL;
+	FILE *fp = NULL;
 	//FIXME: a potiential bug of locating the certificate, we need to get the path from the server's config
 	fp=fopen("localhost.der", "rb");
 

+ 6 - 6
src/server/nodestore/open62541_nodestore_attribute.c

@@ -8,7 +8,7 @@
 #include "../ua_services.h"
 #include "open62541_nodestore.h"
 #include "ua_namespace_0.h"
-
+#include "ua_util.h"
 #define CHECK_NODECLASS(CLASS)                                 \
     if(!(node->nodeClass & (CLASS))) {                         \
         v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE; \
@@ -21,10 +21,10 @@ static UA_DataValue service_read_node(UA_Server *server,
 	UA_DataValue v;
 	UA_DataValue_init(&v);
 
-	UA_Node const *node = NULL;
+	UA_Node const *node = UA_NULL;
 	open62541NodeStore *ns = open62541NodeStore_getNodeStore();
 	UA_Int32 result = open62541NodeStore_get(ns, &(id->nodeId), &node);
-	if (result != UA_STATUSCODE_GOOD || node == NULL) {
+	if (result != UA_STATUSCODE_GOOD || node == UA_NULL) {
 		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
 		v.status = UA_STATUSCODE_BADNODEIDUNKNOWN;
 		return v;
@@ -219,7 +219,7 @@ UA_Int32 open62541NodeStore_ReadNodes(const UA_RequestHeader *requestHeader,
 		UA_DataValue *readNodesResults, UA_Boolean timeStampToReturn,
 		UA_DiagnosticInfo *diagnosticInfos) {
 	for (UA_UInt32 i = 0; i < indicesSize; i++) {
-		readNodesResults[indices[i]] = service_read_node(NULL,
+		readNodesResults[indices[i]] = service_read_node(UA_NULL,
 				&readValueIds[indices[i]]);
 	}
 	return UA_STATUSCODE_GOOD;
@@ -361,9 +361,9 @@ UA_Int32 UA_EXPORT open62541NodeStore_WriteNodes(
 		const UA_RequestHeader *requestHeader, UA_WriteValue *writeValues,
 		UA_UInt32 *indices, UA_UInt32 indicesSize,
 		UA_StatusCode *writeNodesResults, UA_DiagnosticInfo *diagnosticInfo) {
-	open62541NodeStore *nodestore = NULL;
+	open62541NodeStore *nodestore = UA_NULL;
 	nodestore = open62541NodeStore_getNodeStore();
-	if (nodestore == NULL) {
+	if (nodestore == UA_NULL) {
 		return UA_STATUSCODE_BADINTERNALERROR;
 	}
 

+ 2 - 3
tools/type_lists.py

@@ -19,7 +19,6 @@ only_needed_types = set([	"InvalidType", "Node", "NodeClass", "ReferenceNode", "
 							"RelativePath", "BrowsePathTarget", "RelativePathElement", "CreateSubscriptionRequest", "CreateSubscriptionResponse",
 							"BrowseResponse", "BrowseResult", "ReferenceDescription", "BrowseRequest", "ViewDescription", "BrowseDescription",
 							"BrowseDirection", "CloseSessionRequest", "AddNodesRequest", "AddNodesResponse", "AddNodesItem", "AddNodesResult",
-							"AddReferencesRequest", "AddReferencesResponse", "AddReferencesItem", "VariableNode", "MethodNode", "VariableTypeNode",
-							"ViewNode", "ReferenceTypeNode", "BrowseResultMask", "ServerState", "ServerStatusDataType", "BuildInfo", "ObjectNode",
-							"DataTypeNode", "ObjectTypeNode", "IdType", "VariableAttributes", "NodeAttributesMask" ])
+							"DeleteNodesItem","AddReferencesRequest", "AddReferencesResponse", "AddReferencesItem","DeleteReferencesItem", "VariableNode", "MethodNode", 								"VariableTypeNode","ViewNode", "ReferenceTypeNode", "BrowseResultMask", "ServerState", "ServerStatusDataType", "BuildInfo", "ObjectNode",
+							"DataTypeNode", "ObjectTypeNode", "IdType", "VariableAttributes","ObjectAttributes","NodeAttributes","ReferenceTypeAttributes","ViewAttributes","ObjectTypeAttributes","NodeAttributesMask" ])
 only_needed_types = only_needed_types.union(existing_types)