diff options
Diffstat (limited to 'src/Utils.h')
-rw-r--r-- | src/Utils.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/Utils.h b/src/Utils.h index 9e88488..584a756 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -3,7 +3,7 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2023 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -31,12 +31,15 @@ # include "config.h" #endif -#include <stdlib.h> -#include <unistd.h> -#include <stdio.h> -#include <time.h> +#include <optional> #include <string> #include <chrono> +#include <cstdio> +#include <ctime> +#include <cstdlib> +#include <cstdint> +#include <unistd.h> +#include "ConfigParser.h" void printUsage(const char* progName); @@ -44,15 +47,22 @@ void printVersion(void); void printStartupInfo(void); +void printModSettings(const mod_settings_t& mod_settings); + // Set SCHED_RR with priority prio (0=lowest) int set_realtime_prio(int prio); // Set the name of the thread void set_thread_name(const char *name); -// Convert a channel like 10A to a frequency -double parseChannel(const std::string& chan); +// Convert a channel like 10A to a frequency in Hz +double parse_channel(const std::string& chan); + +// Convert a frequency in Hz to a channel. +std::optional<std::string> convert_frequency_to_channel(double frequency); // dabMode is either 1, 2, 3, 4, corresponding to TM I, TM II, TM III and TM IV. // throws a runtime_error if dabMode is not one of these values. std::chrono::milliseconds transmission_frame_duration(unsigned int dabmode); + +time_t get_clock_realtime_seconds(); |