GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
nav_msg_udp_listener.h
Go to the documentation of this file.
1 /*!
2  * \file nav_msg_udp_listener.h
3  * \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
4  *
5  * -----------------------------------------------------------------------------
6  *
7  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
8  * This file is part of GNSS-SDR.
9  *
10  * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
11  * SPDX-License-Identifier: BSD-3-Clause
12  *
13  * -----------------------------------------------------------------------------
14  */
15 
16 #ifndef GNSS_SDR_NAV_MSG_UDP_LISTENER_H
17 #define GNSS_SDR_NAV_MSG_UDP_LISTENER_H
18 
19 #include "nav_message.pb.h"
20 #include <boost/asio.hpp>
21 
23 {
24 public:
25  explicit Nav_Msg_Udp_Listener(unsigned short port);
26  void print_message(gnss_sdr::navMsg &message) const;
27  bool receive_and_parse_nav_message(gnss_sdr::navMsg &message);
28 
29 private:
30  boost::asio::io_service io_service;
31  boost::asio::ip::udp::socket socket;
32  boost::system::error_code error;
33  boost::asio::ip::udp::endpoint endpoint;
34 };
35 
36 #endif