GNU Radio's TEST Package
paveldeminsdr_source_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2015 Pavel Demin
4  * Copyright 2012 Dimitri Stolnikov <horiz0n@gmx.net>
5  *
6  * GNU Radio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * GNU Radio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GNU Radio; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 #ifndef PAVELDEMINSDR_SOURCE_C_H
22 #define PAVELDEMINSDR_SOURCE_C_H
23 
24 #include <gnuradio/sync_block.h>
25 
26 #include "source_iface.h"
27 
28 #include "paveldeminsdr_common.h"
29 
30 #define BUF_SIZE_BYTES 65536
31 
33 
34 typedef std::shared_ptr< paveldeminsdr_source_c > paveldeminsdr_source_c_sptr;
35 
36 paveldeminsdr_source_c_sptr make_paveldeminsdr_source_c( const std::string & args = "" );
37 
39  public gr::sync_block,
40  public source_iface
41 {
42 private:
43  friend paveldeminsdr_source_c_sptr make_paveldeminsdr_source_c(const std::string &args);
44 
45  paveldeminsdr_source_c(const std::string &args);
46 
47 public:
49 
50  int work( int noutput_items,
51  gr_vector_const_void_star &input_items,
52  gr_vector_void_star &output_items );
53 
54  std::string name();
55 
56  static std::vector< std::string > get_devices( bool fake = false );
57 
58  size_t get_num_channels( void );
59 
61  double set_sample_rate( double rate );
62  double get_sample_rate( void );
63 
64  osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
65  double set_center_freq( double freq, size_t chan = 0 );
66  double get_center_freq( size_t chan = 0 );
67  double set_freq_corr( double ppm, size_t chan = 0 );
68  double get_freq_corr( size_t chan = 0 );
69 
70  std::vector<std::string> get_gain_names( size_t chan = 0 );
71  osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
72  osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
73  double set_gain( double gain, size_t chan = 0 );
74  double set_gain( double gain, const std::string & name, size_t chan = 0 );
75  double get_gain( size_t chan = 0 );
76  double get_gain( const std::string & name, size_t chan = 0 );
77 
78  std::vector< std::string > get_antennas( size_t chan = 0 );
79  std::string set_antenna( const std::string & antenna, size_t chan = 0 );
80  std::string get_antenna( size_t chan = 0 );
81 
82 private:
83  double _freq, _rate, _corr;
84  uint32_t _rate_value, _freq_value;
85  gr_complex *_buf;
86  SOCKET _socket;
87 };
88 
89 #endif // PAVELDEMINSDR_SOURCE_C_H
double get_center_freq(size_t chan=0)
Definition: source_iface.h:32
double set_gain(double gain, size_t chan=0)
paveldeminsdr_source_c_sptr make_paveldeminsdr_source_c(const std::string &args="")
double set_sample_rate(double rate)
double set_freq_corr(double ppm, size_t chan=0)
#define SOCKET
Definition: paveldeminsdr_common.h:41
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
std::vector< std::string > get_gain_names(size_t chan=0)
Definition: ranges.h:75
double get_gain(size_t chan=0)
Definition: paveldeminsdr_source_c.h:38
std::vector< std::string > get_antennas(size_t chan=0)
double get_freq_corr(size_t chan=0)
osmosdr::freq_range_t get_freq_range(size_t chan=0)
double get_sample_rate(void)
std::string get_antenna(size_t chan=0)
osmosdr::meta_range_t get_sample_rates(void)
static std::vector< std::string > get_devices(bool fake=false)
size_t get_num_channels(void)
double set_center_freq(double freq, size_t chan=0)
friend paveldeminsdr_source_c_sptr make_paveldeminsdr_source_c(const std::string &args)
osmosdr::gain_range_t get_gain_range(size_t chan=0)
std::string set_antenna(const std::string &antenna, size_t chan=0)