GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
ppstcprx.h
Go to the documentation of this file.
1/*!
2 * \file ppstcprx.h
3 * \brief TCP client class for front-end PPS samplestamp information reception
4 * \author Javier Arribas, jarribas(at)cttc.es
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-2023 (see AUTHORS file for a list of contributors)
11 * SPDX-License-Identifier: GPL-3.0-or-later
12 *
13 * -----------------------------------------------------------------------------
14 */
15
16#ifndef SRC_LIBS_PPSTCPRX_H_
17#define SRC_LIBS_PPSTCPRX_H_
18#include "concurrent_queue.h"
19#include "pps_samplestamp.h"
20#include <arpa/inet.h>
21#include <memory>
22#include <netinet/in.h>
23#include <string>
24#include <sys/socket.h>
25#include <sys/types.h>
26
27class pps_tcp_rx
28{
29private:
30 std::shared_ptr<Concurrent_Queue<PpsSamplestamp>> Pps_queue;
31 int clientSd{-1};
32
33public:
34 volatile bool is_connected{false};
35 pps_tcp_rx() = default;
36 virtual ~pps_tcp_rx() = default;
37
38 void receive_pps(const std::string& ip_address, int port);
39 bool send_cmd(std::string cmd) const;
40
41 void set_pps_samplestamp_queue(std::shared_ptr<Concurrent_Queue<PpsSamplestamp>> queue);
42};
43
44#endif /* SRC_LIBS_PPSTCPRX_H_ */
This class implements a thread-safe std::queue.
Interface of a thread-safe std::queue.
A simple container for the sample count associated to PPS rising edge.