commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11449 - gnuradio/trunk/gr-usrp2/src


From: jcorgan
Subject: [Commit-gnuradio] r11449 - gnuradio/trunk/gr-usrp2/src
Date: Thu, 16 Jul 2009 11:44:04 -0600 (MDT)

Author: jcorgan
Date: 2009-07-16 11:44:03 -0600 (Thu, 16 Jul 2009)
New Revision: 11449

Modified:
   gnuradio/trunk/gr-usrp2/src/usrp2_sink_16sc.cc
   gnuradio/trunk/gr-usrp2/src/usrp2_sink_32fc.cc
Log:
Temporary workaround (until VRT) to stop submitting short packets to libusrp2 
tx_raw().

Modified: gnuradio/trunk/gr-usrp2/src/usrp2_sink_16sc.cc
===================================================================
--- gnuradio/trunk/gr-usrp2/src/usrp2_sink_16sc.cc      2009-07-16 05:06:00 UTC 
(rev 11448)
+++ gnuradio/trunk/gr-usrp2/src/usrp2_sink_16sc.cc      2009-07-16 17:44:03 UTC 
(rev 11449)
@@ -29,6 +29,9 @@
 #include <gr_io_signature.h>
 #include <iostream>
 
+// FIXME hack until VRT replaces libusrp2
+#define U2_MIN_SAMPLES 9
+
 usrp2_sink_16sc_sptr
 usrp2_make_sink_16sc(const std::string &ifc, const std::string &mac_addr) 
   throw (std::runtime_error)
@@ -57,6 +60,12 @@
 {
   std::complex<int16_t> *in = (std::complex<int16_t> *)input_items[0];
 
+  // FIXME: Current libusrp2 can't handle short packets.
+  // Returning 0 assumes there will be more samples
+  // the next round...
+  if (noutput_items < U2_MIN_SAMPLES)
+    return 0;
+
   usrp2::tx_metadata metadata;
   metadata.timestamp = -1;
   metadata.send_now = 1;

Modified: gnuradio/trunk/gr-usrp2/src/usrp2_sink_32fc.cc
===================================================================
--- gnuradio/trunk/gr-usrp2/src/usrp2_sink_32fc.cc      2009-07-16 05:06:00 UTC 
(rev 11448)
+++ gnuradio/trunk/gr-usrp2/src/usrp2_sink_32fc.cc      2009-07-16 17:44:03 UTC 
(rev 11449)
@@ -29,6 +29,9 @@
 #include <gr_io_signature.h>
 #include <iostream>
 
+// FIXME hack until VRT replaces libusrp2
+#define U2_MIN_SAMPLES 9
+
 usrp2_sink_32fc_sptr
 usrp2_make_sink_32fc(const std::string &ifc, const std::string &mac_addr) 
   throw (std::runtime_error)
@@ -57,6 +60,12 @@
 {
   gr_complex *in = (gr_complex *)input_items[0];
 
+  // FIXME: Current libusrp2 can't handle short packets.
+  // Returning 0 assumes there will be more samples
+  // the next round...
+  if (noutput_items < U2_MIN_SAMPLES)
+    return 0;
+
   usrp2::tx_metadata metadata;
   metadata.timestamp = -1;
   metadata.send_now = 1;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]