aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/tx_timed_samples.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-17 15:21:11 -0800
committerJosh Blum <josh@joshknows.com>2011-01-17 15:21:11 -0800
commit7e1d02710090c2c1aac971e41a2abb6f68c37d12 (patch)
tree9c3261ac3eebde988030a80f976e68d49516ac65 /host/examples/tx_timed_samples.cpp
parentcaa911aa270ee4aef7244f3159b9fd402a454069 (diff)
parentd71344091b324266975b58ec075d896fcb79aeb9 (diff)
downloaduhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.tar.gz
uhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.tar.bz2
uhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.zip
Merge branch 'usrp1' into next
Diffstat (limited to 'host/examples/tx_timed_samples.cpp')
-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);