aboutsummaryrefslogtreecommitdiffstats
path: root/lib/osmosdr_source_c_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/osmosdr_source_c_impl.cc')
-rw-r--r--lib/osmosdr_source_c_impl.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/osmosdr_source_c_impl.cc b/lib/osmosdr_source_c_impl.cc
index b8e4a2a..b5e34e4 100644
--- a/lib/osmosdr_source_c_impl.cc
+++ b/lib/osmosdr_source_c_impl.cc
@@ -61,6 +61,10 @@
#include <miri_source_c.h>
#endif
+#ifdef ENABLE_HACKRF
+#include <hackrf_source_c.h>
+#endif
+
#include <osmosdr_arg_helpers.h>
/* This avoids throws in ctor of gr_hier_block2, as gnuradio is unable to deal
@@ -113,6 +117,9 @@ osmosdr_source_c_impl::osmosdr_source_c_impl (const std::string &args)
#ifdef ENABLE_MIRI
dev_types.push_back("miri");
#endif
+#ifdef ENABLE_HACKRF
+ dev_types.push_back("hackrf");
+#endif
std::cerr << "gr-osmosdr "
<< GR_OSMOSDR_VERSION " (" GR_OSMOSDR_LIBVER ") "
@@ -155,6 +162,10 @@ osmosdr_source_c_impl::osmosdr_source_c_impl (const std::string &args)
BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
dev_list.push_back( dev );
#endif
+#ifdef ENABLE_HACKRF
+ BOOST_FOREACH( std::string dev, hackrf_source_c::get_devices() )
+ dev_list.push_back( dev );
+#endif
// std::cerr << std::endl;
// BOOST_FOREACH( std::string dev, dev_list )
// std::cerr << "'" << dev << "'" << std::endl;
@@ -226,6 +237,13 @@ osmosdr_source_c_impl::osmosdr_source_c_impl (const std::string &args)
}
#endif
+#ifdef ENABLE_HACKRF
+ if ( dict.count("hackrf") ) {
+ hackrf_source_c_sptr src = make_hackrf_source_c( arg );
+ block = src; iface = src.get();
+ }
+#endif
+
if ( iface != NULL && long(block.get()) != 0 ) {
_devs.push_back( iface );