aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2011-01-17 22:52:41 -0800
committerNick Foster <nick@nerdnetworks.org>2011-01-17 22:52:41 -0800
commit24c3565f9f887045e414652edffd6b5536f8c7a5 (patch)
treea0e40a679d6a029268fc2a328f3643c40a9e880b /host/examples
parent330a014dfc32b34a7fe5555d3ae2d87a25dc2466 (diff)
parent37116e6c5be8e2660b9dd165e04ea1af4087f1f0 (diff)
downloaduhd-24c3565f9f887045e414652edffd6b5536f8c7a5.tar.gz
uhd-24c3565f9f887045e414652edffd6b5536f8c7a5.tar.bz2
uhd-24c3565f9f887045e414652edffd6b5536f8c7a5.zip
Merge branch 'next' of ettus.sourcerepo.com:ettus/uhdpriv into next
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/tx_timed_samples.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp
index 074b13e81..6d6aa7010 100644
--- a/host/examples/tx_timed_samples.cpp
+++ b/host/examples/tx_timed_samples.cpp
@@ -84,15 +84,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//allocate data to send
std::vector<std::complex<float> > buff(samps_per_packet, std::complex<float>(ampl, ampl));
+ uhd::tx_metadata_t md;
+ md.time_spec = uhd::time_spec_t(seconds_in_future);
+
//send the data in multiple packets
size_t num_packets = (total_num_samps+samps_per_packet-1)/samps_per_packet;
for (size_t i = 0; i < num_packets; i++){
- //setup the metadata flags and time spec
- uhd::tx_metadata_t md;
+
+ //setup the metadata flags per fragment
md.start_of_burst = (i == 0); //only first packet has SOB
md.end_of_burst = (i == num_packets-1); //only last packet has EOB
md.has_time_spec = (i == 0); //only first packet has time
- md.time_spec = uhd::time_spec_t(seconds_in_future);
size_t samps_to_send = std::min(total_num_samps - samps_per_packet*i, samps_per_packet);