GNU Radio's SOAPY Package
|
Source block implementation for SDR devices. More...
#include <source_impl.h>
Public Member Functions | |
source_impl (size_t nchan, const std::string &device, const std::string &dev_args, const std::string &stream_args, const std::vector< std::string > &tune_args, const std::vector< std::string > &other_settings, double sampling_rate, const std::string &type) | |
~source_impl () | |
virtual bool | start () |
virtual bool | stop () |
int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) |
std::vector< std::string > | get_antennas (int channel) |
void | set_frequency (size_t channel, double frequency) |
void | set_frequency (size_t channel, const std::string &name, double frequency) |
void | set_gain (size_t channel, float gain) |
void | set_gain (size_t channel, const std::string name, float gain) |
bool | gain_available (size_t channel, const std::string &name) |
void | set_agc (size_t channel, bool enable) |
void | set_sample_rate (size_t channel, double sample_rate) |
void | set_bandwidth (size_t channel, double bandwidth) |
void | set_antenna (size_t channel, const std::string &name) |
void | set_dc_offset (size_t channel, gr_complexd dc_offset) |
void | set_dc_removal (size_t channel, bool automatic) |
void | set_frequency_correction (size_t channel, double freq_correction) |
void | set_iq_balance (size_t channel, gr_complexd iq_balance) |
void | set_master_clock_rate (double clock_rate) |
void | set_clock_source (const std::string &clock_source) |
void | set_frontend_mapping (const std::string &frontend_mapping) |
double | get_frequency (size_t channel) |
double | get_gain (size_t channel) |
bool | get_gain_mode (size_t channel) |
double | get_sampling_rate (size_t channel) |
double | get_bandwidth (size_t channel) |
std::string | get_antenna (size_t channel) |
std::complex< double > | get_dc_offset (size_t channel) |
bool | get_dc_offset_mode (size_t channel) |
double | get_frequency_correction (size_t channel) |
std::complex< double > | get_iq_balance (size_t channel) |
double | get_master_clock_rate () |
std::string | get_clock_source () |
void | msg_handler_command (pmt::pmt_t msg) |
void | cmd_handler_frequency (pmt::pmt_t val, size_t chann) |
void | cmd_handler_gain (pmt::pmt_t val, size_t chann) |
void | cmd_handler_samp_rate (pmt::pmt_t val, size_t chann) |
void | cmd_handler_bw (pmt::pmt_t val, size_t chann) |
void | cmd_handler_antenna (pmt::pmt_t val, size_t chann) |
Additional Inherited Members | |
![]() | |
typedef boost::shared_ptr< source > | sptr |
![]() | |
static sptr | make (size_t nchan, const std::string &device, const std::string &dev_args, const std::string &stream_args, const std::vector< std::string > &tune_args, const std::vector< std::string > &other_settings, double sampling_rate, const std::string &type) |
Return a shared_ptr to a new instance of soapy::source. More... | |
Source block implementation for SDR devices.
gr::soapy::source_impl::source_impl | ( | size_t | nchan, |
const std::string & | device, | ||
const std::string & | dev_args, | ||
const std::string & | stream_args, | ||
const std::vector< std::string > & | tune_args, | ||
const std::vector< std::string > & | other_settings, | ||
double | sampling_rate, | ||
const std::string & | type | ||
) |
gr::soapy::source_impl::~source_impl | ( | ) |
void gr::soapy::source_impl::cmd_handler_antenna | ( | pmt::pmt_t | val, |
size_t | chann | ||
) |
Set the anntena element for the RX chain.
val | name of the anntena |
chann | an available channel on the device |
void gr::soapy::source_impl::cmd_handler_bw | ( | pmt::pmt_t | val, |
size_t | chann | ||
) |
Set the baseband filter width for the RX chain.
val | baseband filter width in Hz |
chann | an available channel on the device |
void gr::soapy::source_impl::cmd_handler_frequency | ( | pmt::pmt_t | val, |
size_t | chann | ||
) |
Set the center frequency of the RX chain.
val | center frequency in Hz |
chann | an available channel on the device |
void gr::soapy::source_impl::cmd_handler_gain | ( | pmt::pmt_t | val, |
size_t | chann | ||
) |
Set the overall gain for the specified chain. The gain will be distributed automatically across available elements according to Soapy API.
val | the new amplification value in dB |
chann | an avalaible channel on the device |
void gr::soapy::source_impl::cmd_handler_samp_rate | ( | pmt::pmt_t | val, |
size_t | chann | ||
) |
Set the baseband sample rate for the RX chain.
val | the sample rate samples per second |
chann | an available channel on the device |
bool gr::soapy::source_impl::gain_available | ( | size_t | channel, |
const std::string & | name | ||
) |
Checks if the specified gain type for the given channel is available
channel | an available channel on the device |
nane | an available gain on the device |
std::string gr::soapy::source_impl::get_antenna | ( | size_t | channel | ) |
Get the selected antenna on RX chain.
channel | an available channel on the device |
|
virtual |
Returns a list with the available antennas for a specific channel
channel | the channel index |
Implements gr::soapy::source.
double gr::soapy::source_impl::get_bandwidth | ( | size_t | channel | ) |
Get baseband filter width of the RX chain.
channel | an available channel on the device |
std::string gr::soapy::source_impl::get_clock_source | ( | ) |
Get the clock source of the device
std::complex<double> gr::soapy::source_impl::get_dc_offset | ( | size_t | channel | ) |
Get the DC offset correction.
channel | an available channel on the device |
bool gr::soapy::source_impl::get_dc_offset_mode | ( | size_t | channel | ) |
Get the automatic DC offset correction mode.
channel | an available channel on the device |
double gr::soapy::source_impl::get_frequency | ( | size_t | channel | ) |
Get the down conversion frequency of the chain.
channel | an available channel on the device |
double gr::soapy::source_impl::get_frequency_correction | ( | size_t | channel | ) |
Get the frequency correction value.
channel | an available channel on the device |
double gr::soapy::source_impl::get_gain | ( | size_t | channel | ) |
Get the overall value of the gain elements in a chain
channel | an available channel on the device |
bool gr::soapy::source_impl::get_gain_mode | ( | size_t | channel | ) |
Get the automatic gain mode on the RX chain.
channel | an available channel on the device |
std::complex<double> gr::soapy::source_impl::get_iq_balance | ( | size_t | channel | ) |
Get the IQ balance correction.
channel | an available channel on the device |
double gr::soapy::source_impl::get_master_clock_rate | ( | ) |
Get the master clock rate of the device.
double gr::soapy::source_impl::get_sampling_rate | ( | size_t | channel | ) |
Get the baseband sample rate of the RX chain.
channel | an available channel on the device |
void gr::soapy::source_impl::msg_handler_command | ( | pmt::pmt_t | msg | ) |
Calls the correct message handler according to the received message symbol. A dictionary with key the handler name is used in order to call the corresponding handler.
msg | a PMT dictionary |
|
virtual |
Set the automatic gain mode for the specified chain if supported. If not supported set gain value manually.
channel | an available channel on the device |
enable | true for automatic gain mode |
Implements gr::soapy::source.
|
virtual |
Set the antenna element for the RX chain.
channel | an available channel on the device |
name | the name of an available antenna |
Implements gr::soapy::source.
|
virtual |
Set the baseband filter width of the RX chain
channel | an available channel on the device |
bandwidth | the baseband filter width in Hz |
Implements gr::soapy::source.
|
virtual |
Set the clock source of the device
clock_source | the name of clock source |
Implements gr::soapy::source.
|
virtual |
Set the dc offset correction for the RX chain. If the dc offset correction automatic mode is on the value is omitted and the device sets the dc offset correction automatically.
channel | an available channel on the device |
dc_offset | the relative correction (1.0 max) |
Implements gr::soapy::source.
|
virtual |
Set automatic DC removal to the RX chain if supported by the device.
channel | an available channel on the device |
automatic | true for automatic DC offset correction |
Implements gr::soapy::source.
|
virtual |
Set the center frequency for the specified RX chain. Default implementation tunes RF component frequency as close as possible to the requested frequency. See specific device module for more information.
channel | an available channel on the device |
frequency | center frequency in Hz |
Implements gr::soapy::source.
|
virtual |
Set the center frequency for the specified RX chain of the element. Default implementation tunes RF component frequency as close as possible to the requested frequency. See specific device module for more information
channel | an available channel on the device |
name | an available element name |
frequency | center frequency in Hz |
Implements gr::soapy::source.
|
virtual |
Set the frequency correction to the RX chain.
channel | an available channel on the device |
freq_correction | the correction value in PPM |
Implements gr::soapy::source.
void gr::soapy::source_impl::set_frontend_mapping | ( | const std::string & | frontend_mapping | ) |
Set the frontend mapping of available DSP units to RF frontends. This mapping controls channel mapping and channel availability.
frontend_mapping | a vendor-specific mapping string |
|
virtual |
Set the overall gain for the specified RX chain. The gain will be distributed automatically across available elements according to Soapy API.
channel | an available channel on the device |
gain | the new amplification value in dB |
Implements gr::soapy::source.
|
virtual |
Set the value for the specified gain for the specified TX chain.
channel | an available channel on the device |
name | an available gain on the device |
gain | gain the new amplification value in dB |
Implements gr::soapy::source.
|
virtual |
Set iq balance correction to the RX chain
channel | an available channel on the device |
iq_balance | the relative correction (1.0 max) |
Implements gr::soapy::source.
|
virtual |
Set the master clock rate of the device
clock_rate | the clock rate in Hz |
Implements gr::soapy::source.
|
virtual |
Set the baseband sample rate for the RX chain.
channel | an available channel on the device |
sample_rate | the sample rate samples per second |
Implements gr::soapy::source.
|
virtual |
|
virtual |
int gr::soapy::source_impl::work | ( | int | noutput_items, |
gr_vector_const_void_star & | input_items, | ||
gr_vector_void_star & | output_items | ||
) |