return -1 (DONE flag) if source or sink sees an error
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 24 Sep 2008 00:20:41 +0000 (00:20 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 24 Sep 2008 00:20:41 +0000 (00:20 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9650 221aa14e-8319-0410-a670-987f0aec2ac5

gr-usrp2/src/usrp2_sink_16sc.cc
gr-usrp2/src/usrp2_sink_32fc.cc
gr-usrp2/src/usrp2_source_16sc.cc
gr-usrp2/src/usrp2_source_32fc.cc

index bbd85563c8e5dea28e107a80e9df8f651f2fa491..f1356bb42d4c1ad8d2a01cf540613fce85cc4413 100644 (file)
@@ -64,8 +64,10 @@ usrp2_sink_16sc::work(int noutput_items,
 
   bool ok = d_u2->tx_16sc(0,  // FIXME: someday, streams will have channel numbers
                          in, noutput_items, &metadata);
-  if (!ok)
+  if (!ok){
     std::cerr << "usrp2_sink_16sc: tx_complex_int16 failed" << std::endl;
+    return -1; // say we're done
+  }
 
   return noutput_items;
 }
index fbb56e70706b23b341e9bcfd620bc62dc08cee2b..f630c964bbb88cc28e3ec2c249f60b6b3546cb02 100644 (file)
@@ -64,8 +64,10 @@ usrp2_sink_32fc::work(int noutput_items,
 
   bool ok = d_u2->tx_32fc(0,  // FIXME: someday, streams will have channel numbers
                          in, noutput_items, &metadata);
-  if (!ok)
+  if (!ok){
     std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
+    return -1; // say we're done
+  }
 
   return noutput_items;
 }
index b12a6eecea9166cfef7791275b93ee7a21b25f53..1ff32a56e8216ec7f367de9a9e6e9c6a2348bedc 100644 (file)
@@ -59,8 +59,10 @@ usrp2_source_16sc::work(int noutput_items,
   rx_16sc_handler::sptr handler = rx_16sc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
 
   bool ok = d_u2->rx_samples(0, handler.get());
-  if (!ok)
+  if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
+    return -1; // say we're done
+  }
 
   return handler->nsamples();
 }
index 0d241851808ed08fc15cf398dba68b9c8ba7936d..5726f2279e72a358ba1e039301f69ba67a621901 100644 (file)
@@ -59,8 +59,10 @@ usrp2_source_32fc::work(int noutput_items,
   rx_32fc_handler::sptr handler = rx_32fc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
 
   bool ok = d_u2->rx_samples(0, handler.get());
-  if (!ok)
+  if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
+    return -1; // say we're done
+  }
 
   return handler->nsamples();
 }