mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Adding a TCP telecommand squeleton to the control_thread
This commit is contained in:
parent
6f6bb21c76
commit
18e5339ea1
@ -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
|
||||||
|
@ -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();
|
||||||
@ -169,10 +178,12 @@ void ControlThread::run()
|
|||||||
#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";
|
||||||
|
@ -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_;
|
||||||
|
Loading…
Reference in New Issue
Block a user