From 60cd1f601e7b8c6a1bef5bd52efcc4e312b1c9fa Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 13 Apr 2017 16:34:43 -0700 Subject: utils: Made EEPROM readout optional in uhd_usrp_probe --- host/utils/uhd_usrp_probe.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'host/utils') diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 9b02022a9..5bb2ead5e 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -148,10 +148,14 @@ static std::string get_rfnoc_pp_string(property_tree::sptr tree, const fs_path & static std::string get_mboard_pp_string(property_tree::sptr tree, const fs_path &path){ std::stringstream ss; ss << boost::format("Mboard: %s") % (tree->access(path / "name").get()) << std::endl; - //ss << std::endl; - usrp::mboard_eeprom_t mb_eeprom = tree->access(path / "eeprom").get(); - for(const std::string &key: mb_eeprom.keys()){ - if (not mb_eeprom[key].empty()) ss << boost::format("%s: %s") % key % mb_eeprom[key] << std::endl; + + if (tree->exists(path / "eeprom")){ + usrp::mboard_eeprom_t mb_eeprom = tree->access(path / "eeprom").get(); + for(const std::string &key: mb_eeprom.keys()){ + if (not mb_eeprom[key].empty()) ss << boost::format("%s: %s") % key % mb_eeprom[key] << std::endl; + } + } else { + ss << "No mboard EEPROM found." << std::endl; } if (tree->exists(path / "fw_version")){ ss << "FW Version: " << tree->access(path / "fw_version").get() << std::endl; -- cgit v1.2.3