uhd: implement bandwidth controls

standalone
Dimitri Stolnikov 10 years ago
parent 8b2897d767
commit 7b18254262
  1. 22
      lib/uhd/uhd_sink_c.cc
  2. 4
      lib/uhd/uhd_sink_c.h
  3. 22
      lib/uhd/uhd_source_c.cc
  4. 4
      lib/uhd/uhd_source_c.h

@ -262,3 +262,25 @@ std::string uhd_sink_c::get_antenna( size_t chan )
{
return _snk->get_antenna(chan);
}
double uhd_sink_c::set_bandwidth( double bandwidth, size_t chan )
{
_snk->set_bandwidth(bandwidth, chan);
return _snk->get_bandwidth(chan);
}
double uhd_sink_c::get_bandwidth( size_t chan )
{
return _snk->get_bandwidth(chan);
}
osmosdr::freq_range_t uhd_sink_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
BOOST_FOREACH( uhd::range_t bw, _snk->get_bandwidth_range(chan) )
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;
}

@ -71,6 +71,10 @@ public:
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
std::string get_antenna( size_t chan = 0 );
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
double _lo_offset;
gr::uhd::usrp_sink::sptr _snk;

@ -262,3 +262,25 @@ std::string uhd_source_c::get_antenna( size_t chan )
{
return _src->get_antenna(chan);
}
double uhd_source_c::set_bandwidth( double bandwidth, size_t chan )
{
_src->set_bandwidth(bandwidth, chan);
return _src->get_bandwidth(chan);
}
double uhd_source_c::get_bandwidth( size_t chan )
{
return _src->get_bandwidth(chan);
}
osmosdr::freq_range_t uhd_source_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
BOOST_FOREACH( uhd::range_t bw, _src->get_bandwidth_range(chan) )
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;
}

@ -71,6 +71,10 @@ public:
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
std::string get_antenna( size_t chan = 0 );
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
double _lo_offset;
gr::uhd::usrp_source::sptr _src;

Loading…
Cancel
Save