diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index 244fab344..8cad29f6b 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -271,7 +271,18 @@ boost::optional<device_addr_t> mpmd_mboard_impl::is_device_reachable( "Was able to ping device, trying RPC connection."); auto chdr_rpcc = uhd::rpc_client::make(chdr_addr, rpc_port); chdr_rpcc->set_timeout(MPMD_SHORT_RPC_TIMEOUT); - chdr_rpcc->request<dev_info>("get_device_info"); + auto dev_info_chdr = chdr_rpcc->request<dev_info>("get_device_info"); + if (dev_info_chdr["serial"] != device_info_dict["serial"]) { + UHD_LOG_DEBUG("MPMD", boost::format( + "Connected to CHDR interface, but got wrong device. " + "Tried to reach serial %s, got %s") + % device_info_dict["serial"] % dev_info_chdr["serial"]); + return boost::optional<device_addr_t>(); + } else { + UHD_LOG_TRACE("MPMD", boost::format( + "Reachable device matches expected device (serial=%s)") + % device_info_dict["serial"] ); + } device_addr_t device_addr_copy = device_addr; device_addr_copy["addr"] = chdr_addr; return boost::optional<device_addr_t>(device_addr_copy); |