diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 86cdf23d5..55c5dee7e 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -41,6 +41,8 @@ #include "gnss_flowgraph.h" #include "file_configuration.h" #include "control_message_factory.h" +#include +#include using google::LogMessage; @@ -102,6 +104,9 @@ void ControlThread::run() return; } + // start the keyboard_listener thread + keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); + // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { @@ -110,8 +115,8 @@ void ControlThread::run() if (control_messages_ != 0) process_control_messages(); } + keyboard_thread_.join(); flowgraph_->stop(); - LOG_AT_LEVEL(INFO) << "Flowgraph stopped"; } @@ -199,3 +204,26 @@ void ControlThread::apply_action(unsigned int what) } +void ControlThread::keyboard_listener() +{ + bool read_keys=true; + char c; + //std::cout<<"Keystroke reader start!"<handle(cmf->GetQueueMessage(200, 0)); + } + delete cmf; + read_keys=false; + } + } + +} + diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 44a98444e..e4922f81c 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -37,6 +37,7 @@ #include #include "control_message_factory.h" +#include class GNSSFlowgraph; class ConfigurationInterface; @@ -123,6 +124,8 @@ private: unsigned int processed_control_messages_; unsigned int applied_actions_; + boost::thread keyboard_thread_; + void keyboard_listener(); }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/