Browse Source

fix(ex): change type of resuse and loopback options to UA_TYPES_BOOLEAN

The parameters are evaluated in UA_PubSubChannelUDPMC_open
[plugins/ua_pubsub_udp.c] and are expected to be of type
BOOLEAN. Using UINT32 for either of them will cause the options not to
be evaluated and hence not used.
Florian Huber 4 years ago
parent
commit
5af4e6cd19
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/pubsub/tutorial_pubsub_connection.c

+ 2 - 2
examples/pubsub/tutorial_pubsub_connection.c

@@ -64,10 +64,10 @@ int main(void) {
     UA_Variant_setScalar(&connectionOptions[0].value, &ttl, &UA_TYPES[UA_TYPES_UINT32]);
     connectionOptions[1].key = UA_QUALIFIEDNAME(0, "loopback");
     UA_Boolean loopback = UA_FALSE;
-    UA_Variant_setScalar(&connectionOptions[1].value, &loopback, &UA_TYPES[UA_TYPES_UINT32]);
+    UA_Variant_setScalar(&connectionOptions[1].value, &loopback, &UA_TYPES[UA_TYPES_BOOLEAN]);
     connectionOptions[2].key = UA_QUALIFIEDNAME(0, "reuse");
     UA_Boolean reuse = UA_TRUE;
-    UA_Variant_setScalar(&connectionOptions[2].value, &reuse, &UA_TYPES[UA_TYPES_UINT32]);
+    UA_Variant_setScalar(&connectionOptions[2].value, &reuse, &UA_TYPES[UA_TYPES_BOOLEAN]);
     connectionConfig.connectionProperties = connectionOptions;
     connectionConfig.connectionPropertiesSize = 3;
     /* Create a new concrete connection and add the connection