From 558593cf757edc2475f59b3b9e98349a12747a4f Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:01:36 +0200 Subject: [PATCH] Refs #20823: Initialize interval in publisher Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- examples/cpp/content_filter/CLIParser.hpp | 4 ++-- examples/cpp/content_filter/PublisherApp.cpp | 1 + examples/cpp/content_filter/PublisherApp.hpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/cpp/content_filter/CLIParser.hpp b/examples/cpp/content_filter/CLIParser.hpp index 97eb651fd55..28725ece7b5 100644 --- a/examples/cpp/content_filter/CLIParser.hpp +++ b/examples/cpp/content_filter/CLIParser.hpp @@ -47,7 +47,7 @@ class CLIParser struct publisher_config { uint16_t samples = 0; - uint16_t interval = 0; + uint16_t interval = 100; }; //! Subscriber application configuration structure @@ -241,7 +241,7 @@ class CLIParser } else if (config.entity == CLIParser::EntityKind::PUBLISHER) { - EPROSIMA_LOG_ERROR(CLI_PARSER, "fliter option can only be used with the Subscriber"); + EPROSIMA_LOG_ERROR(CLI_PARSER, "filter option can only be used with the Subscriber"); print_help(EXIT_FAILURE); } else diff --git a/examples/cpp/content_filter/PublisherApp.cpp b/examples/cpp/content_filter/PublisherApp.cpp index 1cdb25c88cf..7f107e876e6 100644 --- a/examples/cpp/content_filter/PublisherApp.cpp +++ b/examples/cpp/content_filter/PublisherApp.cpp @@ -49,6 +49,7 @@ PublisherApp::PublisherApp( , matched_(0) , samples_(config.samples) , stop_(false) + , period_ms_(config.interval) { // Initialize internal variables matched_ = 0; diff --git a/examples/cpp/content_filter/PublisherApp.hpp b/examples/cpp/content_filter/PublisherApp.hpp index af831b97648..989024823cb 100644 --- a/examples/cpp/content_filter/PublisherApp.hpp +++ b/examples/cpp/content_filter/PublisherApp.hpp @@ -87,7 +87,7 @@ class PublisherApp : public Application, public DataWriterListener std::atomic stop_; - const uint32_t period_ms_ = 100; // in ms + uint16_t period_ms_ = 100; // in ms }; } // namespace content_filter