aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/multi_usrp.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-10-24 10:35:16 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:33 -0800
commitd5580fcec8611a83336d9634bd81b49e77635f68 (patch)
tree1516de69ea1891bb11205b63ddb319e521df9933 /host/lib/usrp/multi_usrp.cpp
parent4e6177ed5564180fe7a0da705490087e736371b6 (diff)
downloaduhd-d5580fcec8611a83336d9634bd81b49e77635f68.tar.gz
uhd-d5580fcec8611a83336d9634bd81b49e77635f68.tar.bz2
uhd-d5580fcec8611a83336d9634bd81b49e77635f68.zip
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.
Diffstat (limited to 'host/lib/usrp/multi_usrp.cpp')
-rw-r--r--host/lib/usrp/multi_usrp.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 6dad00787..1b39a2827 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -961,7 +961,16 @@ public:
******************************************************************/
rx_streamer::sptr get_rx_stream(const stream_args_t &args) {
_check_link_rate(args, false);
- return this->get_device()->get_rx_stream(args);
+ stream_args_t args_ = args;
+ if (!args.args.has_key("spp")) {
+ for (auto chan : args.channels) {
+ if (_rx_spp.count(chan)) {
+ args_.args.set("spp", std::to_string(_rx_spp.at(chan)));
+ break;
+ }
+ }
+ }
+ return this->get_device()->get_rx_stream(args_);
}
void set_rx_subdev_spec(const subdev_spec_t &spec, size_t mboard){
@@ -1018,6 +1027,11 @@ public:
}
}
+ void set_rx_spp(const size_t spp, const size_t chan = ALL_CHANS)
+ {
+ _rx_spp[chan] = spp;
+ }
+
double get_rx_rate(size_t chan){
return _tree->access<double>(rx_dsp_root(chan) / "rate" / "value").get();
}
@@ -2258,6 +2272,9 @@ private:
device::sptr _dev;
property_tree::sptr _tree;
+ //! Container for spp values set in set_rx_spp()
+ std::unordered_map<size_t, size_t> _rx_spp;
+
struct mboard_chan_pair{
size_t mboard, chan;
mboard_chan_pair(void): mboard(0), chan(0){}