瀏覽代碼

use amalgamated header for the examples

Julius Pfrommer 7 年之前
父節點
當前提交
ce6f56c348

+ 1 - 13
examples/client.c

@@ -1,20 +1,8 @@
 /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_client.h"
-# include "ua_client_highlevel.h"
-# include "ua_nodeids.h"
-# include "ua_network_tcp.h"
-# include "ua_config_standard.h"
-#else
-# include "open62541.h"
-# include <string.h>
-# include <stdlib.h>
-#endif
-
 #include <stdio.h>
+#include "open62541.h"
 
 static void
 handler_TheAnswerChanged(UA_UInt32 monId, UA_DataValue *value, void *context) {

+ 39 - 31
examples/discovery/client_find_servers.c

@@ -7,33 +7,25 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_client.h"
-# include "ua_config_standard.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
+#include "open62541.h"
 
 UA_Logger logger = UA_Log_Stdout;
 
-static UA_StatusCode FindServers(const char* discoveryServerUrl, size_t* registeredServerSize, UA_ApplicationDescription** registeredServers) {
+static UA_StatusCode
+FindServers(const char* discoveryServerUrl, size_t* registeredServerSize,
+            UA_ApplicationDescription** registeredServers) {
     UA_Client *client = UA_Client_new(UA_ClientConfig_standard);
     UA_StatusCode retval = UA_Client_connect(client, discoveryServerUrl);
     if(retval != UA_STATUSCODE_GOOD) {
         UA_Client_delete(client);
         return retval;
     }
-    
 
     UA_FindServersRequest request;
     UA_FindServersRequest_init(&request);
 
-    /*
-     * If you want to find specific servers, you can also include the server URIs in the request:
-     *
-     */
+    /* If you want to find specific servers, you can also include the server
+     * URIs in the request: */
     //request.serverUrisSize = 1;
     //request.serverUris = UA_malloc(sizeof(UA_String));
     //request.serverUris[0] = UA_String_fromChars("open62541.example.server_register");
@@ -61,7 +53,8 @@ static UA_StatusCode FindServers(const char* discoveryServerUrl, size_t* registe
     }
 
     *registeredServerSize = response.serversSize;
-    *registeredServers = (UA_ApplicationDescription*)UA_Array_new(response.serversSize, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]);
+    *registeredServers = (UA_ApplicationDescription*)UA_Array_new(response.serversSize,
+                                                                  &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]);
     for(size_t i=0;i<response.serversSize;i++)
         UA_ApplicationDescription_copy(&response.servers[i], &(*registeredServers)[i]);
     UA_FindServersResponse_deleteMembers(&response);
@@ -71,7 +64,9 @@ static UA_StatusCode FindServers(const char* discoveryServerUrl, size_t* registe
     return (int) UA_STATUSCODE_GOOD;
 }
 
-static UA_StatusCode GetEndpoints(UA_Client *client, const UA_String* endpointUrl, size_t* endpointDescriptionsSize, UA_EndpointDescription** endpointDescriptions) {
+static UA_StatusCode
+GetEndpoints(UA_Client *client, const UA_String* endpointUrl, size_t* endpointDescriptionsSize,
+             UA_EndpointDescription** endpointDescriptions) {
     UA_GetEndpointsRequest request;
     UA_GetEndpointsRequest_init(&request);
     //request.requestHeader.authenticationToken = client->authenticationToken;
@@ -86,13 +81,15 @@ static UA_StatusCode GetEndpoints(UA_Client *client, const UA_String* endpointUr
 
     if(response.responseHeader.serviceResult != UA_STATUSCODE_GOOD) {
         UA_LOG_ERROR(logger, UA_LOGCATEGORY_CLIENT,
-                     "GetEndpointRequest failed with statuscode 0x%08x", response.responseHeader.serviceResult);
+                     "GetEndpointRequest failed with statuscode 0x%08x",
+                     response.responseHeader.serviceResult);
         UA_GetEndpointsResponse_deleteMembers(&response);
         return response.responseHeader.serviceResult;
     }
 
     *endpointDescriptionsSize = response.endpointsSize;
-    *endpointDescriptions = (UA_EndpointDescription*)UA_Array_new(response.endpointsSize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
+    *endpointDescriptions = (UA_EndpointDescription*)UA_Array_new(response.endpointsSize,
+                                                                  &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
     for(size_t i=0;i<response.endpointsSize;i++) {
         UA_EndpointDescription_init(&(*endpointDescriptions)[i]);
         UA_EndpointDescription_copy(&response.endpoints[i], &(*endpointDescriptions)[i]);
@@ -106,18 +103,24 @@ int main(void) {
     UA_ApplicationDescription* applicationDescriptionArray = NULL;
     size_t applicationDescriptionArraySize = 0;
 
-    UA_StatusCode retval = FindServers("opc.tcp://localhost:4840", &applicationDescriptionArraySize, &applicationDescriptionArray);
+    UA_StatusCode retval = FindServers("opc.tcp://localhost:4840",
+                                       &applicationDescriptionArraySize,
+                                       &applicationDescriptionArray);
     if(retval != UA_STATUSCODE_GOOD) {
-        UA_LOG_ERROR(logger, UA_LOGCATEGORY_SERVER, "Could not call FindServers service. Is the discovery server started? StatusCode 0x%08x", retval);
+        UA_LOG_ERROR(logger, UA_LOGCATEGORY_SERVER, "Could not call FindServers service. "
+                     "Is the discovery server started? StatusCode %s", UA_StatusCode_name(retval));
         return (int)retval;
     }
 
     // output all the returned/registered servers
     for (size_t i=0; i<applicationDescriptionArraySize; i++) {
         UA_ApplicationDescription *description = &applicationDescriptionArray[i];
-        printf("Server[%lu]: %.*s", (unsigned long)i, (int)description->applicationUri.length, description->applicationUri.data);
-        printf("\n\tName: %.*s", (int)description->applicationName.text.length, description->applicationName.text.data);
-        printf("\n\tProduct URI: %.*s", (int)description->productUri.length, description->productUri.data);
+        printf("Server[%lu]: %.*s", (unsigned long)i, (int)description->applicationUri.length,
+               description->applicationUri.data);
+        printf("\n\tName: %.*s", (int)description->applicationName.text.length,
+               description->applicationName.text.data);
+        printf("\n\tProduct URI: %.*s", (int)description->productUri.length,
+               description->productUri.data);
         printf("\n\tType: ");
         switch(description->applicationType) {
             case UA_APPLICATIONTYPE_SERVER:
@@ -137,7 +140,9 @@ int main(void) {
         }
         printf("\n\tDiscovery URLs:");
         for (size_t j=0; j<description->discoveryUrlsSize; j++) {
-            printf("\n\t\t[%lu]: %.*s", (unsigned long)j, (int)description->discoveryUrls[j].length, description->discoveryUrls[j].data);
+            printf("\n\t\t[%lu]: %.*s", (unsigned long)j,
+                   (int)description->discoveryUrls[j].length,
+                   description->discoveryUrls[j].data);
         }
         printf("\n\n");
     }
@@ -152,11 +157,14 @@ int main(void) {
     for (size_t i=0; i<applicationDescriptionArraySize; i++) {
         UA_ApplicationDescription *description = &applicationDescriptionArray[i];
         if (description->discoveryUrlsSize == 0) {
-            UA_LOG_INFO(logger, UA_LOGCATEGORY_CLIENT, "[GetEndpoints] Server %.*s did not provide any discovery urls. Skipping.", description->applicationUri);
+            UA_LOG_INFO(logger, UA_LOGCATEGORY_CLIENT,
+                        "[GetEndpoints] Server %.*s did not provide any discovery urls. Skipping.",
+                        description->applicationUri);
             continue;
         }
 
-        printf("\nEndpoints for Server[%lu]: %.*s", (unsigned long)i, (int)description->applicationUri.length, description->applicationUri.data);
+        printf("\nEndpoints for Server[%lu]: %.*s", (unsigned long)i,
+               (int)description->applicationUri.length, description->applicationUri.data);
 
         UA_Client *client = UA_Client_new(UA_ClientConfig_standard);
 
@@ -184,19 +192,19 @@ int main(void) {
             UA_EndpointDescription* endpoint = &endpointArray[j];
             printf("\n\tEndpoint[%lu]:",(unsigned long)j);
             printf("\n\t\tEndpoint URL: %.*s", (int)endpoint->endpointUrl.length, endpoint->endpointUrl.data);
-            printf("\n\t\tTransport profile URI: %.*s", (int)endpoint->transportProfileUri.length, endpoint->transportProfileUri.data);
+            printf("\n\t\tTransport profile URI: %.*s", (int)endpoint->transportProfileUri.length,
+                   endpoint->transportProfileUri.data);
         }
 
         UA_Array_delete(endpointArray, endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
-
-
         UA_Client_disconnect(client);
         UA_Client_delete(client);
     }
 
     printf("\n");
 
-    UA_Array_delete(applicationDescriptionArray, applicationDescriptionArraySize, &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]);
+    UA_Array_delete(applicationDescriptionArray, applicationDescriptionArraySize,
+                    &UA_TYPES[UA_TYPES_APPLICATIONDESCRIPTION]);
 
-    return (int) UA_STATUSCODE_GOOD;
+    return (int)UA_STATUSCODE_GOOD;
 }

+ 10 - 16
examples/discovery/server_discovery.c

@@ -8,15 +8,7 @@
 
 #include <stdio.h>
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-#else
-# include "open62541.h"
-#endif
+#include "open62541.h"
 
 UA_Boolean running = true;
 static void stopHandler(int sig) {
@@ -29,12 +21,14 @@ int main(void) {
 
     UA_ServerConfig config = UA_ServerConfig_standard;
     config.applicationDescription.applicationType = UA_APPLICATIONTYPE_DISCOVERYSERVER;
-    config.applicationDescription.applicationUri = UA_String_fromChars("open62541.example.local_discovery_server");
-    // timeout in seconds when to automatically remove a registered server from the list,
-    // if it doesn't re-register within the given time frame. A value of 0 disables automatic removal.
-    // Default is 60 Minutes (60*60). Must be bigger than 10 seconds, because cleanup is only triggered approximately
-    // ervery 10 seconds.
-    // The server will still be removed depending on the state of the semaphore file.
+    config.applicationDescription.applicationUri =
+        UA_String_fromChars("open62541.example.local_discovery_server");
+    /* timeout in seconds when to automatically remove a registered server from
+     * the list, if it doesn't re-register within the given time frame. A value
+     * of 0 disables automatic removal. Default is 60 Minutes (60*60). Must be
+     * bigger than 10 seconds, because cleanup is only triggered approximately
+     * ervery 10 seconds. The server will still be removed depending on the
+     * state of the semaphore file. */
     // config.discoveryCleanupTimeout = 60*60;
     UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 4840);
     config.networkLayers = &nl;
@@ -46,4 +40,4 @@ int main(void) {
     UA_Server_delete(server);
     nl.deleteMembers(&nl);
     return (int)retval;
-}
+}

+ 5 - 18
examples/discovery/server_register.c

@@ -5,31 +5,18 @@
  * Before shutdown it has to unregister itself.
  */
 
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #ifdef _MSC_VER
 # include <io.h> //access
 #else
 # include <unistd.h> //access
 #endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "open62541.h"
 
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
-
-
-UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;
-
+UA_Boolean running = true;
 static void stopHandler(int sign) {
     UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "received ctrl-c");
     running = false;

+ 2 - 11
examples/server.c

@@ -2,25 +2,16 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
 #ifdef _MSC_VER
-#define _CRT_SECURE_NO_WARNINGS //disable fopen deprication warning in msvs
+#define _CRT_SECURE_NO_WARNINGS /* disable fopen deprication warning in msvs */
 #endif
 
-#ifdef UA_NO_AMALGAMATION
-# include <time.h>
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
 
 #include <signal.h>
 #include <errno.h> // errno, EINTR
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "open62541.h"
 
 UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;

+ 0 - 7
examples/server.cpp

@@ -4,14 +4,7 @@
 #include <signal.h>
 #include <iostream>
 #include <cstring>
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_server.h"
-# include "ua_log_stdout.h"
-# include "ua_network_tcp.h"
-#else
 # include "open62541.h"
-#endif
 
 /* Build Instructions (Linux)
  * - gcc -std=c99 -c open62541.c

+ 3 - 14
examples/server_certificate.c

@@ -5,30 +5,19 @@
 #define _CRT_SECURE_NO_WARNINGS //disable fopen deprication warning in msvs
 #endif
 
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_network_tcp.h"
-#include "ua_log_stdout.h"
-#else
-#include "open62541.h"
-#endif
-
-#include <errno.h> // errno, EINTR
 #include <stdio.h>
 #include <signal.h>
+#include <errno.h> // errno, EINTR
 #include <stdlib.h>
+#include "open62541.h"
 
 UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;
 
 static UA_ByteString loadCertificate(void) {
     UA_ByteString certificate = UA_STRING_NULL;
-    FILE *fp = NULL;
     //FIXME: a potiential bug of locating the certificate, we need to get the path from the server's config
-    fp=fopen("server_cert.der", "rb");
-
+    FILE *fp = fopen("server_cert.der", "rb");
     if(!fp) {
         errno = 0; // we read errno also from the tcp layer...
         UA_LOG_ERROR(logger, UA_LOGCATEGORY_SERVER, "Could not open certificate file");

+ 1 - 10
examples/server_datasource.c

@@ -3,16 +3,7 @@
 
 #include <signal.h>
 #include <stdio.h>
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
+#include "open62541.h"
 
 UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;

+ 0 - 8
examples/server_inheritance.c

@@ -2,15 +2,7 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_network_tcp.h"
-#else
 #include "open62541.h"
-#endif
 
 UA_Boolean running = true;
 static void stopHandler(int sig) {

+ 0 - 8
examples/server_instantiation.c

@@ -2,15 +2,7 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_network_tcp.h"
-#else
 #include "open62541.h"
-#endif
 
 UA_Boolean running = true;
 static void stopHandler(int sig) {

+ 1 - 12
examples/server_mainloop.c

@@ -9,22 +9,11 @@
 #else
 # include <sys/select.h>
 #endif
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
 # include "open62541.h"
-#endif
 
 UA_Boolean running = true;
-UA_Logger logger = UA_Log_Stdout;
-
 static void stopHandler(int sign) {
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "received ctrl-c");
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c");
     running = false;
 }
 

+ 4 - 16
examples/server_method.c

@@ -3,20 +3,7 @@
 
 #include <signal.h>
 #include <stdlib.h>
-
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_network_tcp.h"
-#include "ua_log_stdout.h"
-#else
 #include "open62541.h"
-#endif
-
-UA_Boolean running = true;
-UA_Logger logger = UA_Log_Stdout;
-
 
 /* Example 1 */
 static UA_StatusCode
@@ -33,7 +20,7 @@ helloWorldMethod(void *handle, const UA_NodeId *objectId,
     }
     UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
     UA_String_deleteMembers(&tmp);
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "Hello World was called");
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Hello World was called");
     return UA_STATUSCODE_GOOD;
 }
 
@@ -66,12 +53,13 @@ fooBarMethod(void *handle, const UA_NodeId *objectId,
     }
     UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
     UA_String_deleteMembers(&tmp);
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "FooBar was called");
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "FooBar was called");
     return UA_STATUSCODE_GOOD;
 }
 
+UA_Boolean running = true;
 static void stopHandler(int sign) {
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "received ctrl-c");
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c");
     running = 0;
 }
 

+ 8 - 15
examples/server_nodeset.c

@@ -3,25 +3,16 @@
 
 #include <signal.h>
 #include <stdlib.h>
+#include "open62541.h"
 
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
-
-/* files nodeset.h and nodeset.c are created from server_nodeset.xml in the /src_generated directory by CMake */
+/* Files nodeset.h and nodeset.c are created from server_nodeset.xml in the
+ * /src_generated directory by CMake */
 #include "nodeset.h"
 
-UA_Logger logger = UA_Log_Stdout;
 UA_Boolean running = true;
 
 static void stopHandler(int sign) {
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "received ctrl-c");
+    UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c");
     running = false;
 }
 
@@ -37,14 +28,16 @@ int main(int argc, char** argv) {
 
     /* create nodes from nodeset */
     if (nodeset(server) != UA_STATUSCODE_GOOD) {
-		UA_LOG_ERROR(logger, UA_LOGCATEGORY_SERVER, "Namespace index for generated nodeset does not match. The call to the generated method has to be before any other namespace add calls.");
+		UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Namespace index for generated "
+                     "nodeset does not match. The call to the generated method has to be "
+                     "before any other namespace add calls.");
 		UA_Server_delete(server);
 		nl.deleteMembers(&nl);
 		return (int)UA_STATUSCODE_BADUNEXPECTEDERROR;
 	}
 
     /* start server */
-    UA_StatusCode retval = UA_Server_run(server, &running); //UA_blocks until running=false
+    UA_StatusCode retval = UA_Server_run(server, &running);
 
     /* ctrl-c received -> clean up */
     UA_Server_delete(server);

+ 5 - 13
examples/server_readspeed.c

@@ -6,21 +6,13 @@
 
 #include <time.h>
 #include <stdio.h>
+#include "open62541.h"
 
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_types_generated.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-#else
-# include "open62541.h"
 /* include guards to prevent double definitions with open62541.h */
-# define UA_TYPES_H_
-# define UA_SERVER_H_
-# define UA_CONNECTION_H_
-# define UA_TYPES_GENERATED_H_
-#endif
-
+#define UA_TYPES_H_
+#define UA_SERVER_H_
+#define UA_CONNECTION_H_
+#define UA_TYPES_GENERATED_H_
 #include "server/ua_services.h"
 #include "ua_types_encoding_binary.h"
 

+ 1 - 10
examples/server_repeated_job.c

@@ -2,16 +2,7 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-# include "ua_types.h"
-# include "ua_server.h"
-# include "ua_config_standard.h"
-# include "ua_network_tcp.h"
-# include "ua_log_stdout.h"
-#else
-# include "open62541.h"
-#endif
+#include "open62541.h"
 
 UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;

+ 0 - 11
examples/server_udp.c

@@ -4,22 +4,11 @@
  */
 #include <stdio.h>
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_log_stdout.h"
-#include "ua_network_udp.h"
-#else
 #include "open62541.h"
-#endif
-
 
 UA_Logger logger = UA_Log_Stdout;
 
 UA_Boolean running = 1;
-
 static void stopHandler(int sign) {
     printf("Received Ctrl-C\n");
     running = 0;

+ 0 - 9
examples/server_variable.c

@@ -2,16 +2,7 @@
  * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
 
 #include <signal.h>
-
-#ifdef UA_NO_AMALGAMATION
-#include "ua_types.h"
-#include "ua_server.h"
-#include "ua_config_standard.h"
-#include "ua_network_tcp.h"
-#include "ua_log_stdout.h"
-#else
 #include "open62541.h"
-#endif
 
 UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;