Prechádzať zdrojové kódy

fixed wrong parameters in browse service

FlorianPalm 10 rokov pred
rodič
commit
30e113e0ae
3 zmenil súbory, kde vykonal 11 pridanie a 11 odobranie
  1. 4 4
      Makefile
  2. 1 1
      include/ua_server.h
  3. 6 6
      src/server/ua_services_view.c

+ 4 - 4
Makefile

@@ -42,10 +42,10 @@ EQUALS = =
 CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/opcua/Downloads/AcpltDevelopmentKit/acplt/dev/iec62541/open62541
+CMAKE_SOURCE_DIR = /home/opcua/Downloads/open62541_external_datasource
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/opcua/Downloads/AcpltDevelopmentKit/acplt/dev/iec62541/open62541
+CMAKE_BINARY_DIR = /home/opcua/Downloads/open62541_external_datasource
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -72,9 +72,9 @@ rebuild_cache/fast: rebuild_cache
 
 # The main all target
 all: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/opcua/Downloads/AcpltDevelopmentKit/acplt/dev/iec62541/open62541/CMakeFiles /home/opcua/Downloads/AcpltDevelopmentKit/acplt/dev/iec62541/open62541/CMakeFiles/progress.marks
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/opcua/Downloads/open62541_external_datasource/CMakeFiles /home/opcua/Downloads/open62541_external_datasource/CMakeFiles/progress.marks
 	$(MAKE) -f CMakeFiles/Makefile2 all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/opcua/Downloads/AcpltDevelopmentKit/acplt/dev/iec62541/open62541/CMakeFiles 0
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/opcua/Downloads/open62541_external_datasource/CMakeFiles 0
 .PHONY : all
 
 # The main clean target

+ 1 - 1
include/ua_server.h

@@ -69,7 +69,7 @@ typedef UA_Int32 (*UA_NodeStore_deleteReferences)(UA_DeleteReferencesItem *refer
 
 typedef UA_Int32 (*UA_NodeStore_readNodes)(UA_ReadValueId *readValueIds,UA_UInt32 *indices,UA_UInt32 indicesSize,UA_DataValue *readNodesResults, UA_Boolean timeStampToReturn, UA_DiagnosticInfo *diagnosticInfos);
 typedef UA_Int32 (*UA_NodeStore_writeNodes)(UA_WriteValue *writeValues,UA_UInt32 *indices ,UA_UInt32 indicesSize, UA_StatusCode *writeNodesResults, UA_DiagnosticInfo *diagnosticInfo);
-typedef UA_Int32 (*UA_NodeStore_browseNodes)(UA_BrowseDescription *browseDescriptions,UA_Int32 *indices,UA_UInt32 indicesSize, UA_UInt32 requestedMaxReferencesPerNode, UA_BrowseResult *browseResults, UA_DiagnosticInfo *diagnosticInfos);
+typedef UA_Int32 (*UA_NodeStore_browseNodes)(UA_BrowseDescription *browseDescriptions,UA_UInt32 *indices,UA_UInt32 indicesSize, UA_UInt32 requestedMaxReferencesPerNode, UA_BrowseResult *browseResults, UA_DiagnosticInfo *diagnosticInfos);
 
 
 

+ 6 - 6
src/server/ua_services_view.c

@@ -248,8 +248,8 @@ void Service_Browse(UA_Server *server, UA_Session *session,
     	}
     }
 
-	UA_UInt32 *readValueIdIndices;
-    if(UA_Array_new((void **)&readValueIdIndices,request->nodesToBrowseSize,&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD){
+	UA_UInt32 *browseDescriptionIndices;
+    if(UA_Array_new((void **)&browseDescriptionIndices,request->nodesToBrowseSize,&UA_[UA_UINT32]) != UA_STATUSCODE_GOOD){
     	response->responseHeader.serviceResult = UA_STATUSCODE_BADOUTOFMEMORY;
     	return ;
     }
@@ -263,7 +263,7 @@ void Service_Browse(UA_Server *server, UA_Session *session,
     	    UA_UInt32 n = 0;
     	    for(UA_Int32 j = 0; j < request->nodesToBrowseSize; j++){
     	    	if(request->nodesToBrowse[j].nodeId.namespaceIndex == associatedIndices[i]){
-    	    		readValueIdIndices[n] = j;
+    	    		browseDescriptionIndices[n] = j;
     	    	}
     	    }
 
@@ -271,16 +271,16 @@ void Service_Browse(UA_Server *server, UA_Session *session,
     	    //call read for every namespace
     		tmpNamespace->nodeStore->browseNodes(
     				request->nodesToBrowse,
-    				readValueIdIndices,
+    				browseDescriptionIndices,
     				numberOfFoundIndices[i],
     				request->requestedMaxReferencesPerNode,
     				response->results,
-    				&response->diagnosticInfos[i]);
+    				response->diagnosticInfos);
 
 			//	response->results[i] = service_read_node(server, &request->nodesToRead[i]);
     	}
     }
-    UA_free();
+    UA_free(browseDescriptionIndices);
     UA_free(numberOfFoundIndices);
     UA_free(associatedIndices);
     // for(UA_Int32 i = 0;i < request->nodesToBrowseSize;i++)