diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-10-09 15:01:48 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-10-09 15:01:48 +0200 |
commit | b5ff2da82efb8c6fe2ef011da611c1fb42bb2ec7 (patch) | |
tree | b9be9f0ad87ad07e03627c6bea72b50dffd3c3c0 | |
parent | 2bf6ac511e024be5bf015e19704dba5ad023c637 (diff) | |
download | uhd-b5ff2da82efb8c6fe2ef011da611c1fb42bb2ec7.tar.gz uhd-b5ff2da82efb8c6fe2ef011da611c1fb42bb2ec7.tar.bz2 uhd-b5ff2da82efb8c6fe2ef011da611c1fb42bb2ec7.zip |
utils: Removed deprecated options from mb eeprom and simple net burner.
-rw-r--r-- | host/utils/usrp_burn_mb_eeprom.cpp | 25 | ||||
-rw-r--r-- | host/utils/usrp_n2xx_simple_net_burner.cpp | 14 |
2 files changed, 10 insertions, 29 deletions
diff --git a/host/utils/usrp_burn_mb_eeprom.cpp b/host/utils/usrp_burn_mb_eeprom.cpp index 92df9d7d4..c64e3f56c 100644 --- a/host/utils/usrp_burn_mb_eeprom.cpp +++ b/host/utils/usrp_burn_mb_eeprom.cpp @@ -29,15 +29,13 @@ namespace po = boost::program_options; int UHD_SAFE_MAIN(int argc, char *argv[]){ - std::string args, input_str, key, val; + std::string args, input_str; po::options_description desc("Allowed options"); desc.add_options() ("help", "help message") ("args", po::value<std::string>(&args)->default_value(""), "device address args [default = \"\"]") ("values", po::value<std::string>(&input_str), "keys+values to read/write, separate multiple by \",\"") - ("key", po::value<std::string>(&key), "identifiers for new values in EEPROM, separate multiple by \",\" (DEPRECATED)") - ("val", po::value<std::string>(&val), "the new values to set, omit for readback, separate multiple by \",\" (DEPRECATED)") ("read-all", "Read all motherboard EEPROM values without writing") ; @@ -46,11 +44,13 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ po::notify(vm); //print the help message - if (vm.count("help") or (not vm.count("key") and not vm.count("values") and not vm.count("read-all"))){ + if (vm.count("help") or (not vm.count("values") and not vm.count("read-all"))){ std::cout << boost::format("USRP Burn Motherboard EEPROM %s") % desc << std::endl; std::cout << boost::format( "Omit the value argument to perform a readback,\n" "Or specify a new value to burn into the EEPROM.\n" + "Example (write to ip-addr0 and read out ip-addr1):\n" + " usrp_burn_mb_eeprom --args=<device args> --values\"ip-addr0=192.168.10.3,ip-addr1\"" ) << std::endl; return EXIT_FAILURE; } @@ -69,21 +69,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ keys_vec = vals.keys(); vals_vec = vals.vals(); } - else{ - std::cout << "WARNING: Use of --key and --val is deprecated!" << std::endl; - //remove whitespace, split arguments and values - boost::algorithm::erase_all(key, " "); - boost::algorithm::erase_all(val, " "); - - boost::split(keys_vec, key, boost::is_any_of("\"',")); - boost::split(vals_vec, val, boost::is_any_of("\"',")); - - if((keys_vec.size() != vals_vec.size()) and val != "") { - //If zero values are given, then user just wants values read to them - throw std::runtime_error("Number of keys must match number of values!"); - } - } + // 1. Read out values std::cout << "Fetching current settings from EEPROM..." << std::endl; for(size_t i = 0; i < keys_vec.size(); i++){ if (not mb_eeprom.has_key(keys_vec[i])){ @@ -93,6 +80,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::cout << boost::format(" EEPROM [\"%s\"] is \"%s\"") % keys_vec[i] % mb_eeprom[keys_vec[i]] << std::endl; } std::cout << std::endl; + + // 2. Write new values if given mb_eeprom = uhd::usrp::mboard_eeprom_t(); for(size_t i = 0; i < vals_vec.size(); i++){ if(vals_vec[i] != ""){ diff --git a/host/utils/usrp_n2xx_simple_net_burner.cpp b/host/utils/usrp_n2xx_simple_net_burner.cpp index fe437a2e5..dc83b6fdf 100644 --- a/host/utils/usrp_n2xx_simple_net_burner.cpp +++ b/host/utils/usrp_n2xx_simple_net_burner.cpp @@ -523,13 +523,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("fw", po::value<std::string>(&fw_path), "Specify a filepath for a custom firmware image.") ("fpga", po::value<std::string>(&fpga_path), "Specify a filepath for a custom FPGA image.") ("no-fw", "Do not burn a firmware image.") - ("no_fw", "Do not burn a firmware image (DEPRECATED).") ("no-fpga", "Do not burn an FPGA image.") - ("no_fpga", "Do not burn an FPGA image (DEPRECATED).") ("overwrite-safe", "Overwrite safe images (not recommended).") ("dont-check-rev", "Don't verify images are for correct model before burning.") ("auto-reboot", "Automatically reboot N2XX without prompting.") - ("auto_reboot", "Automatically reboot N2XX without prompting (DEPRECATED).") ("list", "List available N2XX USRP devices.") ; po::variables_map vm; @@ -552,11 +549,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ } //Store user options - bool burn_fpga = (vm.count("no-fpga") == 0) and (vm.count("no_fpga") == 0); - bool burn_fw = (vm.count("no-fw") == 0) and (vm.count("no_fw") == 0); + bool burn_fpga = (vm.count("no-fpga") == 0); + bool burn_fw = (vm.count("no-fw") == 0); bool use_custom_fpga = (vm.count("fpga") > 0); bool use_custom_fw = (vm.count("fw") > 0); - bool auto_reboot = (vm.count("auto-reboot") > 0) or (vm.count("auto_reboot") > 0); + bool auto_reboot = (vm.count("auto-reboot") > 0); bool check_rev = (vm.count("dont-check-rev") == 0); bool overwrite_safe = (vm.count("overwrite-safe") > 0); int fpga_image_size = 0; @@ -592,11 +589,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ else std::cout << std::endl; //Formatting } - //Print deprecation messages if necessary - if(vm.count("no_fpga") > 0) std::cout << "WARNING: --no_fpga option is deprecated! Use --no-fpga instead." << std::endl << std::endl; - if(vm.count("no_fw") > 0) std::cout << "WARNING: --no_fw option is deprecated! Use --no-fw instead." << std::endl << std::endl; - if(vm.count("auto_reboot") > 0) std::cout << "WARNING: --auto_reboot option is deprecated! Use --auto-reboot instead." << std::endl << std::endl; - //Find USRP and establish connection std::cout << boost::format("Searching for USRP N2XX with IP address %s.\n") % ip_addr; udp_simple::sptr udp_transport = udp_simple::make_connected(ip_addr, BOOST_STRINGIZE(USRP2_UDP_UPDATE_PORT)); |