diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-05 11:59:27 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-03 20:37:10 -0700 |
commit | a629bbe7e3c39a10bdc3a981f6badb85a436b443 (patch) | |
tree | 58036a96d8fa045ce8900821b073f9f5a441f683 /host/examples/tx_waveforms.cpp | |
parent | e89b20da1511f02d887435d093d8efef3e4df261 (diff) | |
download | uhd-a629bbe7e3c39a10bdc3a981f6badb85a436b443.tar.gz uhd-a629bbe7e3c39a10bdc3a981f6badb85a436b443.tar.bz2 uhd-a629bbe7e3c39a10bdc3a981f6badb85a436b443.zip |
uhd: updated examples to use new streamer interface
Diffstat (limited to 'host/examples/tx_waveforms.cpp')
-rw-r--r-- | host/examples/tx_waveforms.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 6e5c53642..9aa3ec71f 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -202,6 +202,13 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ const double cps = wave_freq/usrp->get_tx_rate(); double theta = 0; + //create a transmit streamer + //linearly map channels (index0 = channel0, index1 = channel1, ...) + uhd::streamer_args stream_args("fc32"); + for (size_t chan = 0; chan < usrp->get_tx_num_channels(); chan++) + stream_args.channels.push_back(chan); //linear mapping + uhd::tx_streamer::sptr tx_stream = usrp->get_tx_streamer(stream_args); + //allocate a buffer which we re-use for each channel std::vector<std::complex<float> > buff(spb); std::vector<std::complex<float> *> buffs(usrp->get_tx_num_channels(), &buff.front()); @@ -250,11 +257,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ theta = std::fmod(theta, 1); //send the entire contents of the buffer - usrp->get_device()->send( - buffs, buff.size(), md, - uhd::io_type_t::COMPLEX_FLOAT32, - uhd::device::SEND_MODE_FULL_BUFF - ); + tx_stream->send(buffs, buff.size(), md); md.start_of_burst = false; md.has_time_spec = false; @@ -262,10 +265,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //send a mini EOB packet md.end_of_burst = true; - usrp->get_device()->send("", 0, md, - uhd::io_type_t::COMPLEX_FLOAT32, - uhd::device::SEND_MODE_FULL_BUFF - ); + tx_stream->send("", 0, md); //finished std::cout << std::endl << "Done!" << std::endl << std::endl; |