aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-03 15:05:48 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-04 14:17:09 -0800
commit83dd47dc882421f96830fa55bd86405d1d80907f (patch)
treed4dd5f75c027f25351ba0bcb652e6a5a547706f7 /host/lib/usrp/mpmd/mpmd_impl.cpp
parentf25b37900561a50b816d545605b898207d4ca5b5 (diff)
downloaduhd-83dd47dc882421f96830fa55bd86405d1d80907f.tar.gz
uhd-83dd47dc882421f96830fa55bd86405d1d80907f.tar.bz2
uhd-83dd47dc882421f96830fa55bd86405d1d80907f.zip
mpmd: Allow user-overrides for MPM ports
Adds two device args: discovery_port and rpc_port. Both are integers which override the respective constants. Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_impl.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_impl.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp
index 8586aa3a9..ff1e0498d 100644
--- a/host/lib/usrp/mpmd/mpmd_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_impl.cpp
@@ -309,6 +309,10 @@ namespace {
/*****************************************************************************
* Static class attributes
****************************************************************************/
+const size_t mpmd_impl::MPM_DISCOVERY_PORT = 49600;
+const std::string mpmd_impl::MPM_DISCOVERY_PORT_KEY = "discovery_port";
+const size_t mpmd_impl::MPM_RPC_PORT = 49601;
+const std::string mpmd_impl::MPM_RPC_PORT_KEY = "rpc_port";
const std::string mpmd_impl::MPM_RPC_GET_LAST_ERROR_CMD = "get_last_error";
const std::string mpmd_impl::MPM_DISCOVERY_CMD = "MPM-DISC";
const std::string mpmd_impl::MPM_ECHO_CMD = "MPM-ECHO";
@@ -532,10 +536,16 @@ size_t mpmd_impl::allocate_xbar_local_addr()
device_addrs_t mpmd_find_with_addr(const std::string& mgmt_addr, const device_addr_t& hint_)
{
UHD_ASSERT_THROW(not mgmt_addr.empty());
+ const std::string mpm_discovery_port = hint_.get(
+ mpmd_impl::MPM_DISCOVERY_PORT_KEY,
+ std::to_string(mpmd_impl::MPM_DISCOVERY_PORT)
+ );
+ UHD_LOG_DEBUG("MPMD",
+ "Discovering MPM devices on port " << mpm_discovery_port);
device_addrs_t addrs;
transport::udp_simple::sptr comm = transport::udp_simple::make_broadcast(
- mgmt_addr, std::to_string(mpmd_impl::MPM_DISCOVERY_PORT));
+ mgmt_addr, mpm_discovery_port);
comm->send(
boost::asio::buffer(
mpmd_impl::MPM_DISCOVERY_CMD.c_str(),