aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_usrp_probe.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-13 16:34:43 -0700
committerMartin Braun <martin.braun@ettus.com>2017-04-13 16:34:43 -0700
commit60cd1f601e7b8c6a1bef5bd52efcc4e312b1c9fa (patch)
treee302bed0e363016aee3cd76c77f7c958ae6c259b /host/utils/uhd_usrp_probe.cpp
parent2790b51f3072b5ad5e3a5c4921a84f460096f92d (diff)
downloaduhd-60cd1f601e7b8c6a1bef5bd52efcc4e312b1c9fa.tar.gz
uhd-60cd1f601e7b8c6a1bef5bd52efcc4e312b1c9fa.tar.bz2
uhd-60cd1f601e7b8c6a1bef5bd52efcc4e312b1c9fa.zip
utils: Made EEPROM readout optional in uhd_usrp_probe
Diffstat (limited to 'host/utils/uhd_usrp_probe.cpp')
-rw-r--r--host/utils/uhd_usrp_probe.cpp12
1 files changed, 8 insertions, 4 deletions
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<std::string>(path / "name").get()) << std::endl;
- //ss << std::endl;
- usrp::mboard_eeprom_t mb_eeprom = tree->access<usrp::mboard_eeprom_t>(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<usrp::mboard_eeprom_t>(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<std::string>(path / "fw_version").get() << std::endl;