aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_usrp_probe.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-07-15 15:47:52 -0700
committerJosh Blum <josh@joshknows.com>2013-07-15 15:47:52 -0700
commit67cbce5891ec4886ff877d8c277896cb6b1a2ab2 (patch)
treeb7410eee3b88e64d972dc5c049fd376bacb8bc68 /host/utils/uhd_usrp_probe.cpp
parentc464a63e87e32bea2b4c430ff29b0b5e0829893a (diff)
downloaduhd-67cbce5891ec4886ff877d8c277896cb6b1a2ab2.tar.gz
uhd-67cbce5891ec4886ff877d8c277896cb6b1a2ab2.tar.bz2
uhd-67cbce5891ec4886ff877d8c277896cb6b1a2ab2.zip
uhd: conditionalize the eeprom check
Diffstat (limited to 'host/utils/uhd_usrp_probe.cpp')
-rw-r--r--host/utils/uhd_usrp_probe.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index 736490f19..98ed84850 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -115,13 +115,16 @@ static std::string get_dboard_pp_string(const std::string &type, property_tree::
ss << boost::format("%s Dboard: %s") % type % path.leaf() << std::endl;
//ss << std::endl;
const std::string prefix = (type == "RX")? "rx" : "tx";
- usrp::dboard_eeprom_t db_eeprom = tree->access<usrp::dboard_eeprom_t>(path / (prefix + "_eeprom")).get();
- if (db_eeprom.id != usrp::dboard_id_t::none()) ss << boost::format("ID: %s") % db_eeprom.id.to_pp_string() << std::endl;
- if (not db_eeprom.serial.empty()) ss << boost::format("Serial: %s") % db_eeprom.serial << std::endl;
- if (type == "TX"){
- usrp::dboard_eeprom_t gdb_eeprom = tree->access<usrp::dboard_eeprom_t>(path / "gdb_eeprom").get();
- if (gdb_eeprom.id != usrp::dboard_id_t::none()) ss << boost::format("ID: %s") % gdb_eeprom.id.to_pp_string() << std::endl;
- if (not gdb_eeprom.serial.empty()) ss << boost::format("Serial: %s") % gdb_eeprom.serial << std::endl;
+ if (tree->exists(path / (prefix + "_eeprom")))
+ {
+ usrp::dboard_eeprom_t db_eeprom = tree->access<usrp::dboard_eeprom_t>(path / (prefix + "_eeprom")).get();
+ if (db_eeprom.id != usrp::dboard_id_t::none()) ss << boost::format("ID: %s") % db_eeprom.id.to_pp_string() << std::endl;
+ if (not db_eeprom.serial.empty()) ss << boost::format("Serial: %s") % db_eeprom.serial << std::endl;
+ if (type == "TX"){
+ usrp::dboard_eeprom_t gdb_eeprom = tree->access<usrp::dboard_eeprom_t>(path / "gdb_eeprom").get();
+ if (gdb_eeprom.id != usrp::dboard_id_t::none()) ss << boost::format("ID: %s") % gdb_eeprom.id.to_pp_string() << std::endl;
+ if (not gdb_eeprom.serial.empty()) ss << boost::format("Serial: %s") % gdb_eeprom.serial << std::endl;
+ }
}
BOOST_FOREACH(const std::string &name, tree->list(path / (prefix + "_frontends"))){
ss << make_border(get_frontend_pp_string(type, tree, path / (prefix + "_frontends") / name));