GNSS-SDR  0.0.19
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  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 #ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H
19 #define GNSS_SDR_MONITOR_PVT_UDP_SINK_H
20 
21 #include "monitor_pvt.h"
22 #include "serdes_monitor_pvt.h"
23 #include <boost/asio.hpp>
24 #include <memory>
25 #include <string>
26 #include <vector>
27 
28 /** \addtogroup PVT
29  * \{ */
30 /** \addtogroup PVT_libs
31  * \{ */
32 
33 
34 #if USE_BOOST_ASIO_IO_CONTEXT
35 using b_io_context = boost::asio::io_context;
36 #else
37 using b_io_context = boost::asio::io_service;
38 #endif
39 
41 {
42 public:
43  Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
44  bool write_monitor_pvt(const Monitor_Pvt* const monitor_pvt);
45 
46 private:
47  Serdes_Monitor_Pvt serdes;
48  b_io_context io_context;
49  boost::asio::ip::udp::socket socket;
50  std::vector<boost::asio::ip::udp::endpoint> endpoints;
51  boost::system::error_code error;
52  bool use_protobuf;
53 };
54 
55 
56 /** \} */
57 /** \} */
58 #endif // GNSS_SDR_MONITOR_PVT_UDP_SINK_H
This class contains parameters and outputs of the PVT block.
Definition: monitor_pvt.h:33
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.