aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-06-02 14:59:47 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:58 -0800
commit11401e2564bd50bdd76c84d9baedbb797ecf3f61 (patch)
tree00cd5ef509a5b0a111736630f440a46690550584 /host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
parent18098228932f3e25e3ac1750599c5e531657f161 (diff)
downloaduhd-11401e2564bd50bdd76c84d9baedbb797ecf3f61.tar.gz
uhd-11401e2564bd50bdd76c84d9baedbb797ecf3f61.tar.bz2
uhd-11401e2564bd50bdd76c84d9baedbb797ecf3f61.zip
rpc: Changed API to request/notify for better distinction between the two
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_mboard_impl.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index 934663e29..6ebb2caf6 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -39,7 +39,7 @@ mpmd_mboard_impl::mpmd_mboard_impl(
<< "Initializing mboard, connecting to IP address: " << ip_addr
<< " mboard args: " << mb_args.to_string()
;
- auto device_info_dict = rpc->call<dev_info>("get_device_info");
+ auto device_info_dict = rpc->request<dev_info>("get_device_info");
for (const auto &info_pair: device_info_dict) {
device_info[info_pair.first] = info_pair.second;
}
@@ -47,12 +47,13 @@ mpmd_mboard_impl::mpmd_mboard_impl(
<< "MPM reports device info: " << device_info.to_string();
// Claim logic
- auto rpc_token = rpc->call<std::string>("claim",
+ auto rpc_token = rpc->request<std::string>("claim",
mb_args.get("session_id", MPMD_DEFAULT_SESSION_ID)
);
if (rpc_token.empty()) {
throw uhd::value_error("mpmd device claiming failed!");
}
+ UHD_LOG_TRACE("MPMD", "Received claim token " << rpc_token);
rpc->set_token(rpc_token);
_claimer_task = task::make([this] {
if (not this->claim()) {
@@ -64,7 +65,7 @@ mpmd_mboard_impl::mpmd_mboard_impl(
});
// Initialize properties
- this->num_xbars = rpc->call<size_t>("get_num_xbars");
+ this->num_xbars = rpc->request<size_t>("get_num_xbars");
// Local addresses are not yet valid after this!
this->xbar_local_addrs.resize(this->num_xbars, 0xFF);
@@ -100,7 +101,7 @@ uhd::sid_t mpmd_mboard_impl::allocate_sid(const uint16_t port,
const uint32_t xbar_src_addr,
const uint32_t xbar_src_port)
{
- const auto sid = rpc->call_with_token<uint32_t>(
+ const auto sid = rpc->request_with_token<uint32_t>(
"allocate_sid",
port, address.get(), xbar_src_addr, xbar_src_port
);
@@ -111,7 +112,7 @@ void mpmd_mboard_impl::set_xbar_local_addr(
const size_t xbar_index,
const size_t local_addr
) {
- rpc->call_with_token<void>("set_xbar_local_addr", xbar_index, local_addr);
+ UHD_ASSERT_THROW(rpc->request_with_token<bool>("set_xbar_local_addr", xbar_index, local_addr));
UHD_ASSERT_THROW(xbar_index < xbar_local_addrs.size());
xbar_local_addrs.at(xbar_index) = local_addr;
}
@@ -121,7 +122,7 @@ void mpmd_mboard_impl::set_xbar_local_addr(
****************************************************************************/
bool mpmd_mboard_impl::claim()
{
- return rpc->call_with_token<bool>("reclaim");
+ return rpc->request_with_token<bool>("reclaim");
}
/*****************************************************************************