2019-01-21 10:59:29 +00:00
|
|
|
/*!
|
|
|
|
* \file monitor_pvt_udp_sink.h
|
|
|
|
* \brief Interface of a class that sends serialized Monitor_Pvt objects
|
|
|
|
* over udp to one or multiple endpoints
|
|
|
|
* \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2019-01-21 10:59:29 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2019-01-21 10:59:29 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2019-01-21 10:59:29 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2019-01-21 10:59:29 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H
|
|
|
|
#define GNSS_SDR_MONITOR_PVT_UDP_SINK_H
|
2019-01-21 10:59:29 +00:00
|
|
|
|
|
|
|
#include "monitor_pvt.h"
|
2019-04-20 16:50:22 +00:00
|
|
|
#include "serdes_monitor_pvt.h"
|
2019-01-21 10:59:29 +00:00
|
|
|
#include <boost/asio.hpp>
|
2019-08-17 11:56:54 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2019-01-21 10:59:29 +00:00
|
|
|
|
2020-06-12 22:32:40 +00:00
|
|
|
#if USE_BOOST_ASIO_IO_CONTEXT
|
2019-05-08 14:15:59 +00:00
|
|
|
using b_io_context = boost::asio::io_context;
|
|
|
|
#else
|
|
|
|
using b_io_context = boost::asio::io_service;
|
|
|
|
#endif
|
|
|
|
|
2019-01-21 10:59:29 +00:00
|
|
|
class Monitor_Pvt_Udp_Sink
|
|
|
|
{
|
|
|
|
public:
|
2019-07-11 16:39:28 +00:00
|
|
|
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
|
2020-07-26 21:56:36 +00:00
|
|
|
bool write_monitor_pvt(const Monitor_Pvt* const monitor_pvt);
|
2019-01-21 10:59:29 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-24 09:34:14 +00:00
|
|
|
Serdes_Monitor_Pvt serdes;
|
2019-05-08 14:15:59 +00:00
|
|
|
b_io_context io_context;
|
2019-01-21 10:59:29 +00:00
|
|
|
boost::asio::ip::udp::socket socket;
|
|
|
|
std::vector<boost::asio::ip::udp::endpoint> endpoints;
|
2020-06-24 09:34:14 +00:00
|
|
|
boost::system::error_code error;
|
2019-04-21 11:30:59 +00:00
|
|
|
bool use_protobuf;
|
2019-01-21 10:59:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_MONITOR_PVT_UDP_SINK_H
|