29 #include "../src/USRPFrontEnd.hxx" 33 #include <boost/format.hpp> 36 #include <uhd/usrp/multi_usrp.hpp> 39 #include <boost/foreach.hpp> 40 #include <boost/format.hpp> 42 #include <uhd/utils/safe_main.hpp> 43 #include <uhd/version.hpp> 44 #include <uhd/device.hpp> 45 #include <uhd/types/ranges.hpp> 46 #include <uhd/property_tree.hpp> 47 #include <boost/algorithm/string.hpp> 48 #include <uhd/usrp/dboard_id.hpp> 49 #include <uhd/usrp/mboard_eeprom.hpp> 50 #include <uhd/usrp/dboard_eeprom.hpp> 53 std::string
getMbName(uhd::usrp::multi_usrp::sptr usrp)
55 uhd::property_tree::sptr tree = usrp->get_device()->get_tree();
56 std::string mbname = tree->list(
"/mboards").at(0);
57 return tree->access<std::string>(
"/mboards/" + mbname +
"/name").
get();
62 uhd::property_tree::sptr tree = usrp->get_device()->get_tree();
63 std::string mbname = tree->list(
"/mboards").at(0);
65 uhd::usrp::mboard_eeprom_t eeprom = tree->access<uhd::usrp::mboard_eeprom_t>(
"/mboards/" + mbname +
"/eeprom").
get();
66 BOOST_FOREACH(
const std::string & key, eeprom.keys()) {
67 if( eeprom[key].empty() ) {
68 std::cerr << boost::format(
"Empty key [%s]\n") % key;
71 std::cerr << boost::format(
" eeprom[%s] = [%s]\n") % key % eeprom[key];
75 std::cerr << boost::format(
"went the direct route = [%s]\n")
76 % tree->access<uhd::usrp::mboard_eeprom_t>(
"/mboards/" + mbname +
"/eeprom").
get()[
"ip-addr"];
79 int main(
int argc,
char ** argv)
82 std::cerr <<
"Usage: USRPFrontEnd_test dev-arg-string" << std::endl;
86 std::string devaddr(argv[1]);
87 uhd::device_addr_t rad(devaddr);
89 uhd::usrp::multi_usrp::sptr usrp;
91 usrp = uhd::usrp::multi_usrp::make(rad);
100 std::cerr << boost::format(
"RXFE prop [%s]\n") % prn;
105 std::cerr << boost::format(
"TXFE prop [%s]\n") % prn;
PropTree * getUSRPFrontEnd(PropTree *tree, char tr_choice)
return a pointer to a PropTree object for the first "T" or "R" front end that provides an IQ or QI st...
void dumpProps(uhd::usrp::multi_usrp::sptr usrp)
PropTree class encapsulates the USRP property tree functions to allow better trap and error recovery ...
std::string getMbName(uhd::usrp::multi_usrp::sptr usrp)
std::vector< std::string > getPropNames(const std::string &path=std::string(""))
int main(int argc, char **argv)