From d5580fcec8611a83336d9634bd81b49e77635f68 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 24 Oct 2019 10:35:16 -0700 Subject: multi_usrp: Add set_rx_spp() call This API call is a more explicit way of setting the spp than passing in an spp value in the args of the stream args when creating streamers. For pre-RFNoC devices, this is done by injecting the spp arg back into the stream args. For RFNoC devices, the set_property() call on the radio is called. --- host/lib/usrp/multi_usrp_rfnoc.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/multi_usrp_rfnoc.cpp') diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp index b3851ba9e..d6f16824d 100644 --- a/host/lib/usrp/multi_usrp_rfnoc.cpp +++ b/host/lib/usrp/multi_usrp_rfnoc.cpp @@ -16,8 +16,9 @@ #include #include #include +#include #include -#include +#include #include #include #include @@ -1044,6 +1045,20 @@ public: _rx_rates[chan] = actual_rate; } + void set_rx_spp(const size_t spp, const size_t chan = ALL_CHANS) + { + std::lock_guard l(_graph_mutex); + if (chan == ALL_CHANS) { + for (size_t chan = 0; chan < _rx_chans.size(); ++chan) { + set_rx_spp(spp, chan); + } + return; + } + auto rx_chain = _get_rx_chan(chan); + rx_chain.radio->set_property( + "spp", narrow_cast(spp), rx_chain.block_chan); + } + double get_rx_rate(size_t chan) { std::lock_guard l(_graph_mutex); -- cgit v1.2.3