diff options
Diffstat (limited to 'host/lib/usrp')
| -rw-r--r-- | host/lib/usrp/b100/b100_impl.cpp | 2 | ||||
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 11 | ||||
| -rw-r--r-- | host/lib/usrp/mpmd/mpmd_find.cpp | 20 | ||||
| -rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 2 | 
4 files changed, 18 insertions, 17 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp index 9f0c3bdd2..4d72e4f04 100644 --- a/host/lib/usrp/b100/b100_impl.cpp +++ b/host/lib/usrp/b100/b100_impl.cpp @@ -117,7 +117,7 @@ static device_addrs_t b100_find(const device_addr_t& hint)              // this is a found b100 when the hint serial and name match or blank              if ((not hint.has_key("name") or hint["name"] == new_addr["name"])                  and (not hint.has_key("serial") -                        or hint["serial"] == new_addr["serial"])) { +                     or hint["serial"] == new_addr["serial"])) {                  b100_addrs.push_back(new_addr);              }          } diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 23baf44cf..7f250fd42 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -8,6 +8,7 @@  #include "b200_impl.hpp"  #include "../../transport/libusb1_base.hpp"  #include "b200_regs.hpp" +#include <uhd/cal/database.hpp>  #include <uhd/config.hpp>  #include <uhd/exception.hpp>  #include <uhd/transport/usb_control.hpp> @@ -17,7 +18,6 @@  #include <uhd/utils/paths.hpp>  #include <uhd/utils/safe_call.hpp>  #include <uhd/utils/static.hpp> -#include <uhd/cal/database.hpp>  #include <boost/filesystem.hpp>  #include <boost/format.hpp>  #include <boost/functional/hash.hpp> @@ -251,7 +251,7 @@ static device_addrs_t b200_find(const device_addr_t& hint)              // this is a found b200 when the hint serial and name match or blank              if ((not hint.has_key("name") or hint["name"] == new_addr["name"])                  and (not hint.has_key("serial") -                        or hint["serial"] == new_addr["serial"])) { +                     or hint["serial"] == new_addr["serial"])) {                  b200_addrs.push_back(new_addr);              }          } @@ -984,9 +984,8 @@ void b200_impl::setup_radio(const size_t dspno)      // b2xx_power_cal_$dir_$ant, depending on the form factor.      // $dir is either "tx" or "rx", and "ant" is either "tx_rx" or "rx2" (i.e.,      // sanitized version of the antenna names that work in filenames. -    const std::string cal_key_base = (_product == B200MINI or _product == B205MINI) -                                         ? "b2xxmini_pwr_" -                                         : "b2xx_pwr_"; +    const std::string cal_key_base = +        (_product == B200MINI or _product == B205MINI) ? "b2xxmini_pwr_" : "b2xx_pwr_";      for (direction_t dir : std::vector<direction_t>{RX_DIRECTION, TX_DIRECTION}) {          const std::string dir_key = (dir == RX_DIRECTION) ? "rx" : "tx";          const std::string key     = std::string(((dir == RX_DIRECTION) ? "RX" : "TX")) @@ -1148,7 +1147,7 @@ void b200_impl::enforce_tick_rate_limits(  double b200_impl::set_tick_rate(const double new_tick_rate)  {      UHD_LOGGER_INFO("B200") << (boost::format("Asking for clock rate %.6f MHz... ") -                                   % (new_tick_rate / 1e6)) +                                % (new_tick_rate / 1e6))                              << std::flush;      check_tick_rate_with_current_streamers(new_tick_rate); // Defined in b200_io_impl.cpp diff --git a/host/lib/usrp/mpmd/mpmd_find.cpp b/host/lib/usrp/mpmd/mpmd_find.cpp index e436c3998..c08e23fa7 100644 --- a/host/lib/usrp/mpmd/mpmd_find.cpp +++ b/host/lib/usrp/mpmd/mpmd_find.cpp @@ -9,11 +9,11 @@  #include "mpmd_devices.hpp"  #include "mpmd_impl.hpp"  #include "mpmd_link_if_mgr.hpp" -#include <uhdlib/utils/serial_number.hpp>  #include <uhd/transport/if_addrs.hpp>  #include <uhd/transport/udp_simple.hpp>  #include <uhd/types/device_addr.hpp>  #include <uhdlib/utils/prefs.hpp> +#include <uhdlib/utils/serial_number.hpp>  #include <boost/algorithm/string.hpp>  #include <boost/asio.hpp>  #include <future> @@ -65,7 +65,8 @@ device_addrs_t mpmd_find_with_addr(          const char* reply        = (const char*)buff;          std::string reply_string = std::string(reply);          std::vector<std::string> result; -        boost::algorithm::split(result, +        boost::algorithm::split( +            result,              reply_string,              [](const char& in) { return in == ';'; },              boost::token_compress_on); @@ -102,7 +103,8 @@ device_addrs_t mpmd_find_with_addr(          // device_args          for (const auto& el : result) {              std::vector<std::string> value; -            boost::algorithm::split(value, +            boost::algorithm::split( +                value,                  el,                  [](const char& in) { return in == '='; },                  boost::token_compress_on); @@ -112,11 +114,12 @@ device_addrs_t mpmd_find_with_addr(          }          // filter the discovered device below by matching optional keys          if ((not hint_.has_key("name") or hint_["name"] == new_addr["name"]) -            and (not hint_.has_key("serial") or utils::serial_numbers_match(hint_["serial"], new_addr["serial"])) +            and (not hint_.has_key("serial") +                 or utils::serial_numbers_match(hint_["serial"], new_addr["serial"]))              and (not hint_.has_key("type") or hint_["type"] == new_addr["type"] -                    or hint_["type"] == MPM_CATCHALL_DEVICE_TYPE) +                 or hint_["type"] == MPM_CATCHALL_DEVICE_TYPE)              and (not hint_.has_key("product") -                    or hint_["product"] == new_addr["product"])) { +                 or hint_["product"] == new_addr["product"])) {              UHD_LOG_TRACE(                  "MPMD FIND", "Found device that matches hints: " << new_addr.to_string());              addrs.push_back(new_addr); @@ -209,8 +212,7 @@ device_addrs_t mpmd_find(const device_addr_t& hint_)  #endif      device_addrs_t hints_without_prefs = separate_device_addr(hint_);      device_addrs_t hints; -    for (size_t i = 0; i < hints_without_prefs.size(); i++) -    { +    for (size_t i = 0; i < hints_without_prefs.size(); i++) {          hints.push_back(prefs::get_usrp_args(hints_without_prefs[i]));      } @@ -227,7 +229,7 @@ device_addrs_t mpmd_find(const device_addr_t& hint_)      // Scenario 1): User gave us at least one address      if (not hints.empty()          and (hints[0].has_key(xport::FIRST_ADDR_KEY) -                or hints[0].has_key(MGMT_ADDR_KEY))) { +             or hints[0].has_key(MGMT_ADDR_KEY))) {          // Note: We don't try and connect to the devices in this mode, because          // we only get here if the user specified addresses, and we assume she          // knows what she's doing. diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 6fed1521a..c2514ae02 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -166,7 +166,7 @@ device_addrs_t usrp2_find(const device_addr_t& hint_)              // filter the discovered device below by matching optional keys              if ((not hint.has_key("name") or hint["name"] == new_addr["name"])                  and (not hint.has_key("serial") -                        or hint["serial"] == new_addr["serial"])) { +                     or hint["serial"] == new_addr["serial"])) {                  usrp2_addrs.push_back(new_addr);              }  | 
