29 #include "../src/N200Control.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: N200Control_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);
93 std::vector<std::string> banks = usrp->get_gpio_banks(0);
94 BOOST_FOREACH(std::string bank, banks) {
95 std::cerr << boost::format(
"GPIO Bank [%s]\n") % bank;
103 for(
int i = 0; i < 8; i++) {
int main(int argc, char **argv)
Generic Control class to activate T/R switching, band switching, and other control functions...
virtual bool setTXOn()=0
activate external controls to enable transmit mode.
virtual bool setTXOff()=0
activate external controls to disable transmit mode.
void dumpProps(uhd::usrp::multi_usrp::sptr usrp)
std::string getMbName(uhd::usrp::multi_usrp::sptr usrp)
static TRControl * makeTRControl(uhd::usrp::multi_usrp::sptr usrp, int mboard=0)
make the appropriate TR control widget given a pointer to a USRP device.