Browse Source

expose the TranslateBrowsePathstoNodeIds service to userland

Julius Pfrommer 8 years ago
parent
commit
954f69b206
2 changed files with 15 additions and 0 deletions
  1. 4 0
      include/ua_server.h
  2. 11 0
      src/server/ua_services_view.c

+ 4 - 0
include/ua_server.h

@@ -505,6 +505,10 @@ UA_BrowseResult UA_EXPORT
 UA_Server_browseNext(UA_Server *server, UA_Boolean releaseContinuationPoint,
                      const UA_ByteString *continuationPoint);
 
+UA_BrowsePathResult UA_EXPORT
+UA_Server_translateBrowsePathToNodeIds(UA_Server *server,
+                                       const UA_BrowsePath *browsePath);
+
 #ifndef HAVE_NODEITER_CALLBACK
 #define HAVE_NODEITER_CALLBACK
 /* Iterate over all nodes referenced by parentNodeId by calling the callback

+ 11 - 0
src/server/ua_services_view.c

@@ -534,6 +534,17 @@ void Service_TranslateBrowsePathsToNodeIds_single(UA_Server *server, UA_Session
     }
 }
 
+UA_BrowsePathResult
+UA_Server_translateBrowsePathToNodeIds(UA_Server *server,
+                                       const UA_BrowsePath *browsePath) {
+    UA_BrowsePathResult result;
+    UA_BrowsePathResult_init(&result);
+    UA_RCU_LOCK();
+    Service_TranslateBrowsePathsToNodeIds_single(server, &adminSession, browsePath, &result);
+    UA_RCU_UNLOCK();
+    return result;
+}
+
 void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *session,
                                            const UA_TranslateBrowsePathsToNodeIdsRequest *request,
                                            UA_TranslateBrowsePathsToNodeIdsResponse *response) {