Minor cleanup
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 24 Sep 2008 15:36:17 +0000 (15:36 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 24 Sep 2008 15:36:17 +0000 (15:36 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9651 221aa14e-8319-0410-a670-987f0aec2ac5

13 files changed:
gr-usrp2/src/rx_16sc_handler.cc
gr-usrp2/src/rx_16sc_handler.h
gr-usrp2/src/rx_32fc_handler.cc
gr-usrp2/src/rx_32fc_handler.h
gr-usrp2/src/usrp2.i
gr-usrp2/src/usrp2_base.cc
gr-usrp2/src/usrp2_sink_16sc.cc
gr-usrp2/src/usrp2_sink_32fc.cc
gr-usrp2/src/usrp2_sink_base.cc
gr-usrp2/src/usrp2_source_16sc.cc
gr-usrp2/src/usrp2_source_16sc.h
gr-usrp2/src/usrp2_source_32fc.cc
gr-usrp2/src/usrp2_source_base.cc

index a3ab2a2b291ced0467ddb7bcc8a9d48b4965da49..7fb9ad06f92fa8916b7988afc1ef249de24fb974 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <rx_16sc_handler.h>
 
 rx_16sc_handler::~rx_16sc_handler()
 {
+  // NOP
 }
index d9a9e72e414561ca6b631aef3f293fc7002fdaf3..9d5b1f2e9593c7e78bdba98a9ea048bbec799283 100644 (file)
@@ -26,8 +26,6 @@
 #include <usrp2/rx_nop_handler.h>
 #include <usrp2/copiers.h>
 
-#define RX_16SC_HANDLER_DEBUG 0
-
 class rx_16sc_handler : public usrp2::rx_nop_handler
 {
   std::complex<int16_t> *d_dest;
@@ -43,30 +41,20 @@ public:
   // Factory function to return a shared pointer to a new instance
   static sptr make(uint64_t max_samples, uint64_t max_quantum, std::complex<int16_t> *dest) 
   {
-    if (RX_16SC_HANDLER_DEBUG)
-      printf("rx_16sc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-      
     return sptr(new rx_16sc_handler(max_samples, max_quantum, dest));
   }
 
   // Invoked by USRP2 API when samples are available
   bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
   {
-    if (RX_16SC_HANDLER_DEBUG)
-      printf("rx_16sc_handler: called with items=%zu ", nitems);
-
     // Copy/reformat/endian swap USRP2 data to destination buffer
     usrp2::copy_u2_16sc_to_host_16sc(nitems, items, d_dest);
     d_dest += nitems;
 
     // FIXME: do something with metadata
 
-    // Determine if there is room to be called again
-    bool ok = rx_nop_handler::operator()(items, nitems, metadata);
-    if (RX_16SC_HANDLER_DEBUG)
-      printf("ok to call again=%i\n", ok);
-
-    return ok;
+    // Call parent to determine if there is room to be called again
+    return rx_nop_handler::operator()(items, nitems, metadata);
   }
 
   ~rx_16sc_handler();
index f8347633bef3d9a2cc0850666cdbb7a9baf7448f..c9c2515586db97bf790dfccc72ac3cefc296745b 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <rx_32fc_handler.h>
 
 rx_32fc_handler::~rx_32fc_handler()
 {
+  // NOP
 }
index 028dfadabd10a17322400f05b75d48bedb6e8ebb..f2ce2b55df91e8ad3caabc8e0f858d3b827b5541 100644 (file)
@@ -27,8 +27,6 @@
 #include <usrp2/copiers.h>
 #include <gr_complex.h>
 
-#define RX_32FC_HANDLER_DEBUG 0
-
 class rx_32fc_handler : public usrp2::rx_nop_handler
 {
   gr_complex *d_dest;
@@ -44,30 +42,20 @@ public:
   // Factory function to return a shared pointer to a new instance
   static sptr make(uint64_t max_samples, uint64_t max_quantum, gr_complex *dest) 
   {
-    if (RX_32FC_HANDLER_DEBUG)
-      printf("rx_32fc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-      
     return sptr(new rx_32fc_handler(max_samples, max_quantum, dest));
   }
 
   // Invoked by USRP2 API when samples are available
   bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
   {
-    if (RX_32FC_HANDLER_DEBUG)
-      printf("rx_32fc_handler: called with items=%zu ", nitems);
-
     // Copy/reformat/endian swap USRP2 data to destination buffer
     usrp2::copy_u2_16sc_to_host_32fc(nitems, items, d_dest);
     d_dest += nitems;
 
     // FIXME: do something with metadata
 
-    // Determine if there is room to be called again
-    bool ok = rx_nop_handler::operator()(items, nitems, metadata);
-    if (RX_32FC_HANDLER_DEBUG)
-      printf("ok to call again=%i\n", ok);
-
-    return ok;
+    // Call parent to determine if there is room to be called again
+    return rx_nop_handler::operator()(items, nitems, metadata);
   }
 
   ~rx_32fc_handler();
index ae13ab25b8be26a08c3b0c092519621ce1cd96d5..9f82c4cdeb0f6ffd211636213c5a0831e9b083cc 100644 (file)
@@ -98,8 +98,6 @@ protected:
 
 public:
   ~usrp2_source_16sc();
-
-  std::string mac_addr();
 };
 
 // ----------------------------------------------------------------
index 19b977edbd575f9c5937f58ede124c6575362a69..4103862cb06e542ee657e2d415eea82e038ffbd3 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_base.h>
index f1356bb42d4c1ad8d2a01cf540613fce85cc4413..9b3977b30b9b9754b7ea0aaf95fd279f1f89e82b 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_sink_16sc.h>
@@ -62,10 +62,10 @@ usrp2_sink_16sc::work(int noutput_items,
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_16sc(0,  // FIXME: someday, streams will have channel numbers
+  bool ok = d_u2->tx_16sc(0,  // FIXME: use channel number instead of 0
                          in, noutput_items, &metadata);
   if (!ok){
-    std::cerr << "usrp2_sink_16sc: tx_complex_int16 failed" << std::endl;
+    std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
     return -1; // say we're done
   }
 
index f630c964bbb88cc28e3ec2c249f60b6b3546cb02..a36d991e05d90ada98d28d900f304ad196fc90aa 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_sink_32fc.h>
@@ -62,7 +62,7 @@ usrp2_sink_32fc::work(int noutput_items,
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_32fc(0,  // FIXME: someday, streams will have channel numbers
+  bool ok = d_u2->tx_32fc(0, // FIXME: use channel number instead of 0
                          in, noutput_items, &metadata);
   if (!ok){
     std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
index 8a622d65fe4c7ee8e6644b651e9c3b7bfda1f169..0034dd4e9c11ead4084c4a6e8ddeadb3d9adc1a1 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_sink_base.h>
 #include <gr_io_signature.h>
 #include <iostream>
 
-#define USRP2_SINK_BASE_DEBUG 0
-
 usrp2_sink_base::usrp2_sink_base(const char *name,
                                 gr_io_signature_sptr input_signature,
                                 const std::string &ifc,
index 1ff32a56e8216ec7f367de9a9e6e9c6a2348bedc..96dd628b9f9922160d8ac162fbd50c2f8e18eb44 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_source_16sc.h>
@@ -47,6 +47,7 @@ usrp2_source_16sc::usrp2_source_16sc(const std::string &ifc, const std::string &
 
 usrp2_source_16sc::~usrp2_source_16sc()
 {
+  // NOP
 }
 
 int
@@ -58,7 +59,7 @@ 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());
+  bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
   if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
     return -1; // say we're done
index 7a6b8e5963ddcbab1e1c65bdf96f999ffeb851ea..4ab9648b05535a0e34bd773b51fb995fb0385819 100644 (file)
@@ -20,8 +20,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef INCLUDED_USRP2_SOURCE_C_H
-#define INCLUDED_USRP2_SOURCE_C_H
+#ifndef INCLUDED_USRP2_SOURCE_16SC_H
+#define INCLUDED_USRP2_SOURCE_16SC_H
 
 #include <usrp2_source_base.h>
 
index 5726f2279e72a358ba1e039301f69ba67a621901..f5a3c2f1ebe25a7f65a2f203f3e13c562d9a0315 100644 (file)
@@ -47,6 +47,7 @@ usrp2_source_32fc::usrp2_source_32fc(const std::string &ifc, const std::string &
 
 usrp2_source_32fc::~usrp2_source_32fc()
 {
+  // NOP
 }
 
 int
@@ -58,7 +59,7 @@ 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());
+  bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
   if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
     return -1; // say we're done
index e83014308f978f8d47d5b2bb7bf7d489e9198f54..0f174bf20952789af8a455ab03daca7724a704c2 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <usrp2_source_base.h>