diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ConfigParser.cpp | 6 | ||||
-rw-r--r-- | src/DabMod.cpp | 2 | ||||
-rw-r--r-- | src/Events.cpp | 10 | ||||
-rw-r--r-- | src/Events.h | 20 | ||||
-rw-r--r-- | src/Utils.cpp | 7 | ||||
-rw-r--r-- | src/Utils.h | 1 |
6 files changed, 20 insertions, 26 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index 5d9f6f3..c92a520 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -38,8 +38,6 @@ #include "Utils.h" #include "Log.h" #include "Events.h" -#include "DabModulator.h" -#include "output/SDR.h" using namespace std; @@ -145,7 +143,11 @@ static void parse_configfile( // log parameters: const string events_endpoint = pt.Get("log.events_endpoint", ""); if (not events_endpoint.empty()) { +#if defined(HAVE_ZEROMQ) events.bind(events_endpoint); +#else + throw std::runtime_error("Cannot configure events sender when compiled without zeromq"); +#endif } if (pt.GetInteger("log.syslog", 0) == 1) { diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 361e0d4..7866818 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -380,7 +380,9 @@ int launch_modulator(int argc, char* argv[]) mod_settings_t mod_settings; parse_args(argc, argv, mod_settings); +#if defined(HAVE_ZEROMQ) etiLog.register_backend(make_shared<LogToEventSender>()); +#endif // defined(HAVE_ZEROMQ) etiLog.level(info) << "Configuration parsed. Starting up version " << #if defined(GITVERSION) diff --git a/src/Events.cpp b/src/Events.cpp index 3171cda..f8cc2b8 100644 --- a/src/Events.cpp +++ b/src/Events.cpp @@ -3,7 +3,7 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2023 + Copyright (C) 2024 Matthias P. Braendli, matthias.braendli@mpb.li http://www.opendigitalradio.org @@ -22,16 +22,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#include <list> #include <string> -#include <iostream> -#include <sstream> -#include <iomanip> #include <string> -#include <algorithm> #include "Events.h" +#if defined(HAVE_ZEROMQ) + EventSender events; EventSender::EventSender() : @@ -95,3 +92,4 @@ std::string LogToEventSender::get_name() const { return "EventSender"; } +#endif // defined(HAVE_ZEROMQ) diff --git a/src/Events.h b/src/Events.h index 9f838e5..ea1ace2 100644 --- a/src/Events.h +++ b/src/Events.h @@ -3,12 +3,10 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2023 + Copyright (C) 2024 Matthias P. Braendli, matthias.braendli@mpb.li http://www.opendigitalradio.org - - This module adds remote-control capability to some of the dabmux/dabmod modules. */ /* This program is free software: you can redistribute it and/or modify @@ -33,18 +31,9 @@ #if defined(HAVE_ZEROMQ) # include "zmq.hpp" -#endif - -#include <list> -#include <unordered_map> -#include <variant> -#include <map> -#include <memory> -#include <string> -#include <stdexcept> - -#include "Log.h" -#include "Json.h" +# include <string> +# include "Log.h" +# include "Json.h" class EventSender { public: @@ -75,3 +64,4 @@ class LogToEventSender: public LogBackend { * It is constructed in Events.cpp */ extern EventSender events; +#endif // defined(HAVE_ZEROMQ) diff --git a/src/Utils.cpp b/src/Utils.cpp index f54122c..f947acd 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -25,14 +25,17 @@ along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>. */ +#include "Utils.h" + #include <ctime> #include <cstring> #include <sstream> -#include "Utils.h" +#include <iomanip> +#include <pthread.h> #if defined(HAVE_PRCTL) # include <sys/prctl.h> #endif -#include <pthread.h> + static void printHeader() { diff --git a/src/Utils.h b/src/Utils.h index 584a756..b71c3b2 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -37,7 +37,6 @@ #include <cstdio> #include <ctime> #include <cstdlib> -#include <cstdint> #include <unistd.h> #include "ConfigParser.h" |