diff options
Diffstat (limited to 'lib/hackrf')
-rw-r--r-- | lib/hackrf/hackrf_sink_c.cc | 4 | ||||
-rw-r--r-- | lib/hackrf/hackrf_source_c.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc index 2c8025b..7aa864d 100644 --- a/lib/hackrf/hackrf_sink_c.cc +++ b/lib/hackrf/hackrf_sink_c.cc @@ -193,9 +193,11 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args) } _dev = NULL; +#ifdef LIBHACKRF_HAVE_DEVICE_LIST if ( hackrf_serial ) ret = hackrf_open_by_serial( hackrf_serial->c_str(), &_dev ); else +#endif ret = hackrf_open( &_dev ); HACKRF_THROW_ON_ERROR(ret, "Failed to open HackRF device") @@ -484,7 +486,7 @@ std::vector<std::string> hackrf_sink_c::get_devices() _usage++; } -#if 1 +#ifdef LIBHACKRF_HAVE_DEVICE_LIST hackrf_device_list_t *list = hackrf_device_list(); for (unsigned int i = 0; i < list->devicecount; i++) { diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc index 64b8f14..13df11e 100644 --- a/lib/hackrf/hackrf_source_c.cc +++ b/lib/hackrf/hackrf_source_c.cc @@ -144,6 +144,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args) _dev = NULL; +#ifdef LIBHACKRF_HAVE_DEVICE_LIST if (dict.count("hackrf") && dict["hackrf"].length() > 0) { hackrf_serial = dict["hackrf"]; @@ -169,6 +170,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args) hackrf_device_list_free(list); } } else +#endif ret = hackrf_open( &_dev ); HACKRF_THROW_ON_ERROR(ret, "Failed to open HackRF device") @@ -399,7 +401,7 @@ std::vector<std::string> hackrf_source_c::get_devices() _usage++; } -#if 1 +#if LIBHACKRF_HAVE_DEVICE_LIST hackrf_device_list_t *list = hackrf_device_list(); for (unsigned int i = 0; i < list->devicecount; i++) { |