diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-01-23 10:32:59 -0800 |
---|---|---|
committer | atrnati <54334261+atrnati@users.noreply.github.com> | 2020-02-04 08:53:01 -0600 |
commit | 22db12c4b2b55225801ec1efb2465c7a06295b9e (patch) | |
tree | cc60264fffe91465df9c6cbe764bf60931934a56 /host/lib/usrp_clock/multi_usrp_clock.cpp | |
parent | defcb174ebb274d4621a2b958a78ed6cb6cd6aed (diff) | |
download | uhd-22db12c4b2b55225801ec1efb2465c7a06295b9e.tar.gz uhd-22db12c4b2b55225801ec1efb2465c7a06295b9e.tar.bz2 uhd-22db12c4b2b55225801ec1efb2465c7a06295b9e.zip |
octoclock: Apply clang-format
Diffstat (limited to 'host/lib/usrp_clock/multi_usrp_clock.cpp')
-rw-r--r-- | host/lib/usrp_clock/multi_usrp_clock.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/host/lib/usrp_clock/multi_usrp_clock.cpp b/host/lib/usrp_clock/multi_usrp_clock.cpp index 42dc1eb0b..c4bf081cc 100644 --- a/host/lib/usrp_clock/multi_usrp_clock.cpp +++ b/host/lib/usrp_clock/multi_usrp_clock.cpp @@ -5,12 +5,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include <uhd/exception.hpp> #include <uhd/property_tree.hpp> #include <uhd/usrp_clock/multi_usrp_clock.hpp> #include <uhd/usrp_clock/octoclock_eeprom.hpp> - - -#include <uhd/exception.hpp> #include <uhd/utils/log.hpp> #include <boost/assign/list_of.hpp> #include <boost/format.hpp> @@ -21,48 +19,54 @@ using namespace uhd::usrp_clock; /*********************************************************************** * Multi USRP Clock implementation **********************************************************************/ -class multi_usrp_clock_impl : public multi_usrp_clock{ +class multi_usrp_clock_impl : public multi_usrp_clock +{ public: - multi_usrp_clock_impl(const device_addr_t &addr){ - _dev = device::make(addr, device::CLOCK); + multi_usrp_clock_impl(const device_addr_t& addr) + { + _dev = device::make(addr, device::CLOCK); _tree = _dev->get_tree(); } - device::sptr get_device(void){ + device::sptr get_device(void) + { return _dev; } - std::string get_pp_string(void){ + std::string get_pp_string(void) + { std::string buff = str(boost::format("%s USRP Clock Device\n") - % ((get_num_boards() > 1) ? "Multi" : "Single") - ); - for(size_t i = 0; i < get_num_boards(); i++){ + % ((get_num_boards() > 1) ? "Multi" : "Single")); + for (size_t i = 0; i < get_num_boards(); i++) { buff += str(boost::format(" Board %s\n") % i); buff += str(boost::format(" Reference: %s\n") - % (get_sensor("using_ref", i).value) - ); + % (get_sensor("using_ref", i).value)); } return buff; } - size_t get_num_boards(void){ + size_t get_num_boards(void) + { return _tree->list("/mboards").size(); } - uint32_t get_time(size_t board){ + uint32_t get_time(size_t board) + { std::string board_str = str(boost::format("/mboards/%d") % board); return _tree->access<uint32_t>(board_str / "time").get(); } - sensor_value_t get_sensor(const std::string &name, size_t board){ + sensor_value_t get_sensor(const std::string& name, size_t board) + { std::string board_str = str(boost::format("/mboards/%d") % board); return _tree->access<sensor_value_t>(board_str / "sensors" / name).get(); } - std::vector<std::string> get_sensor_names(size_t board){ + std::vector<std::string> get_sensor_names(size_t board) + { std::string board_str = str(boost::format("/mboards/%d") % board); return _tree->list(board_str / "sensors"); @@ -73,14 +77,17 @@ private: property_tree::sptr _tree; }; -multi_usrp_clock::~multi_usrp_clock(void){ +multi_usrp_clock::~multi_usrp_clock(void) +{ /* NOP */ } /*********************************************************************** * Multi USRP Clock factory function **********************************************************************/ -multi_usrp_clock::sptr multi_usrp_clock::make(const device_addr_t &dev_addr){ - UHD_LOGGER_TRACE("OCTOCLOCK") << "multi_usrp_clock::make with args " << dev_addr.to_pp_string() ; +multi_usrp_clock::sptr multi_usrp_clock::make(const device_addr_t& dev_addr) +{ + UHD_LOGGER_TRACE("OCTOCLOCK") + << "multi_usrp_clock::make with args " << dev_addr.to_pp_string(); return sptr(new multi_usrp_clock_impl(dev_addr)); } |