diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2016-01-08 11:19:11 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2016-01-08 11:19:11 -0800 |
commit | 2326da0dd107e2a784771ff163e3b33be45300ea (patch) | |
tree | 7291de150311abbed8a160ce485d7e8b1b785096 /host/lib/usrp | |
parent | cc861b014695ca3f0d6d832494d59fd68ea79038 (diff) | |
download | uhd-2326da0dd107e2a784771ff163e3b33be45300ea.tar.gz uhd-2326da0dd107e2a784771ff163e3b33be45300ea.tar.bz2 uhd-2326da0dd107e2a784771ff163e3b33be45300ea.zip |
n230: Improved error for secondary ethernet detection failure
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/n230/n230_resource_manager.cpp | 13 |
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); } |