aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-02-09 12:17:08 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-10 00:18:43 +0100
commita2b3955e99df426826b922f3bfab41b18324aad0 (patch)
tree8a9f8912831caad4784557dd9fecbf1a2593b39a /host
parent167bc5942e647378022de7b4e7525eb6fc1808b0 (diff)
downloaduhd-a2b3955e99df426826b922f3bfab41b18324aad0.tar.gz
uhd-a2b3955e99df426826b922f3bfab41b18324aad0.tar.bz2
uhd-a2b3955e99df426826b922f3bfab41b18324aad0.zip
mpmd: Fix compiler issues
- Initialization of device_addr_t from another using auto doesn't work across compilers - Moved MPMD_DISC_RESPONSE_PREAMBLE to mpmd_find where it belongs
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/mpmd/mpmd_find.cpp7
-rw-r--r--host/lib/usrp/mpmd/mpmd_impl.hpp3
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp2
3 files changed, 5 insertions, 7 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_find.cpp b/host/lib/usrp/mpmd/mpmd_find.cpp
index 2f70ec280..a71581e78 100644
--- a/host/lib/usrp/mpmd/mpmd_find.cpp
+++ b/host/lib/usrp/mpmd/mpmd_find.cpp
@@ -16,13 +16,14 @@
using namespace uhd;
using namespace uhd::mpmd;
-constexpr char mpmd_impl::MPM_DISC_RESPONSE_PREAMBLE[];
-
namespace {
//! How long we wait for discovery responses (in seconds)
constexpr double MPMD_FIND_TIMEOUT = 0.5;
constexpr char MPMD_CHDR_REACHABILITY_KEY[] = "reachable";
constexpr char MPMD_CHDR_REACHABILITY_NEGATIVE[] = "No";
+ //! The preamble for any response on the discovery port. Can be used to
+ // verify that the response is actually an MPM device.
+ constexpr char MPM_DISC_RESPONSE_PREAMBLE[] = "USRP-MPM";
device_addr_t flag_dev_as_unreachable(const device_addr_t& device_args)
{
@@ -75,7 +76,7 @@ device_addrs_t mpmd_find_with_addr(
}
// Verify we didn't receive something other than an MPM discovery
// response
- if (result[0] != mpmd_impl::MPM_DISC_RESPONSE_PREAMBLE) {
+ if (result[0] != MPM_DISC_RESPONSE_PREAMBLE) {
continue;
}
const std::string recv_addr = comm->get_recv_addr();
diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp
index 291ee7fdd..71ad67d65 100644
--- a/host/lib/usrp/mpmd/mpmd_impl.hpp
+++ b/host/lib/usrp/mpmd/mpmd_impl.hpp
@@ -192,9 +192,6 @@ public:
static const std::string MPM_ECHO_CMD;
//! This is the RPC command that will return the last known error from MPM.
static const std::string MPM_RPC_GET_LAST_ERROR_CMD;
- //! The preamble for any response on the discovery port. Can be used to
- // verify that the response is actually an MPM device.
- static constexpr char MPM_DISC_RESPONSE_PREAMBLE[] = "USRP-MPM";
/**************************************************************************
* Structors
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index 6df78a9dd..797a3edff 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -272,7 +272,7 @@ boost::optional<device_addr_t> mpmd_mboard_impl::is_device_reachable(
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 device_addr_copy{device_addr};
+ device_addr_t device_addr_copy = device_addr;
device_addr_copy["addr"] = chdr_addr;
return boost::optional<device_addr_t>(device_addr_copy);
} catch (...) {