diff options
Diffstat (limited to 'host/examples/test_async_messages.cpp')
-rw-r--r-- | host/examples/test_async_messages.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp index e02bc5f40..e4a996ef5 100644 --- a/host/examples/test_async_messages.cpp +++ b/host/examples/test_async_messages.cpp @@ -18,7 +18,7 @@ #include <uhd/utils/thread_priority.hpp> #include <uhd/utils/safe_main.hpp> #include <uhd/utils/static.hpp> -#include <uhd/usrp/simple_usrp.hpp> +#include <uhd/usrp/single_usrp.hpp> #include <boost/program_options.hpp> #include <boost/format.hpp> #include <complex> @@ -26,14 +26,12 @@ namespace po = boost::program_options; -static const size_t async_to_ms = 100; - /*! * Test that no messages are received: * Send a burst of many samples that will fragment internally. * We expect to not get any async messages. */ -void test_no_async_message(uhd::usrp::simple_usrp::sptr sdev){ +void test_no_async_message(uhd::usrp::single_usrp::sptr sdev){ uhd::device::sptr dev = sdev->get_device(); std::cout << "Test no async message... " << std::flush; @@ -52,13 +50,13 @@ void test_no_async_message(uhd::usrp::simple_usrp::sptr sdev){ ); uhd::async_metadata_t async_md; - if (dev->recv_async_msg(async_md, async_to_ms)){ + if (dev->recv_async_msg(async_md)){ std::cout << boost::format( "failed:\n" " Got unexpected event code 0x%x.\n" ) % async_md.event_code << std::endl; //clear the async messages - while (dev->recv_async_msg(async_md, 0)); + while (dev->recv_async_msg(async_md, 0)){}; } else{ std::cout << boost::format( @@ -73,7 +71,7 @@ void test_no_async_message(uhd::usrp::simple_usrp::sptr sdev){ * Send a start of burst packet with no following end of burst. * We expect to get an underflow(within a burst) async message. */ -void test_underflow_message(uhd::usrp::simple_usrp::sptr sdev){ +void test_underflow_message(uhd::usrp::single_usrp::sptr sdev){ uhd::device::sptr dev = sdev->get_device(); std::cout << "Test underflow message... " << std::flush; @@ -88,7 +86,7 @@ void test_underflow_message(uhd::usrp::simple_usrp::sptr sdev){ ); uhd::async_metadata_t async_md; - if (not dev->recv_async_msg(async_md, async_to_ms)){ + if (not dev->recv_async_msg(async_md)){ std::cout << boost::format( "failed:\n" " Async message recv timed out.\n" @@ -117,7 +115,7 @@ void test_underflow_message(uhd::usrp::simple_usrp::sptr sdev){ * Send a burst packet that occurs at a time in the past. * We expect to get a time error async message. */ -void test_time_error_message(uhd::usrp::simple_usrp::sptr sdev){ +void test_time_error_message(uhd::usrp::single_usrp::sptr sdev){ uhd::device::sptr dev = sdev->get_device(); std::cout << "Test time error message... " << std::flush; @@ -135,7 +133,7 @@ void test_time_error_message(uhd::usrp::simple_usrp::sptr sdev){ ); uhd::async_metadata_t async_md; - if (not dev->recv_async_msg(async_md, async_to_ms)){ + if (not dev->recv_async_msg(async_md)){ std::cout << boost::format( "failed:\n" " Async message recv timed out.\n" @@ -170,7 +168,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ po::options_description desc("Allowed options"); desc.add_options() ("help", "help message") - ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args") + ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args") ("rate", po::value<double>(&rate)->default_value(1.5e6), "rate of outgoing samples") ; po::variables_map vm; @@ -186,7 +184,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //create a usrp device std::cout << std::endl; 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); + uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args); std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl; //set the tx sample rate |