diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-29 12:58:06 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-29 12:58:06 -0700 |
commit | 1295df8cbba76c088a36f9d546a68c1d00e7a1a8 (patch) | |
tree | d8e0fdc72589d6d7614a14788caf31dbe6df6140 /host/utils | |
parent | 7396b53e1bdd1aa5f9dcba760c8993a0cf620b6a (diff) | |
download | uhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.tar.gz uhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.tar.bz2 uhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.zip |
Added utility methods to device addr and mac addr to make them more usable.
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/usrp2_burner.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/host/utils/usrp2_burner.cpp b/host/utils/usrp2_burner.cpp index ff6d4426f..b24425316 100644 --- a/host/utils/usrp2_burner.cpp +++ b/host/utils/usrp2_burner.cpp @@ -57,27 +57,32 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::device::sptr u2_dev = uhd::usrp::usrp2::make(device_addr); //FIXME usees the default mboard for now (until the mimo link is supported) wax::obj u2_mb = (*u2_dev)[uhd::DEVICE_PROP_MBOARD]; + std::cout << std::endl; + + //fetch and print current settings + std::cout << "Fetching current settings from usrp2 eeprom:" << std::endl; + std::string curr_ip = u2_mb[std::string("ip-addr")].as<std::string>(); + std::cout << boost::format(" Current IP Address: %s") % curr_ip << std::endl; + std::string curr_mac = u2_mb[std::string("mac-addr")].as<std::string>(); + std::cout << boost::format(" Current MAC Address: %s") % curr_mac << std::endl; + std::cout << " Done" << std::endl << std::endl; //try to set the new ip (if provided) if (vm.count("new-ip")){ std::cout << "Burning a new ip address into the usrp2 eeprom:" << std::endl; - std::string old_ip = u2_mb[std::string("ip-addr")].as<std::string>(); - std::cout << boost::format(" Old IP Address: %s") % old_ip << std::endl; std::string new_ip = vm["new-ip"].as<std::string>(); std::cout << boost::format(" New IP Address: %s") % new_ip << std::endl; u2_mb[std::string("ip-addr")] = new_ip; - std::cout << " Done" << std::endl; + std::cout << " Done" << std::endl << std::endl; } //try to set the new mac (if provided) if (vm.count("new-mac")){ std::cout << "Burning a new mac address into the usrp2 eeprom:" << std::endl; - std::string old_mac = u2_mb[std::string("mac-addr")].as<std::string>(); - std::cout << boost::format(" Old MAC Address: %s") % old_mac << std::endl; std::string new_mac = vm["new-mac"].as<std::string>(); std::cout << boost::format(" New MAC Address: %s") % new_mac << std::endl; u2_mb[std::string("mac-addr")] = new_mac; - std::cout << " Done" << std::endl; + std::cout << " Done" << std::endl << std::endl; } std::cout << "Power-cycle the usrp2 for the changes to take effect." << std::endl; |