aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--grc/gen_osmosdr_blocks.py2
-rw-r--r--lib/airspy/airspy_source_c.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/grc/gen_osmosdr_blocks.py b/grc/gen_osmosdr_blocks.py
index 07d9d79..c002508 100644
--- a/grc/gen_osmosdr_blocks.py
+++ b/grc/gen_osmosdr_blocks.py
@@ -250,7 +250,7 @@ Lines ending with ... mean it's possible to bind devices together by specifying
netsdr=127.0.0.1[:50000][,nchan=2]
sdr-ip=127.0.0.1[:50000]
sdr-iq=/dev/ttyUSB0
- airspy=0
+ airspy=0[,bias=0|1]
#end if
hackrf=0[,buffers=32]
bladerf=0[,fpga='/path/to/the/bitstream.rbf']
diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc
index 2bfef77..bc33fed 100644
--- a/lib/airspy/airspy_source_c.cc
+++ b/lib/airspy/airspy_source_c.cc
@@ -123,6 +123,13 @@ airspy_source_c::airspy_source_c (const std::string &args)
set_if_gain( 0 ); /* preset to a reasonable default (non-GRC use case) */
+ if ( dict.count( "bias" ) )
+ {
+ bool bias = boost::lexical_cast<bool>( dict["bias"] );
+ int ret = airspy_set_rf_bias(_dev, (uint8_t)bias);
+ AIRSPY_THROW_ON_ERROR(ret, "Failed to enable DC bias")
+ }
+
_fifo = new boost::circular_buffer<gr_complex>(5000000);
if (!_fifo) {
throw std::runtime_error( std::string(__FUNCTION__) + " " +