GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
monitor_pvt_udp_sink.h
Go to the documentation of this file.
1 /*!
2  * \file monitor_pvt_udp_sink.h
3  * \brief Interface of a class that sends serialized Monitor_Pvt objects
4  * over udp to one or multiple endpoints
5  * \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 #ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H
22 #define GNSS_SDR_MONITOR_PVT_UDP_SINK_H
23 
24 #include "monitor_pvt.h"
25 #include "serdes_monitor_pvt.h"
26 #include <boost/asio.hpp>
27 #include <memory>
28 #include <string>
29 #include <vector>
30 
31 #if USE_BOOST_ASIO_IO_CONTEXT
32 using b_io_context = boost::asio::io_context;
33 #else
34 using b_io_context = boost::asio::io_service;
35 #endif
36 
38 {
39 public:
40  Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
41  bool write_monitor_pvt(const Monitor_Pvt* const monitor_pvt);
42 
43 private:
44  Serdes_Monitor_Pvt serdes;
45  b_io_context io_context;
46  boost::asio::ip::udp::socket socket;
47  std::vector<boost::asio::ip::udp::endpoint> endpoints;
48  boost::system::error_code error;
49  bool use_protobuf;
50 };
51 
52 
53 #endif // GNSS_SDR_MONITOR_PVT_UDP_SINK_H
This class contains parameters and outputs of the PVT block.
Definition: monitor_pvt.h:29
This class implements serialization and deserialization of Monitor_Pvt objects using Protocol Buffers...
Interface of the Monitor_Pvt class.
Serialization / Deserialization of Monitor_Pvt objects using Protocol Buffers.