diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index f13e69e5a..47c369270 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -60,6 +60,8 @@ DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 DEFINE_string(RINEX_name, "-", "If defined, specifies the RINEX files base name"); +DEFINE_bool(keyboard, true, "If set to false, it disables the keyboard listener (so the receiver cannot be stopped with [Enter]+q)"); + #if GFLAGS_GREATER_2_0 static bool ValidateC(const char* flagname, const std::string& value) diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index de3daec99..c1aaac5a1 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -59,7 +59,7 @@ const int32_t DEFAULT_CARRIER_SMOOTHING_FACTOR = 200; // Declare flags for PVT DECLARE_string(RINEX_version); //!< If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file. DECLARE_string(RINEX_name); //!< If defined, specifies the RINEX files base name - +DECLARE_bool(keyboard); //!< If set to false, disables the keyboard listener. Only for debug purposes (e.g. ASAN mode termination) /** \} */ /** \} */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 59baf3475..aaef7123a 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -369,7 +369,10 @@ int ControlThread::run() // launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs assist_GNSS(); // start the keyboard_listener thread - keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this); + if (FLAGS_keyboard) + { + keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this); + } sysv_queue_thread_ = std::thread(&ControlThread::sysv_queue_listener, this); // start the telecommand listener thread @@ -405,7 +408,7 @@ int ControlThread::run() #endif // Terminate keyboard thread - if (keyboard_thread_.joinable()) + if (FLAGS_keyboard && keyboard_thread_.joinable()) { pthread_t id = keyboard_thread_.native_handle(); keyboard_thread_.detach();