GNU Radio's SDR Package
source_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010-2014 Free Software Foundation, Inc.
3  *
4  * This file is part of GNU Radio
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 
22 #ifndef INCLUDED_GR_SDR_SOURCE_IMPL_H
23 #define INCLUDED_GR_SDR_SOURCE_IMPL_H
24 
25 #include <SoapySDR/Device.hpp>
26 #include <gnuradio/sdr/source.h>
27 
29 {
30 public:
32  SoapySDR::Device *device,
33  SoapySDR::Stream *stream,
34  const std::vector<size_t> &channels,
35  const gr::io_signature::sptr sig);
36  ~gr_sdr_source_impl(void);
37  void set_frontend_map(const std::string &mapping);
38  std::string get_frontend_map();
39  void set_samp_rate(double rate);
40  double get_samp_rate(void);
41  std::vector<double> get_samp_rates(void);
42  void set_center_freq(double freq, size_t chan);
43  double get_center_freq(size_t chan);
44  std::vector<gr::sdr::range_t> get_freq_range(size_t chan);
45  void set_gain(double gain, size_t chan);
46  void set_gain(double gain, const std::string &name, size_t chan);
47  double get_gain(size_t chan);
48  double get_gain(const std::string &name, size_t chan);
49  std::vector<std::string> get_gain_names(size_t chan);
50  gr::sdr::range_t get_gain_range(size_t chan);
51  gr::sdr::range_t get_gain_range(const std::string &name, size_t chan);
52  void set_antenna(const std::string &ant, size_t chan);
53  std::string get_antenna(size_t chan);
54  std::vector<std::string> get_antennas(size_t chan);
55  void set_bandwidth(double bandwidth, size_t chan);
56  double get_bandwidth(size_t chan);
57  std::vector<double> get_bandwidth_range(size_t chan);
58  void set_dc_offset(const std::complex<double> &offset, size_t chan);
59  void set_iq_balance(const std::complex<double> &correction, size_t chan);
60  void set_time_source(const std::string &source);
61  std::string get_time_source();
62  std::vector<std::string> get_time_sources();
63  void set_clock_source(const std::string &source);
64  std::string get_clock_source();
65  std::vector<std::string> get_clock_sources();
66  double get_clock_rate();
67  void set_clock_rate(double rate);
68  int work(int noutput_items,
69  gr_vector_const_void_star &input_items,
70  gr_vector_void_star &output_items);
71  bool start(void);
72  bool stop(void);
73 
74 private:
75  SoapySDR::Device *d_device;
76  SoapySDR::Stream *d_stream;
77  const std::vector<size_t> d_channels;
78 };
79 
80 #endif /* INCLUDED_GR_SDR_SOURCE_IMPL_H */
gr_sdr_source_impl(SoapySDR::Device *device, SoapySDR::Stream *stream, const std::vector< size_t > &channels, const gr::io_signature::sptr sig)
std::string get_antenna(size_t chan)
double get_center_freq(size_t chan)
void set_center_freq(double freq, size_t chan)
void set_frontend_map(const std::string &mapping)
void set_time_source(const std::string &source)
void set_gain(double gain, size_t chan)
std::vector< double > get_bandwidth_range(size_t chan)
std::vector< std::string > get_clock_sources()
std::string get_time_source()
Definition: types.h:39
double get_samp_rate(void)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
double get_clock_rate()
std::vector< gr::sdr::range_t > get_freq_range(size_t chan)
std::vector< std::string > get_gain_names(size_t chan)
void set_iq_balance(const std::complex< double > &correction, size_t chan)
std::vector< double > get_samp_rates(void)
Definition: source_impl.h:28
std::string get_frontend_map()
Definition: source.h:32
std::vector< std::string > get_time_sources()
void set_antenna(const std::string &ant, size_t chan)
double get_gain(size_t chan)
std::string get_clock_source()
void set_bandwidth(double bandwidth, size_t chan)
void set_clock_rate(double rate)
gr::sdr::range_t get_gain_range(size_t chan)
void set_samp_rate(double rate)
void set_dc_offset(const std::complex< double > &offset, size_t chan)
double get_bandwidth(size_t chan)
void set_clock_source(const std::string &source)
std::vector< std::string > get_antennas(size_t chan)