aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2013-06-08 22:16:05 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2013-06-08 22:16:05 +0200
commitf70550fe40c464348725d49f90efbdb9e743eae3 (patch)
treeed7351f8ebfc1806a2b7bfd0405e0e2d7f534b81
parent5a4033869f257914ac0f2aa0024827940f5b0fb4 (diff)
uhd: implement bandwidth controls
-rw-r--r--lib/uhd/uhd_sink_c.cc22
-rw-r--r--lib/uhd/uhd_sink_c.h4
-rw-r--r--lib/uhd/uhd_source_c.cc22
-rw-r--r--lib/uhd/uhd_source_c.h4
4 files changed, 52 insertions, 0 deletions
diff --git a/lib/uhd/uhd_sink_c.cc b/lib/uhd/uhd_sink_c.cc
index 427087e..d7656b3 100644
--- a/lib/uhd/uhd_sink_c.cc
+++ b/lib/uhd/uhd_sink_c.cc
@@ -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;
+}
diff --git a/lib/uhd/uhd_sink_c.h b/lib/uhd/uhd_sink_c.h
index 704fb33..aae0403 100644
--- a/lib/uhd/uhd_sink_c.h
+++ b/lib/uhd/uhd_sink_c.h
@@ -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;
boost::shared_ptr<uhd_usrp_sink> _snk;
diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc
index ec33610..5f2dec6 100644
--- a/lib/uhd/uhd_source_c.cc
+++ b/lib/uhd/uhd_source_c.cc
@@ -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;
+}
diff --git a/lib/uhd/uhd_source_c.h b/lib/uhd/uhd_source_c.h
index 84a7965..d0b6b54 100644
--- a/lib/uhd/uhd_source_c.h
+++ b/lib/uhd/uhd_source_c.h
@@ -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;
boost::shared_ptr<uhd_usrp_source> _src;