Commit 10a953a7 authored by Ivan Tyagov's avatar Ivan Tyagov

Assume that each heart beat requires a Publish event.

parent e48fc6d8
......@@ -149,6 +149,7 @@ void handleCLI(int argc, char **argv) {
I2C_VIRTUAL_MODE = arguments.mode;
I2C_BLOCK_DEVICE_NAME = arguments.device;
HEART_BEAT_INTERVAL = arguments.heart_beat_interval;
PUBLISHING_INTERVAL = HEART_BEAT_INTERVAL; // we assume that each heart_beat leads to a publish event
HEART_BEAT_TIMEOUT_INTERVAL = arguments.heart_beat_timeout_interval;
NETWORK_ADDRESS_URL_DATA_TYPE = arguments.network_address_url_data_type;
USERNAME = arguments.username;
......
......@@ -27,7 +27,7 @@ static int HEART_BEAT_TIMEOUT_INTERVAL = DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL;
unsigned int HEART_BEAT_ID_LIST[] = {0, 0, 0, 0, 0, 0, 0, 0};
// the interval for publishing messages$
const int PUBLISHING_INTERVAL = 10;
static int PUBLISHING_INTERVAL = 10;
// a hard coded writer group, data set and publisher ID$
// (should be same for publisher / subscriber)$
......
......@@ -217,7 +217,7 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
/*monitor variable*/
if (ENABLE_HEART_BEAT_CHECK) {
UA_MonitoredItemCreateRequest monRequest = UA_MonitoredItemCreateRequest_default(newNode);
//monRequest.requestedParameters.samplingInterval = 100.0; /* 100 ms interval */
monRequest.requestedParameters.samplingInterval = PUBLISHING_INTERVAL;
UA_Server_createDataChangeMonitoredItem(server, UA_TIMESTAMPSTORETURN_NEITHER,
monRequest, NULL, dataChangeNotificationCallback);
}
......
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