Pārlūkot izejas kodu

Use ua-nodeset repository instead of local nodeset copy

Add unit test and example for PLCopen
Stefan Profanter 6 gadi atpakaļ
vecāks
revīzija
2f9a1ce242

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "deps/mdnsd"]
 [submodule "deps/mdnsd"]
 	path = deps/mdnsd
 	path = deps/mdnsd
 	url = https://github.com/Pro/mdnsd.git
 	url = https://github.com/Pro/mdnsd.git
+[submodule "deps/ua-nodeset"]
+	path = deps/ua-nodeset
+	url = https://github.com/OPCFoundation/UA-Nodeset.git

+ 18 - 12
CMakeLists.txt

@@ -90,9 +90,7 @@ mark_as_advanced(UA_ENABLE_EMBEDDED_LIBC)
 option(UA_ENABLE_DETERMINISTIC_RNG "Do not seed the random number generator (e.g. for unit tests)." OFF)
 option(UA_ENABLE_DETERMINISTIC_RNG "Do not seed the random number generator (e.g. for unit tests)." OFF)
 mark_as_advanced(UA_ENABLE_DETERMINISTIC_RNG)
 mark_as_advanced(UA_ENABLE_DETERMINISTIC_RNG)
 
 
-set(UA_NAMESPACE0_XML ${CMAKE_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.Minimal.xml CACHE FILEPATH "Namespace Zero definition XML file")
-set(UA_DATATYPES_FILE ${PROJECT_SOURCE_DIR}/tools/schema/datatypes_minimal.txt CACHE FILEPATH "File containing the list of datatypes added to the server")
-mark_as_advanced(UA_DATATYPES_FILE)
+option(UA_ENABLE_FULL_NS0 "Use the full NS0 instead of a minimal Namespace 0 nodeset" OFF)
 
 
 option(UA_ENABLE_VALGRIND_UNIT_TESTS "Use Valgrind to detect memory leaks when running the unit tests" OFF)
 option(UA_ENABLE_VALGRIND_UNIT_TESTS "Use Valgrind to detect memory leaks when running the unit tests" OFF)
 mark_as_advanced(UA_ENABLE_VALGRIND_UNIT_TESTS)
 mark_as_advanced(UA_ENABLE_VALGRIND_UNIT_TESTS)
@@ -382,8 +380,16 @@ endif()
 # Generate source files #
 # Generate source files #
 #########################
 #########################
 
 
-if(UA_DATATYPES_FILE STREQUAL "")
-  set(SELECTED_TYPES_TMP "")
+if (UA_ENABLE_FULL_NS0)
+    set(UA_NAMESPACE0_XML ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml)
+    set(UA_DATATYPES_FILE "")
+else()
+    set(UA_NAMESPACE0_XML ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.NodeSet2.Minimal.xml)
+    set(UA_DATATYPES_FILE "${PROJECT_SOURCE_DIR}/tools/schema/datatypes_minimal.txt")
+endif()
+
+if (UA_DATATYPES_FILE STREQUAL "")
+    set(SELECTED_TYPES_TMP "")
 else()
 else()
   set(SELECTED_TYPES_TMP "--selected-types=${UA_DATATYPES_FILE}")
   set(SELECTED_TYPES_TMP "--selected-types=${UA_DATATYPES_FILE}")
 endif()
 endif()
@@ -395,14 +401,14 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated
                           ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_encoding_binary.h
                           ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_encoding_binary.h
                    PRE_BUILD
                    PRE_BUILD
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
-                           --type-csv=${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv
+                           --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/NodeIds.csv
                            ${SELECTED_TYPES_TMP}
                            ${SELECTED_TYPES_TMP}
-                           --type-bsd=${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
+                           --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd
                            ${PROJECT_BINARY_DIR}/src_generated/ua_types
                            ${PROJECT_BINARY_DIR}/src_generated/ua_types
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
-                           ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv
-                           ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
-                           ${SELECTED_TYPES})
+                           ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/NodeIds.csv
+                           ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd
+                           ${UA_DATATYPES_FILE})
 # we need a custom target to avoid that the generator is called concurrently and thus overwriting files while the other thread is compiling
 # we need a custom target to avoid that the generator is called concurrently and thus overwriting files while the other thread is compiling
 add_custom_target(open62541-generator-types DEPENDS
 add_custom_target(open62541-generator-types DEPENDS
                   ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
                   ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
@@ -419,13 +425,13 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_transport_gener
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                            --namespace=1
                            --namespace=1
                            --selected-types=${PROJECT_SOURCE_DIR}/tools/schema/datatypes_transport.txt
                            --selected-types=${PROJECT_SOURCE_DIR}/tools/schema/datatypes_transport.txt
-                           --type-bsd=${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
+                           --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd
                            --type-bsd=${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd
                            --type-bsd=${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd
                            --no-builtin
                            --no-builtin
                            ${PROJECT_BINARY_DIR}/src_generated/ua_transport
                            ${PROJECT_BINARY_DIR}/src_generated/ua_transport
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
                            ${PROJECT_SOURCE_DIR}/tools/schema/datatypes_transport.txt
                            ${PROJECT_SOURCE_DIR}/tools/schema/datatypes_transport.txt
-                           ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
+                           ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd
                            ${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd)
                            ${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd)
 # we need a custom target to avoid that the generator is called concurrently and thus overwriting files while the other thread is compiling
 # we need a custom target to avoid that the generator is called concurrently and thus overwriting files while the other thread is compiling
 add_custom_target(open62541-generator-transport DEPENDS
 add_custom_target(open62541-generator-transport DEPENDS

+ 1 - 0
deps/ua-nodeset

@@ -0,0 +1 @@
+Subproject commit ddce8bb6a1792916b161a9e3ba3b6b80675e8c1e

+ 2 - 26
examples/CMakeLists.txt

@@ -78,32 +78,6 @@ if(UA_ENABLE_NODEMANAGEMENT)
     add_example(access_control_client access_control/client_access_control.c)
     add_example(access_control_client access_control/client_access_control.c)
 endif()
 endif()
 
 
-# generate nodeset from XML file
-add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c
-                          ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.h
-                   PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
-                           --types-array=UA_TYPES
-                           --existing ${UA_NAMESPACE0_XML}
-                           --xml ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml
-                           ${PROJECT_BINARY_DIR}/src_generated/example_nodeset
-                   DEPENDS ${UA_NAMESPACE0_XML}
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
-                           ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
-                           ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml
-                   )
-
-include_directories(${PROJECT_SOURCE_DIR}/src)
-add_example(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c)
-if(UA_COMPILE_AS_CXX)
-	set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c PROPERTIES LANGUAGE CXX)
-endif()
-
 if(UA_BUILD_SELFSIGNED_CERTIFICATE)
 if(UA_BUILD_SELFSIGNED_CERTIFICATE)
   find_package(OpenSSL REQUIRED)
   find_package(OpenSSL REQUIRED)
   add_custom_command(OUTPUT server_cert.der ca.crt
   add_custom_command(OUTPUT server_cert.der ca.crt
@@ -125,3 +99,5 @@ if(UA_ENABLE_DISCOVERY)
         add_example(discovery_server_multicast discovery/server_multicast.c)
         add_example(discovery_server_multicast discovery/server_multicast.c)
     endif()
     endif()
 endif()
 endif()
+
+add_subdirectory(nodeset)

+ 118 - 0
examples/nodeset/CMakeLists.txt

@@ -0,0 +1,118 @@
+####################
+# Nodeset Examples #
+####################
+
+###################
+# Custom XML      #
+###################
+
+# generate namespace from XML file
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c
+                   ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.h
+                   PRE_BUILD
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                   --types-array=UA_TYPES
+                   --existing ${UA_NAMESPACE0_XML}
+                   --xml ${PROJECT_SOURCE_DIR}/examples/nodeset/server_nodeset.xml
+                   ${PROJECT_BINARY_DIR}/src_generated/example_nodeset
+                   DEPENDS ${UA_NAMESPACE0_XML}
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
+                   ${PROJECT_SOURCE_DIR}/examples/nodeset/server_nodeset.xml)
+
+add_example(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c)
+if(UA_COMPILE_AS_CXX)
+    set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/example_nodeset.c PROPERTIES LANGUAGE CXX)
+endif()
+
+###################
+# PLCopen Nodeset #
+###################
+
+# PLCopen requires the full ns0 as basis
+if(UA_ENABLE_FULL_NS0)
+
+    # Generate types for DI namespace
+    set(UA_TYPES_OUT "ua_types_di")
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_generated.c
+                       ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_generated.h
+                       ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_generated_handling.h
+                       ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_generated_encoding_binary.h
+                       PRE_BUILD
+                       COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
+                       --namespace=2
+                       --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
+                       --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd
+                       --no-builtin
+                       ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}
+                       DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd)
+
+    # generate DI namespace
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
+                       ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.h
+                       PRE_BUILD
+                       COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                       --internal-headers
+                       --types-array=UA_TYPES
+                       --types-array=UA_TYPES_DI
+                       --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                       --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                       ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di
+                       DEPENDS ${UA_NAMESPACE0_XML}
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                       )
+
+    # generate PLCopen namespace which is using DI
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c
+                       ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.h
+                       PRE_BUILD
+                       COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                       --internal-headers
+                       --types-array=UA_TYPES
+                       --types-array=UA_TYPES_DI
+                       # PLCopen has no specific type definition, thus use the default UA_TYPES to ignore it
+                       --types-array=UA_TYPES
+                       --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                       --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                       --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
+                       ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc
+                       DEPENDS ${UA_NAMESPACE0_XML}
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
+                       ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                       ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
+                       )
+
+    add_example(server_nodeset_plcopen server_nodeset_plcopen.c
+                ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c
+                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
+                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c)
+    target_include_directories(server_nodeset_plcopen PRIVATE ${PROJECT_SOURCE_DIR}/src) # needs an internal header
+
+    if(UA_COMPILE_AS_CXX)
+        set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c PROPERTIES LANGUAGE CXX)
+        set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c PROPERTIES LANGUAGE CXX)
+        set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c PROPERTIES LANGUAGE CXX)
+    endif()
+endif()

examples/server_nodeset.c → examples/nodeset/server_nodeset.c


examples/server_nodeset.xml → examples/nodeset/server_nodeset.xml


+ 46 - 0
examples/nodeset/server_nodeset_plcopen.c

@@ -0,0 +1,46 @@
+/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
+ * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
+
+#include <signal.h>
+#ifdef UA_NO_AMALGAMATION
+#include "ua_server.h"
+#include "ua_log_stdout.h"
+#include "ua_config_default.h"
+#else
+#include "open62541.h"
+#endif
+
+/* Files example_namespace.h and example_namespace.c are created from server_nodeset.xml in the
+ * /src_generated directory by CMake */
+#include "ua_namespace_di.h"
+#include "ua_namespace_plc.h"
+
+UA_Boolean running = true;
+
+static void stopHandler(int sign) {
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c");
+    running = false;
+}
+
+int main(int argc, char** argv) {
+    signal(SIGINT, stopHandler);
+    signal(SIGTERM, stopHandler);
+
+    UA_ServerConfig *config = UA_ServerConfig_new_default();
+    UA_Server *server = UA_Server_new(config);
+
+    /* create nodes from nodeset */
+    UA_StatusCode retval = ua_namespace_di(server);
+    retval |= ua_namespace_plc(server);
+    if(retval != UA_STATUSCODE_GOOD) {
+        UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Adding the DI namespace failed. Please check previous error output.");
+        UA_Server_delete(server);
+        UA_ServerConfig_delete(config);
+        return (int)UA_STATUSCODE_BADUNEXPECTEDERROR;
+    }
+
+    retval = UA_Server_run(server, &running);
+    UA_Server_delete(server);
+    UA_ServerConfig_delete(config);
+    return (int)retval;
+}

+ 58 - 22
tests/CMakeLists.txt

@@ -210,13 +210,13 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_ge
                    PRE_BUILD
                    PRE_BUILD
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    --namespace=2
                    --namespace=2
-                   --type-csv=${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/OpcUaDiModel.csv
-                   --type-bsd=${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/Opc.Ua.Di.Types.bsd
+                   --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
+                   --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd
                    --no-builtin
                    --no-builtin
                    ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}
                    ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}
                    DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/OpcUaDiModel.csv
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/Opc.Ua.Di.Types.bsd)
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd)
 
 
 # Generate types for ADI namespace
 # Generate types for ADI namespace
 set(UA_TYPES_OUT "ua_types_adi")
 set(UA_TYPES_OUT "ua_types_adi")
@@ -227,13 +227,13 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}_ge
                    PRE_BUILD
                    PRE_BUILD
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    --namespace=3
                    --namespace=3
-                   --type-csv=${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/OpcUaAdiModel.csv
-                   --type-bsd=${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd
+                   --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/OpcUaAdiModel.csv
+                   --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd
                    --no-builtin
                    --no-builtin
                    ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}
                    ${PROJECT_BINARY_DIR}/src_generated/${UA_TYPES_OUT}
                    DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
                    DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/OpcUaAdiModel.csv
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd)
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/OpcUaAdiModel.csv
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd)
 
 
 # generate DI namespace
 # generate DI namespace
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
@@ -243,8 +243,8 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
                    --internal-headers
                    --internal-headers
                    --types-array=UA_TYPES
                    --types-array=UA_TYPES
                    --types-array=UA_TYPES_DI
                    --types-array=UA_TYPES_DI
-                   --existing ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
-                   --xml ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                   --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di
                    DEPENDS ${UA_NAMESPACE0_XML}
                    DEPENDS ${UA_NAMESPACE0_XML}
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
@@ -254,12 +254,12 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
-                   ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
                    )
                    )
 
 
 
 
-# generate ADI namespace based on DI and ADI
+# generate ADI namespace which is using DI
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.h
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.h
                    PRE_BUILD
                    PRE_BUILD
@@ -268,9 +268,9 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
                    --types-array=UA_TYPES
                    --types-array=UA_TYPES
                    --types-array=UA_TYPES_DI
                    --types-array=UA_TYPES_DI
                    --types-array=UA_TYPES_ADI
                    --types-array=UA_TYPES_ADI
-                   --existing ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
-                   --existing ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
-                   --xml ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
+                   --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                   --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi
                    ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi
                    DEPENDS ${UA_NAMESPACE0_XML}
                    DEPENDS ${UA_NAMESPACE0_XML}
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
@@ -280,16 +280,52 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
                    ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
-                   ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
-                   ${PROJECT_SOURCE_DIR}/tests/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
                    )
                    )
 
 
-add_executable(check_nodeset_compiler
-               check_nodeset_compiler.c
+# generate PLCopen namespace which is using DI
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c
+                   ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.h
+                   PRE_BUILD
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                   --internal-headers
+                   --types-array=UA_TYPES
+                   --types-array=UA_TYPES_DI
+                   # PLCopen has no specific type definition, thus use the default UA_TYPES to ignore it
+                   --types-array=UA_TYPES
+                   --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
+                   --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
+                   ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc
+                   DEPENDS ${UA_NAMESPACE0_XML}
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
+                   ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
+                   ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
+                   )
+
+add_executable(check_nodeset_compiler_adi
+               check_nodeset_compiler_adi.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_types_adi_generated.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_types_adi_generated.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
                ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_adi.c
                $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
                $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
-target_link_libraries(check_nodeset_compiler ${LIBS})
-add_test_valgrind(check_nodeset_compiler ${TESTS_BINARY_DIR}/check_nodeset_compiler)
+target_link_libraries(check_nodeset_compiler_adi ${LIBS})
+add_test_valgrind(check_nodeset_compiler_adi ${TESTS_BINARY_DIR}/check_nodeset_compiler_adi)
+
+add_executable(check_nodeset_compiler_plc
+               check_nodeset_compiler_plc.c
+               ${PROJECT_BINARY_DIR}/src_generated/ua_types_di_generated.c
+               ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_di.c
+               ${PROJECT_BINARY_DIR}/src_generated/ua_namespace_plc.c
+               $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
+target_link_libraries(check_nodeset_compiler_plc ${LIBS})
+add_test_valgrind(check_nodeset_compiler_plc ${TESTS_BINARY_DIR}/check_nodeset_compiler_plc)

+ 1 - 1
tests/check_nodeset_compiler.c

@@ -3,7 +3,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "ua_server.h"
 #include "ua_server.h"
-#include "ua_config_standard.h"
+#include "ua_config_default.h"
 
 
 #include "ua_namespace_di.h"
 #include "ua_namespace_di.h"
 #include "ua_namespace_adi.h"
 #include "ua_namespace_adi.h"

+ 62 - 0
tests/check_nodeset_compiler_plc.c

@@ -0,0 +1,62 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "ua_server.h"
+#include "ua_config_default.h"
+
+#include "ua_namespace_di.h"
+#include "ua_namespace_plc.h"
+
+#include "check.h"
+#include "testing_clock.h"
+
+#include "unistd.h"
+
+UA_Server *server = NULL;
+UA_ServerConfig *config = NULL;
+
+static void setup(void) {
+    config = UA_ServerConfig_new_default();
+    server = UA_Server_new(config);
+    UA_Server_run_startup(server);
+}
+
+static void teardown(void) {
+    UA_Server_run_shutdown(server);
+    UA_Server_delete(server);
+    UA_ServerConfig_delete(config);
+}
+
+
+START_TEST(Server_addDiNodeset) {
+    UA_StatusCode retval = ua_namespace_di(server);
+    ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
+}
+END_TEST
+
+START_TEST(Server_addPlcNodeset) {
+    UA_StatusCode retval = ua_namespace_plc(server);
+    ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
+}
+END_TEST
+
+static Suite* testSuite_Client(void) {
+    Suite *s = suite_create("Server Nodeset Compiler");
+    TCase *tc_server = tcase_create("Server DI and PLCopen nodeset");
+    tcase_add_unchecked_fixture(tc_server, setup, teardown);
+    tcase_add_test(tc_server, Server_addDiNodeset);
+    tcase_add_test(tc_server, Server_addPlcNodeset);
+    suite_add_tcase(s, tc_server);
+    return s;
+}
+
+int main(void) {
+    Suite *s = testSuite_Client();
+    SRunner *sr = srunner_create(s);
+    srunner_set_fork_status(sr, CK_NOFORK);
+    srunner_run_all(sr,CK_NORMAL);
+    int number_failed = srunner_ntests_failed(sr);
+    srunner_free(sr);
+    return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}

+ 5 - 5
tools/nodeset_compiler/backend_open62541.py

@@ -2,8 +2,10 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 
 
 ###
 ###
-### Author:  Chris Iatrou (ichrispa@core-vector.net)
-### Version: rev 13
+### Authors:
+### - Chris Iatrou (ichrispa@core-vector.net)
+### - Julius Pfrommer
+### - Stefan Profanter (profanter@fortiss.org)
 ###
 ###
 ### This program was created for educational purposes and has been
 ### This program was created for educational purposes and has been
 ### contributed to the open62541 project by the author. All licensing
 ### contributed to the open62541 project by the author. All licensing
@@ -170,8 +172,7 @@ def generateOpen62541Code(nodeset, outfilename, supressGenerationOfAttribute=[],
         for arr in set(typesArray):
         for arr in set(typesArray):
             if arr == "UA_TYPES":
             if arr == "UA_TYPES":
                 continue
                 continue
-            additionalHeaders += """#include "%s_generated.h"
-                                 """ % arr.lower()
+            additionalHeaders += """#include "%s_generated.h"\n""" % arr.lower()
 
 
     # Print the preamble of the generated code
     # Print the preamble of the generated code
     writeh("""/* WARNING: This is a generated file.
     writeh("""/* WARNING: This is a generated file.
@@ -183,7 +184,6 @@ def generateOpen62541Code(nodeset, outfilename, supressGenerationOfAttribute=[],
     if internal_headers:
     if internal_headers:
         writeh("""
         writeh("""
 #ifdef UA_NO_AMALGAMATION
 #ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
 #include "ua_server.h"
 #include "ua_server.h"
 #include "ua_types_encoding_binary.h"
 #include "ua_types_encoding_binary.h"
 %s
 %s

+ 1 - 0
tools/nodeset_compiler/backend_open62541_datatypes.py

@@ -19,6 +19,7 @@ def splitStringLiterals(value, splitLength=500, max_string_length=0):
     If maxLength is set and the string is longer than maxLength, then an
     If maxLength is set and the string is longer than maxLength, then an
     empty string will be returned.
     empty string will be returned.
     """
     """
+    value = value.strip()
     if max_string_length > 0 and len(value) > max_string_length:
     if max_string_length > 0 and len(value) > max_string_length:
         logger.info("String is longer than {}. Returning empty string.".format(max_string_length))
         logger.info("String is longer than {}. Returning empty string.".format(max_string_length))
         return "\"\""
         return "\"\""

+ 2 - 2
tools/nodeset_compiler/backend_open62541_nodes.py

@@ -328,9 +328,9 @@ def generateValueCode(node, parentNode, nodeset, bootstrapping=True, max_string_
     #  0: x-dim | x>0
     #  0: x-dim | x>0
     #  n: n-dim | n>0
     #  n: n-dim | n>0
     if (len(node.value) == 0):
     if (len(node.value) == 0):
-        return ""
+        return ["", ""]
     if not isinstance(node.value[0], Value):
     if not isinstance(node.value[0], Value):
-        return ""
+        return ["", ""]
 
 
     if parentNode.valueRank != -1 and (parentNode.valueRank >= 0
     if parentNode.valueRank != -1 and (parentNode.valueRank >= 0
                                        or (len(node.value) > 1
                                        or (len(node.value) > 1

+ 6 - 0
tools/nodeset_compiler/nodes.py

@@ -555,8 +555,14 @@ class DataTypeNode(Node):
                     enumDict.append((fname, enumVal))
                     enumDict.append((fname, enumVal))
                     continue
                     continue
                 else:
                 else:
+                    if fdtype == "":
+                        # If no datatype given use base datatype
+                        fdtype = "i=24"
+
                     # This might be a subtype... follow the node defined as datatype to find out
                     # This might be a subtype... follow the node defined as datatype to find out
                     # what encoding to use
                     # what encoding to use
+                    if not NodeId(fdtype) in nodeset.nodes:
+                        raise Exception("Node {} not found in nodeset".format(NodeId(fdtype)))
                     dtnode = nodeset.nodes[NodeId(fdtype)]
                     dtnode = nodeset.nodes[NodeId(fdtype)]
                     # The node in the datatype element was found. we inherit its encoding,
                     # The node in the datatype element was found. we inherit its encoding,
                     # but must still ensure that the dtnode is itself validly encodable
                     # but must still ensure that the dtnode is itself validly encodable

+ 4 - 2
tools/nodeset_compiler/nodeset_compiler.py

@@ -6,8 +6,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 ###
 ###
-### Author:  Chris Iatrou (ichrispa@core-vector.net)
-### Version: rev 14
+### Authors:
+### - Chris Iatrou (ichrispa@core-vector.net)
+### - Julius Pfrommer
+### - Stefan Profanter (profanter@fortiss.org)
 ###
 ###
 ### This program was created for educational purposes and has been
 ### This program was created for educational purposes and has been
 ### contributed to the open62541 project by the author. All licensing
 ### contributed to the open62541 project by the author. All licensing

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 5746
tools/schema/NodeIds.csv


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1819 - 1819
tools/schema/namespace0/Opc.Ua.NodeSet2.Minimal.xml


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 2348
tools/schema/Opc.Ua.Types.bsd


+ 0 - 298
tools/schema/datatypes_full.txt

@@ -1,298 +0,0 @@
-ActivateSessionRequest
-ActivateSessionResponse
-AddNodesItem
-AddNodesRequest
-AddNodesResponse
-AddNodesResult
-AddReferencesItem
-AddReferencesRequest
-AddReferencesResponse
-AggregateConfiguration
-AggregateFilter
-AggregateFilterResult
-Annotation
-AnonymousIdentityToken
-ApplicationDescription
-ApplicationInstanceCertificate
-ApplicationType
-Argument
-AttributeOperand
-AttributeWriteMask
-AxisInformation
-AxisScaleEnumeration
-BitFieldMaskDataType
-Boolean
-BrowseDescription
-BrowseDirection
-BrowseNextRequest
-BrowseNextResponse
-BrowsePath
-BrowsePathResult
-BrowsePathTarget
-BrowseRequest
-BrowseResponse
-BrowseResult
-BrowseResultMask
-BuildInfo
-Byte
-ByteString
-ByteStringNodeId
-CallMethodRequest
-CallMethodResult
-CallRequest
-CallResponse
-CancelRequest
-CancelResponse
-ChannelSecurityToken
-CloseSecureChannelRequest
-CloseSecureChannelResponse
-CloseSessionRequest
-CloseSessionResponse
-ComplexNumberType
-ContentFilter
-ContentFilterElement
-ContentFilterElementResult
-ContentFilterResult
-ContinuationPoint
-Counter
-CreateMonitoredItemsRequest
-CreateMonitoredItemsResponse
-CreateSessionRequest
-CreateSessionResponse
-CreateSubscriptionRequest
-CreateSubscriptionResponse
-DataChangeFilter
-DataChangeNotification
-DataChangeTrigger
-DataTypeAttributes
-DataTypeNode
-DataValue
-Date
-DateString
-DateTime
-DeadbandType
-DecimalString
-DeleteAtTimeDetails
-DeleteEventDetails
-DeleteMonitoredItemsRequest
-DeleteMonitoredItemsResponse
-DeleteNodesItem
-DeleteNodesRequest
-DeleteNodesResponse
-DeleteRawModifiedDetails
-DeleteReferencesItem
-DeleteReferencesRequest
-DeleteReferencesResponse
-DeleteSubscriptionsRequest
-DeleteSubscriptionsResponse
-DiagnosticInfo
-DiscoveryConfiguration
-Double
-DoubleComplexNumberType
-Duration
-DurationString
-ElementOperand
-EndpointConfiguration
-EndpointDescription
-EndpointUrlListDataType
-EnumValueType
-EUInformation
-EventFieldList
-EventFilter
-EventFilterResult
-EventNotificationList
-ExceptionDeviationFormat
-ExpandedNodeId
-ExtensionObject
-FilterOperand
-FilterOperator
-FindServersOnNetworkRequest
-FindServersOnNetworkResponse
-FindServersRequest
-FindServersResponse
-Float
-FourByteNodeId
-GetEndpointsRequest
-GetEndpointsResponse
-Guid
-GuidNodeId
-HistoryData
-HistoryEvent
-HistoryEventFieldList
-HistoryModifiedData
-HistoryReadDetails
-HistoryReadRequest
-HistoryReadResponse
-HistoryReadResult
-HistoryReadValueId
-HistoryUpdateDetails
-HistoryUpdateRequest
-HistoryUpdateResponse
-HistoryUpdateResult
-HistoryUpdateType
-IdType
-ImageBMP
-ImageGIF
-ImageJPG
-ImagePNG
-InstanceNode
-Int16
-Int32
-Int64
-IntegerId
-IssuedIdentityToken
-LiteralOperand
-LocaleId
-LocalizedText
-MdnsDiscoveryConfiguration
-MessageSecurityMode
-MethodAttributes
-MethodNode
-ModelChangeStructureDataType
-ModelChangeStructureVerbMask
-ModificationInfo
-ModifyMonitoredItemsRequest
-ModifyMonitoredItemsResponse
-ModifySubscriptionRequest
-ModifySubscriptionResponse
-MonitoredItemCreateRequest
-MonitoredItemCreateResult
-MonitoredItemModifyRequest
-MonitoredItemModifyResult
-MonitoredItemNotification
-MonitoringFilter
-MonitoringFilterResult
-MonitoringMode
-MonitoringParameters
-NamingRuleType
-NetworkGroupDataType
-Node
-NodeAttributes
-NodeAttributesMask
-NodeClass
-NodeId
-NodeIdType
-NodeReference
-NodeTypeDescription
-NormalizedString
-NotificationData
-NotificationMessage
-NumericNodeId
-NumericRange
-ObjectAttributes
-ObjectNode
-ObjectTypeAttributes
-ObjectTypeNode
-OpenFileMode
-OpenSecureChannelRequest
-OpenSecureChannelResponse
-OptionSet
-ParsingResult
-PerformUpdateType
-ProgramDiagnosticDataType
-PublishRequest
-PublishResponse
-QualifiedName
-QueryDataDescription
-QueryDataSet
-QueryFirstRequest
-QueryFirstResponse
-QueryNextRequest
-QueryNextResponse
-Range
-ReadAtTimeDetails
-ReadEventDetails
-ReadProcessedDetails
-ReadRawModifiedDetails
-ReadRequest
-ReadResponse
-ReadValueId
-RedundancySupport
-RedundantServerDataType
-ReferenceDescription
-ReferenceNode
-ReferenceTypeAttributes
-ReferenceTypeNode
-RegisteredServer
-RegisterNodesRequest
-RegisterNodesResponse
-RegisterServer2Request
-RegisterServer2Response
-RegisterServerRequest
-RegisterServerResponse
-RelativePath
-RelativePathElement
-RepublishRequest
-RepublishResponse
-RequestHeader
-ResponseHeader
-SamplingIntervalDiagnosticsDataType
-SByte
-SecurityTokenRequestType
-SemanticChangeStructureDataType
-ServerDiagnosticsSummaryDataType
-ServerOnNetwork
-ServerState
-ServerStatusDataType
-ServiceCounterDataType
-ServiceFault
-SessionAuthenticationToken
-SessionDiagnosticsDataType
-SessionSecurityDiagnosticsDataType
-SetMonitoringModeRequest
-SetMonitoringModeResponse
-SetPublishingModeRequest
-SetPublishingModeResponse
-SetTriggeringRequest
-SetTriggeringResponse
-SignatureData
-SignedSoftwareCertificate
-SimpleAttributeOperand
-StatusChangeNotification
-StatusCode
-StatusResult
-String
-StringNodeId
-SubscriptionAcknowledgement
-SubscriptionDiagnosticsDataType
-Time
-TimestampsToReturn
-TimeString
-TimeZoneDataType
-TransferResult
-TransferSubscriptionsRequest
-TransferSubscriptionsResponse
-TranslateBrowsePathsToNodeIdsRequest
-TranslateBrowsePathsToNodeIdsResponse
-TrustListDataType
-TrustListMasks
-TwoByteNodeId
-TypeNode
-UInt16
-UInt32
-UInt64
-Union
-UnregisterNodesRequest
-UnregisterNodesResponse
-UpdateDataDetails
-UpdateEventDetails
-UpdateStructureDataDetails
-UserIdentityToken
-UserNameIdentityToken
-UserTokenPolicy
-UserTokenType
-UtcTime
-VariableAttributes
-VariableNode
-VariableTypeAttributes
-VariableTypeNode
-Variant
-ViewAttributes
-ViewDescription
-ViewNode
-WriteRequest
-WriteResponse
-WriteValue
-X509IdentityToken
-XmlElement
-XVType

+ 0 - 4
tools/schema/datatypes_full_generate.sh

@@ -1,4 +0,0 @@
-#!/bin/bash
-
-cd $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-egrep "<opc\:(Structured|Enumerated|Opaque)Type" Opc.Ua.Types.bsd | grep -Po 'Name="\K.*?(?=")' | sort -u datatypes_minimal.txt - > datatypes_full.txt

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 31499
tools/schema/namespace0/Opc.Ua.NodeSet2.xml


+ 0 - 3
tools/schema/namespace0/README.md

@@ -1,3 +0,0 @@
-This directory contains XML nodesets of namespace 0 for automatic generation.
-The generation option can be activated via CMake option ENABLE_GENERATE_NAMESPACE0.
-The nodesets can be selected via CMake variable GENERATE_NAMESPACE0_FILE.

+ 2 - 3
tools/travis/travis_linux_script.sh

@@ -85,7 +85,7 @@ else
     echo -e "\r\n== Full Namespace 0 Generation ==" && echo -en 'travis_fold:start:script.build.ns0\\r'
     echo -e "\r\n== Full Namespace 0 Generation ==" && echo -en 'travis_fold:start:script.build.ns0\\r'
     mkdir -p build
     mkdir -p build
     cd build
     cd build
-    cmake -DCMAKE_BUILD_TYPE=Debug -DUA_NAMESPACE0_XML=../tools/schema/namespace0/Opc.Ua.NodeSet2.xml -DUA_DATATYPES_FILE=../tools/schema/datatypes_full.txt -DUA_BUILD_EXAMPLES=ON  ..
+    cmake -DCMAKE_BUILD_TYPE=Debug -DUA_ENABLE_FULL_NS0=ON -DUA_BUILD_EXAMPLES=ON  ..
     make -j
     make -j
     if [ $? -ne 0 ] ; then exit 1 ; fi
     if [ $? -ne 0 ] ; then exit 1 ; fi
     cd .. && rm build -rf
     cd .. && rm build -rf
@@ -194,10 +194,9 @@ else
     echo -en 'travis_fold:end:script.build.multithread\\r'
     echo -en 'travis_fold:end:script.build.multithread\\r'
 
 
     echo -e "\r\n== Debug build and unit tests (64 bit, python 2) ==" && echo -en 'travis_fold:start:script.build.unit_test_valgrind_python2\\r'
     echo -e "\r\n== Debug build and unit tests (64 bit, python 2) ==" && echo -en 'travis_fold:start:script.build.unit_test_valgrind_python2\\r'
-    git clone --depth 1 https://github.com/OPCFoundation/UA-Nodeset.git tests/ua-nodeset
     mkdir -p build && cd build
     mkdir -p build && cd build
     # Force to use python2 to test compilation with python2
     # Force to use python2 to test compilation with python2
-    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 -DUA_NAMESPACE0_XML=../tools/schema/namespace0/Opc.Ua.NodeSet2.xml -DUA_DATATYPES_FILE= \
+    cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 -DUA_ENABLE_FULL_NS0=ON \
     -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=ON -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
     -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=ON -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
     -DUA_BUILD_UNIT_TESTS=ON -DUA_ENABLE_COVERAGE=ON -DUA_ENABLE_VALGRIND_UNIT_TESTS=ON ..
     -DUA_BUILD_UNIT_TESTS=ON -DUA_ENABLE_COVERAGE=ON -DUA_ENABLE_VALGRIND_UNIT_TESTS=ON ..
     make -j && make test ARGS="-V"
     make -j && make test ARGS="-V"

+ 1 - 1
tools/travis/travis_osx_script.sh

@@ -18,7 +18,7 @@ echo -en 'travis_fold:end:script.build.doc\\r'
 echo "Full Namespace 0 Generation"  && echo -en 'travis_fold:start:script.build.ns0\\r'
 echo "Full Namespace 0 Generation"  && echo -en 'travis_fold:start:script.build.ns0\\r'
 mkdir -p build
 mkdir -p build
 cd build
 cd build
-cmake -DCMAKE_BUILD_TYPE=Debug -DUA_NAMESPACE0_XML=../tools/schema/namespace0/Opc.Ua.NodeSet2.xml -DUA_DATATYPES_FILE=../tools/schema/datatypes_full.txt -DUA_BUILD_EXAMPLES=ON  ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DUA_ENABLE_FULL_NS0=ON -DUA_BUILD_EXAMPLES=ON  ..
 make -j
 make -j
 cd .. && rm -rf build
 cd .. && rm -rf build
 echo -en 'travis_fold:end:script.build.ns0\\r'
 echo -en 'travis_fold:end:script.build.ns0\\r'