Skip to content

Commit

Permalink
Refactor custom hostname handling for open62541 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
m-meingast committed Oct 10, 2024
1 parent 3232f06 commit 7c1b3a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/com/opc_ua/opcua_local_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ void COPC_UA_Local_Handler::configureUAServer(UA_ServerStrings &paServerStrings,
UA_String serverUrls[1];
size_t serverUrlsSize = 0;
char serverUrlBuffer[512];
#ifdef FORTE_COM_OPC_UA_CUSTOM_HOSTNAME
snprintf(serverUrlBuffer, sizeof(serverUrlBuffer), "opc.tcp://%s:%u", FORTE_COM_OPC_UA_CUSTOM_HOSTNAME, paServerPort);
#else
snprintf(serverUrlBuffer, sizeof(serverUrlBuffer), "opc.tcp://:%u", paServerPort);
#endif
serverUrls[serverUrlsSize] = UA_STRING(serverUrlBuffer);
serverUrlsSize++;
UA_StatusCode retVal = UA_Array_copy(serverUrls, serverUrlsSize, (void**)&paUaServerConfig.serverUrls, &UA_TYPES[UA_TYPES_STRING]);
Expand All @@ -179,10 +183,6 @@ void COPC_UA_Local_Handler::configureUAServer(UA_ServerStrings &paServerStrings,
}
paUaServerConfig.serverUrlsSize = serverUrlsSize;

#ifdef FORTE_COM_OPC_UA_CUSTOM_HOSTNAME

#endif

// delete pre-initialized values
UA_LocalizedText_clear(&paUaServerConfig.applicationDescription.applicationName);
UA_String_clear(&paUaServerConfig.applicationDescription.applicationUri);
Expand Down

0 comments on commit 7c1b3a6

Please sign in to comment.