Commit cb9d8d97 authored by Ivan Tyagov's avatar Ivan Tyagov

Cleanup.

parent 8f399963
......@@ -235,90 +235,3 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
pMetaData->fields[1].name = UA_STRING ("ID (subscribed)");
pMetaData->fields[1].valueRank = -1; /* scalar */
}
/**
* Followed by the main server code, making use of the above definitions */
/*
UA_Boolean running = true;
static void stopHandler(int sign) {
UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c");
running = false;
}
*/
static int run(UA_String *transportProfile, UA_NetworkAddressUrlDataType *networkAddressUrl) {
//signal(SIGINT, stopHandler);
//signal(SIGTERM, stopHandler);
/* Return value initialized to Status Good */
//UA_StatusCode retval = UA_STATUSCODE_GOOD;
//UA_Server *server = UA_Server_new();
//UA_ServerConfig *config = UA_Server_getConfig(server);
//UA_ServerConfig_setMinimal(config, 4801, NULL);
/* Add the PubSub network layer implementation to the server config.
* The TransportLayer is acting as factory to create new connections
* on runtime. Details about the PubSubTransportLayer can be found inside the
* tutorial_pubsub_connection */
//UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
/* API calls */
/* Add PubSubConnection */
//retval |= addPubSubConnection(server, transportProfile, networkAddressUrl);
//if (retval != UA_STATUSCODE_GOOD)
// return EXIT_FAILURE;
/* Add ReaderGroup to the created PubSubConnection */
//retval |= addReaderGroup(server);
//if (retval != UA_STATUSCODE_GOOD)
// return EXIT_FAILURE;
/* Add DataSetReader to the created ReaderGroup */
//retval |= addDataSetReader(server);
//if (retval != UA_STATUSCODE_GOOD)
// return EXIT_FAILURE;
/* Add SubscribedVariables to the created DataSetReader */
//retval |= addSubscribedVariables(server, readerIdentifier);
//if (retval != UA_STATUSCODE_GOOD)
// return EXIT_FAILURE;
//retval = UA_Server_run(server, &running);
//UA_Server_delete(server);
//return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE;
}
/*
static void
usage(char *progname) {
printf("usage: %s <uri> [device]\n", progname);
}
int main(int argc, char **argv) {
UA_String transportProfile = UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp");
UA_NetworkAddressUrlDataType networkAddressUrl = {UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
if(argc > 1) {
if(strcmp(argv[1], "-h") == 0) {
usage(argv[0]);
return EXIT_SUCCESS;
} else if(strncmp(argv[1], "opc.udp://", 10) == 0) {
networkAddressUrl.url = UA_STRING(argv[1]);
} else if(strncmp(argv[1], "opc.eth://", 10) == 0) {
transportProfile =
UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-eth-uadp");
if(argc < 3) {
printf("Error: UADP/ETH needs an interface name\n");
return EXIT_FAILURE;
}
networkAddressUrl.networkInterface = UA_STRING(argv[2]);
networkAddressUrl.url = UA_STRING(argv[1]);
} else {
printf ("Error: unknown URI\n");
return EXIT_FAILURE;
}
}
return run(&transportProfile, &networkAddressUrl);
}
*/
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