From c8950c1e0b82ef3e849d91ffb436ac41514022a4 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 11 Nov 2019 15:40:02 -0800 Subject: examples: Send only single packets in test_messages For the burst ACK test, test_messages would send 3 packets. However, that assumes that the underlying link is fast enough to send three packets in time, and some devices are hard to operate without underruns without also specifying a start-of burst timestamp. Often, test_messages would report that no ACK was received, but instead, an underrun was received. test_messages also doesn't need to send three packets. The three packets came from the "start of burst" flag, which no device in UHD supports. The change is thus to send a single packet with an EOB marker for the burst ACK test. This will work regardless of the link speed and CPU power. --- host/examples/test_messages.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host') diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp index 637f086f0..78abd3c29 100644 --- a/host/examples/test_messages.cpp +++ b/host/examples/test_messages.cpp @@ -136,8 +136,7 @@ bool test_burst_ack_message( md.end_of_burst = true; md.has_time_spec = false; - // 3 times max-sps guarantees a SOB, no burst, and EOB packet - std::vector> buff(tx_stream->get_max_num_samps() * 3); + std::vector> buff(tx_stream->get_max_num_samps()); tx_stream->send(&buff.front(), buff.size(), md); uhd::async_metadata_t async_md; @@ -330,7 +329,8 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) ("Test Burst ACK ", &test_burst_ack_message) ("Test Underflow ", &test_underflow_message) ("Test Time Error", &test_time_error_message) - ("Test Late Command", &test_late_command_message); + ("Test Late Command", &test_late_command_message) + ; // clang-format on if (vm.count("test-chain")) { -- cgit v1.2.3