lordgamez commented on code in PR #2259:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2259#discussion_r3980228378


##########
extensions/opc/tests/OpcUaTestServer.h:
##########
@@ -155,20 +364,45 @@ class OpcUaTestServer {
     return object_id;
   }
 
-  UA_NodeId addIntVariable(const char *name, UA_NodeId parent, UA_Int32 value) 
{
+  UA_StatusCode addNode(UA_NodeId parent_node_id, UA_NodeId& target_node_id, 
opc::OPCNodeIDType type, const std::string& browse_name,
+      const UA_VariableAttributes& attr) {
+    UA_QualifiedName qname = UA_QUALIFIEDNAME(ns_index_, 
const_cast<char*>(browse_name.c_str()));
+    UA_NodeId node_id;
+
+    switch (type) {
+      case opc::OPCNodeIDType::Int:
+        node_id = UA_NODEID_NUMERIC(ns_index_, std::stoi(browse_name));
+        break;
+      case opc::OPCNodeIDType::String:
+        node_id = UA_NODEID_STRING_ALLOC(ns_index_, browse_name.c_str());
+        break;
+      case opc::OPCNodeIDType::Guid:
+        node_id = UA_NODEID_GUID(ns_index_, UA_GUID(browse_name.c_str()));
+        break;

Review Comment:
   `UA_GUID` actually a function that uses `UA_Guid_parse` to parse an 
`UA_Guid` type from string so it is not a problem.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to