aboutsummaryrefslogtreecommitdiffstats
path: root/lib/uhd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uhd')
-rw-r--r--lib/uhd/CMakeLists.txt26
-rw-r--r--lib/uhd/uhd_sink_c.cc15
-rw-r--r--lib/uhd/uhd_source_c.cc15
3 files changed, 29 insertions, 27 deletions
diff --git a/lib/uhd/CMakeLists.txt b/lib/uhd/CMakeLists.txt
index 0ab6508..aba5c77 100644
--- a/lib/uhd/CMakeLists.txt
+++ b/lib/uhd/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of gr-osmosdr
+# This file is part of GNU Radio
#
-# gr-osmosdr is free software; you can redistribute it and/or modify
+# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
-# gr-osmosdr is distributed in the hope that it will be useful,
+# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with gr-osmosdr; see the file COPYING. If not, write to
+# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,19 +21,19 @@
# This file included, use CMake directory variables
########################################################################
-target_include_directories(gnuradio-osmosdr PRIVATE
+include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
- ${gnuradio-uhd_INCLUDE_DIRS}
+ ${GNURADIO_UHD_INCLUDE_DIRS}
${UHD_INCLUDE_DIRS}
)
-APPEND_LIB_LIST(
- gnuradio::gnuradio-uhd
- ${UHD_LIBRARIES}
-)
-
-list(APPEND gr_osmosdr_srcs
+set(uhd_srcs
${CMAKE_CURRENT_SOURCE_DIR}/uhd_sink_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/uhd_source_c.cc
)
-set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
+
+########################################################################
+# Append gnuradio-osmosdr library sources
+########################################################################
+list(APPEND gr_osmosdr_srcs ${uhd_srcs})
+list(APPEND gr_osmosdr_libs ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES})
diff --git a/lib/uhd/uhd_sink_c.cc b/lib/uhd/uhd_sink_c.cc
index 8698f4c..a154556 100644
--- a/lib/uhd/uhd_sink_c.cc
+++ b/lib/uhd/uhd_sink_c.cc
@@ -18,6 +18,7 @@
* Boston, MA 02110-1301, USA.
*/
+#include <boost/foreach.hpp>
#include <boost/assign.hpp>
#include <boost/algorithm/string.hpp>
@@ -70,7 +71,7 @@ uhd_sink_c::uhd_sink_c(const std::string &args) :
_lo_offset = boost::lexical_cast< double >( dict["lo_offset"] );
std::string arguments; // rebuild argument string without internal arguments
- for (dict_t::value_type &entry : dict)
+ BOOST_FOREACH( dict_t::value_type &entry, dict )
{
if ( "cpu_format" == entry.first ||
"otw_format" == entry.first ||
@@ -134,7 +135,7 @@ std::vector< std::string > uhd_sink_c::get_devices()
std::vector< std::string > devices;
uhd::device_addr_t hint;
- for (const uhd::device_addr_t &dev : uhd::device::find(hint))
+ BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
std::string args = "uhd," + dev.to_string();
@@ -189,7 +190,7 @@ osmosdr::meta_range_t uhd_sink_c::get_sample_rates( void )
{
osmosdr::meta_range_t rates;
- for (uhd::range_t rate : _snk->get_samp_rates())
+ BOOST_FOREACH( uhd::range_t rate, _snk->get_samp_rates() )
rates += osmosdr::range_t( rate.start(), rate.stop(), rate.step() );
return rates;
@@ -210,7 +211,7 @@ osmosdr::freq_range_t uhd_sink_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
- for (uhd::range_t freq : _snk->get_freq_range(chan))
+ BOOST_FOREACH( uhd::range_t freq, _snk->get_freq_range(chan) )
range += osmosdr::range_t( freq.start(), freq.stop(), freq.step() );
return range;
@@ -259,7 +260,7 @@ osmosdr::gain_range_t uhd_sink_c::get_gain_range( size_t chan )
{
osmosdr::gain_range_t range;
- for (uhd::range_t gain : _snk->get_gain_range(chan))
+ BOOST_FOREACH( uhd::range_t gain, _snk->get_gain_range(chan) )
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -269,7 +270,7 @@ osmosdr::gain_range_t uhd_sink_c::get_gain_range( const std::string & name, size
{
osmosdr::gain_range_t range;
- for (uhd::range_t gain : _snk->get_gain_range(name, chan))
+ BOOST_FOREACH( uhd::range_t gain, _snk->get_gain_range(name, chan) )
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -350,7 +351,7 @@ osmosdr::freq_range_t uhd_sink_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
- for (uhd::range_t bw : _snk->get_bandwidth_range(chan))
+ BOOST_FOREACH( uhd::range_t bw, _snk->get_bandwidth_range(chan) )
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;
diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc
index f9f9fdd..fc13017 100644
--- a/lib/uhd/uhd_source_c.cc
+++ b/lib/uhd/uhd_source_c.cc
@@ -18,6 +18,7 @@
* Boston, MA 02110-1301, USA.
*/
+#include <boost/foreach.hpp>
#include <boost/assign.hpp>
#include <boost/algorithm/string.hpp>
@@ -71,7 +72,7 @@ uhd_source_c::uhd_source_c(const std::string &args) :
_lo_offset = boost::lexical_cast< double >( dict["lo_offset"] );
std::string arguments; // rebuild argument string without internal arguments
- for (dict_t::value_type &entry : dict)
+ BOOST_FOREACH( dict_t::value_type &entry, dict )
{
if ( "cpu_format" == entry.first ||
"otw_format" == entry.first ||
@@ -135,7 +136,7 @@ std::vector< std::string > uhd_source_c::get_devices()
std::vector< std::string > devices;
uhd::device_addr_t hint;
- for (const uhd::device_addr_t &dev : uhd::device::find(hint))
+ BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
std::string args = "uhd," + dev.to_string();
@@ -190,7 +191,7 @@ osmosdr::meta_range_t uhd_source_c::get_sample_rates( void )
{
osmosdr::meta_range_t rates;
- for (uhd::range_t rate : _src->get_samp_rates())
+ BOOST_FOREACH( uhd::range_t rate, _src->get_samp_rates() )
rates += osmosdr::range_t( rate.start(), rate.stop(), rate.step() );
return rates;
@@ -211,7 +212,7 @@ osmosdr::freq_range_t uhd_source_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
- for (uhd::range_t freq : _src->get_freq_range(chan))
+ BOOST_FOREACH( uhd::range_t freq, _src->get_freq_range(chan) )
range += osmosdr::range_t( freq.start(), freq.stop(), freq.step() );
return range;
@@ -260,7 +261,7 @@ osmosdr::gain_range_t uhd_source_c::get_gain_range( size_t chan )
{
osmosdr::gain_range_t range;
- for (uhd::range_t gain : _src->get_gain_range(chan))
+ BOOST_FOREACH( uhd::range_t gain, _src->get_gain_range(chan) )
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -270,7 +271,7 @@ osmosdr::gain_range_t uhd_source_c::get_gain_range( const std::string & name, si
{
osmosdr::gain_range_t range;
- for (uhd::range_t gain : _src->get_gain_range(name, chan))
+ BOOST_FOREACH( uhd::range_t gain, _src->get_gain_range(name, chan) )
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -382,7 +383,7 @@ osmosdr::freq_range_t uhd_source_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
- for (uhd::range_t bw : _src->get_bandwidth_range(chan))
+ BOOST_FOREACH( uhd::range_t bw, _src->get_bandwidth_range(chan) )
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;