GNU Radio's TEST Package
rtl_tcp_source_c.h
Go to the documentation of this file.
1/* -*- mode: c++; c-basic-offset: 2 -*- */
2/*
3 * Copyright 2012 Dimitri Stolnikov <horiz0n@gmx.net>
4 *
5 * GNU Radio is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * GNU Radio is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Radio; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20#ifndef RTL_TCP_SOURCE_C_H
21#define RTL_TCP_SOURCE_C_H
22
23#include <gnuradio/sync_block.h>
24
25#include "source_iface.h"
26
28
29typedef std::shared_ptr< rtl_tcp_source_c > rtl_tcp_source_c_sptr;
30
31rtl_tcp_source_c_sptr make_rtl_tcp_source_c( const std::string & args = "" );
32
34 public gr::sync_block,
35 public source_iface
36{
37private:
38 /* copied from rtl sdr */
39 enum rtlsdr_tuner {
40 RTLSDR_TUNER_UNKNOWN = 0,
41 RTLSDR_TUNER_E4000,
42 RTLSDR_TUNER_FC0012,
43 RTLSDR_TUNER_FC0013,
44 RTLSDR_TUNER_FC2580,
45 RTLSDR_TUNER_R820T,
46 RTLSDR_TUNER_R828D
47 };
48
49 friend rtl_tcp_source_c_sptr make_rtl_tcp_source_c(const std::string &args);
50
51 rtl_tcp_source_c(const std::string &args);
52 const char * get_tuner_name(void);
53
54public:
56
57 int work(int noutput_items,
58 gr_vector_const_void_star &input_items,
59 gr_vector_void_star &output_items);
60
61 std::string name();
62
63 static std::vector< std::string > get_devices( bool fake = false );
64
65 size_t get_num_channels( void );
66
68 double set_sample_rate( double rate );
69 double get_sample_rate( void );
70
72 double set_center_freq( double freq, size_t chan = 0 );
73 double get_center_freq( size_t chan = 0 );
74 double set_freq_corr( double ppm, size_t chan = 0 );
75 double get_freq_corr( size_t chan = 0 );
76
77 std::vector<std::string> get_gain_names( size_t chan = 0 );
79 osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
80 bool set_gain_mode( bool automatic, size_t chan = 0 );
81 bool get_gain_mode( size_t chan = 0 );
82 double set_gain( double gain, size_t chan = 0 );
83 double set_gain( double gain, const std::string & name, size_t chan = 0 );
84 double get_gain( size_t chan = 0 );
85 double get_gain( const std::string & name, size_t chan = 0 );
86
87 double set_if_gain( double gain, size_t chan = 0 );
88
89 std::vector< std::string > get_antennas( size_t chan = 0 );
90 std::string set_antenna( const std::string & antenna, size_t chan = 0 );
91 std::string get_antenna( size_t chan = 0 );
92
93private:
94 int d_socket; // handle to socket
95 double _freq, _rate, _gain, _corr;
96 bool _no_tuner;
97 bool _auto_gain;
98 double _if_gain;
99
100 enum rtlsdr_tuner d_tuner_type;
101 unsigned int d_tuner_gain_count;
102 unsigned int d_tuner_if_gain_count;
103 unsigned char *d_temp_buff; // hold buffer between calls
104 float *d_LUT;
105};
106
107#endif // RTL_TCP_SOURCE_C_H
Definition rtl_tcp_source_c.h:36
double get_gain(const std::string &name, size_t chan=0)
double set_gain(double gain, const std::string &name, size_t chan=0)
std::string name()
osmosdr::freq_range_t get_freq_range(size_t chan=0)
osmosdr::gain_range_t get_gain_range(size_t chan=0)
bool get_gain_mode(size_t chan=0)
static std::vector< std::string > get_devices(bool fake=false)
double set_if_gain(double gain, size_t chan=0)
double get_sample_rate(void)
size_t get_num_channels(void)
double set_center_freq(double freq, size_t chan=0)
friend rtl_tcp_source_c_sptr make_rtl_tcp_source_c(const std::string &args)
double set_gain(double gain, size_t chan=0)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
double set_sample_rate(double rate)
std::string get_antenna(size_t chan=0)
std::vector< std::string > get_antennas(size_t chan=0)
osmosdr::gain_range_t get_gain_range(const std::string &name, size_t chan=0)
double get_freq_corr(size_t chan=0)
bool set_gain_mode(bool automatic, size_t chan=0)
double get_center_freq(size_t chan=0)
double set_freq_corr(double ppm, size_t chan=0)
std::string set_antenna(const std::string &antenna, size_t chan=0)
std::vector< std::string > get_gain_names(size_t chan=0)
osmosdr::meta_range_t get_sample_rates(void)
double get_gain(size_t chan=0)
Definition source_iface.h:33
rtl_tcp_source_c_sptr make_rtl_tcp_source_c(const std::string &args="")
Definition ranges.h:75