Commit 95a2c16d authored by Ivan Tyagov's avatar Ivan Tyagov

Fix interval

See merge request !27
parents 3b8131cb a3c31269
...@@ -170,6 +170,7 @@ void handleCLI(int argc, char **argv) { ...@@ -170,6 +170,7 @@ void handleCLI(int argc, char **argv) {
ENABLE_HEART_BEAT = arguments.heart_beat; ENABLE_HEART_BEAT = arguments.heart_beat;
X509_KEY_FILENAME = arguments.key; X509_KEY_FILENAME = arguments.key;
X509_CERTIFICATE_FILENAME = arguments.certificate; X509_CERTIFICATE_FILENAME = arguments.certificate;
printf("PUBLISHING_INTERVAL=%d\n", PUBLISHING_INTERVAL);
// convert arguments.slave_address_list -> I2C_SLAVE_ADDR_LIST // convert arguments.slave_address_list -> I2C_SLAVE_ADDR_LIST
i = 0; i = 0;
......
...@@ -168,6 +168,12 @@ int main(int argc, char **argv) ...@@ -168,6 +168,12 @@ int main(int argc, char **argv)
// enable protocol for Pub/Sub // enable protocol for Pub/Sub
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP()); UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
// set for Pub / Sub the minimal and maximal sampling and publishing intervals
UA_DurationRange rangePublishing = {PUBLISHING_INTERVAL, 3600.0 * 1000.0};
UA_DurationRange rangeSampling = {PUBLISHING_INTERVAL, 24.0 * 3600.0 * 1000.0};
config->publishingIntervalLimits = rangePublishing;
config->samplingIntervalLimits = rangeSampling;
// enable publish keep-alive messages // enable publish keep-alive messages
if (ENABLE_HEART_BEAT) { if (ENABLE_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