summaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-12 18:15:38 +0000
committerJosh Blum <josh@joshknows.com>2010-07-12 18:15:38 +0000
commit9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e (patch)
tree37188194053ca00dc69349e607cf77831939ab6e /host/examples
parent3a3aefd68f054e3fccff31173be2a878841b29aa (diff)
parent8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d (diff)
downloaduhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.tar.gz
uhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.tar.bz2
uhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/benchmark_rx_rate.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp
index 7a7e9c3e0..a63337b38 100644
--- a/host/examples/benchmark_rx_rate.cpp
+++ b/host/examples/benchmark_rx_rate.cpp
@@ -38,6 +38,15 @@ static inline void test_device(
uhd::rx_metadata_t md;
std::vector<std::complex<float> > buff(dev->get_max_recv_samps_per_packet());
+ //flush the buffers in the recv path
+ while(dev->recv(
+ &buff.front(), buff.size(), md,
+ uhd::io_type_t::COMPLEX_FLOAT32,
+ uhd::device::RECV_MODE_ONE_PACKET
+ )){
+ /* NOP */
+ };
+
//declare status variables
bool got_first_packet = false;
size_t total_recv_packets = 0;
@@ -45,7 +54,7 @@ static inline void test_device(
size_t total_recv_samples = 0;
uhd::time_spec_t initial_time_spec;
uhd::time_spec_t next_expected_time_spec;
-
+
sdev->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
do {
size_t num_rx_samps = dev->recv(
@@ -79,15 +88,6 @@ static inline void test_device(
} while((next_expected_time_spec - initial_time_spec) < uhd::time_spec_t(duration_secs));
sdev->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
-
- //flush the buffers
- while(dev->recv(
- &buff.front(), buff.size(), md,
- uhd::io_type_t::COMPLEX_FLOAT32,
- uhd::device::RECV_MODE_ONE_PACKET
- )){
- /* NOP */
- };
//print a summary
std::cout << std::endl; //go to newline, recv may spew SXSYSZ...