summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-usrp2/src/usrp2_sink_16sc.cc9
-rw-r--r--gr-usrp2/src/usrp2_sink_32fc.cc9
2 files changed, 18 insertions, 0 deletions
diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc
index 96e6b174c..1e7c54dcd 100644
--- a/gr-usrp2/src/usrp2_sink_16sc.cc
+++ b/gr-usrp2/src/usrp2_sink_16sc.cc
@@ -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 @@ usrp2_sink_16sc::work(int noutput_items,
{
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;
diff --git a/gr-usrp2/src/usrp2_sink_32fc.cc b/gr-usrp2/src/usrp2_sink_32fc.cc
index 6cfff0d75..b1e28a829 100644
--- a/gr-usrp2/src/usrp2_sink_32fc.cc
+++ b/gr-usrp2/src/usrp2_sink_32fc.cc
@@ -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 @@ usrp2_sink_32fc::work(int noutput_items,
{
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;