Commit 2d578a7c authored by Ivan Tyagov's avatar Ivan Tyagov

Cleanup.

parent 3fda7a8e
...@@ -166,7 +166,7 @@ void callbackTicHeartBeat() ...@@ -166,7 +166,7 @@ void callbackTicHeartBeat()
} }
static void enablePublishHeartBeat(UA_Server *erver, UA_ServerConfig *config){ static void enablePublishHeartBeat(UA_Server *server, UA_ServerConfig *config){
int i; int i;
// add a callback which will increment heart beat tics // add a callback which will increment heart beat tics
UA_UInt64 callbackId = 1; UA_UInt64 callbackId = 1;
...@@ -195,7 +195,6 @@ static void enablePublishHeartBeat(UA_Server *erver, UA_ServerConfig *config){ ...@@ -195,7 +195,6 @@ static void enablePublishHeartBeat(UA_Server *erver, UA_ServerConfig *config){
UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"); UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp");
UA_NetworkAddressUrlDataType networkAddressUrl = UA_NetworkAddressUrlDataType networkAddressUrl =
{UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")}; {UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
addPubSubConnection(server, &transportProfile, &networkAddressUrl); addPubSubConnection(server, &transportProfile, &networkAddressUrl);
addPublishedDataSet(server); addPublishedDataSet(server);
for(i = 0; i < countof(publishedVariableArray); i++) { for(i = 0; i < countof(publishedVariableArray); i++) {
......
...@@ -236,9 +236,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) { ...@@ -236,9 +236,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
pMetaData->fields[1].valueRank = -1; /* scalar */ pMetaData->fields[1].valueRank = -1; /* scalar */
} }
static int enableSubscribeToHeartBeat(UA_Server *erver, UA_ServerConfig *config){ static int enableSubscribeToHeartBeat(UA_Server *server, UA_ServerConfig *config){
// enable subscribe to keep-alive messages // enable subscribe to keep-alive messages
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
UA_String transportProfile = UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"); 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_NetworkAddressUrlDataType networkAddressUrl = {UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
addPubSubConnectionXXX(server, &transportProfile, &networkAddressUrl); addPubSubConnectionXXX(server, &transportProfile, &networkAddressUrl);
......
...@@ -257,6 +257,9 @@ int main(int argc, char **argv) ...@@ -257,6 +257,9 @@ int main(int argc, char **argv)
} }
#endif #endif
// enable protocol for Pub/Sub
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
// enable publish keep-alive messages // enable publish keep-alive messages
if (arguments.heart_beat) { if (arguments.heart_beat) {
enablePublishHeartBeat(server, config); enablePublishHeartBeat(server, config);
......
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