summaryrefslogtreecommitdiffstats
path: root/host/examples/tx_bursts.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-07 18:47:29 -0800
committerJosh Blum <josh@joshknows.com>2011-11-07 18:47:29 -0800
commite219ad10a6e86cd4edc748f2218e01a9890e108c (patch)
tree372f2e426781de9885889bec6aa98697006268ec /host/examples/tx_bursts.cpp
parent8ff8f206d317e8d9c026fef9228a80edc241f9d4 (diff)
parent11f1390bbde65c60f45962acb128cac1ce21e474 (diff)
downloaduhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.tar.gz
uhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.tar.bz2
uhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.zip
Merge branch 'uhd_next'
Diffstat (limited to 'host/examples/tx_bursts.cpp')
-rw-r--r--host/examples/tx_bursts.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp
index a66fb85b6..f5ae18a9f 100644
--- a/host/examples/tx_bursts.cpp
+++ b/host/examples/tx_bursts.cpp
@@ -93,15 +93,19 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
usrp->set_time_now(uhd::time_spec_t(0.0));
+ //create a transmit streamer
+ uhd::stream_args_t stream_args("fc32"); //complex floats
+ uhd::tx_streamer::sptr tx_stream = usrp->get_tx_stream(stream_args);
+
//allocate buffer with data to send
- size_t spb = usrp->get_device()->get_max_send_samps_per_packet();
+ const size_t spb = tx_stream->get_max_num_samps();
std::vector<std::complex<float> *> buffs;
for(size_t i=0; i < usrp->get_num_mboards(); i++) {
buffs.push_back(new std::complex<float>[spb]);
for(size_t n=0; n < spb; n++)
buffs.back()[n] = std::complex<float>(ampl, ampl);
- }
+ };
std::signal(SIGINT, &sig_int_handler);
if(repeat) std::cout << "Press Ctrl + C to quit..." << std::endl;
@@ -127,10 +131,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
md.end_of_burst = samps_to_send < spb;
//send a single packet
- size_t num_tx_samps = usrp->get_device()->send(
- buffs, samps_to_send, md,
- uhd::io_type_t::COMPLEX_FLOAT32,
- uhd::device::SEND_MODE_ONE_PACKET, timeout
+ size_t num_tx_samps = tx_stream->send(
+ buffs, samps_to_send, md, timeout
);
//do not use time spec for subsequent packets