22 #ifndef INCLUDED_SOAPY_SINK_IMPL_H
23 #define INCLUDED_SOAPY_SINK_IMPL_H
26 #include <boost/bind.hpp>
27 #include <boost/thread/mutex.hpp>
29 #include <SoapySDR/Version.hpp>
30 #include <SoapySDR/Modules.hpp>
31 #include <SoapySDR/Registry.hpp>
32 #include <SoapySDR/Device.hpp>
45 SoapySDR::Device *d_device;
46 SoapySDR::Stream *d_stream;
49 pmt::pmt_t d_message_port;
53 double d_sampling_rate;
55 std::string d_antenna;
57 gr_complex d_dc_offset;
58 bool d_dc_offset_auto_mode;
59 bool d_gain_auto_mode;
60 double d_frequency_correction;
61 gr_complex d_iq_balance;
63 std::string d_clock_source;
64 std::string d_frontend_mapping;
68 const pmt::pmt_t d_length_tag_key;
69 long d_burst_remaining;
71 virtual bool is_gain_valid(
size_t channel, std::string gainType);
73 void register_msg_cmd_handler(
const pmt::pmt_t &cmd,
cmd_handler_t handler);
74 std::map<pmt::pmt_t, cmd_handler_t> d_cmd_handlers;
76 inline io_signature::sptr
77 args_to_io_sig(
const std::string type,
size_t nchan)
86 return io_signature::make(nchan, nchan, size);
89 void tag_work(
int noutput_items);
93 const std::string &args,
double sampling_rate,
94 const std::string &type,
95 const std::string &length_tag_name);
103 gr_vector_const_void_star &input_items,
104 gr_vector_void_star &output_items);
127 void set_frequency(
size_t channel,
const std::string &name,
double frequency);
148 void set_gain(
size_t channel,
const std::string name,
float gain);
189 bool dc_offset_auto_mode);
Sink block implementation for SDR devices.
Definition: sink_impl.h:43
void cmd_handler_antenna(pmt::pmt_t val, size_t chann)
void set_antenna(size_t channel, const std::string &name)
double get_bandwidth(size_t channel)
void set_dc_offset_mode(size_t channel, bool dc_offset_auto_mode)
void set_gain(size_t channel, float gain)
void set_sample_rate(size_t channel, double sample_rate)
void set_iq_balance(size_t channel, gr_complexd iq_balance)
double get_gain(size_t channel)
void set_bandwidth(size_t channel, double bandwidth)
double get_frequency_correction(size_t channel)
std::complex< double > get_dc_offset(size_t channel)
virtual std::vector< std::string > listAntennas(int channel)
void cmd_handler_samp_rate(pmt::pmt_t val, size_t chann)
void set_frequency_correction(size_t channel, double freq_correction)
void set_gain_mode(size_t channel, bool gain_auto_mode)
sink_impl(size_t nchan, const std::string &device, const std::string &args, double sampling_rate, const std::string &type, const std::string &length_tag_name)
void set_frontend_mapping(const std::string &frontend_mapping)
void set_master_clock_rate(double clock_rate)
std::complex< double > get_iq_balance(size_t channel)
double get_master_clock_rate()
void set_frequency(size_t channel, double frequency)
virtual bool DC_offset_support(int channel)
bool get_gain_mode(size_t channel)
void set_clock_source(const std::string &clock_source)
bool get_dc_offset_mode(size_t channel)
void set_frequency(size_t channel, const std::string &name, double frequency)
void set_dc_offset(size_t channel, gr_complexd dc_offset, bool dc_offset_auto_mode)
virtual bool IQ_balance_support(int channel)
double get_sampling_rate(size_t channel)
void cmd_handler_bw(pmt::pmt_t val, size_t chann)
void cmd_handler_frequency(pmt::pmt_t val, size_t chann)
std::string get_clock_source()
void set_gain(size_t channel, const std::string name, float gain)
void msg_handler_command(pmt::pmt_t msg)
void cmd_handler_gain(pmt::pmt_t val, size_t chann)
virtual bool freq_correction_support(int channel)
std::string get_antenna(size_t channel)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
double get_frequency(size_t channel)
boost::function< void(pmt::pmt_t, size_t)> cmd_handler_t
Definition: sink_impl.h:34