aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2016-01-08 11:19:11 -0800
committerAshish Chaudhari <ashish@ettus.com>2016-01-08 11:19:11 -0800
commit2326da0dd107e2a784771ff163e3b33be45300ea (patch)
tree7291de150311abbed8a160ce485d7e8b1b785096
parentcc861b014695ca3f0d6d832494d59fd68ea79038 (diff)
downloaduhd-2326da0dd107e2a784771ff163e3b33be45300ea.tar.gz
uhd-2326da0dd107e2a784771ff163e3b33be45300ea.tar.bz2
uhd-2326da0dd107e2a784771ff163e3b33be45300ea.zip
n230: Improved error for secondary ethernet detection failure
-rw-r--r--host/lib/usrp/n230/n230_resource_manager.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp
index 340bc7c6c..d3d272354 100644
--- a/host/lib/usrp/n230/n230_resource_manager.cpp
+++ b/host/lib/usrp/n230/n230_resource_manager.cpp
@@ -88,12 +88,19 @@ n230_resource_manager::n230_resource_manager(
n230_eth_conn_t conn_iface;
conn_iface.ip_addr = addr;
- boost::uint32_t iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id(
- conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID);
+ boost::uint32_t iface_id = 0xFFFFFFFF;
+ try {
+ iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id(
+ conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID);
+ } catch (uhd::io_error&) {
+ throw uhd::io_error(str(boost::format(
+ "Could not communicate with the device over address %s") %
+ conn_iface.ip_addr));
+ }
switch (iface_id) {
case N230_ETH0_IFACE_ID: conn_iface.type = ETH0; break;
case N230_ETH1_IFACE_ID: conn_iface.type = ETH1; break;
- default: throw uhd::runtime_error("N230 Initialization Error: Could not detect iface.)");
+ default: throw uhd::runtime_error("N230 Initialization Error: Could not detect ethernet port number.)");
}
_eth_conns.push_back(conn_iface);
}