aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
diff options
context:
space:
mode:
authorTrung Tran <trung.tran@ettus.com>2019-01-09 21:51:41 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-14 09:43:56 -0800
commita8ac2016ee18e37bddbde05bf299c97a896a7f56 (patch)
treee4d2ba326d9298764f010d9f381471a74968a024 /host/lib/usrp/mpmd/mpmd_prop_tree.cpp
parent654c2fece997c4708dd928625494b8b796d1b2a2 (diff)
downloaduhd-a8ac2016ee18e37bddbde05bf299c97a896a7f56.tar.gz
uhd-a8ac2016ee18e37bddbde05bf299c97a896a7f56.tar.bz2
uhd-a8ac2016ee18e37bddbde05bf299c97a896a7f56.zip
rpc,mpmd: replace all set_timeout() to new api
Using new rpc client new API that ensure atomic setting of timeout on each rpc call.
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_prop_tree.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_prop_tree.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
index 256ac850a..27893341d 100644
--- a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
+++ b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
@@ -55,10 +55,8 @@ namespace {
// Now call update component
const size_t update_component_timeout = MPMD_UPDATE_COMPONENT_TIMEOUT * comps.size();
- mb->rpc->set_timeout(update_component_timeout);
- mb->rpc->notify_with_token("update_component", all_metadata, all_data);
- mb->set_timeout_default();
-
+ mb->rpc->notify_with_token(update_component_timeout,
+ "update_component", all_metadata, all_data);
return all_comps_copy;
}
@@ -114,9 +112,7 @@ void mpmd_impl::init_property_tree(
/*** Clocking *******************************************************/
tree->create<std::string>(mb_path / "clock_source/value")
.add_coerced_subscriber([mb](const std::string &clock_source){
- mb->set_timeout_init();
- mb->rpc->notify_with_token("set_clock_source", clock_source);
- mb->set_timeout_default();
+ mb->rpc->notify_with_token(MPMD_DEFAULT_INIT_TIMEOUT, "set_clock_source", clock_source);
})
.set_publisher([mb](){
return mb->rpc->request_with_token<std::string>(
@@ -134,9 +130,7 @@ void mpmd_impl::init_property_tree(
;
tree->create<std::string>(mb_path / "time_source/value")
.add_coerced_subscriber([mb](const std::string &time_source){
- mb->set_timeout_init();
- mb->rpc->notify_with_token("set_time_source", time_source);
- mb->set_timeout_default();
+ mb->rpc->notify_with_token(MPMD_DEFAULT_INIT_TIMEOUT, "set_time_source", time_source);
})
.set_publisher([mb](){
return mb->rpc->request_with_token<std::string>(
@@ -168,13 +162,11 @@ void mpmd_impl::init_property_tree(
tree->create<sensor_value_t>(
mb_path / "sensors" / sensor_name)
.set_publisher([mb, sensor_name](){
- mb->set_timeout_init();
auto sensor_val = sensor_value_t(
mb->rpc->request_with_token<sensor_value_t::sensor_map_t>(
- "get_mb_sensor", sensor_name
+ MPMD_DEFAULT_INIT_TIMEOUT, "get_mb_sensor", sensor_name
)
);
- mb->set_timeout_default();
return sensor_val;
})
.set_coercer([](const sensor_value_t &){
@@ -196,7 +188,7 @@ void mpmd_impl::init_property_tree(
mb_eeprom[key].cend()
);
}
- mb->rpc->notify_with_token("set_mb_eeprom", eeprom_map);
+ mb->rpc->notify_with_token(MPMD_DEFAULT_INIT_TIMEOUT, "set_mb_eeprom", eeprom_map);
})
.set_publisher([mb](){
auto mb_eeprom =