From 71169b8e030d984220eadde83c4b40481f97cf6b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 24 May 2010 14:38:25 -0700 Subject: Added timeout error message to timed samples example. Added try catch to recv helper because vrt unpack can throw. --- host/examples/rx_timed_samples.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'host/examples') 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") -- cgit v1.2.3