diff options
Diffstat (limited to 'lib/hackrf/hackrf_source_c.cc')
-rw-r--r-- | lib/hackrf/hackrf_source_c.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc index 5543ea0..e5db62c 100644 --- a/lib/hackrf/hackrf_source_c.cc +++ b/lib/hackrf/hackrf_source_c.cc @@ -625,13 +625,13 @@ std::string hackrf_source_c::get_antenna( size_t chan ) return "ANT"; } -void hackrf_source_c::set_bandwidth( double bandwidth, size_t chan ) +double hackrf_source_c::set_bandwidth( double bandwidth, size_t chan ) { int ret; // osmosdr::meta_range_t bandwidths = get_bandwidth_range( chan ); - if ( bandwidth == 0.0 ) - return; + if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */ + bandwidth = _sample_rate; if ( _dev ) { /* compute best default value depending on sample rate (auto filter) */ @@ -643,6 +643,8 @@ void hackrf_source_c::set_bandwidth( double bandwidth, size_t chan ) throw std::runtime_error( std::string( __FUNCTION__ ) ); } } + + return _bandwidth; } double hackrf_source_c::get_bandwidth( size_t chan ) |