Commit 6382d317 authored by Ivan Tyagov's avatar Ivan Tyagov

Define in one place only.

parent a022805e
......@@ -191,10 +191,9 @@ static void enablePublishHeartBeat(UA_Server *server, UA_ServerConfig *config){
}
};
UA_String transportProfile =
UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp");
UA_String transportProfile = UA_STRING(DEFAULT_TRANSPORT_PROFILE);
UA_NetworkAddressUrlDataType networkAddressUrl =
{UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
{UA_STRING_NULL , UA_STRING(DEFAULT_NETWORK_ADDRESS_URL)};
addPubSubConnection(server, &transportProfile, &networkAddressUrl);
addPublishedDataSet(server);
for(i = 0; i < countof(publishedVariableArray); i++) {
......
......@@ -238,8 +238,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
static int enableSubscribeToHeartBeat(UA_Server *server, UA_ServerConfig *config){
// enable subscribe to keep-alive messages
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/")};
UA_String transportProfile = UA_STRING(DEFAULT_TRANSPORT_PROFILE);
UA_NetworkAddressUrlDataType networkAddressUrl = {UA_STRING_NULL , UA_STRING(DEFAULT_NETWORK_ADDRESS_URL)};
addPubSubConnectionXXX(server, &transportProfile, &networkAddressUrl);
/* Add ReaderGroup to the created PubSubConnection */
......
......@@ -39,14 +39,18 @@ static int COUPLER_ID = 0;
// global server
UA_Server *server;
#include "keep_alive_publisher.h"
#include "keep_alive_subscriber.h"
// The default port of OPC-UA server
const int DEFAULT_OPC_UA_PORT = 4840;
const int DEFAULT_MODE = 0;
const int DEFAULT_ID = 0;
// OPC UA's Pub/Sub profile
char *DEFAULT_TRANSPORT_PROFILE = "http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp";
char *DEFAULT_NETWORK_ADDRESS_URL = "opc.udp://224.0.0.22:4840/";
#include "keep_alive_publisher.h"
#include "keep_alive_subscriber.h"
// CLI arguments handling
const char *argp_program_version = "OSIE OPC-UA coupler 0.0.1";
const char *argp_program_bug_address = "ivan@nexedi.com";
......
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