From 8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 12 Jul 2010 11:14:38 -0700 Subject: uhd: setup metadata for fragment case (not in general case) usrp2: print rev number in mboard name --- host/examples/benchmark_rx_rate.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'host/examples/benchmark_rx_rate.cpp') 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 > 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... -- cgit v1.2.3