1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Adding a TCP telecommand squeleton to the control_thread

This commit is contained in:
Javier 2018-10-19 14:54:03 +02:00
parent 6f6bb21c76
commit 18e5339ea1
3 changed files with 19 additions and 2 deletions

View File

@ -24,6 +24,7 @@ set(GNSS_RECEIVER_SOURCES
gnss_block_factory.cc gnss_block_factory.cc
gnss_flowgraph.cc gnss_flowgraph.cc
in_memory_configuration.cc in_memory_configuration.cc
tcp_cmd_interface.cc
) )
set(GNSS_RECEIVER_HEADERS set(GNSS_RECEIVER_HEADERS

View File

@ -98,6 +98,12 @@ ControlThread::~ControlThread()
} }
void ControlThread::telecommand_listener()
{
int tcp_cmd_port = configuration_->property("Channel.telecontrol_tcp_port", 3333);
cmd_interface_.run_cmd_server(tcp_cmd_port);
}
/* /*
* Runs the control thread that manages the receiver control plane * Runs the control thread that manages the receiver control plane
* *
@ -146,8 +152,11 @@ void ControlThread::run()
keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this);
sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this);
bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); //start the telecommand listener thread
cmd_interface_thread_ = boost::thread(&ControlThread::telecommand_listener, this);
bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false);
if (enable_FPGA == true) if (enable_FPGA == true)
{ {
flowgraph_->start_acquisition_helper(); flowgraph_->start_acquisition_helper();
@ -165,14 +174,16 @@ void ControlThread::run()
stop_ = true; stop_ = true;
flowgraph_->disconnect(); flowgraph_->disconnect();
//Join keyboard thread //Join keyboard thread
#ifdef OLD_BOOST #ifdef OLD_BOOST
keyboard_thread_.timed_join(boost::posix_time::seconds(1)); keyboard_thread_.timed_join(boost::posix_time::seconds(1));
sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); sysv_queue_thread_.timed_join(boost::posix_time::seconds(1));
cmd_interface_thread_.timed_join(boost::posix_time::seconds(1));
#endif #endif
#ifndef OLD_BOOST #ifndef OLD_BOOST
keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
#endif #endif
LOG(INFO) << "Flowgraph stopped"; LOG(INFO) << "Flowgraph stopped";

View File

@ -37,6 +37,7 @@
#include "control_message_factory.h" #include "control_message_factory.h"
#include "gnss_sdr_supl_client.h" #include "gnss_sdr_supl_client.h"
#include "tcp_cmd_interface.h"
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <memory> #include <memory>
@ -113,6 +114,10 @@ public:
} }
private: private:
//Telecommand TCP interface
TcpCmdInterface cmd_interface_;
void telecommand_listener();
boost::thread cmd_interface_thread_;
//SUPL assistance classes //SUPL assistance classes
gnss_sdr_supl_client supl_client_acquisition_; gnss_sdr_supl_client supl_client_acquisition_;
gnss_sdr_supl_client supl_client_ephemeris_; gnss_sdr_supl_client supl_client_ephemeris_;