From 2326da0dd107e2a784771ff163e3b33be45300ea Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Fri, 8 Jan 2016 11:19:11 -0800 Subject: n230: Improved error for secondary ethernet detection failure --- host/lib/usrp/n230/n230_resource_manager.cpp | 13 ++++++++++--- 1 file 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); } -- cgit v1.2.3