aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/benchmark_rx_rate.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-14 22:13:54 +0000
committerJosh Blum <josh@joshknows.com>2010-07-14 22:13:54 +0000
commitf34c3ce69ca6ecac9dedf7c13804064b860d8463 (patch)
treefbd2855b45ff24bead6342375f87fe00abb20a05 /host/examples/benchmark_rx_rate.cpp
parent9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e (diff)
parent959669e383c75fdcbd11091466516bd5af66cfb5 (diff)
downloaduhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.tar.gz
uhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.tar.bz2
uhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/examples/benchmark_rx_rate.cpp')
-rw-r--r--host/examples/benchmark_rx_rate.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp
index a63337b38..752facb0d 100644
--- a/host/examples/benchmark_rx_rate.cpp
+++ b/host/examples/benchmark_rx_rate.cpp
@@ -62,13 +62,18 @@ static inline void test_device(
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::RECV_MODE_ONE_PACKET
);
- if (num_rx_samps == 0 and md.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT){
- std::cerr << "Unexpected timeout on recv, exit test..." << std::endl;
+
+ //handle the error codes
+ switch(md.error_code){
+ case uhd::rx_metadata_t::ERROR_CODE_NONE:
+ case uhd::rx_metadata_t::ERROR_CODE_OVERRUN:
+ break;
+
+ default:
+ std::cerr << "Unexpected error on recv, exit test..." << std::endl;
return;
}
- if (num_rx_samps == 0 and md.error_code != uhd::rx_metadata_t::ERROR_CODE_OVERRUN){
- std::cerr << "Unexpected error on recv, continuing..." << std::endl;
- }
+
if (not md.has_time_spec){
std::cerr << "Metadata missing time spec, exit test..." << std::endl;
return;
@@ -132,6 +137,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
+ sdev->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); //stop if left running
if (not vm.count("rate")){
sdev->set_rx_rate(500e3); //initial rate