From d9b7d9f2f9c6ebe27b6cfd4085f4a5c524363a1f Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 14 Jul 2010 22:16:52 +0000 Subject: Convert basic test programs to use shorts in the GPP to avoid using short to float code in uhd. --- host/examples/rx_timed_samples.cpp | 6 +++--- host/examples/tx_timed_samples.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'host') 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 > buff(dev->get_max_recv_samps_per_packet()); while(num_acc_samps < total_num_samps){ - uhd::rx_metadata_t md; - std::vector > 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 > buff(samps_per_packet, std::complex(ampl, ampl)); + std::vector > buff(samps_per_packet, std::complex(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; -- cgit v1.2.3