Commit a026a9ad authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Precise the networkInterface

parent 45accab3
...@@ -366,19 +366,19 @@ int runPubsub(UA_String *transportProfile, ...@@ -366,19 +366,19 @@ int runPubsub(UA_String *transportProfile,
/* Publishing */ /* Publishing */
addPublishedDataSet(global_server, id); // addPublishedDataSet(global_server, id);
for(size_t i = 0; i < nbVariable; i++) { // for(size_t i = 0; i < nbVariable; i++) {
retval |= addVariable(global_server, variableArray[i]); // retval |= addVariable(global_server, variableArray[i]);
if (retval != UA_STATUSCODE_GOOD) // if (retval != UA_STATUSCODE_GOOD)
return EXIT_FAILURE; // return EXIT_FAILURE;
addDataSetField(global_server, variableArray[i]); // addDataSetField(global_server, variableArray[i]);
} // }
//
addWriterGroup(global_server); // addWriterGroup(global_server);
retval |= addDataSetWriter(global_server); // retval |= addDataSetWriter(global_server);
if (retval != UA_STATUSCODE_GOOD) // if (retval != UA_STATUSCODE_GOOD)
return EXIT_FAILURE; // return EXIT_FAILURE;
//
/* Subscribing */ /* Subscribing */
retval |= addReaderGroup(global_server); retval |= addReaderGroup(global_server);
...@@ -464,7 +464,12 @@ int main(int argc, char **argv) { ...@@ -464,7 +464,12 @@ int main(int argc, char **argv) {
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else if(strncmp(argv[1], "opc.udp://", 10) == 0) { } else if(strncmp(argv[1], "opc.udp://", 10) == 0) {
networkAddressUrl.url = UA_STRING(argv[1]); networkAddressUrl.url = UA_STRING(argv[1]);
drone_id_index = 1; if(argc < 3) {
printf("Error: UDP needs an interface name to know where to listen\n");
return EXIT_FAILURE;
}
networkAddressUrl.networkInterface = UA_STRING(argv[2]);
drone_id_index = 2;
} else if(strncmp(argv[1], "opc.eth://", 10) == 0) { } else if(strncmp(argv[1], "opc.eth://", 10) == 0) {
transportProfile = transportProfile =
UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-eth-uadp"); UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-eth-uadp");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment