diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-24 14:38:25 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-24 14:38:25 -0700 |
commit | 71169b8e030d984220eadde83c4b40481f97cf6b (patch) | |
tree | 2d488a0408934fbddc0a49c245f26adc1101306c /host/examples | |
parent | 830e34fe30737432a5bfa4b19cc4bad5b4e425ee (diff) | |
download | uhd-71169b8e030d984220eadde83c4b40481f97cf6b.tar.gz uhd-71169b8e030d984220eadde83c4b40481f97cf6b.tar.bz2 uhd-71169b8e030d984220eadde83c4b40481f97cf6b.zip |
Added timeout error message to timed samples example.
Added try catch to recv helper because vrt unpack can throw.
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/rx_timed_samples.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp index d2306c7c4..64da260d5 100644 --- a/host/examples/rx_timed_samples.cpp +++ b/host/examples/rx_timed_samples.cpp @@ -86,6 +86,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ md, uhd::io_type_t::COMPLEX_FLOAT32, uhd::device::RECV_MODE_ONE_PACKET ); + if (num_rx_samps == 0 and num_acc_samps > 0){ + std::cout << "Got timeout before all samples received, possible packet loss, exiting loop..." << std::endl; + break; + } if (num_rx_samps == 0) continue; //wait for packets with contents std::cout << boost::format("Got packet: %u samples, %u secs, %u nsecs") |