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

Cleanup.

parent 3fda7a8e
......@@ -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;
// add a callback which will increment heart beat tics
UA_UInt64 callbackId = 1;
......@@ -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_NetworkAddressUrlDataType networkAddressUrl =
{UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
addPubSubConnection(server, &transportProfile, &networkAddressUrl);
addPublishedDataSet(server);
for(i = 0; i < countof(publishedVariableArray); i++) {
......
......@@ -236,9 +236,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
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
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
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/")};
addPubSubConnectionXXX(server, &transportProfile, &networkAddressUrl);
......
......@@ -257,6 +257,9 @@ int main(int argc, char **argv)
}
#endif
// enable protocol for Pub/Sub
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
// enable publish keep-alive messages
if (arguments.heart_beat) {
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