aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-10-16 16:21:19 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:32 -0800
commitd3a16b702230534f7265613a73204bdb051a458e (patch)
tree5cd9ace71b187aa2c5d8deb5904b14db28dc7c70 /host/lib/usrp/dboard
parentdc698b990d368dfb8641b68dbe32a90079b7bd90 (diff)
downloaduhd-d3a16b702230534f7265613a73204bdb051a458e.tar.gz
uhd-d3a16b702230534f7265613a73204bdb051a458e.tar.bz2
uhd-d3a16b702230534f7265613a73204bdb051a458e.zip
uhd: Replace all occurrences of boost::bind with std::bind
Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_cbx.cpp5
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp24
-rw-r--r--host/lib/usrp/dboard/db_dbsrx2.cpp21
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp25
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.cpp17
-rw-r--r--host/lib/usrp/dboard/db_sbx_version3.cpp5
-rw-r--r--host/lib/usrp/dboard/db_sbx_version4.cpp5
-rw-r--r--host/lib/usrp/dboard/db_tvrx.cpp26
-rw-r--r--host/lib/usrp/dboard/db_tvrx2.cpp15
-rw-r--r--host/lib/usrp/dboard/db_twinrx.cpp16
-rw-r--r--host/lib/usrp/dboard/db_ubx.cpp60
-rw-r--r--host/lib/usrp/dboard/db_wbx_common.cpp11
-rw-r--r--host/lib/usrp/dboard/db_wbx_common.hpp2
-rw-r--r--host/lib/usrp/dboard/db_wbx_simple.cpp9
-rw-r--r--host/lib/usrp/dboard/db_wbx_version2.cpp24
-rw-r--r--host/lib/usrp/dboard/db_wbx_version3.cpp22
-rw-r--r--host/lib/usrp/dboard/db_wbx_version4.cpp22
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp37
18 files changed, 177 insertions, 169 deletions
diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp
index dd0640d00..c08ae11ae 100644
--- a/host/lib/usrp/dboard/db_cbx.cpp
+++ b/host/lib/usrp/dboard/db_cbx.cpp
@@ -8,6 +8,7 @@
#include "db_sbx_common.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/math/special_functions/round.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -19,8 +20,8 @@ using namespace boost::assign;
sbx_xcvr::cbx::cbx(sbx_xcvr *_self_sbx_xcvr) {
//register the handle to our base CBX class
self_base = _self_sbx_xcvr;
- _txlo = max287x_iface::make<max2870>(boost::bind(&sbx_xcvr::cbx::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = max287x_iface::make<max2870>(boost::bind(&sbx_xcvr::cbx::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = max287x_iface::make<max2870>(std::bind(&sbx_xcvr::cbx::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = max287x_iface::make<max2870>(std::bind(&sbx_xcvr::cbx::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
}
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 587158470..6e4d482be 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -10,23 +10,23 @@
// RX IO Functions
#include "max2118_regs.hpp"
-#include <uhd/utils/log.hpp>
-#include <uhd/utils/static.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
-
+#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/types/dict.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <uhd/utils/static.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <utility>
-#include <cmath>
#include <chrono>
+#include <cmath>
+#include <functional>
#include <thread>
+#include <utility>
using namespace uhd;
using namespace uhd::usrp;
@@ -195,16 +195,16 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<std::string>("name")
.set("DBSRX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&dbsrx::get_locked, this));
+ .set_publisher(std::bind(&dbsrx::get_locked, this));
for(const std::string &name: dbsrx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&dbsrx::set_gain, this, _1, name))
+ .set_coercer(std::bind(&dbsrx::set_gain, this, std::placeholders::_1, name))
.set(dbsrx_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(dbsrx_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&dbsrx::set_lo_freq, this, _1));
+ .set_coercer(std::bind(&dbsrx::set_lo_freq, this, std::placeholders::_1));
this->get_rx_subtree()->create<meta_range_t>("freq/range")
.set(dbsrx_freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
@@ -218,7 +218,7 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<bool>("use_lo_offset")
.set(false);
this->get_rx_subtree()->create<double>("bandwidth/value")
- .set_coercer(boost::bind(&dbsrx::set_bandwidth, this, _1));
+ .set_coercer(std::bind(&dbsrx::set_bandwidth, this, std::placeholders::_1));
this->get_rx_subtree()->create<meta_range_t>("bandwidth/range")
.set(dbsrx_bandwidth_range);
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp
index e2505dfd7..2d800467c 100644
--- a/host/lib/usrp/dboard/db_dbsrx2.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx2.cpp
@@ -8,19 +8,20 @@
// No RX IO Pins Used
#include "max2112_regs.hpp"
-#include <uhd/utils/log.hpp>
-#include <uhd/utils/static.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
+#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/types/dict.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <uhd/utils/static.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
-#include <boost/thread.hpp>
#include <boost/math/special_functions/round.hpp>
+#include <boost/thread.hpp>
+#include <functional>
#include <utility>
using namespace uhd;
@@ -176,16 +177,16 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<std::string>("name")
.set("DBSRX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&dbsrx2::get_locked, this));
+ .set_publisher(std::bind(&dbsrx2::get_locked, this));
for(const std::string &name: dbsrx2_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&dbsrx2::set_gain, this, _1, name))
+ .set_coercer(std::bind(&dbsrx2::set_gain, this, std::placeholders::_1, name))
.set(dbsrx2_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(dbsrx2_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&dbsrx2::set_lo_freq, this, _1))
+ .set_coercer(std::bind(&dbsrx2::set_lo_freq, this, std::placeholders::_1))
.set(dbsrx2_freq_range.start());
this->get_rx_subtree()->create<meta_range_t>("freq/range")
.set(dbsrx2_freq_range);
@@ -203,7 +204,7 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){
double codec_rate = this->get_iface()->get_codec_rate(dboard_iface::UNIT_RX);
this->get_rx_subtree()->create<double>("bandwidth/value")
- .set_coercer(boost::bind(&dbsrx2::set_bandwidth, this, _1))
+ .set_coercer(std::bind(&dbsrx2::set_bandwidth, this, std::placeholders::_1))
.set(2.0*(0.8*codec_rate/2.0)); //bandwidth in lowpass, convert to complex bandpass
//default to anti-alias at different codec_rate
this->get_rx_subtree()->create<meta_range_t>("bandwidth/range")
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index f530458ff..1bf4a7228 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -26,18 +26,17 @@
#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
+#include <uhd/usrp/dboard_base.hpp>
+#include <uhd/usrp/dboard_id.hpp>
+#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/utils/algorithm.hpp>
-
-#include <uhd/usrp/dboard_id.hpp>
-#include <uhd/usrp/dboard_base.hpp>
-#include <uhd/usrp/dboard_manager.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -173,20 +172,20 @@ rfx_xcvr::rfx_xcvr(
else this->get_rx_subtree()->create<std::string>("name").set("RFX RX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
+ .set_publisher(std::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
for(const std::string &name: _rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&rfx_xcvr::set_rx_gain, this, _1, name))
+ .set_coercer(std::bind(&rfx_xcvr::set_rx_gain, this, std::placeholders::_1, name))
.set(_rx_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(_rx_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&rfx_xcvr::set_lo_freq, this, dboard_iface::UNIT_RX, _1))
+ .set_coercer(std::bind(&rfx_xcvr::set_lo_freq, this, dboard_iface::UNIT_RX, std::placeholders::_1))
.set((_freq_range.start() + _freq_range.stop())/2.0);
this->get_rx_subtree()->create<meta_range_t>("freq/range").set(_freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&rfx_xcvr::set_rx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&rfx_xcvr::set_rx_ant, this, std::placeholders::_1))
.set("RX2");
this->get_rx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(rfx_rx_antennas);
@@ -209,14 +208,14 @@ rfx_xcvr::rfx_xcvr(
else this->get_tx_subtree()->create<std::string>("name").set("RFX TX");
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_TX));
+ .set_publisher(std::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_TX));
this->get_tx_subtree()->create<int>("gains"); //phony property so this dir exists
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&rfx_xcvr::set_lo_freq, this, dboard_iface::UNIT_TX, _1))
+ .set_coercer(std::bind(&rfx_xcvr::set_lo_freq, this, dboard_iface::UNIT_TX, std::placeholders::_1))
.set((_freq_range.start() + _freq_range.stop())/2.0);
this->get_tx_subtree()->create<meta_range_t>("freq/range").set(_freq_range);
this->get_tx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&rfx_xcvr::set_tx_ant, this, _1)).set(rfx_tx_antennas.at(0));
+ .add_coerced_subscriber(std::bind(&rfx_xcvr::set_tx_ant, this, std::placeholders::_1)).set(rfx_tx_antennas.at(0));
this->get_tx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(rfx_tx_antennas);
this->get_tx_subtree()->create<std::string>("connection").set("IQ");
diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp
index b6eaedc3d..dc49a97aa 100644
--- a/host/lib/usrp/dboard/db_sbx_common.cpp
+++ b/host/lib/usrp/dboard/db_sbx_common.cpp
@@ -6,6 +6,7 @@
//
#include "db_sbx_common.hpp"
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -146,20 +147,20 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){
else this->get_rx_subtree()->create<std::string>("name").set("SBX/CBX RX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
+ .set_publisher(std::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
for(const std::string &name: sbx_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&sbx_xcvr::set_rx_gain, this, _1, name))
+ .set_coercer(std::bind(&sbx_xcvr::set_rx_gain, this, std::placeholders::_1, name))
.set(sbx_rx_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(sbx_rx_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&sbx_xcvr::set_lo_freq, this, dboard_iface::UNIT_RX, _1))
+ .set_coercer(std::bind(&sbx_xcvr::set_lo_freq, this, dboard_iface::UNIT_RX, std::placeholders::_1))
.set((freq_range.start() + freq_range.stop())/2.0);
this->get_rx_subtree()->create<meta_range_t>("freq/range").set(freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&sbx_xcvr::set_rx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&sbx_xcvr::set_rx_ant, this, std::placeholders::_1))
.set("RX2");
this->get_rx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(sbx_rx_antennas);
@@ -187,20 +188,20 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){
else this->get_tx_subtree()->create<std::string>("name").set("SBX/CBX TX");
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_TX));
+ .set_publisher(std::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_TX));
for(const std::string &name: sbx_tx_gain_ranges.keys()){
this->get_tx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&sbx_xcvr::set_tx_gain, this, _1, name))
+ .set_coercer(std::bind(&sbx_xcvr::set_tx_gain, this, std::placeholders::_1, name))
.set(sbx_tx_gain_ranges[name].start());
this->get_tx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(sbx_tx_gain_ranges[name]);
}
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&sbx_xcvr::set_lo_freq, this, dboard_iface::UNIT_TX, _1))
+ .set_coercer(std::bind(&sbx_xcvr::set_lo_freq, this, dboard_iface::UNIT_TX, std::placeholders::_1))
.set((freq_range.start() + freq_range.stop())/2.0);
this->get_tx_subtree()->create<meta_range_t>("freq/range").set(freq_range);
this->get_tx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&sbx_xcvr::set_tx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&sbx_xcvr::set_tx_ant, this, std::placeholders::_1))
.set(sbx_tx_antennas.at(0));
this->get_tx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(sbx_tx_antennas);
diff --git a/host/lib/usrp/dboard/db_sbx_version3.cpp b/host/lib/usrp/dboard/db_sbx_version3.cpp
index 369315b2e..835b2f725 100644
--- a/host/lib/usrp/dboard/db_sbx_version3.cpp
+++ b/host/lib/usrp/dboard/db_sbx_version3.cpp
@@ -9,6 +9,7 @@
#include "db_sbx_common.hpp"
#include <uhd/types/tune_request.hpp>
#include <boost/algorithm/string.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -20,8 +21,8 @@ using namespace boost::assign;
sbx_xcvr::sbx_version3::sbx_version3(sbx_xcvr *_self_sbx_xcvr) {
//register the handle to our base SBX class
self_base = _self_sbx_xcvr;
- _txlo = adf435x_iface::make_adf4350(boost::bind(&sbx_xcvr::sbx_version3::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = adf435x_iface::make_adf4350(boost::bind(&sbx_xcvr::sbx_version3::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = adf435x_iface::make_adf4350(std::bind(&sbx_xcvr::sbx_version3::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = adf435x_iface::make_adf4350(std::bind(&sbx_xcvr::sbx_version3::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
}
sbx_xcvr::sbx_version3::~sbx_version3(void){
diff --git a/host/lib/usrp/dboard/db_sbx_version4.cpp b/host/lib/usrp/dboard/db_sbx_version4.cpp
index d1c76287b..5c76a1b12 100644
--- a/host/lib/usrp/dboard/db_sbx_version4.cpp
+++ b/host/lib/usrp/dboard/db_sbx_version4.cpp
@@ -9,6 +9,7 @@
#include "db_sbx_common.hpp"
#include <uhd/types/tune_request.hpp>
#include <boost/algorithm/string.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -20,8 +21,8 @@ using namespace boost::assign;
sbx_xcvr::sbx_version4::sbx_version4(sbx_xcvr *_self_sbx_xcvr) {
//register the handle to our base SBX class
self_base = _self_sbx_xcvr;
- _txlo = adf435x_iface::make_adf4351(boost::bind(&sbx_xcvr::sbx_version4::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = adf435x_iface::make_adf4351(boost::bind(&sbx_xcvr::sbx_version4::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = adf435x_iface::make_adf4351(std::bind(&sbx_xcvr::sbx_version4::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = adf435x_iface::make_adf4351(std::bind(&sbx_xcvr::sbx_version4::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
}
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp
index 8bf377c4d..5235b1bfe 100644
--- a/host/lib/usrp/dboard/db_tvrx.cpp
+++ b/host/lib/usrp/dboard/db_tvrx.cpp
@@ -17,26 +17,26 @@
//max freq: 860e6
//gain range: [0:1dB:115dB]
-#include <uhd/utils/log.hpp>
-#include <uhd/utils/static.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
-
+#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/types/dict.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <uhd/utils/static.hpp>
+#include <tuner_4937di5_regs.hpp>
+#include <boost/array.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
-#include <boost/thread.hpp>
-#include <boost/array.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <utility>
-#include <cmath>
+#include <boost/thread.hpp>
#include <cfloat>
+#include <cmath>
+#include <functional>
#include <limits>
-#include <tuner_4937di5_regs.hpp>
+#include <utility>
using namespace uhd;
using namespace uhd::usrp;
@@ -180,12 +180,12 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<int>("sensors"); //phony property so this dir exists
for(const std::string &name: get_tvrx_gain_ranges().keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&tvrx::set_gain, this, _1, name));
+ .set_coercer(std::bind(&tvrx::set_gain, this, std::placeholders::_1, name));
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(get_tvrx_gain_ranges()[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&tvrx::set_freq, this, _1));
+ .set_coercer(std::bind(&tvrx::set_freq, this, std::placeholders::_1));
this->get_rx_subtree()->create<meta_range_t>("freq/range")
.set(tvrx_freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp
index 5dba83551..5767243d9 100644
--- a/host/lib/usrp/dboard/db_tvrx2.cpp
+++ b/host/lib/usrp/dboard/db_tvrx2.cpp
@@ -61,6 +61,7 @@
#include <cmath>
#include <chrono>
#include <thread>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -951,19 +952,19 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<std::string>("name")
.set("TVRX2");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&tvrx2::get_locked, this));
+ .set_publisher(std::bind(&tvrx2::get_locked, this));
this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi")
- .set_publisher(boost::bind(&tvrx2::get_rssi, this));
+ .set_publisher(std::bind(&tvrx2::get_rssi, this));
this->get_rx_subtree()->create<sensor_value_t>("sensors/temperature")
- .set_publisher(boost::bind(&tvrx2::get_temp, this));
+ .set_publisher(std::bind(&tvrx2::get_temp, this));
for(const std::string &name: tvrx2_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&tvrx2::set_gain, this, _1, name));
+ .set_coercer(std::bind(&tvrx2::set_gain, this, std::placeholders::_1, name));
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(tvrx2_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&tvrx2::set_lo_freq, this, _1));
+ .set_coercer(std::bind(&tvrx2::set_lo_freq, this, std::placeholders::_1));
this->get_rx_subtree()->create<meta_range_t>("freq/range")
.set(tvrx2_freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
@@ -973,12 +974,12 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<std::string>("connection")
.set(tvrx2_sd_name_to_conn[get_subdev_name()]);
this->get_rx_subtree()->create<bool>("enabled")
- .set_coercer(boost::bind(&tvrx2::set_enabled, this, _1))
+ .set_coercer(std::bind(&tvrx2::set_enabled, this, std::placeholders::_1))
.set(_enabled);
this->get_rx_subtree()->create<bool>("use_lo_offset")
.set(false);
this->get_rx_subtree()->create<double>("bandwidth/value")
- .set_coercer(boost::bind(&tvrx2::set_bandwidth, this, _1))
+ .set_coercer(std::bind(&tvrx2::set_bandwidth, this, std::placeholders::_1))
.set(_bandwidth);
this->get_rx_subtree()->create<meta_range_t>("bandwidth/range")
.set(tvrx2_bandwidth_range);
diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp
index 5a8fefeb7..9f9efd158 100644
--- a/host/lib/usrp/dboard/db_twinrx.cpp
+++ b/host/lib/usrp/dboard/db_twinrx.cpp
@@ -5,12 +5,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include "twinrx/twinrx_experts.hpp"
+#include "dboard_ctor_args.hpp"
#include "twinrx/twinrx_ctrl.hpp"
-#include "twinrx/twinrx_io.hpp"
+#include "twinrx/twinrx_experts.hpp"
#include "twinrx/twinrx_ids.hpp"
-
-#include <uhdlib/experts/expert_factory.hpp>
+#include "twinrx/twinrx_io.hpp"
#include <uhd/types/device_addr.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
@@ -18,10 +17,10 @@
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/static.hpp>
-#include "dboard_ctor_args.hpp"
-#include <memory>
+#include <uhdlib/experts/expert_factory.hpp>
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
+#include <memory>
//#include <fstream> //Needed for _expert->to_dot() below
using namespace uhd;
@@ -153,8 +152,9 @@ public:
false, AUTO_RESOLVE_ON_WRITE);
//Readback
- get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&twinrx_rcvr_fe::get_lo_locked, this));
+ get_rx_subtree()
+ ->create<sensor_value_t>("sensors/lo_locked")
+ .set_publisher([this]() { return this->get_lo_locked(); });
//---------------------------------------------------------
// Add internal channel-specific data nodes to expert
diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp
index 72b3e331d..3771c9f2d 100644
--- a/host/lib/usrp/dboard/db_ubx.cpp
+++ b/host/lib/usrp/dboard/db_ubx.cpp
@@ -9,23 +9,23 @@
**********************************************************************/
#include <uhd/types/device_addr.hpp>
#include <uhd/types/dict.hpp>
+#include <uhd/types/direction.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/types/direction.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/log.hpp>
-#include <uhd/utils/static.hpp>
#include <uhd/utils/safe_call.hpp>
+#include <uhd/utils/static.hpp>
#include <uhdlib/usrp/common/max287x.hpp>
-
-#include <memory>
-#include <boost/math/special_functions/round.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/math/special_functions/round.hpp>
#include <boost/thread/mutex.hpp>
-#include <map>
#include <chrono>
+#include <functional>
+#include <map>
+#include <memory>
#include <thread>
using namespace uhd;
@@ -395,10 +395,10 @@ public:
// Initialize LOs
if (_rev == 0)
{
- _txlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, TXLO1, _1));
- _txlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, TXLO2, _1));
- _rxlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
- _rxlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
+ _txlo1 = max287x_iface::make<max2870>(std::bind(&ubx_xcvr::write_spi_regs, this, TXLO1, std::placeholders::_1));
+ _txlo2 = max287x_iface::make<max2870>(std::bind(&ubx_xcvr::write_spi_regs, this, TXLO2, std::placeholders::_1));
+ _rxlo1 = max287x_iface::make<max2870>(std::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, std::placeholders::_1));
+ _rxlo2 = max287x_iface::make<max2870>(std::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, std::placeholders::_1));
std::vector<max287x_iface::sptr> los{_txlo1, _txlo2, _rxlo1, _rxlo2};
for(max287x_iface::sptr lo: los)
{
@@ -409,10 +409,10 @@ public:
}
else if (_rev == 1 or _rev == 2)
{
- _txlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, TXLO1, _1));
- _txlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, TXLO2, _1));
- _rxlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
- _rxlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
+ _txlo1 = max287x_iface::make<max2871>(std::bind(&ubx_xcvr::write_spi_regs, this, TXLO1, std::placeholders::_1));
+ _txlo2 = max287x_iface::make<max2871>(std::bind(&ubx_xcvr::write_spi_regs, this, TXLO2, std::placeholders::_1));
+ _rxlo1 = max287x_iface::make<max2871>(std::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, std::placeholders::_1));
+ _rxlo2 = max287x_iface::make<max2871>(std::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, std::placeholders::_1));
std::vector<max287x_iface::sptr> los{_txlo1, _txlo2, _rxlo1, _rxlo2};
for(max287x_iface::sptr lo: los)
{
@@ -439,12 +439,12 @@ public:
get_rx_subtree()->create<std::vector<std::string> >("power_mode/options")
.set(ubx_power_modes);
get_rx_subtree()->create<std::string>("power_mode/value")
- .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_power_mode, this, _1))
+ .add_coerced_subscriber(std::bind(&ubx_xcvr::set_power_mode, this, std::placeholders::_1))
.set("performance");
get_rx_subtree()->create<std::vector<std::string> >("xcvr_mode/options")
.set(ubx_xcvr_modes);
get_rx_subtree()->create<std::string>("xcvr_mode/value")
- .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_xcvr_mode, this, _1))
+ .add_coerced_subscriber(std::bind(&ubx_xcvr::set_xcvr_mode, this, std::placeholders::_1))
.set("FDX");
get_rx_subtree()->create<std::vector<std::string> >("temp_comp_mode/options")
.set(ubx_temp_comp_modes);
@@ -456,13 +456,13 @@ public:
get_tx_subtree()->create<std::vector<std::string> >("power_mode/options")
.set(ubx_power_modes);
get_tx_subtree()->create<std::string>("power_mode/value")
- .add_coerced_subscriber(boost::bind(&uhd::property<std::string>::set, &get_rx_subtree()->access<std::string>("power_mode/value"), _1))
- .set_publisher(boost::bind(&uhd::property<std::string>::get, &get_rx_subtree()->access<std::string>("power_mode/value")));
+ .add_coerced_subscriber(std::bind(&uhd::property<std::string>::set, &get_rx_subtree()->access<std::string>("power_mode/value"), std::placeholders::_1))
+ .set_publisher(std::bind(&uhd::property<std::string>::get, &get_rx_subtree()->access<std::string>("power_mode/value")));
get_tx_subtree()->create<std::vector<std::string> >("xcvr_mode/options")
.set(ubx_xcvr_modes);
get_tx_subtree()->create<std::string>("xcvr_mode/value")
- .add_coerced_subscriber(boost::bind(&uhd::property<std::string>::set, &get_rx_subtree()->access<std::string>("xcvr_mode/value"), _1))
- .set_publisher(boost::bind(&uhd::property<std::string>::get, &get_rx_subtree()->access<std::string>("xcvr_mode/value")));
+ .add_coerced_subscriber(std::bind(&uhd::property<std::string>::set, &get_rx_subtree()->access<std::string>("xcvr_mode/value"), std::placeholders::_1))
+ .set_publisher(std::bind(&uhd::property<std::string>::get, &get_rx_subtree()->access<std::string>("xcvr_mode/value")));
get_tx_subtree()->create<std::vector<std::string> >("temp_comp_mode/options")
.set(ubx_temp_comp_modes);
get_tx_subtree()
@@ -486,20 +486,20 @@ public:
get_tx_subtree()->create<device_addr_t>("tune_args")
.set(device_addr_t());
get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&ubx_xcvr::get_locked, this, "TXLO"));
+ .set_publisher(std::bind(&ubx_xcvr::get_locked, this, "TXLO"));
get_tx_subtree()->create<double>("gains/PGA0/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_tx_gain, this, _1)).set(0);
+ .set_coercer(std::bind(&ubx_xcvr::set_tx_gain, this, std::placeholders::_1)).set(0);
get_tx_subtree()->create<meta_range_t>("gains/PGA0/range")
.set(ubx_tx_gain_range);
get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_tx_freq, this, _1))
+ .set_coercer(std::bind(&ubx_xcvr::set_tx_freq, this, std::placeholders::_1))
.set(ubx_freq_range.start());
get_tx_subtree()->create<meta_range_t>("freq/range")
.set(ubx_freq_range);
get_tx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(ubx_tx_antennas);
get_tx_subtree()->create<std::string>("antenna/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_tx_ant, this, _1))
+ .set_coercer(std::bind(&ubx_xcvr::set_tx_ant, this, std::placeholders::_1))
.set(ubx_tx_antennas.at(0));
get_tx_subtree()->create<std::string>("connection")
.set("QI");
@@ -512,7 +512,7 @@ public:
get_tx_subtree()->create<meta_range_t>("bandwidth/range")
.set(freq_range_t(bw, bw));
get_tx_subtree()->create<int64_t>("sync_delay")
- .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_sync_delay, this, true, _1))
+ .add_coerced_subscriber(std::bind(&ubx_xcvr::set_sync_delay, this, true, std::placeholders::_1))
.set(0);
////////////////////////////////////////////////////////////////////
@@ -522,21 +522,21 @@ public:
get_rx_subtree()->create<device_addr_t>("tune_args")
.set(device_addr_t());
get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&ubx_xcvr::get_locked, this, "RXLO"));
+ .set_publisher(std::bind(&ubx_xcvr::get_locked, this, "RXLO"));
get_rx_subtree()->create<double>("gains/PGA0/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_rx_gain, this, _1))
+ .set_coercer(std::bind(&ubx_xcvr::set_rx_gain, this, std::placeholders::_1))
.set(0);
get_rx_subtree()->create<meta_range_t>("gains/PGA0/range")
.set(ubx_rx_gain_range);
get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_rx_freq, this, _1))
+ .set_coercer(std::bind(&ubx_xcvr::set_rx_freq, this, std::placeholders::_1))
.set(ubx_freq_range.start());
get_rx_subtree()->create<meta_range_t>("freq/range")
.set(ubx_freq_range);
get_rx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(ubx_rx_antennas);
get_rx_subtree()->create<std::string>("antenna/value")
- .set_coercer(boost::bind(&ubx_xcvr::set_rx_ant, this, _1)).set("RX2");
+ .set_coercer(std::bind(&ubx_xcvr::set_rx_ant, this, std::placeholders::_1)).set("RX2");
get_rx_subtree()->create<std::string>("connection")
.set("IQ");
get_rx_subtree()->create<bool>("enabled")
@@ -548,7 +548,7 @@ public:
get_rx_subtree()->create<meta_range_t>("bandwidth/range")
.set(freq_range_t(bw, bw));
get_rx_subtree()->create<int64_t>("sync_delay")
- .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_sync_delay, this, false, _1))
+ .add_coerced_subscriber(std::bind(&ubx_xcvr::set_sync_delay, this, false, std::placeholders::_1))
.set(0);
}
diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp
index 41f323d19..4651de76a 100644
--- a/host/lib/usrp/dboard/db_wbx_common.cpp
+++ b/host/lib/usrp/dboard/db_wbx_common.cpp
@@ -9,9 +9,10 @@
#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/log.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -59,17 +60,17 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){
this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t());
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_RX));
+ .set_publisher(std::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_RX));
for(const std::string &name: wbx_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&wbx_base::set_rx_gain, this, _1, name))
+ .set_coercer(std::bind(&wbx_base::set_rx_gain, this, std::placeholders::_1, name))
.set(wbx_rx_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(wbx_rx_gain_ranges[name]);
}
this->get_rx_subtree()->create<std::string>("connection").set("IQ");
this->get_rx_subtree()->create<bool>("enabled")
- .add_coerced_subscriber(boost::bind(&wbx_base::set_rx_enabled, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_base::set_rx_enabled, this, std::placeholders::_1))
.set(true); //start enabled
this->get_rx_subtree()->create<bool>("use_lo_offset").set(false);
@@ -84,7 +85,7 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){
this->get_tx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t());
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_TX));
+ .set_publisher(std::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_TX));
this->get_tx_subtree()->create<std::string>("connection").set("IQ");
this->get_tx_subtree()->create<bool>("use_lo_offset").set(false);
diff --git a/host/lib/usrp/dboard/db_wbx_common.hpp b/host/lib/usrp/dboard/db_wbx_common.hpp
index ec6459583..9425b041c 100644
--- a/host/lib/usrp/dboard/db_wbx_common.hpp
+++ b/host/lib/usrp/dboard/db_wbx_common.hpp
@@ -63,7 +63,7 @@
#include <boost/format.hpp>
#include <memory>
#include <boost/math/special_functions/round.hpp>
-#include <boost/bind.hpp>
+#include <functional>
namespace uhd{ namespace usrp{
diff --git a/host/lib/usrp/dboard/db_wbx_simple.cpp b/host/lib/usrp/dboard/db_wbx_simple.cpp
index 390c5c47a..98eb96c1f 100644
--- a/host/lib/usrp/dboard/db_wbx_simple.cpp
+++ b/host/lib/usrp/dboard/db_wbx_simple.cpp
@@ -13,10 +13,11 @@
#define ANT_RX2 ANTSW_IO //the rx line in on rx2
#include "db_wbx_common.hpp"
-#include <uhd/utils/static.hpp>
-#include <uhd/utils/assert_has.hpp>
#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/static.hpp>
#include <boost/assign/list_of.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -78,7 +79,7 @@ wbx_simple::wbx_simple(ctor_args_t args) : wbx_base(args){
std::string(str(boost::format("%s+GDB") % this->get_rx_subtree()->access<std::string>("name").get()
)));
this->get_rx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&wbx_simple::set_rx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_simple::set_rx_ant, this, std::placeholders::_1))
.set("RX2");
this->get_rx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(wbx_rx_antennas);
@@ -90,7 +91,7 @@ wbx_simple::wbx_simple(ctor_args_t args) : wbx_base(args){
std::string(str(boost::format("%s+GDB") % this->get_tx_subtree()->access<std::string>("name").get()
)));
this->get_tx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&wbx_simple::set_tx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_simple::set_tx_ant, this, std::placeholders::_1))
.set(wbx_tx_antennas.at(0));
this->get_tx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(wbx_tx_antennas);
diff --git a/host/lib/usrp/dboard/db_wbx_version2.cpp b/host/lib/usrp/dboard/db_wbx_version2.cpp
index 775ee4467..a8605942b 100644
--- a/host/lib/usrp/dboard/db_wbx_version2.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version2.cpp
@@ -6,19 +6,19 @@
//
#include "db_wbx_common.hpp"
-#include <uhd/types/tune_request.hpp>
-#include <uhd/utils/log.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
-
+#include <uhd/types/tune_request.hpp>
#include <uhd/usrp/dboard_base.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <boost/algorithm/string.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/algorithm/string.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -65,15 +65,15 @@ static double tx_pga0_gain_to_dac_volts(double &gain){
wbx_base::wbx_version2::wbx_version2(wbx_base *_self_wbx_base) {
//register our handle on the primary wbx_base instance
self_base = _self_wbx_base;
- _txlo = adf435x_iface::make_adf4350(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = adf435x_iface::make_adf4350(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = adf435x_iface::make_adf4350(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = adf435x_iface::make_adf4350(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Register RX properties
////////////////////////////////////////////////////////////////////
this->get_rx_subtree()->create<std::string>("name").set("WBXv2 RX");
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version2::set_lo_freq, this, dboard_iface::UNIT_RX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version2::set_lo_freq, this, dboard_iface::UNIT_RX, std::placeholders::_1))
.set((wbx_v2_freq_range.start() + wbx_v2_freq_range.stop())/2.0);
this->get_rx_subtree()->create<meta_range_t>("freq/range").set(wbx_v2_freq_range);
@@ -83,17 +83,17 @@ wbx_base::wbx_version2::wbx_version2(wbx_base *_self_wbx_base) {
this->get_tx_subtree()->create<std::string>("name").set("WBXv2 TX");
for(const std::string &name: wbx_v2_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version2::set_tx_gain, this, _1, name))
+ .set_coercer(std::bind(&wbx_base::wbx_version2::set_tx_gain, this, std::placeholders::_1, name))
.set(wbx_v2_tx_gain_ranges[name].start());
self_base->get_tx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(wbx_v2_tx_gain_ranges[name]);
}
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version2::set_lo_freq, this, dboard_iface::UNIT_TX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version2::set_lo_freq, this, dboard_iface::UNIT_TX, std::placeholders::_1))
.set((wbx_v2_freq_range.start() + wbx_v2_freq_range.stop())/2.0);
this->get_tx_subtree()->create<meta_range_t>("freq/range").set(wbx_v2_freq_range);
this->get_tx_subtree()->create<bool>("enabled")
- .add_coerced_subscriber(boost::bind(&wbx_base::wbx_version2::set_tx_enabled, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_base::wbx_version2::set_tx_enabled, this, std::placeholders::_1))
.set(true); //start enabled
//set attenuator control bits
diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp
index 41979f8ef..43c1d9652 100644
--- a/host/lib/usrp/dboard/db_wbx_version3.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version3.cpp
@@ -6,18 +6,18 @@
//
#include "db_wbx_common.hpp"
-#include <uhd/utils/log.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
-
#include <uhd/usrp/dboard_base.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <boost/algorithm/string.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/algorithm/string.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -70,15 +70,15 @@ static int tx_pga0_gain_to_iobits(double &gain){
wbx_base::wbx_version3::wbx_version3(wbx_base *_self_wbx_base) {
//register our handle on the primary wbx_base instance
self_base = _self_wbx_base;
- _txlo = adf435x_iface::make_adf4350(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = adf435x_iface::make_adf4350(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = adf435x_iface::make_adf4350(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = adf435x_iface::make_adf4350(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Register RX properties
////////////////////////////////////////////////////////////////////
this->get_rx_subtree()->create<std::string>("name").set("WBXv3 RX");
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version3::set_lo_freq, this, dboard_iface::UNIT_RX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version3::set_lo_freq, this, dboard_iface::UNIT_RX, std::placeholders::_1))
.set((wbx_v3_freq_range.start() + wbx_v3_freq_range.stop())/2.0);
this->get_rx_subtree()->create<meta_range_t>("freq/range").set(wbx_v3_freq_range);
@@ -88,17 +88,17 @@ wbx_base::wbx_version3::wbx_version3(wbx_base *_self_wbx_base) {
this->get_tx_subtree()->create<std::string>("name").set("WBXv3 TX");
for(const std::string &name: wbx_v3_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version3::set_tx_gain, this, _1, name))
+ .set_coercer(std::bind(&wbx_base::wbx_version3::set_tx_gain, this, std::placeholders::_1, name))
.set(wbx_v3_tx_gain_ranges[name].start());
self_base->get_tx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(wbx_v3_tx_gain_ranges[name]);
}
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version3::set_lo_freq, this, dboard_iface::UNIT_TX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version3::set_lo_freq, this, dboard_iface::UNIT_TX, std::placeholders::_1))
.set((wbx_v3_freq_range.start() + wbx_v3_freq_range.stop())/2.0);
this->get_tx_subtree()->create<meta_range_t>("freq/range").set(wbx_v3_freq_range);
this->get_tx_subtree()->create<bool>("enabled")
- .add_coerced_subscriber(boost::bind(&wbx_base::wbx_version3::set_tx_enabled, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_base::wbx_version3::set_tx_enabled, this, std::placeholders::_1))
.set(true); //start enabled
//set attenuator control bits
diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp
index 8b3d13b37..6755fb6eb 100644
--- a/host/lib/usrp/dboard/db_wbx_version4.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version4.cpp
@@ -6,18 +6,18 @@
//
#include "db_wbx_common.hpp"
-#include <uhd/utils/log.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
-
#include <uhd/usrp/dboard_base.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <boost/algorithm/string.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/algorithm/string.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -71,8 +71,8 @@ static int tx_pga0_gain_to_iobits(double &gain){
wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) {
//register our handle on the primary wbx_base instance
self_base = _self_wbx_base;
- _txlo = adf435x_iface::make_adf4351(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, _1));
- _rxlo = adf435x_iface::make_adf4351(boost::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, _1));
+ _txlo = adf435x_iface::make_adf4351(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_TX, std::placeholders::_1));
+ _rxlo = adf435x_iface::make_adf4351(std::bind(&wbx_base::wbx_versionx::write_lo_regs, this, dboard_iface::UNIT_RX, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Register RX properties
@@ -82,7 +82,7 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) {
if(rx_id == 0x0063) this->get_rx_subtree()->create<std::string>("name").set("WBXv4 RX");
else if(rx_id == 0x0081) this->get_rx_subtree()->create<std::string>("name").set("WBX-120 RX");
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version4::set_lo_freq, this, dboard_iface::UNIT_RX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version4::set_lo_freq, this, dboard_iface::UNIT_RX, std::placeholders::_1))
.set((wbx_v4_freq_range.start() + wbx_v4_freq_range.stop())/2.0);
this->get_rx_subtree()->create<meta_range_t>("freq/range").set(wbx_v4_freq_range);
@@ -95,17 +95,17 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) {
else if(rx_id == 0x0081) this->get_tx_subtree()->create<std::string>("name").set("WBX-120 TX");
for(const std::string &name: wbx_v4_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version4::set_tx_gain, this, _1, name))
+ .set_coercer(std::bind(&wbx_base::wbx_version4::set_tx_gain, this, std::placeholders::_1, name))
.set(wbx_v4_tx_gain_ranges[name].start());
self_base->get_tx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(wbx_v4_tx_gain_ranges[name]);
}
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&wbx_base::wbx_version4::set_lo_freq, this, dboard_iface::UNIT_TX, _1))
+ .set_coercer(std::bind(&wbx_base::wbx_version4::set_lo_freq, this, dboard_iface::UNIT_TX, std::placeholders::_1))
.set((wbx_v4_freq_range.start() + wbx_v4_freq_range.stop())/2.0);
this->get_tx_subtree()->create<meta_range_t>("freq/range").set(wbx_v4_freq_range);
this->get_tx_subtree()->create<bool>("enabled")
- .add_coerced_subscriber(boost::bind(&wbx_base::wbx_version4::set_tx_enabled, this, _1))
+ .add_coerced_subscriber(std::bind(&wbx_base::wbx_version4::set_tx_enabled, this, std::placeholders::_1))
.set(true); //start enabled
//set attenuator control bits
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index 9e1c9f2b0..40fdca0a5 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -38,22 +38,23 @@
#define RX_DIS_RXIO 0
#include "max2829_regs.hpp"
-#include <uhd/utils/log.hpp>
-#include <uhd/utils/static.hpp>
-#include <uhd/utils/safe_call.hpp>
-#include <uhd/utils/assert_has.hpp>
-#include <uhd/utils/algorithm.hpp>
+#include <uhd/types/dict.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/sensors.hpp>
-#include <uhd/types/dict.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_manager.hpp>
+#include <uhd/utils/algorithm.hpp>
+#include <uhd/utils/assert_has.hpp>
+#include <uhd/utils/log.hpp>
+#include <uhd/utils/safe_call.hpp>
+#include <uhd/utils/static.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <utility>
#include <chrono>
+#include <functional>
#include <thread>
+#include <utility>
using namespace uhd;
using namespace uhd::usrp;
@@ -222,23 +223,23 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
this->get_rx_subtree()->create<std::string>("name")
.set("XCVR2450 RX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&xcvr2450::get_locked, this));
+ .set_publisher(std::bind(&xcvr2450::get_locked, this));
this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi")
- .set_publisher(boost::bind(&xcvr2450::get_rssi, this));
+ .set_publisher(std::bind(&xcvr2450::get_rssi, this));
for(const std::string &name: xcvr_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&xcvr2450::set_rx_gain, this, _1, name))
+ .set_coercer(std::bind(&xcvr2450::set_rx_gain, this, std::placeholders::_1, name))
.set(xcvr_rx_gain_ranges[name].start());
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(xcvr_rx_gain_ranges[name]);
}
this->get_rx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&xcvr2450::set_lo_freq, this, _1))
+ .set_coercer(std::bind(&xcvr2450::set_lo_freq, this, std::placeholders::_1))
.set(double(2.45e9));
this->get_rx_subtree()->create<meta_range_t>("freq/range")
.set(xcvr_freq_range);
this->get_rx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&xcvr2450::set_rx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&xcvr2450::set_rx_ant, this, std::placeholders::_1))
.set(xcvr_antennas.at(0));
this->get_rx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(xcvr_antennas);
@@ -249,7 +250,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
this->get_rx_subtree()->create<bool>("use_lo_offset")
.set(false);
this->get_rx_subtree()->create<double>("bandwidth/value")
- .set_coercer(boost::bind(&xcvr2450::set_rx_bandwidth, this, _1)) //complex bandpass bandwidth
+ .set_coercer(std::bind(&xcvr2450::set_rx_bandwidth, this, std::placeholders::_1)) //complex bandpass bandwidth
.set(2.0*_rx_bandwidth); //_rx_bandwidth in lowpass, convert to complex bandpass
this->get_rx_subtree()->create<meta_range_t>("bandwidth/range")
.set(xcvr_rx_bandwidth_range);
@@ -260,21 +261,21 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
this->get_tx_subtree()->create<std::string>("name")
.set("XCVR2450 TX");
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
- .set_publisher(boost::bind(&xcvr2450::get_locked, this));
+ .set_publisher(std::bind(&xcvr2450::get_locked, this));
for(const std::string &name: xcvr_tx_gain_ranges.keys()){
this->get_tx_subtree()->create<double>("gains/"+name+"/value")
- .set_coercer(boost::bind(&xcvr2450::set_tx_gain, this, _1, name))
+ .set_coercer(std::bind(&xcvr2450::set_tx_gain, this, std::placeholders::_1, name))
.set(xcvr_tx_gain_ranges[name].start());
this->get_tx_subtree()->create<meta_range_t>("gains/"+name+"/range")
.set(xcvr_tx_gain_ranges[name]);
}
this->get_tx_subtree()->create<double>("freq/value")
- .set_coercer(boost::bind(&xcvr2450::set_lo_freq, this, _1))
+ .set_coercer(std::bind(&xcvr2450::set_lo_freq, this, std::placeholders::_1))
.set(double(2.45e9));
this->get_tx_subtree()->create<meta_range_t>("freq/range")
.set(xcvr_freq_range);
this->get_tx_subtree()->create<std::string>("antenna/value")
- .add_coerced_subscriber(boost::bind(&xcvr2450::set_tx_ant, this, _1))
+ .add_coerced_subscriber(std::bind(&xcvr2450::set_tx_ant, this, std::placeholders::_1))
.set(xcvr_antennas.at(1));
this->get_tx_subtree()->create<std::vector<std::string> >("antenna/options")
.set(xcvr_antennas);
@@ -285,7 +286,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
this->get_tx_subtree()->create<bool>("use_lo_offset")
.set(false);
this->get_tx_subtree()->create<double>("bandwidth/value")
- .set_coercer(boost::bind(&xcvr2450::set_tx_bandwidth, this, _1)) //complex bandpass bandwidth
+ .set_coercer(std::bind(&xcvr2450::set_tx_bandwidth, this, std::placeholders::_1)) //complex bandpass bandwidth
.set(2.0*_tx_bandwidth); //_tx_bandwidth in lowpass, convert to complex bandpass
this->get_tx_subtree()->create<meta_range_t>("bandwidth/range")
.set(xcvr_tx_bandwidth_range);