diff options
author | michael-west <michael.west@ettus.com> | 2020-12-04 13:50:54 -0800 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2020-12-10 16:16:02 -0800 |
commit | 744e60bd598df4677a88df10d1fceb56e7c1ee36 (patch) | |
tree | d37d56a209fa5f667615e9382e86ec5df45775e2 /host/lib | |
parent | 1fa617045c7c3ffb345ea595e4ca040219df9fc8 (diff) | |
download | uhd-744e60bd598df4677a88df10d1fceb56e7c1ee36.tar.gz uhd-744e60bd598df4677a88df10d1fceb56e7c1ee36.tar.bz2 uhd-744e60bd598df4677a88df10d1fceb56e7c1ee36.zip |
RFNoC: Handle receive of 0 samples
Returns immediately if requested number of samples is zero. Prevents
timeout error from being thrown if user requests no samples.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 5 | ||||
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp index ce66d2ccb..087a13de7 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp @@ -132,6 +132,11 @@ public: const double timeout, const bool one_packet) { + if (nsamps_per_buff == 0) { + metadata.reset(); + return 0; + } + if (_error_metadata_cache.check(metadata)) { return 0; } diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index f428f01f1..c6947ba26 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -238,6 +238,12 @@ public: return 0; } + // Just return if no samples requested + if (nsamps_per_buff == 0) { + metadata.reset(); + return 0; + } + size_t accum_num_samps = recv_one_packet(buffs, nsamps_per_buff, metadata, timeout); |