2018-10-21 17:33:02 +00:00
|
|
|
/*!
|
|
|
|
* \file tcp_cmd_interface.cc
|
|
|
|
*
|
2018-12-11 09:36:15 +00:00
|
|
|
* \brief Class that implements a TCP/IP telecommand command line interface
|
2018-10-21 17:33:02 +00:00
|
|
|
* for GNSS-SDR
|
|
|
|
* \author Javier Arribas jarribas (at) cttc.es
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "tcp_cmd_interface.h"
|
2018-10-23 14:54:06 +00:00
|
|
|
#include "control_message_factory.h"
|
2019-03-05 18:31:41 +00:00
|
|
|
#include "pvt_interface.h"
|
|
|
|
#include <boost/asio.hpp>
|
|
|
|
#include <cmath> // for isnan
|
|
|
|
#include <exception> // for exception
|
|
|
|
#include <iomanip> // for setprecision
|
|
|
|
#include <sstream> // for stringstream
|
|
|
|
#include <utility> // for move
|
2018-10-21 17:33:02 +00:00
|
|
|
|
|
|
|
|
2018-11-24 08:41:21 +00:00
|
|
|
TcpCmdInterface::TcpCmdInterface()
|
|
|
|
{
|
|
|
|
register_functions();
|
|
|
|
keep_running_ = true;
|
|
|
|
control_queue_ = nullptr;
|
|
|
|
rx_latitude_ = 0;
|
|
|
|
rx_longitude_ = 0;
|
|
|
|
rx_altitude_ = 0;
|
|
|
|
receiver_utc_time_ = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-03 10:12:10 +00:00
|
|
|
TcpCmdInterface::~TcpCmdInterface() = default;
|
2018-11-24 08:41:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
void TcpCmdInterface::register_functions()
|
|
|
|
{
|
|
|
|
functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1);
|
|
|
|
functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1);
|
|
|
|
functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1);
|
|
|
|
functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1);
|
|
|
|
functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1);
|
|
|
|
functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1);
|
|
|
|
functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-06 13:39:57 +00:00
|
|
|
void TcpCmdInterface::set_pvt(std::shared_ptr<PvtInterface> PVT_sptr)
|
|
|
|
{
|
2019-02-05 00:31:09 +00:00
|
|
|
PVT_sptr_ = std::move(PVT_sptr);
|
2018-11-06 13:39:57 +00:00
|
|
|
}
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
|
2018-11-05 16:53:53 +00:00
|
|
|
time_t TcpCmdInterface::get_utc_time()
|
|
|
|
{
|
|
|
|
return receiver_utc_time_;
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
2018-11-05 16:53:53 +00:00
|
|
|
arma::vec TcpCmdInterface::get_LLH()
|
|
|
|
{
|
|
|
|
return arma::vec{rx_latitude_, rx_longitude_, rx_altitude_};
|
|
|
|
}
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine __attribute__((unused)))
|
2018-10-23 14:54:06 +00:00
|
|
|
{
|
|
|
|
std::string response;
|
|
|
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
|
|
|
if (control_queue_ != nullptr)
|
|
|
|
{
|
|
|
|
control_queue_->handle(cmf->GetQueueMessage(200, 1)); //send the restart message (who=200,what=1)
|
|
|
|
response = "OK\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = "ERROR\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine __attribute__((unused)))
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
|
|
|
std::string response;
|
2018-10-28 10:07:53 +00:00
|
|
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
|
|
|
if (control_queue_ != nullptr)
|
|
|
|
{
|
|
|
|
control_queue_->handle(cmf->GetQueueMessage(300, 10)); //send the standby message (who=300,what=10)
|
|
|
|
response = "OK\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = "ERROR\n";
|
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine __attribute__((unused)))
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-11-06 13:39:57 +00:00
|
|
|
std::stringstream str_stream;
|
2018-10-28 10:07:53 +00:00
|
|
|
//todo: implement the receiver status report
|
2018-11-06 13:39:57 +00:00
|
|
|
|
|
|
|
// str_stream << "-------------------------------------------------------\n";
|
|
|
|
// str_stream << "ch | sys | sig | mode | Tlm | Eph | Doppler | CN0 |\n";
|
|
|
|
// str_stream << " | | | | | | [Hz] | [dB - Hz] |\n";
|
|
|
|
// str_stream << "-------------------------------------------------------\n";
|
|
|
|
// int n_ch = 10;
|
|
|
|
// for (int n = 0; n < n_ch; n++)
|
|
|
|
// {
|
|
|
|
// str_stream << n << "GPS | L1CA | TRK | YES | YES | 23412.4 | 44.3 |\n";
|
|
|
|
// }
|
|
|
|
// str_stream << "--------------------------------------------------------\n";
|
|
|
|
|
|
|
|
double longitude_deg, latitude_deg, height_m, ground_speed_kmh, course_over_ground_deg;
|
|
|
|
time_t UTC_time;
|
|
|
|
if (PVT_sptr_->get_latest_PVT(&longitude_deg,
|
|
|
|
&latitude_deg,
|
|
|
|
&height_m,
|
|
|
|
&ground_speed_kmh,
|
|
|
|
&course_over_ground_deg,
|
|
|
|
&UTC_time) == true)
|
|
|
|
{
|
2018-12-03 09:05:47 +00:00
|
|
|
struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr};
|
2018-11-06 13:39:57 +00:00
|
|
|
char buf1[80];
|
|
|
|
tstruct = *gmtime(&UTC_time);
|
|
|
|
strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct);
|
|
|
|
std::string str_time = std::string(buf1);
|
|
|
|
str_stream << "- Receiver UTC Time: " << str_time << std::endl;
|
|
|
|
str_stream << std::setprecision(9);
|
|
|
|
str_stream << "- Receiver Position WGS84 [Lat, Long, H]: "
|
|
|
|
<< latitude_deg << ", "
|
|
|
|
<< longitude_deg << ", ";
|
|
|
|
str_stream << std::setprecision(3);
|
|
|
|
str_stream << height_m << std::endl;
|
|
|
|
str_stream << std::setprecision(1);
|
|
|
|
str_stream << "- Receiver Speed over Ground [km/h]: " << ground_speed_kmh << std::endl;
|
|
|
|
str_stream << "- Receiver Course over ground [deg]: " << course_over_ground_deg << std::endl;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
str_stream << "No PVT information available.\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return str_stream.str();
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
2018-10-28 10:07:53 +00:00
|
|
|
std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLine)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
|
|
|
std::string response;
|
2018-11-05 16:53:53 +00:00
|
|
|
if (commandLine.size() > 5)
|
2018-10-28 10:07:53 +00:00
|
|
|
{
|
2019-05-07 16:24:38 +00:00
|
|
|
std::string tmp_str;
|
2018-11-20 21:01:48 +00:00
|
|
|
// Read commandline time parameter
|
2018-12-03 09:05:47 +00:00
|
|
|
struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr};
|
2019-05-07 16:24:38 +00:00
|
|
|
tmp_str = commandLine.at(1) + commandLine.at(2);
|
|
|
|
if (strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr)
|
2018-11-24 08:41:21 +00:00
|
|
|
{
|
|
|
|
response = "ERROR: time parameter malformed\n";
|
|
|
|
return response;
|
|
|
|
}
|
2018-11-05 16:53:53 +00:00
|
|
|
receiver_utc_time_ = timegm(&tm);
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
// Read latitude, longitude, and height
|
2018-11-05 16:53:53 +00:00
|
|
|
rx_latitude_ = std::stod(commandLine.at(3).c_str());
|
|
|
|
rx_longitude_ = std::stod(commandLine.at(4).c_str());
|
|
|
|
rx_altitude_ = std::stod(commandLine.at(5).c_str());
|
|
|
|
|
|
|
|
if (std::isnan(rx_latitude_) || std::isnan(rx_longitude_) || std::isnan(rx_altitude_))
|
|
|
|
{
|
|
|
|
response = "ERROR: position malformed\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
|
|
|
if (control_queue_ != nullptr)
|
|
|
|
{
|
|
|
|
control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12)
|
|
|
|
response = "OK\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = "ERROR\n";
|
|
|
|
}
|
|
|
|
}
|
2018-10-28 10:07:53 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-11-20 21:01:48 +00:00
|
|
|
response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S Lat Long H\n";
|
2018-10-28 10:07:53 +00:00
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
2018-10-21 17:33:02 +00:00
|
|
|
std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLine)
|
|
|
|
{
|
|
|
|
std::string response;
|
2018-11-05 16:53:53 +00:00
|
|
|
if (commandLine.size() > 5)
|
2018-10-28 10:07:53 +00:00
|
|
|
{
|
2018-11-05 16:53:53 +00:00
|
|
|
std::string tmp_str;
|
2018-11-20 21:01:48 +00:00
|
|
|
// Read commandline time parameter
|
2018-12-03 09:05:47 +00:00
|
|
|
struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr};
|
2018-11-05 16:53:53 +00:00
|
|
|
tmp_str = commandLine.at(1) + commandLine.at(2);
|
2019-05-07 16:24:38 +00:00
|
|
|
if (strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr)
|
2018-11-24 08:41:21 +00:00
|
|
|
{
|
|
|
|
response = "ERROR: time parameter malformed\n";
|
|
|
|
return response;
|
|
|
|
}
|
2018-11-05 16:53:53 +00:00
|
|
|
receiver_utc_time_ = timegm(&tm);
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
// Read latitude, longitude, and height
|
2018-11-05 16:53:53 +00:00
|
|
|
rx_latitude_ = std::stod(commandLine.at(3).c_str());
|
|
|
|
rx_longitude_ = std::stod(commandLine.at(4).c_str());
|
|
|
|
rx_altitude_ = std::stod(commandLine.at(5).c_str());
|
2019-05-07 16:24:38 +00:00
|
|
|
|
2018-11-05 16:53:53 +00:00
|
|
|
if (std::isnan(rx_latitude_) || std::isnan(rx_longitude_) || std::isnan(rx_altitude_))
|
|
|
|
{
|
|
|
|
response = "ERROR: position malformed\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
|
|
|
if (control_queue_ != nullptr)
|
|
|
|
{
|
2018-11-20 21:01:48 +00:00
|
|
|
control_queue_->handle(cmf->GetQueueMessage(300, 13)); // send the warmstart message (who=300,what=13)
|
2018-11-05 16:53:53 +00:00
|
|
|
response = "OK\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = "ERROR\n";
|
|
|
|
}
|
|
|
|
}
|
2018-10-28 10:07:53 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-11-05 16:53:53 +00:00
|
|
|
response = "ERROR: time parameter not found, please use warmstart %d/%m/%Y %H:%M:%S Lat Long H\n";
|
2018-10-28 10:07:53 +00:00
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine __attribute__((unused)))
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
|
|
|
std::string response;
|
2018-10-28 10:07:53 +00:00
|
|
|
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
|
|
|
if (control_queue_ != nullptr)
|
|
|
|
{
|
2018-11-20 21:01:48 +00:00
|
|
|
control_queue_->handle(cmf->GetQueueMessage(300, 11)); // send the coldstart message (who=300,what=11)
|
2018-10-28 10:07:53 +00:00
|
|
|
response = "OK\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = "ERROR\n";
|
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &commandLine __attribute__((unused)))
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
|
|
|
std::string response;
|
2018-10-28 10:07:53 +00:00
|
|
|
//todo: implement the set satellite command
|
2018-10-21 17:33:02 +00:00
|
|
|
response = "Not implemented\n";
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-10-23 14:54:06 +00:00
|
|
|
void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue)
|
|
|
|
{
|
2019-02-05 00:31:09 +00:00
|
|
|
control_queue_ = std::move(control_queue);
|
2018-10-23 14:54:06 +00:00
|
|
|
}
|
2018-11-20 21:01:48 +00:00
|
|
|
|
|
|
|
|
2018-10-21 17:33:02 +00:00
|
|
|
void TcpCmdInterface::run_cmd_server(int tcp_port)
|
|
|
|
{
|
|
|
|
// Get the port from the parameters
|
|
|
|
uint16_t port = tcp_port;
|
|
|
|
|
|
|
|
// Error to not throw exception
|
|
|
|
boost::system::error_code not_throw;
|
|
|
|
|
|
|
|
// Socket and acceptor
|
2019-05-08 13:23:55 +00:00
|
|
|
boost::asio::io_context context;
|
2018-10-21 19:08:46 +00:00
|
|
|
try
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2019-05-08 13:23:55 +00:00
|
|
|
boost::asio::ip::tcp::acceptor acceptor(context, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port));
|
2018-10-23 14:54:06 +00:00
|
|
|
|
|
|
|
while (keep_running_)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-21 19:08:46 +00:00
|
|
|
try
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface: Telecommand TCP interface listening on port " << tcp_port << std::endl;
|
2018-10-21 17:33:02 +00:00
|
|
|
|
2019-05-08 13:23:55 +00:00
|
|
|
boost::asio::ip::tcp::socket socket(context);
|
2018-10-21 19:08:46 +00:00
|
|
|
acceptor.accept(socket, not_throw);
|
|
|
|
if (not_throw)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface: Error when binding the port in the socket" << std::endl;
|
2018-10-21 19:08:46 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read a message
|
|
|
|
boost::system::error_code error = boost::asio::error::eof;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
std::string response;
|
|
|
|
boost::asio::streambuf b;
|
2018-10-23 14:54:06 +00:00
|
|
|
boost::asio::read_until(socket, b, '\n', error);
|
2018-10-21 19:08:46 +00:00
|
|
|
std::istream is(&b);
|
|
|
|
std::string line;
|
|
|
|
std::getline(is, line);
|
|
|
|
std::istringstream iss(line);
|
|
|
|
std::vector<std::string> cmd_vector(std::istream_iterator<std::string>{iss},
|
|
|
|
std::istream_iterator<std::string>());
|
|
|
|
|
2019-02-05 00:31:09 +00:00
|
|
|
if (!cmd_vector.empty())
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-21 19:08:46 +00:00
|
|
|
try
|
|
|
|
{
|
2018-12-02 04:29:11 +00:00
|
|
|
if (cmd_vector.at(0) == "exit")
|
2018-10-23 14:54:06 +00:00
|
|
|
{
|
|
|
|
error = boost::asio::error::eof;
|
2018-11-20 21:01:48 +00:00
|
|
|
// send cmd response
|
2018-10-28 10:07:53 +00:00
|
|
|
socket.write_some(boost::asio::buffer("OK\n"), not_throw);
|
2018-10-23 14:54:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
response = functions[cmd_vector.at(0)](cmd_vector);
|
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
}
|
2018-11-06 13:39:57 +00:00
|
|
|
catch (const std::bad_function_call &ex)
|
|
|
|
{
|
|
|
|
response = "ERROR: command not found \n ";
|
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
catch (const std::exception &ex)
|
|
|
|
{
|
|
|
|
response = "ERROR: command execution error: " + std::string(ex.what()) + "\n";
|
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
else
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-21 19:08:46 +00:00
|
|
|
response = "ERROR: empty command\n";
|
|
|
|
}
|
|
|
|
|
2018-11-20 21:01:48 +00:00
|
|
|
// send cmd response
|
2018-10-21 19:08:46 +00:00
|
|
|
socket.write_some(boost::asio::buffer(response), not_throw);
|
|
|
|
if (not_throw)
|
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "Error sending(" << not_throw.value() << "): " << not_throw.message() << std::endl;
|
2018-10-21 19:08:46 +00:00
|
|
|
break;
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
|
|
|
}
|
2018-10-23 14:54:06 +00:00
|
|
|
while (error != boost::asio::error::eof);
|
2018-10-21 19:08:46 +00:00
|
|
|
|
|
|
|
if (error == boost::asio::error::eof)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface: EOF detected\n";
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
else
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface unexpected error: " << error << std::endl;
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
|
|
|
|
2018-10-21 19:08:46 +00:00
|
|
|
// Close socket
|
|
|
|
socket.close();
|
|
|
|
}
|
|
|
|
catch (const boost::exception &e)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface: Boost exception " << std::endl;
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
catch (const std::exception &ex)
|
2018-10-21 17:33:02 +00:00
|
|
|
{
|
2018-10-23 14:54:06 +00:00
|
|
|
std::cout << "TcpCmdInterface: Exception " << ex.what() << std::endl;
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-10-21 19:08:46 +00:00
|
|
|
catch (const boost::exception &e)
|
|
|
|
{
|
|
|
|
std::cout << "TCP Command Interface exception: address already in use" << std::endl;
|
|
|
|
}
|
2018-10-21 17:33:02 +00:00
|
|
|
}
|