diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-16 01:54:36 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-16 01:54:36 +0000 |
commit | a17b6c31ecefa2f8752bb30b222eb3fa8b7d88d5 (patch) | |
tree | daf5666ca179cf75ad708a0b20898c6b7a86367c /host | |
parent | f34c3ce69ca6ecac9dedf7c13804064b860d8463 (diff) | |
parent | 624eb248cd5ee2343cb0f4f24f60916ea51b60fd (diff) | |
download | uhd-a17b6c31ecefa2f8752bb30b222eb3fa8b7d88d5.tar.gz uhd-a17b6c31ecefa2f8752bb30b222eb3fa8b7d88d5.tar.bz2 uhd-a17b6c31ecefa2f8752bb30b222eb3fa8b7d88d5.zip |
Merge branch 'usrp_e' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host')
-rw-r--r-- | host/examples/rx_timed_samples.cpp | 6 | ||||
-rw-r--r-- | host/examples/tx_timed_samples.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/usrp_e_impl.hpp | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp index 3b9acbb2c..a72e1ec81 100644 --- a/host/examples/rx_timed_samples.cpp +++ b/host/examples/rx_timed_samples.cpp @@ -84,12 +84,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //loop until total number of samples reached size_t num_acc_samps = 0; //number of accumulated samples + uhd::rx_metadata_t md; + std::vector<std::complex<short> > buff(dev->get_max_recv_samps_per_packet()); while(num_acc_samps < total_num_samps){ - uhd::rx_metadata_t md; - std::vector<std::complex<float> > buff(dev->get_max_recv_samps_per_packet()); size_t num_rx_samps = dev->recv( &buff.front(), buff.size(), md, - uhd::io_type_t::COMPLEX_FLOAT32, + uhd::io_type_t::COMPLEX_INT16, uhd::device::RECV_MODE_ONE_PACKET ); diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp index 5b72bd72f..ceae58a22 100644 --- a/host/examples/tx_timed_samples.cpp +++ b/host/examples/tx_timed_samples.cpp @@ -77,13 +77,13 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ sdev->set_time_now(uhd::time_spec_t(0.0)); //allocate data to send - std::vector<std::complex<float> > buff(samps_per_packet, std::complex<float>(ampl, ampl)); + std::vector<std::complex<short> > buff(samps_per_packet, std::complex<float>(ampl, ampl)); + uhd::tx_metadata_t md; //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; md.start_of_burst = true; //always SOB (good for continuous streaming) md.end_of_burst = (i == num_packets-1); //only last packet has EOB md.has_time_spec = (i == 0); //only first packet has time @@ -94,7 +94,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //send the entire packet (driver fragments internally) size_t num_tx_samps = dev->send( &buff.front(), samps_to_send, md, - uhd::io_type_t::COMPLEX_FLOAT32, + uhd::io_type_t::COMPLEX_INT16, uhd::device::SEND_MODE_FULL_BUFF ); if(verbose) std::cout << std::endl << boost::format("Sent %d samples") % num_tx_samps << std::endl; diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.hpp b/host/lib/usrp/usrp_e/usrp_e_impl.hpp index 4a63a6d21..efbf9f68f 100644 --- a/host/lib/usrp/usrp_e/usrp_e_impl.hpp +++ b/host/lib/usrp/usrp_e/usrp_e_impl.hpp @@ -83,8 +83,8 @@ public: //the io interface size_t send(const std::vector<const void *> &, size_t, const uhd::tx_metadata_t &, const uhd::io_type_t &, send_mode_t); size_t recv(const std::vector<void *> &, size_t, uhd::rx_metadata_t &, const uhd::io_type_t &, recv_mode_t); - size_t get_max_send_samps_per_packet(void) const{return 300;} - size_t get_max_recv_samps_per_packet(void) const{return 300;} + size_t get_max_send_samps_per_packet(void) const{return 503;} + size_t get_max_recv_samps_per_packet(void) const{return 503;} private: //interface to ioctls and file descriptor |