2012-03-16 10:55:58 +00:00
|
|
|
/*!
|
|
|
|
* \file tcp_communication.h
|
2012-03-24 02:53:00 +00:00
|
|
|
* \brief Interface of the TCP communication class
|
2012-03-16 10:55:58 +00:00
|
|
|
* \author David Pubill, 2011. dpubill(at)cttc.es
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2013-01-28 23:50:09 +00:00
|
|
|
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
|
2012-03-16 10:55:58 +00:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2012-03-24 02:53:00 +00:00
|
|
|
#ifndef GNSS_SDR_TCP_COMMUNICATION_H_
|
|
|
|
#define GNSS_SDR_TCP_COMMUNICATION_H_
|
2012-03-16 10:55:58 +00:00
|
|
|
|
|
|
|
#include <boost/asio.hpp>
|
2012-03-24 02:53:00 +00:00
|
|
|
#include <boost/array.hpp>
|
2012-03-16 10:55:58 +00:00
|
|
|
#include "tcp_packet_data.h"
|
|
|
|
|
2012-10-19 13:38:25 +00:00
|
|
|
#define NUM_TX_VARIABLES_GALILEO_E1 13
|
|
|
|
#define NUM_TX_VARIABLES_GPS_L1_CA 9
|
|
|
|
#define NUM_RX_VARIABLES 4
|
2012-03-24 02:53:00 +00:00
|
|
|
|
2013-01-28 23:50:09 +00:00
|
|
|
/*!
|
|
|
|
* \brief TCP communication class
|
|
|
|
*/
|
2012-03-16 10:55:58 +00:00
|
|
|
class tcp_communication
|
|
|
|
{
|
|
|
|
public:
|
2012-03-24 02:53:00 +00:00
|
|
|
tcp_communication();
|
|
|
|
~tcp_communication();
|
2012-03-16 10:55:58 +00:00
|
|
|
|
2013-01-28 23:50:09 +00:00
|
|
|
int listen_tcp_connection(size_t d_port_, size_t d_port_ch0_);
|
|
|
|
void send_receive_tcp_packet_galileo_e1(boost::array<float, NUM_TX_VARIABLES_GALILEO_E1> buf, tcp_packet_data *tcp_data_);
|
|
|
|
void send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, tcp_packet_data *tcp_data_);
|
|
|
|
void close_tcp_connection(size_t d_port_);
|
2012-03-16 10:55:58 +00:00
|
|
|
|
|
|
|
private:
|
2012-03-24 02:53:00 +00:00
|
|
|
boost::asio::io_service io_service_;
|
|
|
|
boost::asio::ip::tcp::socket tcp_socket_;
|
2012-03-16 10:55:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|