aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp90
1 files changed, 44 insertions, 46 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 1be4c7339..fd35f3a1d 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -6,22 +6,20 @@
#include "usrp2_impl.hpp"
#include "fw_common.h"
-#include <uhdlib/usrp/common/apply_corrections.hpp>
-#include <uhd/utils/log.hpp>
-
#include <uhd/exception.hpp>
#include <uhd/transport/if_addrs.hpp>
#include <uhd/transport/udp_zero_copy.hpp>
#include <uhd/types/ranges.hpp>
-#include <uhd/exception.hpp>
-#include <uhd/utils/static.hpp>
#include <uhd/utils/byteswap.hpp>
+#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
-#include <boost/format.hpp>
-#include <boost/bind.hpp>
-#include <boost/asio/ip/address_v4.hpp>
+#include <uhd/utils/static.hpp>
+#include <uhdlib/usrp/common/apply_corrections.hpp>
#include <boost/asio.hpp> //used for htonl and ntohl
+#include <boost/asio/ip/address_v4.hpp>
+#include <boost/format.hpp>
#include <boost/thread.hpp>
+#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@@ -462,15 +460,15 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
_tree->create<mboard_eeprom_t>(mb_path / "eeprom")
.set(_mbc[mb].iface->mb_eeprom)
.add_coerced_subscriber(
- boost::bind(&usrp2_impl::set_mb_eeprom, this, mb, _1));
+ std::bind(&usrp2_impl::set_mb_eeprom, this, mb, std::placeholders::_1));
////////////////////////////////////////////////////////////////
// create clock control objects
////////////////////////////////////////////////////////////////
_mbc[mb].clock = usrp2_clock_ctrl::make(_mbc[mb].iface, _mbc[mb].spiface);
_tree->create<double>(mb_path / "tick_rate")
- .set_publisher(boost::bind(&usrp2_clock_ctrl::get_master_clock_rate, _mbc[mb].clock))
- .add_coerced_subscriber(boost::bind(&usrp2_impl::update_tick_rate, this, _1));
+ .set_publisher(std::bind(&usrp2_clock_ctrl::get_master_clock_rate, _mbc[mb].clock))
+ .add_coerced_subscriber(std::bind(&usrp2_impl::update_tick_rate, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////
// create codec control objects
@@ -488,10 +486,10 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
_tree->create<std::string>(rx_codec_path / "name").set("ads62p44");
_tree->create<meta_range_t>(rx_codec_path / "gains/digital/range").set(meta_range_t(0, 6.0, 0.5));
_tree->create<double>(rx_codec_path / "gains/digital/value")
- .add_coerced_subscriber(boost::bind(&usrp2_codec_ctrl::set_rx_digital_gain, _mbc[mb].codec, _1)).set(0);
+ .add_coerced_subscriber(std::bind(&usrp2_codec_ctrl::set_rx_digital_gain, _mbc[mb].codec, std::placeholders::_1)).set(0);
_tree->create<meta_range_t>(rx_codec_path / "gains/fine/range").set(meta_range_t(0, 0.5, 0.05));
_tree->create<double>(rx_codec_path / "gains/fine/value")
- .add_coerced_subscriber(boost::bind(&usrp2_codec_ctrl::set_rx_digital_fine_gain, _mbc[mb].codec, _1)).set(0);
+ .add_coerced_subscriber(std::bind(&usrp2_codec_ctrl::set_rx_digital_fine_gain, _mbc[mb].codec, std::placeholders::_1)).set(0);
}break;
case usrp2_iface::USRP2_REV3:
@@ -538,7 +536,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
for(const std::string &name: _mbc[mb].gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
- .set_publisher(boost::bind(&gps_ctrl::get_sensor, _mbc[mb].gps, name));
+ .set_publisher(std::bind(&gps_ctrl::get_sensor, _mbc[mb].gps, name));
}
}
else
@@ -551,9 +549,9 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
// and do the misc mboard sensors
////////////////////////////////////////////////////////////////
_tree->create<sensor_value_t>(mb_path / "sensors/mimo_locked")
- .set_publisher(boost::bind(&usrp2_impl::get_mimo_locked, this, mb));
+ .set_publisher(std::bind(&usrp2_impl::get_mimo_locked, this, mb));
_tree->create<sensor_value_t>(mb_path / "sensors/ref_locked")
- .set_publisher(boost::bind(&usrp2_impl::get_ref_locked, this, mb));
+ .set_publisher(std::bind(&usrp2_impl::get_ref_locked, this, mb));
////////////////////////////////////////////////////////////////
// create frontend control objects
@@ -566,27 +564,27 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
);
_tree->create<subdev_spec_t>(mb_path / "rx_subdev_spec")
- .add_coerced_subscriber(boost::bind(&usrp2_impl::update_rx_subdev_spec, this, mb, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::update_rx_subdev_spec, this, mb, std::placeholders::_1));
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
- .add_coerced_subscriber(boost::bind(&usrp2_impl::update_tx_subdev_spec, this, mb, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::update_tx_subdev_spec, this, mb, std::placeholders::_1));
const fs_path rx_fe_path = mb_path / "rx_frontends" / "A";
const fs_path tx_fe_path = mb_path / "tx_frontends" / "A";
_tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
- .set_coercer(boost::bind(&rx_frontend_core_200::set_dc_offset, _mbc[mb].rx_fe, _1))
+ .set_coercer(std::bind(&rx_frontend_core_200::set_dc_offset, _mbc[mb].rx_fe, std::placeholders::_1))
.set(std::complex<double>(0.0, 0.0));
_tree->create<bool>(rx_fe_path / "dc_offset" / "enable")
- .add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, _mbc[mb].rx_fe, _1))
+ .add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_dc_offset_auto, _mbc[mb].rx_fe, std::placeholders::_1))
.set(true);
_tree->create<std::complex<double> >(rx_fe_path / "iq_balance" / "value")
- .add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_iq_balance, _mbc[mb].rx_fe, _1))
+ .add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_iq_balance, _mbc[mb].rx_fe, std::placeholders::_1))
.set(std::complex<double>(0.0, 0.0));
_tree->create<std::complex<double> >(tx_fe_path / "dc_offset" / "value")
- .set_coercer(boost::bind(&tx_frontend_core_200::set_dc_offset, _mbc[mb].tx_fe, _1))
+ .set_coercer(std::bind(&tx_frontend_core_200::set_dc_offset, _mbc[mb].tx_fe, std::placeholders::_1))
.set(std::complex<double>(0.0, 0.0));
_tree->create<std::complex<double> >(tx_fe_path / "iq_balance" / "value")
- .add_coerced_subscriber(boost::bind(&tx_frontend_core_200::set_iq_balance, _mbc[mb].tx_fe, _1))
+ .add_coerced_subscriber(std::bind(&tx_frontend_core_200::set_iq_balance, _mbc[mb].tx_fe, std::placeholders::_1))
.set(std::complex<double>(0.0, 0.0));
////////////////////////////////////////////////////////////////
@@ -601,20 +599,20 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
for (size_t dspno = 0; dspno < _mbc[mb].rx_dsps.size(); dspno++){
_mbc[mb].rx_dsps[dspno]->set_link_rate(USRP2_LINK_RATE_BPS);
_tree->access<double>(mb_path / "tick_rate")
- .add_coerced_subscriber(boost::bind(&rx_dsp_core_200::set_tick_rate, _mbc[mb].rx_dsps[dspno], _1));
+ .add_coerced_subscriber(std::bind(&rx_dsp_core_200::set_tick_rate, _mbc[mb].rx_dsps[dspno], std::placeholders::_1));
fs_path rx_dsp_path = mb_path / str(boost::format("rx_dsps/%u") % dspno);
_tree->create<meta_range_t>(rx_dsp_path / "rate/range")
- .set_publisher(boost::bind(&rx_dsp_core_200::get_host_rates, _mbc[mb].rx_dsps[dspno]));
+ .set_publisher(std::bind(&rx_dsp_core_200::get_host_rates, _mbc[mb].rx_dsps[dspno]));
_tree->create<double>(rx_dsp_path / "rate/value")
.set(1e6) //some default
- .set_coercer(boost::bind(&rx_dsp_core_200::set_host_rate, _mbc[mb].rx_dsps[dspno], _1))
- .add_coerced_subscriber(boost::bind(&usrp2_impl::update_rx_samp_rate, this, mb, dspno, _1));
+ .set_coercer(std::bind(&rx_dsp_core_200::set_host_rate, _mbc[mb].rx_dsps[dspno], std::placeholders::_1))
+ .add_coerced_subscriber(std::bind(&usrp2_impl::update_rx_samp_rate, this, mb, dspno, std::placeholders::_1));
_tree->create<double>(rx_dsp_path / "freq/value")
- .set_coercer(boost::bind(&rx_dsp_core_200::set_freq, _mbc[mb].rx_dsps[dspno], _1));
+ .set_coercer(std::bind(&rx_dsp_core_200::set_freq, _mbc[mb].rx_dsps[dspno], std::placeholders::_1));
_tree->create<meta_range_t>(rx_dsp_path / "freq/range")
- .set_publisher(boost::bind(&rx_dsp_core_200::get_freq_range, _mbc[mb].rx_dsps[dspno]));
+ .set_publisher(std::bind(&rx_dsp_core_200::get_freq_range, _mbc[mb].rx_dsps[dspno]));
_tree->create<stream_cmd_t>(rx_dsp_path / "stream_cmd")
- .add_coerced_subscriber(boost::bind(&rx_dsp_core_200::issue_stream_command, _mbc[mb].rx_dsps[dspno], _1));
+ .add_coerced_subscriber(std::bind(&rx_dsp_core_200::issue_stream_command, _mbc[mb].rx_dsps[dspno], std::placeholders::_1));
}
////////////////////////////////////////////////////////////////
@@ -681,22 +679,22 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
_mbc[mb].wbiface, U2_REG_SR_ADDR(SR_TIME64), time64_rb_bases, mimo_clock_sync_delay_cycles
);
_tree->access<double>(mb_path / "tick_rate")
- .add_coerced_subscriber(boost::bind(&time64_core_200::set_tick_rate, _mbc[mb].time64, _1));
+ .add_coerced_subscriber(std::bind(&time64_core_200::set_tick_rate, _mbc[mb].time64, std::placeholders::_1));
_tree->create<time_spec_t>(mb_path / "time/now")
- .set_publisher(boost::bind(&time64_core_200::get_time_now, _mbc[mb].time64))
- .add_coerced_subscriber(boost::bind(&time64_core_200::set_time_now, _mbc[mb].time64, _1));
+ .set_publisher(std::bind(&time64_core_200::get_time_now, _mbc[mb].time64))
+ .add_coerced_subscriber(std::bind(&time64_core_200::set_time_now, _mbc[mb].time64, std::placeholders::_1));
_tree->create<time_spec_t>(mb_path / "time/pps")
- .set_publisher(boost::bind(&time64_core_200::get_time_last_pps, _mbc[mb].time64))
- .add_coerced_subscriber(boost::bind(&time64_core_200::set_time_next_pps, _mbc[mb].time64, _1));
+ .set_publisher(std::bind(&time64_core_200::get_time_last_pps, _mbc[mb].time64))
+ .add_coerced_subscriber(std::bind(&time64_core_200::set_time_next_pps, _mbc[mb].time64, std::placeholders::_1));
//setup time source props
_tree->create<std::string>(mb_path / "time_source/value")
- .add_coerced_subscriber(boost::bind(&time64_core_200::set_time_source, _mbc[mb].time64, _1))
+ .add_coerced_subscriber(std::bind(&time64_core_200::set_time_source, _mbc[mb].time64, std::placeholders::_1))
.set("none");
_tree->create<std::vector<std::string> >(mb_path / "time_source/options")
- .set_publisher(boost::bind(&time64_core_200::get_time_sources, _mbc[mb].time64));
+ .set_publisher(std::bind(&time64_core_200::get_time_sources, _mbc[mb].time64));
//setup reference source props
_tree->create<std::string>(mb_path / "clock_source/value")
- .add_coerced_subscriber(boost::bind(&usrp2_impl::update_clock_source, this, mb, _1))
+ .add_coerced_subscriber(std::bind(&usrp2_impl::update_clock_source, this, mb, std::placeholders::_1))
.set("internal");
std::vector<std::string> clock_sources{"internal", "external", "mimo"};
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected()) {
@@ -711,18 +709,18 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
case usrp2_iface::USRP_N200_R4:
case usrp2_iface::USRP_N210_R4:
_tree->create<time_spec_t>(mb_path / "time/cmd")
- .add_coerced_subscriber(boost::bind(&usrp2_fifo_ctrl::set_time, _mbc[mb].fifo_ctrl, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_fifo_ctrl::set_time, _mbc[mb].fifo_ctrl, std::placeholders::_1));
default: break; //otherwise, do not register
}
_tree->access<double>(mb_path / "tick_rate")
- .add_coerced_subscriber(boost::bind(&usrp2_fifo_ctrl::set_tick_rate, _mbc[mb].fifo_ctrl, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_fifo_ctrl::set_tick_rate, _mbc[mb].fifo_ctrl, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create user-defined control objects
////////////////////////////////////////////////////////////////////
_mbc[mb].user = user_settings_core_200::make(_mbc[mb].wbiface, U2_REG_SR_ADDR(SR_USER_REGS));
_tree->create<user_settings_core_200::user_reg_t>(mb_path / "user/regs")
- .add_coerced_subscriber(boost::bind(&user_settings_core_200::set_reg, _mbc[mb].user, _1));
+ .add_coerced_subscriber(std::bind(&user_settings_core_200::set_reg, _mbc[mb].user, std::placeholders::_1));
////////////////////////////////////////////////////////////////
// create dboard control objects
@@ -740,13 +738,13 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//create the properties and register subscribers
_tree->create<dboard_eeprom_t>(mb_path / "dboards/A/rx_eeprom")
.set(rx_db_eeprom)
- .add_coerced_subscriber(boost::bind(&usrp2_impl::set_db_eeprom, this, mb, "rx", _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::set_db_eeprom, this, mb, "rx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards/A/tx_eeprom")
.set(tx_db_eeprom)
- .add_coerced_subscriber(boost::bind(&usrp2_impl::set_db_eeprom, this, mb, "tx", _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::set_db_eeprom, this, mb, "tx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards/A/gdb_eeprom")
.set(gdb_eeprom)
- .add_coerced_subscriber(boost::bind(&usrp2_impl::set_db_eeprom, this, mb, "gdb", _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::set_db_eeprom, this, mb, "gdb", std::placeholders::_1));
//create a new dboard interface and manager
_mbc[mb].dboard_manager = dboard_manager::make(
@@ -759,12 +757,12 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
for(const std::string &name: _tree->list(db_tx_fe_path)){
_tree->access<double>(db_tx_fe_path / name / "freq" / "value")
- .add_coerced_subscriber(boost::bind(&usrp2_impl::set_tx_fe_corrections, this, mb, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::set_tx_fe_corrections, this, mb, std::placeholders::_1));
}
const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
for(const std::string &name: _tree->list(db_rx_fe_path)){
_tree->access<double>(db_rx_fe_path / name / "freq" / "value")
- .add_coerced_subscriber(boost::bind(&usrp2_impl::set_rx_fe_corrections, this, mb, _1));
+ .add_coerced_subscriber(std::bind(&usrp2_impl::set_rx_fe_corrections, this, mb, std::placeholders::_1));
}
}