From 7bcaacdbc7d58c06e69fe42806aedbbd5ad9d8d2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 30 May 2012 12:51:26 -0700 Subject: examples: fix tx bursts so we only set EOB at the end --- host/examples/tx_bursts.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'host') diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp index 5a10ff81b..4cf5f2fd1 100644 --- a/host/examples/tx_bursts.cpp +++ b/host/examples/tx_bursts.cpp @@ -100,12 +100,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //allocate buffer with data to send const size_t spb = tx_stream->get_max_num_samps(); - std::vector *> buffs; - for(size_t i=0; i < usrp->get_num_mboards(); i++) { - buffs.push_back(new std::complex[spb]); - for(size_t n=0; n < spb; n++) - buffs.back()[n] = std::complex(ampl, ampl); - }; + std::vector > buff(spb, std::complex(ampl, ampl)); + std::vector *> buffs(usrp->get_tx_num_channels(), &buff.front()); std::signal(SIGINT, &sig_int_handler); if(repeat) std::cout << "Press Ctrl + C to quit..." << std::endl; @@ -127,9 +123,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ while(num_acc_samps < total_num_samps){ size_t samps_to_send = std::min(total_num_samps - num_acc_samps, spb); - //ensure the the last packet has EOB set - md.end_of_burst = samps_to_send <= spb; - //send a single packet size_t num_tx_samps = tx_stream->send( buffs, samps_to_send, md, timeout @@ -145,6 +138,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ num_acc_samps += num_tx_samps; } + md.end_of_burst = true; + tx_stream->send(buffs, 0, md, timeout); + time_to_send += rep_rate; std::cout << std::endl << "Waiting for async burst ACK... " << std::flush; -- cgit v1.2.3