aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2013-09-28 13:27:58 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2013-09-28 13:49:00 +0200
commitb3bbe0935ede6ba50b39ea94f12c5b9cdda8c51b (patch)
tree0bd7e6b8d75c268dcce3f02806be753930ed61e2 /lib
parent9b41c6aa202f241eaf2d2c42dc9b2943463089d3 (diff)
hackrf: don't set automatic bandwidth on samplerate change
automatic bandwidth selection may be triggered by calling set_bandwidth(0) after changing the sample rate
Diffstat (limited to 'lib')
-rw-r--r--lib/hackrf/hackrf_sink_c.cc9
-rw-r--r--lib/hackrf/hackrf_source_c.cc9
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc
index 37baee5..da19488 100644
--- a/lib/hackrf/hackrf_sink_c.cc
+++ b/lib/hackrf/hackrf_sink_c.cc
@@ -159,7 +159,8 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
_freq_corr(0),
_auto_gain(false),
_amp_gain(0),
- _vga_gain(0)
+ _vga_gain(0),
+ _bandwidth(0)
{
int ret;
@@ -208,8 +209,8 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
<< std::endl;
}
-// set_sample_rate( get_sample_rates().start() );
- set_sample_rate( 10e6 );
+ set_sample_rate( get_sample_rates().start() );
+ set_bandwidth( 0 );
set_gain( 0 ); /* disable AMP gain stage by default */
@@ -495,7 +496,7 @@ double hackrf_sink_c::set_sample_rate( double rate )
ret = hackrf_set_sample_rate( _dev, rate );
if ( HACKRF_SUCCESS == ret ) {
_sample_rate = rate;
- set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
+ //set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
} else {
HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
}
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc
index 6462fa3..74e7980 100644
--- a/lib/hackrf/hackrf_source_c.cc
+++ b/lib/hackrf/hackrf_source_c.cc
@@ -93,7 +93,8 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
_auto_gain(false),
_amp_gain(0),
_lna_gain(0),
- _vga_gain(0)
+ _vga_gain(0),
+ _bandwidth(0)
{
int ret;
@@ -162,8 +163,8 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
<< std::endl;
}
-// set_sample_rate( get_sample_rates().start() );
- set_sample_rate( 10e6 );
+ set_sample_rate( get_sample_rates().start() );
+ set_bandwidth( 0 );
set_gain( 0 ); /* disable AMP gain stage by default */
@@ -387,7 +388,7 @@ double hackrf_source_c::set_sample_rate( double rate )
ret = hackrf_set_sample_rate( _dev, rate );
if ( HACKRF_SUCCESS == ret ) {
_sample_rate = rate;
- set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
+ //set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
} else {
HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
}