diff options
-rw-r--r-- | host/examples/tx_timed_samples.cpp | 8 |
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); |