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.
This commit is contained in:
Martin Braun 2019-10-16 16:21:19 -07:00
parent dc698b990d
commit d3a16b7022
65 changed files with 585 additions and 578 deletions

View File

@ -15,6 +15,7 @@
#include <chrono>
#include <csignal>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <thread>
#include <vector>
@ -101,10 +102,10 @@ public:
boost::unique_lock<boost::mutex> lock(
spawn_mutex); // lock in preparation to wait for threads to spawn
(void)_thread_group.create_thread(
boost::bind(&udp_relay_type::server_thread, this));
std::bind(&udp_relay_type::server_thread, this));
wait_for_thread.wait(lock); // wait for thread to spin up
(void)_thread_group.create_thread(
boost::bind(&udp_relay_type::client_thread, this));
std::bind(&udp_relay_type::client_thread, this));
wait_for_thread.wait(lock); // wait for thread to spin up
std::cout << " done!" << std::endl << std::endl;
}

View File

@ -21,6 +21,7 @@
#include <complex>
#include <csignal>
#include <fstream>
#include <functional>
#include <iostream>
#include <thread>
@ -419,10 +420,10 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
if (not vm.count("skip-lo")) {
// TODO
// check_locked_sensor(usrp->get_rx_sensor_names(0), "lo_locked",
// boost::bind(&uhd::usrp::multi_usrp::get_rx_sensor, usrp, _1, radio_id),
// std::bind(&uhd::usrp::multi_usrp::get_rx_sensor, usrp, _1, radio_id),
// setup_time); if (ref == "external")
// check_locked_sensor(usrp->get_mboard_sensor_names(0), "ref_locked",
// boost::bind(&uhd::usrp::multi_usrp::get_mboard_sensor, usrp, _1, radio_id),
// std::bind(&uhd::usrp::multi_usrp::get_mboard_sensor, usrp, _1, radio_id),
// setup_time);
}

View File

@ -15,6 +15,7 @@
#include <boost/format.hpp>
#include <boost/program_options.hpp>
#include <chrono>
#include <functional>
#include <iostream>
#include <thread>
@ -118,7 +119,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
boost::thread_group thread_group;
clock_time = clock->get_time();
for (size_t j = 0; j < usrp->get_num_mboards(); j++) {
thread_group.create_thread(boost::bind(&get_usrp_time, usrp, j, &usrp_times));
thread_group.create_thread(std::bind(&get_usrp_time, usrp, j, &usrp_times));
}
// Wait for threads to complete
thread_group.join_all();

View File

@ -13,7 +13,7 @@
#include <uhd/utils/static.hpp>
#include <uhd/utils/thread.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <boost/format.hpp>
#include <boost/program_options.hpp>
#include <complex>

View File

@ -20,6 +20,7 @@
#include <boost/thread/thread.hpp>
#include <csignal>
#include <fstream>
#include <functional>
#include <iostream>
namespace po = boost::program_options;
@ -526,7 +527,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// start transmit worker thread
boost::thread_group transmit_thread;
transmit_thread.create_thread(boost::bind(
transmit_thread.create_thread(std::bind(
&transmit_worker, buff, wave_table, tx_stream, md, step, index, num_channels));
// recv to file

View File

@ -10,12 +10,11 @@
#include <uhd/config.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#include <functional>
#include <boost/circular_buffer.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/locks.hpp>
#include <boost/utility.hpp>
#include <functional>
namespace uhd{ namespace transport{
@ -26,8 +25,8 @@ namespace uhd{ namespace transport{
bounded_buffer_detail(size_t capacity):
_buffer(capacity)
{
_not_full_fcn = boost::bind(&bounded_buffer_detail<elem_type>::not_full, this);
_not_empty_fcn = boost::bind(&bounded_buffer_detail<elem_type>::not_empty, this);
_not_full_fcn = std::bind(&bounded_buffer_detail<elem_type>::not_full, this);
_not_empty_fcn = std::bind(&bounded_buffer_detail<elem_type>::not_empty, this);
}
UHD_INLINE bool push_with_haste(const elem_type &elem)

View File

@ -8,15 +8,14 @@
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/experts/expert_container.hpp>
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <functional>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <functional>
#include <memory>
#ifdef UHD_EXPERT_LOGGING
@ -25,6 +24,7 @@
#define EX_LOG(depth, str)
#endif
namespace uhd { namespace experts {
typedef boost::adjacency_list<
@ -298,11 +298,11 @@ protected:
//Add resolve callbacks
if (resolve_mode == AUTO_RESOLVE_ON_WRITE or resolve_mode == AUTO_RESOLVE_ON_READ_WRITE) {
EX_LOG(2, str(boost::format("added write callback")));
data_node->set_write_callback(boost::bind(&expert_container_impl::resolve_from, this, _1));
data_node->set_write_callback(std::bind(&expert_container_impl::resolve_from, this, std::placeholders::_1));
}
if (resolve_mode == AUTO_RESOLVE_ON_READ or resolve_mode == AUTO_RESOLVE_ON_READ_WRITE) {
EX_LOG(2, str(boost::format("added read callback")));
data_node->set_read_callback(boost::bind(&expert_container_impl::resolve_to, this, _1));
data_node->set_read_callback(std::bind(&expert_container_impl::resolve_to, this, std::placeholders::_1));
}
} catch (...) {
clear();

View File

@ -8,13 +8,14 @@
#ifndef INCLUDED_UHD_EXPERTS_EXPERT_FACTORY_HPP
#define INCLUDED_UHD_EXPERTS_EXPERT_FACTORY_HPP
#include <uhdlib/experts/expert_container.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/config.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <boost/bind.hpp>
#include <uhdlib/experts/expert_container.hpp>
#include <functional>
#include <memory>
namespace uhd { namespace experts {
/*!
@ -94,8 +95,8 @@ namespace uhd { namespace experts {
data_node_t<data_t>* node_ptr =
new data_node_t<data_t>(name, init_val, &container->resolve_mutex());
prop.set(init_val);
prop.add_desired_subscriber(boost::bind(&data_node_t<data_t>::commit, node_ptr, _1));
prop.set_publisher(boost::bind(&data_node_t<data_t>::retrieve, node_ptr));
prop.add_desired_subscriber(std::bind(&data_node_t<data_t>::commit, node_ptr, std::placeholders::_1));
prop.set_publisher(std::bind(&data_node_t<data_t>::retrieve, node_ptr));
container->add_data_node(node_ptr, mode);
return prop;
}
@ -161,8 +162,8 @@ namespace uhd { namespace experts {
new data_node_t<data_t>(coerced_name, init_val, &container->resolve_mutex());
prop.set(init_val);
prop.set_coerced(init_val);
prop.add_desired_subscriber(boost::bind(&data_node_t<data_t>::commit, desired_node_ptr, _1));
prop.set_publisher(boost::bind(&data_node_t<data_t>::retrieve, coerced_node_ptr));
prop.add_desired_subscriber(std::bind(&data_node_t<data_t>::commit, desired_node_ptr, std::placeholders::_1));
prop.set_publisher(std::bind(&data_node_t<data_t>::retrieve, coerced_node_ptr));
container->add_data_node(desired_node_ptr,
auto_resolve_desired ? AUTO_RESOLVE_ON_WRITE : AUTO_RESOLVE_OFF);

View File

@ -8,7 +8,7 @@
#ifndef INCLUDED_IHEX_READER_HPP
#define INCLUDED_IHEX_READER_HPP
#include <boost/bind.hpp>
#include <functional>
#include <functional>
#include <stdint.h>
#include <string>

View File

@ -20,7 +20,6 @@ using namespace uhd;
using namespace uhd::rfnoc;
using namespace uhd::rfnoc::chdr;
using namespace std::placeholders;
chdr_ctrl_endpoint::~chdr_ctrl_endpoint() = default;

View File

@ -11,9 +11,9 @@
#include <uhd/types/serial.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/tasks.hpp>
#include <boost/bind.hpp>
#include <boost/thread/mutex.hpp>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <mutex>
#include <memory>
@ -37,7 +37,7 @@ public:
UHD_ASSERT_THROW(libusb_init(&_context) == 0);
libusb_set_debug(_context, debug_level);
task_handler = task::make(
boost::bind(&libusb_session_impl::libusb_event_handler_task, this, _context));
std::bind(&libusb_session_impl::libusb_event_handler_task, this, _context));
}
virtual ~libusb_session_impl(void);

View File

@ -12,14 +12,13 @@
#include <uhd/transport/buffer_pool.hpp>
#include <uhd/transport/usb_zero_copy.hpp>
#include <uhd/utils/log.hpp>
#include <boost/bind.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/format.hpp>
#include <functional>
#include <memory>
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp>
#include <functional>
#include <list>
#include <memory>
using namespace uhd;
using namespace uhd::transport;
@ -253,7 +252,7 @@ public:
_mb_pool.push_back(std::make_shared<libusb_zero_copy_mb>(lut,
this->get_frame_size(),
boost::bind(&libusb_zero_copy_single::enqueue_buffer, this, _1),
std::bind(&libusb_zero_copy_single::enqueue_buffer, this, std::placeholders::_1),
is_recv,
name));

View File

@ -11,6 +11,7 @@
#include <uhd/utils/safe_call.hpp>
#include <boost/thread.hpp>
#include <boost/thread/locks.hpp>
#include <functional>
#include <map>
#include <memory>
@ -35,7 +36,7 @@ public:
// Create the receive thread to poll the underlying transport
// and classify packets into queues
_recv_thread =
boost::thread(boost::bind(&muxed_zero_copy_if_impl::_update_queues, this));
boost::thread(std::bind(&muxed_zero_copy_if_impl::_update_queues, this));
}
virtual ~muxed_zero_copy_if_impl()

View File

@ -6,10 +6,11 @@
//
#include <uhd/transport/nirio/rpc/rpc_client.hpp>
#include <boost/bind.hpp>
#include <boost/version.hpp>
#include <boost/format.hpp>
#include <boost/asio/error.hpp>
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <boost/version.hpp>
#define CHAIN_BLOCKING_XFER(func, exp, status) \
if (status) { \

View File

@ -10,7 +10,7 @@
#include <uhd/transport/zero_copy_flow_ctrl.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <boost/format.hpp>
#include <memory>
#include <boost/thread/mutex.hpp>

View File

@ -7,18 +7,19 @@
#include "b100_impl.hpp"
#include "b100_regs.hpp"
#include <uhd/transport/usb_control.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/transport/usb_control.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/static.hpp>
#include <uhdlib/usrp/common/apply_corrections.hpp>
#include <boost/format.hpp>
#include <cstdio>
#include <iostream>
#include <chrono>
#include <cstdio>
#include <functional>
#include <iostream>
using namespace uhd;
using namespace uhd::usrp;
@ -274,7 +275,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_tree->create<std::string>(mb_path / "name").set("B100");
_tree->create<std::string>(mb_path / "codename").set("B-Hundo");
_tree->create<std::string>(mb_path / "load_eeprom")
.add_coerced_subscriber(boost::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, _1));
.add_coerced_subscriber(std::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// setup the mboard eeprom
@ -282,20 +283,20 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
const mboard_eeprom_t mb_eeprom = this->get_mb_eeprom(_fx2_ctrl);
_tree->create<mboard_eeprom_t>(mb_path / "eeprom")
.set(mb_eeprom)
.add_coerced_subscriber(boost::bind(&b100_impl::set_mb_eeprom, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_mb_eeprom, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create clock control objects
////////////////////////////////////////////////////////////////////
//^^^ clock created up top, just reg props here... ^^^
_tree->create<double>(mb_path / "tick_rate")
.set_publisher(boost::bind(&b100_clock_ctrl::get_fpga_clock_rate, _clock_ctrl))
.add_coerced_subscriber(boost::bind(&fifo_ctrl_excelsior::set_tick_rate, _fifo_ctrl, _1))
.add_coerced_subscriber(boost::bind(&b100_impl::update_tick_rate, this, _1));
.set_publisher(std::bind(&b100_clock_ctrl::get_fpga_clock_rate, _clock_ctrl))
.add_coerced_subscriber(std::bind(&fifo_ctrl_excelsior::set_tick_rate, _fifo_ctrl, std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b100_impl::update_tick_rate, this, std::placeholders::_1));
//add_coerced_subscriber the command time while we are at it
_tree->create<time_spec_t>(mb_path / "time/cmd")
.add_coerced_subscriber(boost::bind(&fifo_ctrl_excelsior::set_time, _fifo_ctrl, _1));
.add_coerced_subscriber(std::bind(&fifo_ctrl_excelsior::set_time, _fifo_ctrl, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create codec control objects
@ -306,20 +307,20 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_tree->create<std::string>(rx_codec_path / "name").set("ad9522");
_tree->create<meta_range_t>(rx_codec_path / "gains/pga/range").set(b100_codec_ctrl::rx_pga_gain_range);
_tree->create<double>(rx_codec_path / "gains/pga/value")
.set_coercer(boost::bind(&b100_impl::update_rx_codec_gain, this, _1))
.set_coercer(std::bind(&b100_impl::update_rx_codec_gain, this, std::placeholders::_1))
.set(0.0);
_tree->create<std::string>(tx_codec_path / "name").set("ad9522");
_tree->create<meta_range_t>(tx_codec_path / "gains/pga/range").set(b100_codec_ctrl::tx_pga_gain_range);
_tree->create<double>(tx_codec_path / "gains/pga/value")
.add_coerced_subscriber(boost::bind(&b100_codec_ctrl::set_tx_pga_gain, _codec_ctrl, _1))
.set_publisher(boost::bind(&b100_codec_ctrl::get_tx_pga_gain, _codec_ctrl))
.add_coerced_subscriber(std::bind(&b100_codec_ctrl::set_tx_pga_gain, _codec_ctrl, std::placeholders::_1))
.set_publisher(std::bind(&b100_codec_ctrl::get_tx_pga_gain, _codec_ctrl))
.set(0.0);
////////////////////////////////////////////////////////////////////
// and do the misc mboard sensors
////////////////////////////////////////////////////////////////////
_tree->create<sensor_value_t>(mb_path / "sensors/ref_locked")
.set_publisher(boost::bind(&b100_impl::get_ref_locked, this));
.set_publisher(std::bind(&b100_impl::get_ref_locked, this));
////////////////////////////////////////////////////////////////////
// create frontend control objects
@ -328,27 +329,27 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_tx_fe = tx_frontend_core_200::make(_fifo_ctrl, TOREG(SR_TX_FE));
_tree->create<subdev_spec_t>(mb_path / "rx_subdev_spec")
.add_coerced_subscriber(boost::bind(&b100_impl::update_rx_subdev_spec, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::update_rx_subdev_spec, this, std::placeholders::_1));
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.add_coerced_subscriber(boost::bind(&b100_impl::update_tx_subdev_spec, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::update_tx_subdev_spec, this, 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, _rx_fe, _1))
.set_coercer(std::bind(&rx_frontend_core_200::set_dc_offset, _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, _rx_fe, _1))
.add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_dc_offset_auto, _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, _rx_fe, _1))
.add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_iq_balance, _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, _tx_fe, _1))
.set_coercer(std::bind(&tx_frontend_core_200::set_dc_offset, _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, _tx_fe, _1))
.add_coerced_subscriber(std::bind(&tx_frontend_core_200::set_iq_balance, _tx_fe, std::placeholders::_1))
.set(std::complex<double>(0.0, 0.0));
////////////////////////////////////////////////////////////////////
@ -367,20 +368,20 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_rx_dsps[dspno]->set_link_rate(B100_LINK_RATE_BPS);
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&rx_dsp_core_200::set_tick_rate, _rx_dsps[dspno], _1));
.add_coerced_subscriber(std::bind(&rx_dsp_core_200::set_tick_rate, _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, _rx_dsps[dspno]));
.set_publisher(std::bind(&rx_dsp_core_200::get_host_rates, _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, _rx_dsps[dspno], _1))
.add_coerced_subscriber(boost::bind(&b100_impl::update_rx_samp_rate, this, dspno, _1));
.set_coercer(std::bind(&rx_dsp_core_200::set_host_rate, _rx_dsps[dspno], std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b100_impl::update_rx_samp_rate, this, dspno, std::placeholders::_1));
_tree->create<double>(rx_dsp_path / "freq/value")
.set_coercer(boost::bind(&rx_dsp_core_200::set_freq, _rx_dsps[dspno], _1));
.set_coercer(std::bind(&rx_dsp_core_200::set_freq, _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, _rx_dsps[dspno]));
.set_publisher(std::bind(&rx_dsp_core_200::get_freq_range, _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, _rx_dsps[dspno], _1));
.add_coerced_subscriber(std::bind(&rx_dsp_core_200::issue_stream_command, _rx_dsps[dspno], std::placeholders::_1));
}
////////////////////////////////////////////////////////////////////
@ -391,17 +392,17 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
);
_tx_dsp->set_link_rate(B100_LINK_RATE_BPS);
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&tx_dsp_core_200::set_tick_rate, _tx_dsp, _1));
.add_coerced_subscriber(std::bind(&tx_dsp_core_200::set_tick_rate, _tx_dsp, std::placeholders::_1));
_tree->create<meta_range_t>(mb_path / "tx_dsps/0/rate/range")
.set_publisher(boost::bind(&tx_dsp_core_200::get_host_rates, _tx_dsp));
.set_publisher(std::bind(&tx_dsp_core_200::get_host_rates, _tx_dsp));
_tree->create<double>(mb_path / "tx_dsps/0/rate/value")
.set(1e6) //some default
.set_coercer(boost::bind(&tx_dsp_core_200::set_host_rate, _tx_dsp, _1))
.add_coerced_subscriber(boost::bind(&b100_impl::update_tx_samp_rate, this, 0, _1));
.set_coercer(std::bind(&tx_dsp_core_200::set_host_rate, _tx_dsp, std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b100_impl::update_tx_samp_rate, this, 0, std::placeholders::_1));
_tree->create<double>(mb_path / "tx_dsps/0/freq/value")
.set_coercer(boost::bind(&tx_dsp_core_200::set_freq, _tx_dsp, _1));
.set_coercer(std::bind(&tx_dsp_core_200::set_freq, _tx_dsp, std::placeholders::_1));
_tree->create<meta_range_t>(mb_path / "tx_dsps/0/freq/range")
.set_publisher(boost::bind(&tx_dsp_core_200::get_freq_range, _tx_dsp));
.set_publisher(std::bind(&tx_dsp_core_200::get_freq_range, _tx_dsp));
////////////////////////////////////////////////////////////////////
// create time control objects
@ -415,21 +416,21 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_fifo_ctrl, TOREG(SR_TIME64), time64_rb_bases
);
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&time64_core_200::set_tick_rate, _time64, _1));
.add_coerced_subscriber(std::bind(&time64_core_200::set_tick_rate, _time64, std::placeholders::_1));
_tree->create<time_spec_t>(mb_path / "time/now")
.set_publisher(boost::bind(&time64_core_200::get_time_now, _time64))
.add_coerced_subscriber(boost::bind(&time64_core_200::set_time_now, _time64, _1));
.set_publisher(std::bind(&time64_core_200::get_time_now, _time64))
.add_coerced_subscriber(std::bind(&time64_core_200::set_time_now, _time64, std::placeholders::_1));
_tree->create<time_spec_t>(mb_path / "time/pps")
.set_publisher(boost::bind(&time64_core_200::get_time_last_pps, _time64))
.add_coerced_subscriber(boost::bind(&time64_core_200::set_time_next_pps, _time64, _1));
.set_publisher(std::bind(&time64_core_200::get_time_last_pps, _time64))
.add_coerced_subscriber(std::bind(&time64_core_200::set_time_next_pps, _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, _time64, _1));
.add_coerced_subscriber(std::bind(&time64_core_200::set_time_source, _time64, std::placeholders::_1));
_tree->create<std::vector<std::string> >(mb_path / "time_source/options")
.set_publisher(boost::bind(&time64_core_200::get_time_sources, _time64));
.set_publisher(std::bind(&time64_core_200::get_time_sources, _time64));
//setup reference source props
_tree->create<std::string>(mb_path / "clock_source/value")
.add_coerced_subscriber(boost::bind(&b100_impl::update_clock_source, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::update_clock_source, this, std::placeholders::_1));
static const std::vector<std::string> clock_sources = {
"internal", "external", "auto"
};
@ -440,7 +441,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
////////////////////////////////////////////////////////////////////
_user = user_settings_core_200::make(_fifo_ctrl, TOREG(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, _user, _1));
.add_coerced_subscriber(std::bind(&user_settings_core_200::set_reg, _user, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create dboard control objects
@ -458,13 +459,13 @@ b100_impl::b100_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(&b100_impl::set_db_eeprom, this, "rx", _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_db_eeprom, this, "rx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards/A/tx_eeprom")
.set(tx_db_eeprom)
.add_coerced_subscriber(boost::bind(&b100_impl::set_db_eeprom, this, "tx", _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_db_eeprom, this, "tx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards/A/gdb_eeprom")
.set(gdb_eeprom)
.add_coerced_subscriber(boost::bind(&b100_impl::set_db_eeprom, this, "gdb", _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_db_eeprom, this, "gdb", std::placeholders::_1));
//create a new dboard interface and manager
_dboard_manager = dboard_manager::make(
@ -477,12 +478,12 @@ b100_impl::b100_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(&b100_impl::set_tx_fe_corrections, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_tx_fe_corrections, this, 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(&b100_impl::set_rx_fe_corrections, this, _1));
.add_coerced_subscriber(std::bind(&b100_impl::set_rx_fe_corrections, this, std::placeholders::_1));
}
//initialize io handling
@ -498,7 +499,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
this->update_rates();
_tree->access<double>(mb_path / "tick_rate") //now add_coerced_subscriber the clock rate setter
.add_coerced_subscriber(boost::bind(&b100_clock_ctrl::set_fpga_clock_rate, _clock_ctrl, _1));
.add_coerced_subscriber(std::bind(&b100_clock_ctrl::set_fpga_clock_rate, _clock_ctrl, std::placeholders::_1));
//reset cordic rates and their properties to zero
for(const std::string &name: _tree->list(mb_path / "rx_dsps")){

View File

@ -5,16 +5,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include "../../transport/super_recv_packet_handler.hpp"
#include "../../transport/super_send_packet_handler.hpp"
#include "b100_impl.hpp"
#include <uhd/utils/log.hpp>
#include <uhdlib/usrp/common/validate_subdev_spec.hpp>
#include "../../transport/super_recv_packet_handler.hpp"
#include "../../transport/super_send_packet_handler.hpp"
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <functional>
#include <memory>
using namespace uhd;
@ -149,14 +147,14 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
_rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
_rx_dsps[dsp]->setup(args);
_recv_demuxer->realloc_sid(B100_RX_SID_BASE + dsp);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&recv_packet_demuxer_3000::get_recv_buff, _recv_demuxer, B100_RX_SID_BASE + dsp, _1
my_streamer->set_xport_chan_get_buff(chan_i, std::bind(
&recv_packet_demuxer_3000::get_recv_buff, _recv_demuxer, B100_RX_SID_BASE + dsp, std::placeholders::_1
), true /*flush*/);
my_streamer->set_overflow_handler(chan_i, boost::bind(
my_streamer->set_overflow_handler(chan_i, std::bind(
&rx_dsp_core_200::handle_overflow, _rx_dsps[dsp]
));
my_streamer->set_issue_stream_cmd(chan_i, boost::bind(
&rx_dsp_core_200::issue_stream_command, _rx_dsps[dsp], _1));
my_streamer->set_issue_stream_cmd(chan_i, std::bind(
&rx_dsp_core_200::issue_stream_command, _rx_dsps[dsp], std::placeholders::_1));
_rx_streamers[dsp] = my_streamer; //store weak pointer
}
@ -207,10 +205,10 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
_tx_dsp->setup(args);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
my_streamer->set_xport_chan_get_buff(chan_i, std::bind(
&zero_copy_if::get_send_buff, _data_transport, std::placeholders::_1
));
my_streamer->set_async_receiver(boost::bind(&fifo_ctrl_excelsior::pop_async_msg, _fifo_ctrl, _1, _2));
my_streamer->set_async_receiver(std::bind(&fifo_ctrl_excelsior::pop_async_msg, _fifo_ctrl, std::placeholders::_1, std::placeholders::_2));
_tx_streamers[dsp] = my_streamer; //store weak pointer
}

View File

@ -5,18 +5,18 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <uhd/transport/usb_zero_copy.hpp>
#include <uhd/transport/buffer_pool.hpp>
#include <uhd/transport/usb_zero_copy.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhdlib/utils/atomic.hpp>
#include <memory>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/bind.hpp>
#include <vector>
#include <boost/thread/mutex.hpp>
#include <functional>
#include <iostream>
#include <memory>
#include <vector>
using namespace uhd;
using namespace uhd::transport;
@ -75,7 +75,7 @@ public:
_internal(internal), _fragmentation_size(fragmentation_size)
{
_ok_to_auto_flush = false;
_task = uhd::task::make(boost::bind(&usb_zero_copy_wrapper_msb::auto_flush, this));
_task = uhd::task::make(std::bind(&usb_zero_copy_wrapper_msb::auto_flush, this));
}
~usb_zero_copy_wrapper_msb(void)

View File

@ -6,25 +6,24 @@
//
#include "b200_iface.hpp"
#include <uhd/config.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/utils/ihex.hpp>
#include <libusb.h>
#include <stdint.h>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/functional/hash.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <libusb.h>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#include <iomanip>
#include <chrono>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <string>
#include <thread>
#include <stdint.h>
#include <vector>
//! libusb_error_name is only in newer API
#ifndef HAVE_LIBUSB_ERROR_NAME
@ -215,9 +214,9 @@ public:
ihex_reader file_reader(filestring);
try {
file_reader.read(
boost::bind(
std::bind(
&b200_iface_impl::fx3_control_write, this,
FX3_FIRMWARE_LOAD, _1, _2, _3, _4, 0
FX3_FIRMWARE_LOAD, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, 0
)
);
} catch (const uhd::io_error &e) {

View File

@ -6,27 +6,27 @@
//
#include "b200_impl.hpp"
#include "../../transport/libusb1_base.hpp"
#include "b200_regs.hpp"
#include <uhd/config.hpp>
#include <uhd/transport/usb_control.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/transport/usb_control.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <boost/format.hpp>
#include <uhd/utils/static.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/functional/hash.hpp>
#include <memory>
#include <boost/lexical_cast.hpp>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <cmath>
#include <chrono>
#include "../../transport/libusb1_base.hpp"
#include <functional>
#include <memory>
using namespace uhd;
using namespace uhd::usrp;
@ -357,7 +357,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
const mboard_eeprom_t mb_eeprom = get_mb_eeprom(_iface);
_tree->create<mboard_eeprom_t>(mb_path / "eeprom")
.set(mb_eeprom)
.add_coerced_subscriber(boost::bind(&b200_impl::set_mb_eeprom, this, _1));
.add_coerced_subscriber(std::bind(&b200_impl::set_mb_eeprom, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Identify the device type
@ -457,7 +457,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
{
_async_task_data->gpsdo_uart = b200_uart::make(_ctrl_transport, B200_TX_GPS_UART_SID);
}
_async_task = uhd::msg_task::make(boost::bind(&b200_impl::handle_async_task, this, _ctrl_transport, _async_task_data));
_async_task = uhd::msg_task::make(std::bind(&b200_impl::handle_async_task, this, _ctrl_transport, _async_task_data));
////////////////////////////////////////////////////////////////////
// Local control endpoint
@ -494,7 +494,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
for(const std::string &name: _gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, _gps, name));
.set_publisher(std::bind(&gps_ctrl::get_sensor, _gps, name));
}
}
else
@ -611,9 +611,9 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
// create clock control objects
////////////////////////////////////////////////////////////////////
_tree->create<double>(mb_path / "tick_rate")
.set_coercer(boost::bind(&b200_impl::set_tick_rate, this, _1))
.set_publisher(boost::bind(&b200_impl::get_tick_rate, this))
.add_coerced_subscriber(boost::bind(&b200_impl::update_tick_rate, this, _1));
.set_coercer(std::bind(&b200_impl::set_tick_rate, this, std::placeholders::_1))
.set_publisher(std::bind(&b200_impl::get_tick_rate, this))
.add_coerced_subscriber(std::bind(&b200_impl::update_tick_rate, this, std::placeholders::_1));
_tree->create<meta_range_t>(mb_path / "tick_rate/range")
.set_publisher([this](){
return this->_codec_ctrl->get_clock_rate_range();
@ -626,7 +626,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
// and do the misc mboard sensors
////////////////////////////////////////////////////////////////////
_tree->create<sensor_value_t>(mb_path / "sensors" / "ref_locked")
.set_publisher(boost::bind(&b200_impl::get_ref_locked, this));
.set_publisher(std::bind(&b200_impl::get_ref_locked, this));
////////////////////////////////////////////////////////////////////
// create frontend mapping
@ -635,13 +635,13 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
_tree->create<std::vector<size_t> >(mb_path / "rx_chan_dsp_mapping").set(default_map);
_tree->create<std::vector<size_t> >(mb_path / "tx_chan_dsp_mapping").set(default_map);
_tree->create<subdev_spec_t>(mb_path / "rx_subdev_spec")
.set_coercer(boost::bind(&b200_impl::coerce_subdev_spec, this, _1))
.set_coercer(std::bind(&b200_impl::coerce_subdev_spec, this, std::placeholders::_1))
.set(subdev_spec_t())
.add_coerced_subscriber(boost::bind(&b200_impl::update_subdev_spec, this, "rx", _1));
.add_coerced_subscriber(std::bind(&b200_impl::update_subdev_spec, this, "rx", std::placeholders::_1));
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.set_coercer(boost::bind(&b200_impl::coerce_subdev_spec, this, _1))
.set_coercer(std::bind(&b200_impl::coerce_subdev_spec, this, std::placeholders::_1))
.set(subdev_spec_t())
.add_coerced_subscriber(boost::bind(&b200_impl::update_subdev_spec, this, "tx", _1));
.add_coerced_subscriber(std::bind(&b200_impl::update_subdev_spec, this, "tx", std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// setup radio control
@ -670,18 +670,18 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
//register time now and pps onto available radio cores
_tree->create<time_spec_t>(mb_path / "time" / "now")
.set_publisher(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64))
.add_coerced_subscriber(boost::bind(&b200_impl::set_time, this, _1))
.set_publisher(std::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64))
.add_coerced_subscriber(std::bind(&b200_impl::set_time, this, std::placeholders::_1))
.set(0.0);
//re-sync the times when the tick rate changes
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&b200_impl::sync_times, this));
.add_coerced_subscriber(std::bind(&b200_impl::sync_times, this));
_tree->create<time_spec_t>(mb_path / "time" / "pps")
.set_publisher(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64));
.set_publisher(std::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64));
for(radio_perifs_t &perif: _radio_perifs)
{
_tree->access<time_spec_t>(mb_path / "time" / "pps")
.add_coerced_subscriber(boost::bind(&time_core_3000::set_time_next_pps, perif.time64, _1));
.add_coerced_subscriber(std::bind(&time_core_3000::set_time_next_pps, perif.time64, std::placeholders::_1));
}
//setup time source props
@ -692,8 +692,8 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
_tree->create<std::vector<std::string> >(mb_path / "time_source" / "options")
.set(time_sources);
_tree->create<std::string>(mb_path / "time_source" / "value")
.set_coercer(boost::bind(&check_option_valid, "time source", time_sources, _1))
.add_coerced_subscriber(boost::bind(&b200_impl::update_time_source, this, _1));
.set_coercer(std::bind(&check_option_valid, "time source", time_sources, std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b200_impl::update_time_source, this, std::placeholders::_1));
//setup reference source props
const std::vector<std::string> clock_sources =
(_gpsdo_capable) ?
@ -702,8 +702,8 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
_tree->create<std::vector<std::string> >(mb_path / "clock_source" / "options")
.set(clock_sources);
_tree->create<std::string>(mb_path / "clock_source" / "value")
.set_coercer(boost::bind(&check_option_valid, "clock source", clock_sources, _1))
.add_coerced_subscriber(boost::bind(&b200_impl::update_clock_source, this, _1));
.set_coercer(std::bind(&check_option_valid, "clock source", clock_sources, std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b200_impl::update_clock_source, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// front panel gpio
@ -732,12 +732,12 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
break;
case usrp::gpio_atr::GPIO_READBACK:
_tree->create<uint32_t>(mb_path / "gpio" / "FP0" / "READBACK")
.set_publisher(boost::bind(&gpio_atr_3000::read_gpio, _radio_perifs[0].fp_gpio));
.set_publisher(std::bind(&gpio_atr_3000::read_gpio, _radio_perifs[0].fp_gpio));
break;
default:
_tree->create<uint32_t>(mb_path / "gpio" / "FP0" / attr.second)
.set(0)
.add_coerced_subscriber(boost::bind(&gpio_atr_3000::set_gpio_attr, _radio_perifs[0].fp_gpio, attr.first, _1));
.add_coerced_subscriber(std::bind(&gpio_atr_3000::set_gpio_attr, _radio_perifs[0].fp_gpio, attr.first, std::placeholders::_1));
}
}
@ -817,9 +817,9 @@ void b200_impl::setup_radio(const size_t dspno)
perif.ctrl->hold_task(_async_task);
_async_task_data->radio_ctrl[dspno] = perif.ctrl; //weak
_tree->access<time_spec_t>(mb_path / "time" / "cmd")
.add_coerced_subscriber(boost::bind(&radio_ctrl_core_3000::set_time, perif.ctrl, _1));
.add_coerced_subscriber(std::bind(&radio_ctrl_core_3000::set_time, perif.ctrl, std::placeholders::_1));
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&radio_ctrl_core_3000::set_tick_rate, perif.ctrl, _1));
.add_coerced_subscriber(std::bind(&radio_ctrl_core_3000::set_tick_rate, perif.ctrl, std::placeholders::_1));
this->register_loopback_self_test(perif.ctrl);
////////////////////////////////////////////////////////////////////
@ -865,20 +865,20 @@ void b200_impl::setup_radio(const size_t dspno)
perif.ddc->populate_subtree(_tree->subtree(rx_dsp_path));
_tree->create<bool>(rx_dsp_path / "rate" / "set").set(false);
_tree->access<double>(rx_dsp_path / "rate" / "value")
.set_coercer(boost::bind(&b200_impl::coerce_rx_samp_rate, this, perif.ddc, dspno, _1))
.set_coercer(std::bind(&b200_impl::coerce_rx_samp_rate, this, perif.ddc, dspno, std::placeholders::_1))
.add_coerced_subscriber([this, rx_dsp_path](const double){
if (this->_tree) {
this->_tree->access<bool>(rx_dsp_path / "rate" / "set")
.set(true);
}
})
.add_coerced_subscriber(boost::bind(&b200_impl::update_rx_samp_rate, this, dspno, _1))
.add_coerced_subscriber(std::bind(&b200_impl::update_rx_samp_rate, this, dspno, std::placeholders::_1))
;
_tree->create<stream_cmd_t>(rx_dsp_path / "stream_cmd")
.add_coerced_subscriber(boost::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, _1));
.add_coerced_subscriber(std::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, std::placeholders::_1));
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&rx_vita_core_3000::set_tick_rate, perif.framer, _1))
.add_coerced_subscriber(boost::bind(&b200_impl::update_rx_dsp_tick_rate, this, _1, perif.ddc, rx_dsp_path))
.add_coerced_subscriber(std::bind(&rx_vita_core_3000::set_tick_rate, perif.framer, std::placeholders::_1))
.add_coerced_subscriber(std::bind(&b200_impl::update_rx_dsp_tick_rate, this, std::placeholders::_1, perif.ddc, rx_dsp_path))
;
////////////////////////////////////////////////////////////////////
@ -888,17 +888,17 @@ void b200_impl::setup_radio(const size_t dspno)
perif.duc->populate_subtree(_tree->subtree(tx_dsp_path));
_tree->create<bool>(tx_dsp_path / "rate" / "set").set(false);
_tree->access<double>(tx_dsp_path / "rate" / "value")
.set_coercer(boost::bind(&b200_impl::coerce_tx_samp_rate, this, perif.duc, dspno, _1))
.set_coercer(std::bind(&b200_impl::coerce_tx_samp_rate, this, perif.duc, dspno, std::placeholders::_1))
.add_coerced_subscriber([this, tx_dsp_path](const double){
if (this->_tree) {
this->_tree->access<bool>(tx_dsp_path / "rate" / "set")
.set(true);
}
})
.add_coerced_subscriber(boost::bind(&b200_impl::update_tx_samp_rate, this, dspno, _1))
.add_coerced_subscriber(std::bind(&b200_impl::update_tx_samp_rate, this, dspno, std::placeholders::_1))
;
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&b200_impl::update_tx_dsp_tick_rate, this, _1, perif.duc, tx_dsp_path))
.add_coerced_subscriber(std::bind(&b200_impl::update_tx_dsp_tick_rate, this, std::placeholders::_1, perif.duc, tx_dsp_path))
;
////////////////////////////////////////////////////////////////////
@ -917,17 +917,17 @@ void b200_impl::setup_radio(const size_t dspno)
// Now connect all the b200_impl-specific items
_tree->create<sensor_value_t>(rf_fe_path / "sensors" / "lo_locked")
.set_publisher(boost::bind(&b200_impl::get_fe_pll_locked, this, dir == TX_DIRECTION))
.set_publisher(std::bind(&b200_impl::get_fe_pll_locked, this, dir == TX_DIRECTION))
;
_tree->access<double>(rf_fe_path / "freq" / "value")
.add_coerced_subscriber(boost::bind(&b200_impl::update_bandsel, this, key, _1))
.add_coerced_subscriber(std::bind(&b200_impl::update_bandsel, this, key, std::placeholders::_1))
;
if (dir == RX_DIRECTION)
{
static const std::vector<std::string> ants{"TX/RX", "RX2"};
_tree->create<std::vector<std::string> >(rf_fe_path / "antenna" / "options").set(ants);
_tree->create<std::string>(rf_fe_path / "antenna" / "value")
.add_coerced_subscriber(boost::bind(&b200_impl::update_antenna_sel, this, dspno, _1))
.add_coerced_subscriber(std::bind(&b200_impl::update_antenna_sel, this, dspno, std::placeholders::_1))
.set("RX2")
;

View File

@ -12,7 +12,7 @@
#include <uhd/utils/math.hpp>
#include <uhdlib/usrp/common/async_packet_handler.hpp>
#include <uhdlib/usrp/common/validate_subdev_spec.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <memory>
#include <set>
@ -458,12 +458,12 @@ rx_streamer::sptr b200_impl::get_rx_stream(const uhd::stream_args_t& args_)
perif.ddc->setup(args);
_demux->realloc_sid(sid);
my_streamer->set_xport_chan_get_buff(stream_i,
boost::bind(&recv_packet_demuxer_3000::get_recv_buff, _demux, sid, _1),
std::bind(&recv_packet_demuxer_3000::get_recv_buff, _demux, sid, std::placeholders::_1),
true /*flush*/);
my_streamer->set_overflow_handler(
stream_i, boost::bind(&b200_impl::handle_overflow, this, radio_index));
stream_i, std::bind(&b200_impl::handle_overflow, this, radio_index));
my_streamer->set_issue_stream_cmd(stream_i,
boost::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, _1));
std::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, std::placeholders::_1));
perif.rx_streamer = my_streamer; // store weak pointer
// sets all tick and samp rates on this streamer
@ -575,9 +575,9 @@ tx_streamer::sptr b200_impl::get_tx_stream(const uhd::stream_args_t& args_)
perif.duc->setup(args);
my_streamer->set_xport_chan_get_buff(
stream_i, boost::bind(&zero_copy_if::get_send_buff, _data_transport, _1));
my_streamer->set_async_receiver(boost::bind(
&async_md_type::pop_with_timed_wait, _async_task_data->async_md, _1, _2));
stream_i, std::bind(&zero_copy_if::get_send_buff, _data_transport, std::placeholders::_1));
my_streamer->set_async_receiver(std::bind(
&async_md_type::pop_with_timed_wait, _async_task_data->async_md, std::placeholders::_1, std::placeholders::_2));
my_streamer->set_xport_chan_sid(
stream_i, true, radio_index ? B200_TX_DATA1_SID : B200_TX_DATA0_SID);
my_streamer->set_enable_trailer(false); // TODO not implemented trailer support

View File

@ -16,7 +16,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <queue>
using namespace uhd;

View File

@ -14,9 +14,9 @@
#include <uhdlib/usrp/cores/rx_dsp_core_3000.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/thread/thread.hpp> //thread sleep
#include <algorithm>
#include <cmath>
#include <functional>
#define REG_DSP_RX_FREQ _dsp_base + 0
#define REG_DSP_RX_SCALE_IQ _dsp_base + 4
@ -297,16 +297,16 @@ public:
void populate_subtree(property_tree::sptr subtree)
{
subtree->create<meta_range_t>("rate/range")
.set_publisher(boost::bind(&rx_dsp_core_3000::get_host_rates, this));
.set_publisher(std::bind(&rx_dsp_core_3000::get_host_rates, this));
subtree->create<double>("rate/value")
.set(DEFAULT_RATE)
.set_coercer(boost::bind(&rx_dsp_core_3000::set_host_rate, this, _1));
.set_coercer(std::bind(&rx_dsp_core_3000::set_host_rate, this, std::placeholders::_1));
subtree->create<double>("freq/value")
.set(DEFAULT_CORDIC_FREQ)
.set_coercer(boost::bind(&rx_dsp_core_3000::set_freq, this, _1))
.set_coercer(std::bind(&rx_dsp_core_3000::set_freq, this, std::placeholders::_1))
.set_publisher([this]() { return this->get_freq(); });
subtree->create<meta_range_t>("freq/range")
.set_publisher(boost::bind(&rx_dsp_core_3000::get_freq_range, this));
.set_publisher(std::bind(&rx_dsp_core_3000::get_freq_range, this));
}
private:

View File

@ -5,10 +5,10 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <uhdlib/usrp/cores/rx_frontend_core_200.hpp>
#include <uhd/types/ranges.hpp>
#include <uhdlib/usrp/cores/rx_frontend_core_200.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/bind.hpp>
#include <functional>
using namespace uhd;
@ -82,15 +82,15 @@ public:
;
subtree->create<std::complex<double> >("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
.set_coercer(boost::bind(&rx_frontend_core_200::set_dc_offset, this, _1))
.set_coercer(std::bind(&rx_frontend_core_200::set_dc_offset, this, std::placeholders::_1))
;
subtree->create<bool>("dc_offset/enable")
.set(DEFAULT_DC_OFFSET_ENABLE)
.add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, this, _1))
.add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_dc_offset_auto, this, std::placeholders::_1))
;
subtree->create<std::complex<double> >("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
.add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_iq_balance, this, _1))
.add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_iq_balance, this, std::placeholders::_1))
;
}

View File

@ -11,8 +11,8 @@
#include <uhdlib/usrp/cores/dsp_core_utils.hpp>
#include <uhdlib/usrp/cores/rx_frontend_core_3000.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/bind.hpp>
#include <boost/math/special_functions/round.hpp>
#include <functional>
using namespace uhd;
@ -177,15 +177,15 @@ public:
.set(meta_range_t(DC_OFFSET_MIN, DC_OFFSET_MAX));
subtree->create<std::complex<double>>("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
.set_coercer(boost::bind(&rx_frontend_core_3000::set_dc_offset, this, _1));
.set_coercer(std::bind(&rx_frontend_core_3000::set_dc_offset, this, std::placeholders::_1));
subtree->create<bool>("dc_offset/enable")
.set(DEFAULT_DC_OFFSET_ENABLE)
.add_coerced_subscriber(
boost::bind(&rx_frontend_core_3000::set_dc_offset_auto, this, _1));
std::bind(&rx_frontend_core_3000::set_dc_offset_auto, this, std::placeholders::_1));
subtree->create<std::complex<double>>("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
.add_coerced_subscriber(
boost::bind(&rx_frontend_core_3000::set_iq_balance, this, _1));
std::bind(&rx_frontend_core_3000::set_iq_balance, this, std::placeholders::_1));
}
double get_output_rate()

View File

@ -13,9 +13,9 @@
#include <uhdlib/usrp/cores/tx_dsp_core_3000.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/thread/thread.hpp> //sleep
#include <algorithm>
#include <cmath>
#include <functional>
#define REG_DSP_TX_FREQ _dsp_base + 0
#define REG_DSP_TX_SCALE_IQ _dsp_base + 4
@ -184,16 +184,16 @@ public:
void populate_subtree(property_tree::sptr subtree)
{
subtree->create<meta_range_t>("rate/range")
.set_publisher(boost::bind(&tx_dsp_core_3000::get_host_rates, this));
.set_publisher(std::bind(&tx_dsp_core_3000::get_host_rates, this));
subtree->create<double>("rate/value")
.set(DEFAULT_RATE)
.set_coercer(boost::bind(&tx_dsp_core_3000::set_host_rate, this, _1));
.set_coercer(std::bind(&tx_dsp_core_3000::set_host_rate, this, std::placeholders::_1));
subtree->create<double>("freq/value")
.set(DEFAULT_CORDIC_FREQ)
.set_coercer(boost::bind(&tx_dsp_core_3000::set_freq, this, _1))
.set_coercer(std::bind(&tx_dsp_core_3000::set_freq, this, std::placeholders::_1))
.set_publisher([this]() { return this->get_freq(); });
subtree->create<meta_range_t>("freq/range")
.set_publisher(boost::bind(&tx_dsp_core_3000::get_freq_range, this));
.set_publisher(std::bind(&tx_dsp_core_3000::get_freq_range, this));
}
private:

View File

@ -11,7 +11,7 @@
#include <uhd/exception.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/bind.hpp>
#include <functional>
using namespace uhd;
@ -78,11 +78,11 @@ public:
;
subtree->create< std::complex<double> >("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
.set_coercer(boost::bind(&tx_frontend_core_200::set_dc_offset, this, _1))
.set_coercer(std::bind(&tx_frontend_core_200::set_dc_offset, this, std::placeholders::_1))
;
subtree->create< std::complex<double> >("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
.add_coerced_subscriber(boost::bind(&tx_frontend_core_200::set_iq_balance, this, _1))
.add_coerced_subscriber(std::bind(&tx_frontend_core_200::set_iq_balance, this, std::placeholders::_1))
;
}

View File

@ -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));
}

View File

@ -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);

View File

@ -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")

View File

@ -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");

View File

@ -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);

View File

@ -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){

View File

@ -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));
}

View File

@ -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")

View File

@ -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);

View File

@ -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

View File

@ -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);
}

View File

@ -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);

View File

@ -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{

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -14,7 +14,7 @@
#include <uhd/types/dict.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <boost/assign/list_of.hpp>
using namespace uhd;

View File

@ -6,29 +6,30 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <uhd/convert.hpp>
#include <uhd/exception.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/types/eeprom.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/usrp/dboard_id.hpp>
#include <uhd/usrp/gpio_defs.hpp>
#include <uhd/exception.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/gain_group.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/math.hpp>
#include <uhd/utils/gain_group.hpp>
#include <uhd/usrp/dboard_id.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/convert.hpp>
#include <uhd/utils/soft_register.hpp>
#include <uhdlib/usrp/gpio_defs.hpp>
#include <uhdlib/rfnoc/rfnoc_device.hpp>
#include <uhdlib/usrp/gpio_defs.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
#include <memory>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <chrono>
#include <cmath>
#include <functional>
#include <memory>
#include <thread>
namespace uhd { namespace rfnoc {
@ -40,7 +41,6 @@ uhd::usrp::multi_usrp::sptr make_rfnoc_device(
}} /* namespace uhd::rfnoc */
using namespace uhd;
using namespace uhd::usrp;
@ -226,9 +226,9 @@ static meta_range_t get_gain_range(property_tree::sptr subtree){
static gain_fcns_t make_gain_fcns_from_subtree(property_tree::sptr subtree){
gain_fcns_t gain_fcns;
gain_fcns.get_range = boost::bind(&get_gain_range, subtree);
gain_fcns.get_value = boost::bind(&get_gain_value, subtree);
gain_fcns.set_value = boost::bind(&set_gain_value, subtree, _1);
gain_fcns.get_range = std::bind(&get_gain_range, subtree);
gain_fcns.get_value = std::bind(&get_gain_value, subtree);
gain_fcns.set_value = std::bind(&set_gain_value, subtree, std::placeholders::_1);
return gain_fcns;
}

View File

@ -12,18 +12,18 @@
#include "../../transport/super_recv_packet_handler.hpp"
#define SSPH_DONT_PAD_TO_ONE
#include "../../transport/super_send_packet_handler.hpp"
#include <uhd/utils/log.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/transport/bounded_buffer.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/tasks.hpp>
#include <boost/format.hpp>
#include <memory>
#include <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/thread/thread.hpp>
#include <atomic>
#include <chrono>
#include <functional>
#include <memory>
#include <thread>
#define bmFR_RX_FORMAT_SHIFT_SHIFT 0
@ -140,7 +140,7 @@ struct usrp1_impl::io_impl{
io_impl(zero_copy_if::sptr data_transport):
data_transport(data_transport),
curr_buff(offset_send_buffer(data_transport->get_send_buff())),
omsb(boost::bind(&usrp1_impl::io_impl::commit_send_buff, this, _1, _2, _3)),
omsb(std::bind(&usrp1_impl::io_impl::commit_send_buff, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)),
vandal_loop_exit(false)
{
/* NOP */
@ -242,7 +242,7 @@ void usrp1_impl::io_init(void){
_io_impl->flush_send_buff();
//create a new vandal thread to poll xerflow conditions
_io_impl->vandal_task = task::make(boost::bind(
_io_impl->vandal_task = task::make(std::bind(
&usrp1_impl::vandal_conquest_loop, this, std::ref(_io_impl->vandal_loop_exit)
));
}
@ -637,8 +637,8 @@ rx_streamer::sptr usrp1_impl::get_rx_stream(const uhd::stream_args_t &args_){
//init some streamer stuff
my_streamer->set_tick_rate(_master_clock_rate);
my_streamer->set_vrt_unpacker(&usrp1_bs_vrt_unpacker);
my_streamer->set_xport_chan_get_buff(0, boost::bind(
&uhd::transport::zero_copy_if::get_recv_buff, _io_impl->data_transport, _1
my_streamer->set_xport_chan_get_buff(0, std::bind(
&uhd::transport::zero_copy_if::get_recv_buff, _io_impl->data_transport, std::placeholders::_1
));
//set the converter
@ -687,15 +687,15 @@ tx_streamer::sptr usrp1_impl::get_tx_stream(const uhd::stream_args_t &args_){
const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format);
//make the new streamer given the samples per packet
std::function<void(bool)> tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1);
std::function<void(bool)> tx_fcn = std::bind(&usrp1_impl::tx_stream_on_off, this, std::placeholders::_1);
std::shared_ptr<usrp1_send_packet_streamer> my_streamer =
std::make_shared<usrp1_send_packet_streamer>(spp, _soft_time_ctrl, tx_fcn);
//init some streamer stuff
my_streamer->set_tick_rate(_master_clock_rate);
my_streamer->set_vrt_packer(&usrp1_bs_vrt_packer);
my_streamer->set_xport_chan_get_buff(0, boost::bind(
&usrp1_impl::io_impl::get_send_buff, _io_impl.get(), _1
my_streamer->set_xport_chan_get_buff(0, std::bind(
&usrp1_impl::io_impl::get_send_buff, _io_impl.get(), std::placeholders::_1
));
//set the converter

View File

@ -6,12 +6,13 @@
//
#include "soft_time_ctrl.hpp"
#include <uhdlib/utils/system_time.hpp>
#include <uhd/utils/tasks.hpp>
#include <memory>
#include <boost/thread/condition_variable.hpp>
#include <uhdlib/utils/system_time.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread/condition_variable.hpp>
#include <functional>
#include <iostream>
#include <memory>
using namespace uhd;
using namespace uhd::usrp;
@ -39,7 +40,7 @@ public:
_stream_on_off(stream_on_off)
{
//synchronously spawn a new thread
_recv_cmd_task = task::make(boost::bind(&soft_time_ctrl_impl::recv_cmd_task, this));
_recv_cmd_task = task::make(std::bind(&soft_time_ctrl_impl::recv_cmd_task, this));
//initialize the time to something
this->set_time(time_spec_t(0.0));

View File

@ -6,20 +6,20 @@
//
#include "usrp1_impl.hpp"
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/transport/usb_control.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/transport/usb_control.hpp>
#include <uhd/utils/cast.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <boost/format.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/static.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/round.hpp>
#include <cstdio>
#include <chrono>
#include <cstdio>
#include <functional>
using namespace uhd;
using namespace uhd::usrp;
@ -176,7 +176,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
);
_iface = usrp1_iface::make(_fx2_ctrl);
_soft_time_ctrl = soft_time_ctrl::make(
boost::bind(&usrp1_impl::rx_stream_on_off, this, _1)
std::bind(&usrp1_impl::rx_stream_on_off, this, std::placeholders::_1)
);
_dbc["A"]; _dbc["B"]; //ensure that keys exist
@ -201,13 +201,13 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
const fs_path mb_path = "/mboards/0";
_tree->create<std::string>(mb_path / "name").set("USRP1");
_tree->create<std::string>(mb_path / "load_eeprom")
.add_coerced_subscriber(boost::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, _1));
.add_coerced_subscriber(std::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create user-defined control objects
////////////////////////////////////////////////////////////////////
_tree->create<std::pair<uint8_t, uint32_t> >(mb_path / "user" / "regs")
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_reg, this, _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::set_reg, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// setup the mboard eeprom
@ -216,7 +216,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
const mboard_eeprom_t mb_eeprom = this->get_mb_eeprom(_fx2_ctrl);
_tree->create<mboard_eeprom_t>(mb_path / "eeprom")
.set(mb_eeprom)
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_mb_eeprom, this, _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::set_mb_eeprom, this, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// create clock control objects
@ -240,7 +240,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
}
UHD_LOGGER_INFO("USRP1") << boost::format("Using FPGA clock rate of %fMHz...") % (_master_clock_rate/1e6) ;
_tree->create<double>(mb_path / "tick_rate")
.add_coerced_subscriber(boost::bind(&usrp1_impl::update_tick_rate, this, _1))
.add_coerced_subscriber(std::bind(&usrp1_impl::update_tick_rate, this, std::placeholders::_1))
.set(_master_clock_rate);
////////////////////////////////////////////////////////////////////
@ -253,13 +253,13 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
_tree->create<std::string>(rx_codec_path / "name").set("ad9522");
_tree->create<meta_range_t>(rx_codec_path / "gains/pga/range").set(usrp1_codec_ctrl::rx_pga_gain_range);
_tree->create<double>(rx_codec_path / "gains/pga/value")
.set_coercer(boost::bind(&usrp1_impl::update_rx_codec_gain, this, db, _1))
.set_coercer(std::bind(&usrp1_impl::update_rx_codec_gain, this, db, std::placeholders::_1))
.set(0.0);
_tree->create<std::string>(tx_codec_path / "name").set("ad9522");
_tree->create<meta_range_t>(tx_codec_path / "gains/pga/range").set(usrp1_codec_ctrl::tx_pga_gain_range);
_tree->create<double>(tx_codec_path / "gains/pga/value")
.add_coerced_subscriber(boost::bind(&usrp1_codec_ctrl::set_tx_pga_gain, _dbc[db].codec, _1))
.set_publisher(boost::bind(&usrp1_codec_ctrl::get_tx_pga_gain, _dbc[db].codec))
.add_coerced_subscriber(std::bind(&usrp1_codec_ctrl::set_tx_pga_gain, _dbc[db].codec, std::placeholders::_1))
.set_publisher(std::bind(&usrp1_codec_ctrl::get_tx_pga_gain, _dbc[db].codec))
.set(0.0);
}
@ -274,18 +274,18 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
////////////////////////////////////////////////////////////////////
_tree->create<subdev_spec_t>(mb_path / "rx_subdev_spec")
.set(subdev_spec_t())
.add_coerced_subscriber(boost::bind(&usrp1_impl::update_rx_subdev_spec, this, _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::update_rx_subdev_spec, this, std::placeholders::_1));
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.set(subdev_spec_t())
.add_coerced_subscriber(boost::bind(&usrp1_impl::update_tx_subdev_spec, this, _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::update_tx_subdev_spec, this, std::placeholders::_1));
for(const std::string &db: _dbc.keys()){
const fs_path rx_fe_path = mb_path / "rx_frontends" / db;
_tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.set_coercer(boost::bind(&usrp1_impl::set_rx_dc_offset, this, db, _1))
.set_coercer(std::bind(&usrp1_impl::set_rx_dc_offset, this, db, 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(&usrp1_impl::set_enb_rx_dc_offset, this, db, _1))
.add_coerced_subscriber(std::bind(&usrp1_impl::set_enb_rx_dc_offset, this, db, std::placeholders::_1))
.set(true);
}
@ -296,19 +296,19 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
for (size_t dspno = 0; dspno < get_num_ddcs(); dspno++){
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(&usrp1_impl::get_rx_dsp_host_rates, this));
.set_publisher(std::bind(&usrp1_impl::get_rx_dsp_host_rates, this));
_tree->create<double>(rx_dsp_path / "rate/value")
.set(1e6) //some default rate
.set_coercer(boost::bind(&usrp1_impl::update_rx_samp_rate, this, dspno, _1));
.set_coercer(std::bind(&usrp1_impl::update_rx_samp_rate, this, dspno, std::placeholders::_1));
_tree->create<double>(rx_dsp_path / "freq/value")
.set_coercer(boost::bind(&usrp1_impl::update_rx_dsp_freq, this, dspno, _1));
.set_coercer(std::bind(&usrp1_impl::update_rx_dsp_freq, this, dspno, std::placeholders::_1));
_tree->create<meta_range_t>(rx_dsp_path / "freq/range")
.set_publisher(boost::bind(&usrp1_impl::get_rx_dsp_freq_range, this));
.set_publisher(std::bind(&usrp1_impl::get_rx_dsp_freq_range, this));
_tree->create<stream_cmd_t>(rx_dsp_path / "stream_cmd");
if (dspno == 0){
//only add_coerced_subscriber the callback for dspno 0 since it will stream all dsps
_tree->access<stream_cmd_t>(rx_dsp_path / "stream_cmd")
.add_coerced_subscriber(boost::bind(&soft_time_ctrl::issue_stream_cmd, _soft_time_ctrl, _1));
.add_coerced_subscriber(std::bind(&soft_time_ctrl::issue_stream_cmd, _soft_time_ctrl, std::placeholders::_1));
}
}
@ -319,22 +319,22 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
for (size_t dspno = 0; dspno < get_num_ducs(); dspno++){
fs_path tx_dsp_path = mb_path / str(boost::format("tx_dsps/%u") % dspno);
_tree->create<meta_range_t>(tx_dsp_path / "rate/range")
.set_publisher(boost::bind(&usrp1_impl::get_tx_dsp_host_rates, this));
.set_publisher(std::bind(&usrp1_impl::get_tx_dsp_host_rates, this));
_tree->create<double>(tx_dsp_path / "rate/value")
.set(1e6) //some default rate
.set_coercer(boost::bind(&usrp1_impl::update_tx_samp_rate, this, dspno, _1));
.set_coercer(std::bind(&usrp1_impl::update_tx_samp_rate, this, dspno, std::placeholders::_1));
_tree->create<double>(tx_dsp_path / "freq/value")
.set_coercer(boost::bind(&usrp1_impl::update_tx_dsp_freq, this, dspno, _1));
.set_coercer(std::bind(&usrp1_impl::update_tx_dsp_freq, this, dspno, std::placeholders::_1));
_tree->create<meta_range_t>(tx_dsp_path / "freq/range")
.set_publisher(boost::bind(&usrp1_impl::get_tx_dsp_freq_range, this));
.set_publisher(std::bind(&usrp1_impl::get_tx_dsp_freq_range, this));
}
////////////////////////////////////////////////////////////////////
// create time control objects
////////////////////////////////////////////////////////////////////
_tree->create<time_spec_t>(mb_path / "time/now")
.set_publisher(boost::bind(&soft_time_ctrl::get_time, _soft_time_ctrl))
.add_coerced_subscriber(boost::bind(&soft_time_ctrl::set_time, _soft_time_ctrl, _1));
.set_publisher(std::bind(&soft_time_ctrl::get_time, _soft_time_ctrl))
.add_coerced_subscriber(std::bind(&soft_time_ctrl::set_time, _soft_time_ctrl, std::placeholders::_1));
_tree->create<std::vector<std::string> >(mb_path / "clock_source/options").set(std::vector<std::string>(1, "internal"));
_tree->create<std::vector<std::string> >(mb_path / "time_source/options").set(std::vector<std::string>(1, "none"));
@ -358,13 +358,13 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
//create the properties and register subscribers
_tree->create<dboard_eeprom_t>(mb_path / "dboards" / db/ "rx_eeprom")
.set(rx_db_eeprom)
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_db_eeprom, this, db, "rx", _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::set_db_eeprom, this, db, "rx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards" / db/ "tx_eeprom")
.set(tx_db_eeprom)
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_db_eeprom, this, db, "tx", _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::set_db_eeprom, this, db, "tx", std::placeholders::_1));
_tree->create<dboard_eeprom_t>(mb_path / "dboards" / db/ "gdb_eeprom")
.set(gdb_eeprom)
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_db_eeprom, this, db, "gdb", _1));
.add_coerced_subscriber(std::bind(&usrp1_impl::set_db_eeprom, this, db, "gdb", std::placeholders::_1));
//create a new dboard interface and manager
dboard_iface::sptr dboard_iface = make_dboard_iface(

View File

@ -5,28 +5,27 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <uhdlib/usrp/common/validate_subdev_spec.hpp>
#include <uhdlib/usrp/common/async_packet_handler.hpp>
#include "../../transport/super_recv_packet_handler.hpp"
#include "../../transport/super_send_packet_handler.hpp"
#include "fw_common.h"
#include "usrp2_impl.hpp"
#include "usrp2_regs.hpp"
#include "fw_common.h"
#include <uhd/utils/log.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/thread.hpp>
#include <uhd/transport/bounded_buffer.hpp>
#include <boost/thread/thread.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/thread.hpp>
#include <uhdlib/usrp/common/async_packet_handler.hpp>
#include <uhdlib/usrp/common/validate_subdev_spec.hpp>
#include <boost/asio.hpp>
#include <boost/format.hpp>
#include <boost/thread/mutex.hpp>
#include <memory>
#include <iostream>
#include <boost/thread/thread.hpp>
#include <chrono>
#include <functional>
#include <iostream>
#include <memory>
#include <thread>
using namespace uhd;
@ -63,7 +62,7 @@ public:
*/
flow_control_monitor(seq_type max_seqs_out):_max_seqs_out(max_seqs_out){
this->clear();
_ready_fcn = boost::bind(&flow_control_monitor::ready, this);
_ready_fcn = std::bind(&flow_control_monitor::ready, this);
}
//! Clear the monitor, Ex: when a streamer is created
@ -242,10 +241,10 @@ void usrp2_impl::io_init(void){
size_t index = 0;
for(const std::string &mb: _mbc.keys()){
//spawn a new pirate to plunder the recv booty
_io_impl->pirate_tasks.push_back(task::make(boost::bind(
_io_impl->pirate_tasks.push_back(task::make(std::bind(
&usrp2_impl::io_impl::recv_pirate_loop, _io_impl.get(),
_mbc[mb].tx_dsp_xport, index++,
boost::ref(_pirate_task_exit)
std::ref(_pirate_task_exit)
)));
}
}
@ -454,11 +453,11 @@ rx_streamer::sptr usrp2_impl::get_rx_stream(const uhd::stream_args_t &args_){
_mbc[mb].rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
_mbc[mb].rx_dsps[dsp]->setup(args);
this->program_stream_dest(_mbc[mb].rx_dsp_xports[dsp], args);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_recv_buff, _mbc[mb].rx_dsp_xports[dsp], _1
my_streamer->set_xport_chan_get_buff(chan_i, std::bind(
&zero_copy_if::get_recv_buff, _mbc[mb].rx_dsp_xports[dsp], std::placeholders::_1
), true /*flush*/);
my_streamer->set_issue_stream_cmd(chan_i, boost::bind(
&rx_dsp_core_200::issue_stream_command, _mbc[mb].rx_dsps[dsp], _1));
my_streamer->set_issue_stream_cmd(chan_i, std::bind(
&rx_dsp_core_200::issue_stream_command, _mbc[mb].rx_dsps[dsp], std::placeholders::_1));
_mbc[mb].rx_streamers[dsp] = my_streamer; //store weak pointer
break;
}
@ -525,10 +524,10 @@ tx_streamer::sptr usrp2_impl::get_tx_stream(const uhd::stream_args_t &args_){
_io_impl->fc_mons[abs]->clear();
}
_mbc[mb].tx_dsp->setup(args);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&usrp2_impl::io_impl::get_send_buff, _io_impl.get(), abs, _1
my_streamer->set_xport_chan_get_buff(chan_i, std::bind(
&usrp2_impl::io_impl::get_send_buff, _io_impl.get(), abs, std::placeholders::_1
));
my_streamer->set_async_receiver(boost::bind(&bounded_buffer<async_metadata_t>::pop_with_timed_wait, &(_io_impl->async_msg_fifo), _1, _2));
my_streamer->set_async_receiver(std::bind(&bounded_buffer<async_metadata_t>::pop_with_timed_wait, &(_io_impl->async_msg_fifo), std::placeholders::_1, std::placeholders::_2));
_mbc[mb].tx_streamers[dsp] = my_streamer; //store weak pointer
break;
}

View File

@ -5,29 +5,28 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include "usrp2_regs.hpp"
#include "usrp2_impl.hpp"
#include "fw_common.h"
#include "usrp2_iface.hpp"
#include "fw_common.h"
#include "usrp2_impl.hpp"
#include "usrp2_regs.hpp"
#include <uhd/exception.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/platform.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/utils/tasks.hpp>
#include <boost/asio.hpp> //used for htonl and ntohl
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#include <boost/tokenizer.hpp>
#include <boost/functional/hash.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/functional/hash.hpp>
#include <boost/tokenizer.hpp>
#include <algorithm>
#include <iostream>
#include <chrono>
#include <functional>
#include <iostream>
#include <thread>
#include <uhd/utils/platform.hpp>
using namespace uhd;
using namespace uhd::usrp;
@ -88,7 +87,7 @@ public:
void lock_device(bool lock){
if (lock){
this->pokefw(U2_FW_REG_LOCK_GPID, get_process_hash());
_lock_task = task::make(boost::bind(&usrp2_iface_impl::lock_task, this));
_lock_task = task::make(std::bind(&usrp2_iface_impl::lock_task, this));
}
else{
_lock_task.reset(); //shutdown the task

View File

@ -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));
}
}

View File

@ -5,31 +5,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <iostream>
#include <boost/asio.hpp>
#include <boost/assign.hpp>
#include <stdint.h>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/thread.hpp>
#include "octoclock_impl.hpp"
#include "common.h"
#include "octoclock_uart.hpp"
#include <uhd/device.hpp>
#include <uhd/exception.hpp>
#include <uhd/transport/udp_simple.hpp>
#include <uhd/transport/if_addrs.hpp>
#include <uhd/transport/udp_simple.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/usrp/gps_ctrl.hpp>
#include <uhd/usrp_clock/octoclock_eeprom.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/static.hpp>
#include "octoclock_impl.hpp"
#include "octoclock_uart.hpp"
#include "common.h"
#include <stdint.h>
#include <boost/asio.hpp>
#include <boost/assign.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
using namespace uhd;
using namespace uhd::usrp_clock;
@ -232,21 +226,21 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){
_oc_dict[oc].eeprom = octoclock_eeprom_t(_oc_dict[oc].ctrl_xport, _proto_ver);
_tree->create<octoclock_eeprom_t>(oc_path / "eeprom")
.set(_oc_dict[oc].eeprom)
.add_coerced_subscriber(boost::bind(&octoclock_impl::_set_eeprom, this, oc, _1));
.add_coerced_subscriber(std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Initialize non-GPSDO sensors
////////////////////////////////////////////////////////////////////
_tree->create<uint32_t>(oc_path / "time")
.set_publisher(boost::bind(&octoclock_impl::_get_time, this, oc));
.set_publisher(std::bind(&octoclock_impl::_get_time, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/ext_ref_detected")
.set_publisher(boost::bind(&octoclock_impl::_ext_ref_detected, this, oc));
.set_publisher(std::bind(&octoclock_impl::_ext_ref_detected, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/gps_detected")
.set_publisher(boost::bind(&octoclock_impl::_gps_detected, this, oc));
.set_publisher(std::bind(&octoclock_impl::_gps_detected, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/using_ref")
.set_publisher(boost::bind(&octoclock_impl::_which_ref, this, oc));
.set_publisher(std::bind(&octoclock_impl::_which_ref, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/switch_pos")
.set_publisher(boost::bind(&octoclock_impl::_switch_pos, this, oc));
.set_publisher(std::bind(&octoclock_impl::_switch_pos, this, oc));
////////////////////////////////////////////////////////////////////
// Check reference and GPSDO
@ -266,7 +260,7 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){
if(_oc_dict[oc].gps and _oc_dict[oc].gps->gps_detected()){
for(const std::string &name: _oc_dict[oc].gps->get_sensors()){
_tree->create<sensor_value_t>(oc_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, _oc_dict[oc].gps, name));
.set_publisher(std::bind(&gps_ctrl::get_sensor, _oc_dict[oc].gps, name));
}
}
else{

View File

@ -10,8 +10,8 @@
#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/gain_group.hpp>
#include <uhd/utils/log.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <functional>
#include <vector>
using namespace uhd;
@ -130,7 +130,7 @@ public:
}
std::sort(indexes_step_size_dec.begin(),
indexes_step_size_dec.end(),
boost::bind(&compare_by_step_size, _1, _2, all_fcns));
std::bind(&compare_by_step_size, std::placeholders::_1, std::placeholders::_2, all_fcns));
UHD_ASSERT_THROW(all_fcns.at(indexes_step_size_dec.front()).get_range().step()
>= all_fcns.at(indexes_step_size_dec.back()).get_range().step());

View File

@ -8,9 +8,10 @@
#include <uhd/exception.hpp>
#include <uhdlib/utils/ihex.hpp>
#include <boost/format.hpp>
#include <fstream>
#include <functional>
#include <memory>
#include <sstream>
#include <fstream>
using namespace uhd;
@ -196,7 +197,7 @@ void ihex_reader::to_bin_file(const std::string &bin_filename)
throw uhd::io_error(str(boost::format("Could not open file for writing: %s") % bin_filename));
}
this->read(boost::bind(&_file_writer_callback, output_file, _3, _4));
this->read(std::bind(&_file_writer_callback, output_file, std::placeholders::_3, std::placeholders::_4));
output_file->close();
}
@ -219,7 +220,7 @@ std::vector<uint8_t> ihex_reader::to_vector(const size_t size_estimate)
std::vector<uint8_t> buf;
buf.reserve(size_estimate == 0 ? DEFAULT_SIZE_ESTIMATE : size_estimate);
this->read(boost::bind(&_vector_writer_callback, boost::ref(buf), _3, _4));
this->read(std::bind(&_vector_writer_callback, std::ref(buf), std::placeholders::_3, std::placeholders::_4));
return buf;
}

View File

@ -11,7 +11,7 @@
#include <uhdlib/utils/paths.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <regex>

View File

@ -5,18 +5,19 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/msg_task.hpp>
#include <uhd/utils/thread.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/exception.hpp>
#include <boost/thread/thread.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/msg_task.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/thread.hpp>
#include <boost/thread/barrier.hpp>
#include <exception>
#include <iostream>
#include <vector>
#include <thread>
#include <boost/thread/thread.hpp>
#include <atomic>
#include <exception>
#include <functional>
#include <iostream>
#include <thread>
#include <vector>
using namespace uhd;
@ -88,7 +89,7 @@ public:
msg_task_impl(const task_fcn_type &task_fcn):
_spawn_barrier(2)
{
(void)_thread_group.create_thread(boost::bind(&msg_task_impl::task_loop, this, task_fcn));
(void)_thread_group.create_thread(std::bind(&msg_task_impl::task_loop, this, task_fcn));
_spawn_barrier.wait();
}

View File

@ -6,9 +6,9 @@
//
#include <uhd/utils/gain_group.hpp>
#include <boost/bind.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/test/unit_test.hpp>
#include <functional>
#include <iostream>
#define rint(x) boost::math::iround(x)
@ -75,14 +75,14 @@ static gain_group::sptr get_gain_group(size_t pri1 = 0, size_t pri2 = 0)
gain_group::sptr gg(gain_group::make());
// load gain group with function sets
gain_fcns.get_range = boost::bind(&gain_element1::get_range, &g1);
gain_fcns.get_value = boost::bind(&gain_element1::get_value, &g1);
gain_fcns.set_value = boost::bind(&gain_element1::set_value, &g1, _1);
gain_fcns.get_range = std::bind(&gain_element1::get_range, &g1);
gain_fcns.get_value = std::bind(&gain_element1::get_value, &g1);
gain_fcns.set_value = std::bind(&gain_element1::set_value, &g1, std::placeholders::_1);
gg->register_fcns("g1", gain_fcns, pri1);
gain_fcns.get_range = boost::bind(&gain_element2::get_range, &g2);
gain_fcns.get_value = boost::bind(&gain_element2::get_value, &g2);
gain_fcns.set_value = boost::bind(&gain_element2::set_value, &g2, _1);
gain_fcns.get_range = std::bind(&gain_element2::get_range, &g2);
gain_fcns.get_value = std::bind(&gain_element2::get_value, &g2);
gain_fcns.set_value = std::bind(&gain_element2::set_value, &g2, std::placeholders::_1);
gg->register_fcns("g2", gain_fcns, pri2);
return gg;

View File

@ -7,11 +7,12 @@
//
#include <uhd/property_tree.hpp>
#include <boost/bind.hpp>
#include <boost/test/unit_test.hpp>
#include <exception>
#include <functional>
#include <iostream>
struct coercer_type
{
int doit(int x)
@ -69,7 +70,7 @@ BOOST_AUTO_TEST_CASE(test_prop_with_desired_subscriber)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
prop.add_desired_subscriber(boost::bind(&setter_type::doit, &setter, _1));
prop.add_desired_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
prop.set(42);
BOOST_CHECK_EQUAL(prop.get_desired(), 42);
@ -88,7 +89,7 @@ BOOST_AUTO_TEST_CASE(test_prop_with_coerced_subscriber)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
prop.add_coerced_subscriber(boost::bind(&setter_type::doit, &setter, _1));
prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
prop.set(42);
BOOST_CHECK_EQUAL(prop.get_desired(), 42);
@ -107,8 +108,8 @@ BOOST_AUTO_TEST_CASE(test_prop_manual_coercion)
uhd::property<int>& prop = tree->create<int>("/", uhd::property_tree::MANUAL_COERCE);
setter_type dsetter, csetter;
prop.add_desired_subscriber(boost::bind(&setter_type::doit, &dsetter, _1));
prop.add_coerced_subscriber(boost::bind(&setter_type::doit, &csetter, _1));
prop.add_desired_subscriber(std::bind(&setter_type::doit, &dsetter, std::placeholders::_1));
prop.add_coerced_subscriber(std::bind(&setter_type::doit, &csetter, std::placeholders::_1));
BOOST_CHECK_EQUAL(dsetter._x, 0);
BOOST_CHECK_EQUAL(csetter._x, 0);
@ -132,7 +133,7 @@ BOOST_AUTO_TEST_CASE(test_prop_with_publisher)
BOOST_CHECK(prop.empty());
getter_type getter;
prop.set_publisher(boost::bind(&getter_type::doit, &getter));
prop.set_publisher(std::bind(&getter_type::doit, &getter));
BOOST_CHECK(not prop.empty());
getter._x = 42;
@ -150,10 +151,10 @@ BOOST_AUTO_TEST_CASE(test_prop_with_publisher_and_subscriber)
uhd::property<int>& prop = tree->create<int>("/");
getter_type getter;
prop.set_publisher(boost::bind(&getter_type::doit, &getter));
prop.set_publisher(std::bind(&getter_type::doit, &getter));
setter_type setter;
prop.add_coerced_subscriber(boost::bind(&setter_type::doit, &setter, _1));
prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
getter._x = 42;
prop.set(0);
@ -172,10 +173,10 @@ BOOST_AUTO_TEST_CASE(test_prop_with_coercion)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
prop.add_coerced_subscriber(boost::bind(&setter_type::doit, &setter, _1));
prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
coercer_type coercer;
prop.set_coercer(boost::bind(&coercer_type::doit, &coercer, _1));
prop.set_coercer(std::bind(&coercer_type::doit, &coercer, std::placeholders::_1));
prop.set(42);
BOOST_CHECK_EQUAL(prop.get(), 40);

View File

@ -7,10 +7,10 @@
#include "../common/mock_zero_copy.hpp"
#include "../lib/transport/super_recv_packet_handler.hpp"
#include <boost/bind.hpp>
#include <boost/shared_array.hpp>
#include <boost/test/unit_test.hpp>
#include <complex>
#include <functional>
#include <list>
#include <vector>
@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE(test_sph_recv_one_channel_inline_message)
// create an overflow handler
overflow_handler_type overflow_handler;
handler.set_overflow_handler(
0, boost::bind(&overflow_handler_type::handle, &overflow_handler));
0, std::bind(&overflow_handler_type::handle, &overflow_handler));
// check the received packets
size_t num_accum_samps = 0;

View File

@ -7,7 +7,7 @@
#include "../common/mock_zero_copy.hpp"
#include "../lib/transport/super_send_packet_handler.hpp"
#include <boost/bind.hpp>
#include <functional>
#include <boost/shared_array.hpp>
#include <boost/test/unit_test.hpp>
#include <complex>

View File

@ -20,6 +20,7 @@
#include <complex>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <thread>
@ -142,7 +143,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// create a transmitter thread
boost::thread_group threads;
threads.create_thread(boost::bind(&tx_thread, usrp, tx_stream, tx_wave_ampl));
threads.create_thread(std::bind(&tx_thread, usrp, tx_stream, tx_wave_ampl));
// re-usable buffer for samples
std::vector<samp_type> buff;

View File

@ -20,6 +20,7 @@
#include <ctime>
#include <iostream>
#include <thread>
#include <functional>
namespace po = boost::program_options;
@ -149,7 +150,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// create a transmitter thread
boost::thread_group threads;
threads.create_thread(
boost::bind(&tx_thread, usrp, tx_stream, tx_wave_freq, tx_wave_ampl));
std::bind(&tx_thread, usrp, tx_stream, tx_wave_freq, tx_wave_ampl));
// re-usable buffer for samples
std::vector<samp_type> buff;

View File

@ -17,6 +17,7 @@
#include <ctime>
#include <iostream>
#include <thread>
#include <functional>
namespace po = boost::program_options;
@ -146,7 +147,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// create a transmitter thread
boost::thread_group threads;
threads.create_thread(
boost::bind(&tx_thread, usrp, tx_stream, tx_wave_freq, tx_wave_ampl));
std::bind(&tx_thread, usrp, tx_stream, tx_wave_freq, tx_wave_ampl));
// re-usable buffer for samples
std::vector<samp_type> buff;