diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-12 20:39:21 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-12 20:39:21 -0700 |
commit | 508af598a1b32345a53522b4d6d71e021f448347 (patch) | |
tree | 8399f1b3ba955b5dc2228fc818d131ce11a78c56 /host/examples/benchmark_rx_rate.cpp | |
parent | 4594aef53f75be451b9b64ad0ebdfdc742df251c (diff) | |
download | uhd-508af598a1b32345a53522b4d6d71e021f448347.tar.gz uhd-508af598a1b32345a53522b4d6d71e021f448347.tar.bz2 uhd-508af598a1b32345a53522b4d6d71e021f448347.zip |
uhd: switch statements to handle error code, default md to error code none
Diffstat (limited to 'host/examples/benchmark_rx_rate.cpp')
-rw-r--r-- | host/examples/benchmark_rx_rate.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp index a63337b38..2bde3865d 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; |