aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rtl/rtl_source_c.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rtl/rtl_source_c.cc')
-rw-r--r--lib/rtl/rtl_source_c.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rtl/rtl_source_c.cc b/lib/rtl/rtl_source_c.cc
index 8a8df7c..a371464 100644
--- a/lib/rtl/rtl_source_c.cc
+++ b/lib/rtl/rtl_source_c.cc
@@ -92,6 +92,7 @@ rtl_source_c::rtl_source_c (const std::string &args)
{
int ret;
int index;
+ int bias_tee = 0;
unsigned int dev_index = 0, rtl_freq = 0, tuner_freq = 0, direct_samp = 0;
unsigned int offset_tune = 0;
char manufact[256];
@@ -150,6 +151,9 @@ rtl_source_c::rtl_source_c (const std::string &args)
if (dict.count("offset_tune"))
offset_tune = boost::lexical_cast< unsigned int >( dict["offset_tune"] );
+ if (dict.count("bias"))
+ bias_tee = boost::lexical_cast<bool>( dict["bias"] );
+
_buf_num = _buf_len = _buf_head = _buf_used = _buf_offset = 0;
if (dict.count("buffers"))
@@ -217,6 +221,10 @@ rtl_source_c::rtl_source_c (const std::string &args)
throw std::runtime_error("Failed to enable offset tuning.");
}
+ ret = rtlsdr_set_bias_tee(_dev, bias_tee);
+ if (ret < 0)
+ throw std::runtime_error("Failed to set bias tee.");
+
ret = rtlsdr_reset_buffer( _dev );
if (ret < 0)
throw std::runtime_error("Failed to reset usb buffers.");