Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc
- index 203caf4..9bdcd27 100644
- --- a/lib/uhd/uhd_source_c.cc
- +++ b/lib/uhd/uhd_source_c.cc
- @@ -55,7 +55,8 @@ uhd_source_c::uhd_source_c(const std::string &args) :
- BOOST_FOREACH( dict_t::value_type &entry, dict ) {
- if ( "uhd" != entry.first &&
- "nchan" != entry.first &&
- - "subdev" != entry.first ) {
- + "subdev" != entry.first &&
- + "lo_offset" != entry.first ) {
- arguments += entry.first + "=" + entry.second + ",";
- }
- }
- @@ -66,6 +67,10 @@ uhd_source_c::uhd_source_c(const std::string &args) :
- if (dict.count("subdev"))
- _src->set_subdev_spec( dict["subdev"] );
- +
- + _offset = 0.0;
- + if (dict.count("lo_offset"))
- + _offset = boost::lexical_cast< double >( dict["lo_offset"] );
- for ( size_t i = 0; i < nchan; i++ )
- connect( _src, i, self(), i );
- @@ -167,7 +172,10 @@ osmosdr::freq_range_t uhd_source_c::get_freq_range( size_t chan )
- double uhd_source_c::set_center_freq( double freq, size_t chan )
- {
- - _src->set_center_freq(freq, chan);
- + //advanced tuning with tune_request_t
- + uhd::tune_request_t tune_req(freq, _offset);
- +
- + _src->set_center_freq(tune_req, chan);
- return get_center_freq(chan);
- }
- diff --git a/lib/uhd/uhd_source_c.h b/lib/uhd/uhd_source_c.h
- index 9c193ae..4e1d60c 100644
- --- a/lib/uhd/uhd_source_c.h
- +++ b/lib/uhd/uhd_source_c.h
- @@ -72,12 +72,14 @@ public:
- double get_gain( size_t chan = 0 );
- double get_gain( const std::string & name, size_t chan = 0 );
- +
- std::vector< std::string > get_antennas( size_t chan = 0 );
- std::string set_antenna( const std::string & antenna, size_t chan = 0 );
- std::string get_antenna( size_t chan = 0 );
- private:
- boost::shared_ptr<uhd_usrp_source> _src;
- + double _offset;
- };
- #endif // UHD_SOURCE_C_H
Advertisement
Add Comment
Please, Sign In to add comment