GNU Radio's SOAPY Package
|
Go to the documentation of this file.
23 #ifndef INCLUDED_SOAPY_SOURCE_IMPL_H
24 #define INCLUDED_SOAPY_SOURCE_IMPL_H
27 #include <boost/bind.hpp>
28 #include <boost/thread/mutex.hpp>
30 #include <SoapySDR/Version.hpp>
31 #include <SoapySDR/Modules.hpp>
32 #include <SoapySDR/Registry.hpp>
33 #include <SoapySDR/Device.hpp>
46 const std::string d_dev_str;
47 const std::string d_args;
49 SoapySDR::Device *d_device;
50 SoapySDR::Stream *d_stream;
57 double d_sampling_rate;
59 std::string d_antenna;
61 gr_complexd d_dc_offset;
62 bool d_dc_offset_auto_mode;
63 bool d_gain_auto_mode;
64 double d_frequency_correction;
65 gr_complexd d_iq_balance;
67 std::string d_clock_source;
69 void register_msg_cmd_handler(
const pmt::pmt_t &cmd,
cmd_handler_t handler);
70 std::map<pmt::pmt_t, cmd_handler_t> d_cmd_handlers;
72 inline io_signature::sptr
73 args_to_io_sig(
const std::string type,
size_t nchan)
79 else if (type ==
"sc16") {
82 else if (type ==
"sc8") {
85 else if (type ==
"s16") {
88 else if (type ==
"s8") {
91 return io_signature::make(nchan, nchan, size);
102 makeDevice(
const std::string &argStr);
110 unmakeDevice(SoapySDR::Device *dev);
113 source_impl(
size_t nchan,
const std::string device,
114 const std::string args,
double sampling_rate,
115 const std::string type);
118 virtual bool start();
122 int work(
int noutput_items,
123 gr_vector_const_void_star &input_items,
124 gr_vector_void_star &output_items);
126 virtual std::vector<std::string>
listAntennas(
int channel);
147 void set_frequency(
size_t channel,
const std::string &name,
double frequency);
149 virtual void set_overall_gain(
size_t channel,
float gain,
bool manual_mode);
162 void set_gain(
size_t channel,
float gain);
170 void set_gain(
size_t channel,
const std::string name,
float gain,
210 void set_antenna(
size_t channel,
const std::string &name);
222 bool dc_offset_auto_mode);
void set_clock_source(const std::string &clock_source)
double get_gain(size_t channel)
void set_iq_balance(size_t channel, gr_complexd iq_balance)
boost::function< void(pmt::pmt_t, size_t)> cmd_handler_t
Definition: sink_impl.h:34
void set_frontend_mapping(const std::string &frontend_mapping)
void set_gain_mode(size_t channel, bool gain_auto_mode)
void cmd_handler_bw(pmt::pmt_t val, size_t chann)
virtual bool hasIQBalance(int channel)
std::complex< double > get_dc_offset(size_t channel)
virtual bool hasFrequencyCorrection(int channel)
void set_frequency(size_t channel, double frequency)
void set_master_clock_rate(double clock_rate)
void set_dc_offset(size_t channel, gr_complexd dc_offset, bool dc_offset_auto_mode)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
double get_sampling_rate(size_t channel)
void set_gain(size_t channel, float gain)
virtual void set_overall_gain(size_t channel, float gain, bool manual_mode)
void cmd_handler_antenna(pmt::pmt_t val, size_t chann)
void cmd_handler_gain(pmt::pmt_t val, size_t chann)
void msg_handler_command(pmt::pmt_t msg)
double get_master_clock_rate()
void cmd_handler_samp_rate(pmt::pmt_t val, size_t chann)
Source block implementation for SDR devices.
Definition: source_impl.h:44
double get_frequency_correction(size_t channel)
boost::function< void(pmt::pmt_t, size_t)> cmd_handler_t
Definition: source_impl.h:35
std::string get_antenna(size_t channel)
virtual std::vector< std::string > listAntennas(int channel)
void cmd_handler_frequency(pmt::pmt_t val, size_t chann)
double get_frequency(size_t channel)
virtual bool hasDCOffset(int channel)
std::complex< double > get_iq_balance(size_t channel)
bool get_dc_offset_mode(size_t channel)
void set_bandwidth(size_t channel, double bandwidth)
double get_bandwidth(size_t channel)
void set_dc_offset_mode(size_t channel, bool dc_offset_auto_mode)
void set_sample_rate(size_t channel, double sample_rate)
bool gain_available(size_t channel, const std::string &name)
void set_frequency_correction(size_t channel, double freq_correction)
source_impl(size_t nchan, const std::string device, const std::string args, double sampling_rate, const std::string type)
std::string get_clock_source()
void set_antenna(size_t channel, const std::string &name)
bool get_gain_mode(size_t channel)