GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
rtl_tcp_dongle_info.h
Go to the documentation of this file.
1 /*!
2  * \file rtl_tcp_dongle_info.h
3  * \brief Interface for a structure sent by rtl_tcp defining the hardware.
4  * \author Anthony Arnold, 2015. anthony.arnold(at)uqconnect.edu.au
5  *
6  * This file contains information taken from librtlsdr:
7  * https://git.osmocom.org/rtl-sdr
8  * -----------------------------------------------------------------------------
9  *
10  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
11  *
12  * GNSS-SDR is a software defined Global Navigation
13  * Satellite Systems receiver
14  *
15  * This file is part of GNSS-SDR.
16  *
17  * SPDX-License-Identifier: GPL-3.0-or-later
18  *
19  * -----------------------------------------------------------------------------
20  */
21 
22 #ifndef GNSS_SDR_RTL_TCP_DONGLE_INFO_H
23 #define GNSS_SDR_RTL_TCP_DONGLE_INFO_H
24 
25 #include <boost/asio/ip/tcp.hpp>
26 
27 /*!
28  * \brief This class represents the dongle information
29  * which is sent by rtl_tcp.
30  */
32 {
33 public:
34  enum
35  {
36  TUNER_UNKNOWN = 0,
37  TUNER_E4000,
38  TUNER_FC0012,
39  TUNER_FC0013,
40  TUNER_FC2580,
41  TUNER_R820T,
42  TUNER_R828D
43  };
44 
46 
47  boost::system::error_code read(boost::asio::ip::tcp::socket &socket);
48 
49  bool is_valid() const;
50 
51  const char *get_type_name() const;
52 
53  double clip_gain(int gain) const;
54 
55  inline uint32_t get_tuner_type() const
56  {
57  return tuner_type_;
58  }
59 
60  inline uint32_t get_tuner_gain_count() const
61  {
62  return tuner_gain_count_;
63  }
64 
65 private:
66  char magic_[4]{};
67  uint32_t tuner_type_;
68  uint32_t tuner_gain_count_;
69 };
70 
71 
72 #endif // GNSS_SDR_RTL_TCP_DONGLE_INFO_H
This class represents the dongle information which is sent by rtl_tcp.