Skip to content

Commit

Permalink
[CTT] Multiple fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jayanth Velusamy <[email protected]>
  • Loading branch information
opcua-tsn-team-kalycito authored and jpfr committed Jul 24, 2019
1 parent 4816ead commit 89ada35
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions examples/server_ctt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions plugins/ua_config_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 3 additions & 11 deletions src/server/ua_server_ns0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion tools/certs/localhost.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]

Expand Down

0 comments on commit 89ada35

Please sign in to comment.