Browse Source

[CTT] Multiple fixes

Signed-off-by: Jayanth Velusamy <jayanth.v@kalycito.com>
Jayanth Velusamy 4 years ago
parent
commit
328b63cf36
4 changed files with 9 additions and 14 deletions
  1. 2 0
      examples/server_ctt.c
  2. 3 2
      plugins/ua_config_default.c
  3. 3 11
      src/server/ua_server_ns0.c
  4. 1 1
      tools/certs/localhost.cnf

+ 2 - 0
examples/server_ctt.c

@@ -592,6 +592,8 @@ int main(int argc, char **argv) {
 
     /* Override with a custom access control policy */
     config->accessControl.getUserAccessLevel = getUserAccessLevel_disallowSpecific;
+    UA_String_clear(&config->applicationDescription.applicationUri);
+    config->applicationDescription.applicationUri = UA_String_fromChars("urn:open62541.server.application");
 
     setInformationModel(server);
 

+ 3 - 2
plugins/ua_config_default.c

@@ -55,6 +55,7 @@ const UA_ConnectionConfig UA_ConnectionConfig_default = {
 #define PRODUCT_URI "http://open62541.org"
 #define APPLICATION_NAME "open62541-based OPC UA Application"
 #define APPLICATION_URI "urn:unconfigured:application"
+#define APPLICATION_URI_SERVER "urn:open62541.server.application"
 
 #define STRINGIFY(arg) #arg
 #define VERSION(MAJOR, MINOR, PATCH, LABEL) \
@@ -119,9 +120,9 @@ setDefaultConfig(UA_ServerConfig *conf) {
     #else
     conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__);
     #endif
-    conf->buildInfo.buildDate = 0;
+    conf->buildInfo.buildDate = UA_DateTime_now();
 
-    conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI);
+    conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER);
     conf->applicationDescription.productUri = UA_STRING_ALLOC(PRODUCT_URI);
     conf->applicationDescription.applicationName =
         UA_LOCALIZEDTEXT_ALLOC("en", APPLICATION_NAME);

+ 3 - 11
src/server/ua_server_ns0.c

@@ -790,21 +790,13 @@ UA_Server_initNS0(UA_Server *server) {
                                &maxBrowseContinuationPoints, &UA_TYPES[UA_TYPES_UINT16]);
 
     /* ServerProfileArray */
-    UA_String profileArray[5];
+    UA_String profileArray[2];
     UA_UInt16 profileArraySize = 0;
 #define ADDPROFILEARRAY(x) profileArray[profileArraySize++] = UA_STRING(x)
-    ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/NanoEmbeddedDevice");
-#ifdef UA_ENABLE_NODEMANAGEMENT
-    ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/NodeManagement");
-#endif
+    ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/MicroEmbeddedDevice");
+
 #ifdef UA_ENABLE_METHODCALLS
     ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/Methods");
-#endif
-#ifdef UA_ENABLE_SUBSCRIPTIONS
-    ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/EmbeddedDataChangeSubscription");
-#endif
-#ifdef UA_ENABLE_HISTORIZING
-    ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/HistoricalRawData");
 #endif
     retVal |= writeNs0VariableArray(server, UA_NS0ID_SERVER_SERVERCAPABILITIES_SERVERPROFILEARRAY,
                                     profileArray, profileArraySize, &UA_TYPES[UA_TYPES_STRING]);

+ 1 - 1
tools/certs/localhost.cnf

@@ -231,7 +231,7 @@ DNS.1 = ${hostname}
 DNS.2 = ${hostname}
 IP.1 = ${ipaddress1}
 IP.2 = ${ipaddress2}
-URI.1 = urn:unconfigured:application
+URI.1 = urn:open62541.server.application
 
 [ v3_ca ]