diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-12 11:14:38 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-12 11:14:38 -0700 |
commit | 8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d (patch) | |
tree | b32bc7d5b1e4ebbbb74acaf044e603d5b32e6e3d /host/examples/benchmark_rx_rate.cpp | |
parent | 5e7af879c890c1168ba957ca9158428eeb387c94 (diff) | |
download | uhd-8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d.tar.gz uhd-8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d.tar.bz2 uhd-8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d.zip |
uhd: setup metadata for fragment case (not in general case)
usrp2: print rev number in mboard name
Diffstat (limited to 'host/examples/benchmark_rx_rate.cpp')
-rw-r--r-- | host/examples/benchmark_rx_rate.cpp | 20 |
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... |