From 9cea1342941e74b911ca26cc41c64e340f04c270 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 4 Oct 2010 10:06:17 -0700 Subject: uhd: modified tx timed samples to deal with timeout --- host/examples/tx_timed_samples.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'host/examples') diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp index f34c121d5..2a15b2f66 100644 --- a/host/examples/tx_timed_samples.cpp +++ b/host/examples/tx_timed_samples.cpp @@ -95,8 +95,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ size_t num_tx_samps = dev->send( &buff.front(), samps_to_send, md, uhd::io_type_t::COMPLEX_FLOAT32, - uhd::device::SEND_MODE_FULL_BUFF + uhd::device::SEND_MODE_FULL_BUFF, + //send will backup into the host this many seconds before sending: + seconds_in_future + 0.1 //timeout (delay before transmit + padding) ); + if (num_tx_samps == 0) std::cout << "Send timeout..." << std::endl; if(verbose) std::cout << std::endl << boost::format("Sent %d samples") % num_tx_samps << std::endl; } -- cgit v1.2.3 From c2dc0fe98ddc6441cb989a49384b0c305a955368 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 4 Oct 2010 15:41:34 -0700 Subject: timeout: proper way to check for timeout in full buff mode --- host/examples/tx_timed_samples.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/examples') diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp index 2a15b2f66..863446682 100644 --- a/host/examples/tx_timed_samples.cpp +++ b/host/examples/tx_timed_samples.cpp @@ -99,7 +99,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //send will backup into the host this many seconds before sending: seconds_in_future + 0.1 //timeout (delay before transmit + padding) ); - if (num_tx_samps == 0) std::cout << "Send timeout..." << std::endl; + if (num_tx_samps < samps_to_send) std::cout << "Send timeout..." << std::endl; if(verbose) std::cout << std::endl << boost::format("Sent %d samples") % num_tx_samps << std::endl; } -- cgit v1.2.3