瀏覽代碼

adding type definitions to nodes in ns0

Stasik0 10 年之前
父節點
當前提交
6be893fa2a
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/server/ua_server.c

+ 10 - 0
src/server/ua_server.c

@@ -716,6 +716,10 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
         UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE));
     ADDREFERENCE(UA_NODEID_NUMERIC(0, UA_NS0ID_VIEWSFOLDER), UA_NODEID_NUMERIC(0, UA_NS0ID_HASTYPEDEFINITION),
         UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_FOLDERTYPE));
+    addObjectTypeNode(server, "ServerDiagnosticsType", UA_NS0ID_SERVERDIAGNOSTICSTYPE, UA_NS0ID_BASEOBJECTTYPE, UA_NS0ID_HASSUBTYPE);
+    addObjectTypeNode(server, "ServerCapatilitiesType", UA_NS0ID_SERVERCAPABILITIESTYPE, UA_NS0ID_BASEOBJECTTYPE, UA_NS0ID_HASSUBTYPE);
+    addObjectTypeNode(server, "ServerStatusType", UA_NS0ID_SERVERSTATUSTYPE, UA_NS0ID_BASEOBJECTTYPE, UA_NS0ID_HASSUBTYPE);
+
 
     /**************/
     /* Data Types */
@@ -823,6 +827,8 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
    UA_Server_addNode(server, (UA_Node*)servercapablities,
            &UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVER),
            &UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT));
+   ADDREFERENCE(UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERCAPABILITIES), UA_NODEID_NUMERIC(0, UA_NS0ID_HASTYPEDEFINITION),
+       UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVERCAPABILITIESTYPE));
 
    UA_VariableNode *localeIdArray = UA_VariableNode_new();
    copyNames((UA_Node*)localeIdArray, "LocaleIdArray");
@@ -846,6 +852,8 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
    UA_Server_addNode(server, (UA_Node*)serverdiagnostics,
            &UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVER),
            &UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT));
+   ADDREFERENCE(UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERDIAGNOSTICS), UA_NODEID_NUMERIC(0, UA_NS0ID_HASTYPEDEFINITION),
+       UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVERDIAGNOSTICSTYPE));
 
    UA_VariableNode *enabledFlag = UA_VariableNode_new();
    copyNames((UA_Node*)enabledFlag, "EnabledFlag");
@@ -869,6 +877,8 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
        .release = releaseStatus, .write = UA_NULL};
    UA_Server_addNode(server, (UA_Node*)serverstatus, &UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVER),
            &UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT));
+   ADDREFERENCE(UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_SERVERSTATUS), UA_NODEID_NUMERIC(0, UA_NS0ID_HASTYPEDEFINITION),
+       UA_EXPANDEDNODEID_NUMERIC(0, UA_NS0ID_SERVERSTATUSTYPE));
 
    UA_VariableNode *state = UA_VariableNode_new();
    UA_ServerState *stateEnum = UA_ServerState_new();