commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8387 - in usrp2/branches/developers/jcorgan/gr-usrp2/


From: jcorgan
Subject: [Commit-gnuradio] r8387 - in usrp2/branches/developers/jcorgan/gr-usrp2/host: . gr-usrp2 lib
Date: Sun, 11 May 2008 11:31:02 -0600 (MDT)

Author: jcorgan
Date: 2008-05-11 11:31:02 -0600 (Sun, 11 May 2008)
New Revision: 8387

Added:
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/Makefile.am
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2.i
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.h
Removed:
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.h
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.cc
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.h
Modified:
   usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.am
   usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/
   usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am
Log:
Refactored gr-usrp2 into separate subdirectory.

Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.am
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.am 2008-05-11 
17:25:08 UTC (rev 8386)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.am 2008-05-11 
17:31:02 UTC (rev 8387)
@@ -26,4 +26,4 @@
        configure \
        config.h.in
 
-SUBDIRS = config lib apps
+SUBDIRS = config lib gr-usrp2 apps

Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac        
2008-05-11 17:25:08 UTC (rev 8386)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac        
2008-05-11 17:31:02 UTC (rev 8387)
@@ -205,6 +205,7 @@
     Makefile \
     config/Makefile \
     apps/Makefile \
+    gr-usrp2/Makefile \
     lib/Makefile \
 ])
 


Property changes on: usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2
___________________________________________________________________
Name: svn:ignore
   + .libs
.deps
Makefile
Makefile.in
*.pyc
usrp2.cc
usrp2.py


Copied: usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/Makefile.am 
(from rev 8382, usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/Makefile.am        
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/Makefile.am        
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,84 @@
+#
+# Copyright 2007,2008 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+include $(top_srcdir)/Makefile.common
+
+INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES)
+
+lib_LTLIBRARIES = \
+       libgr_usrp2.la
+
+libgr_usrp2_la_SOURCES = \
+       usrp2_sink_base.cc \
+       usrp2_sink_c.cc \
+       usrp2_source_base.cc \
+       usrp2_source_c.cc
+
+libgr_usrp2_la_LIBADD = \
+       ../lib/libusrp2.la
+
+include_HEADERS = \
+       usrp2_sink_base.h \
+       usrp2_sink_c.h \
+       usrp2_source_base.h \
+       usrp2_source_c.h
+
+# Export C++ GNU Radio driver to Python via SWIG
+ourpythondir = $(grpythondir)
+ourlibdir    = $(grpyexecdir)
+
+SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(SWIGGRFLAGS) $(WITH_SWIG_INCLUDES) \
+       $(WITH_INCLUDES)
+
+LOCAL_IFILES = \
+       usrp2.i                         
+
+BUILT_SOURCES =        \
+       usrp2.cc \
+       usrp2.py                        
+
+ourpython_PYTHON = \
+       usrp2.py
+
+ourlib_LTLIBRARIES = \
+       _usrp2.la
+
+_usrp2_la_SOURCES = \
+       usrp2.cc
+
+_usrp2_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+
+_usrp2_la_LIBADD = \
+       $(PYTHON_LDFLAGS) \
+       libgr_usrp2.la \
+       $(GNURADIO_CORE_LIBS) \
+       -lstdc++                        
+
+_usrp2_la_CPPFLAGS = $(PYTHON_CPPFLAGS)
+
+usrp2.cc usrp2.py: $(LOCAL_IFILES)
+       $(SWIG) $(SWIGPYTHONARGS) -module usrp2 -o usrp2.cc $(LOCAL_IFILES)
+
+swiginclude_HEADERS = \
+       $(LOCAL_IFILES)
+
+# Don't distribute output of swig
+dist-hook:
+       @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
+       @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done
+
+MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc *~

Copied: usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2.i (from 
rev 8382, usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2.i            
                (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2.i    
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,97 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%feature("autodoc", "1");              // generate python docstrings
+
+%include "exception.i"
+%import "gnuradio.i"                           // the common stuff
+
+%{
+#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
+#include "usrp2_sink_c.h"
+#include "usrp2_source_c.h"
+%}
+
+// ----------------------------------------------------------------
+
+class usrp2_sink_base : public gr_sync_block {
+
+protected:
+  usrp2_sink_base(const std::string &name,
+                 gr_io_signature_sptr input_signature) 
+    throw (std::runtime_error);
+
+public:
+  ~usrp2_sink_base();
+
+};
+
+// ----------------------------------------------------------------
+
+class usrp2_source_base : public gr_sync_block {
+
+protected:
+  usrp2_source_base(const std::string &name,
+                   gr_io_signature_sptr output_signature) 
+    throw (std::runtime_error);
+
+public:
+  ~usrp2_source_base();
+
+};
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(usrp2,sink_c)
+
+usrp2_sink_c_sptr
+usrp2_make_sink_c() throw (std::runtime_error);
+
+class usrp2_sink_c : public usrp2_sink_base {
+
+protected:
+  usrp2_sink_c();
+
+public:
+  ~usrp2_sink_c();
+
+};
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(usrp2,source_c)
+
+usrp2_source_c_sptr
+usrp2_make_source_c(const std::string &ifc="eth0",
+                   const std::string &mac="") 
+  throw (std::runtime_error);
+
+class usrp2_source_c : public usrp2_source_base {
+
+protected:
+  usrp2_source_c(const std::string &ifc,
+                const std::string &mac);
+
+public:
+  ~usrp2_source_c();
+
+};

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.cc 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.cc 
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.cc 
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,49 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp2_sink_base.h>
+#include <gr_io_signature.h>
+
+usrp2_sink_base::usrp2_sink_base(const std::string &name,
+                                gr_io_signature_sptr input_signature) 
+  throw (std::runtime_error)
+  : gr_sync_block(name,
+                 input_signature,
+                 gr_make_io_signature(0, 0, 0))
+{
+}
+
+usrp2_sink_base::~usrp2_sink_base ()
+{
+}
+
+int
+usrp2_sink_base::work(int noutput_items,
+                     gr_vector_const_void_star &input_items,
+                     gr_vector_void_star &output_items)
+{
+  return noutput_items;
+}

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.h 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.h  
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_base.h  
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SINK_BASE_H
+#define INCLUDED_USRP2_SINK_BASE_H
+
+#include <gr_sync_block.h>
+#include <stdexcept>
+
+class usrp2_sink_base : public gr_sync_block {
+
+private:
+
+protected:
+  usrp2_sink_base(const std::string &name,
+                 gr_io_signature_sptr input_signature) 
+    throw (std::runtime_error);
+  
+public:
+  ~usrp2_sink_base();
+  
+  int work(int noutput_items,
+          gr_vector_const_void_star &input_items,
+          gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SINK_BASE_H */

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.cc (from 
rev 8382, usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.cc    
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.cc    
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp2_sink_c.h>
+#include <gr_io_signature.h>
+#include <usrp_standard.h>
+#include <usrp_bytesex.h>
+
+usrp2_sink_c_sptr
+usrp2_make_sink_c() throw (std::runtime_error)
+{
+  return usrp2_sink_c_sptr(new usrp2_sink_c());
+}
+
+usrp2_sink_c::usrp2_sink_c() throw (std::runtime_error)
+  : usrp2_sink_base("usrp2_sink_c",
+                   gr_make_io_signature(1, 1, sizeof(gr_complex)))
+{
+}
+
+usrp2_sink_c::~usrp2_sink_c()
+{
+}

Copied: usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.h 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.h     
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_sink_c.h     
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,47 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SINK_C_H
+#define INCLUDED_USRP2_SINK_C_H
+
+#include <usrp2_sink_base.h>
+
+class usrp2_sink_c;
+typedef boost::shared_ptr<usrp2_sink_c> usrp2_sink_c_sptr;
+
+usrp2_sink_c_sptr
+usrp2_make_sink_c() throw (std::runtime_error);
+
+class usrp2_sink_c : public usrp2_sink_base {
+private:
+
+  friend usrp2_sink_c_sptr
+  usrp2_make_sink_c() throw (std::runtime_error);
+
+protected:
+  usrp2_sink_c() throw (std::runtime_error);
+
+public:
+  ~usrp2_sink_c();
+};
+
+#endif /* INCLUDED_USRP2_SINK_C_H */

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.cc 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.cc)
===================================================================
--- 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.cc   
                            (rev 0)
+++ 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.cc   
    2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,86 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp2_source_base.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+#define USRP2_SOURCE_BASE_DEBUG 1
+
+usrp2_source_base::usrp2_source_base(const std::string &name,
+                                    gr_io_signature_sptr output_signature,
+                                    const std::string &ifc,
+                                    const std::string &mac) 
+  throw (std::runtime_error)
+  : gr_sync_block(name,
+                 gr_make_io_signature(0, 0, 0),
+                 output_signature),
+    d_u2(0), d_addr()
+{
+  std::vector<op_id_reply_t> r = usrp2_basic::find_usrps(ifc);
+  if (r.size() == 0)
+    throw std::runtime_error("No USRP2s found on interface.");
+
+  if (mac == "") {
+    if (r.size() > 1)
+      throw std::runtime_error("Must supply USRP2 MAC address when multiple 
devices are present");
+    d_addr = r[0].addr;
+  }
+  else {
+    u2_mac_addr_t addr;
+    if (!usrp2_basic::parse_mac_addr(mac, &addr))
+      throw std::runtime_error("Invalid MAC address");
+
+    unsigned int i;
+    for (i = 0; i < r.size(); i++)
+      if (r[i].addr == addr) {
+       d_addr = addr;
+       break;
+      }
+    
+    if (i == r.size())
+      throw std::runtime_error("Unable to find specified USRP2.");
+  }
+
+  if (USRP2_SOURCE_BASE_DEBUG)
+    std::cout << "usrp2_source_base: using ifc=" << ifc << " mac=" << d_addr 
<< std::endl;
+
+  // Now retrieve or make and return usrp2_basic object for MAC address in 
d_addr
+}
+
+usrp2_source_base::~usrp2_source_base ()
+{
+  if (d_u2)
+    delete d_u2;
+}
+
+int
+usrp2_source_base::work(int noutput_items,
+                       gr_vector_const_void_star &input_items,
+                       gr_vector_void_star &output_items)
+{
+  return noutput_items;
+}

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.h 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.h)
===================================================================
--- 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.h    
                            (rev 0)
+++ 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_base.h    
    2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SOURCE_BASE_H
+#define INCLUDED_USRP2_SOURCE_BASE_H
+
+#include <gr_sync_block.h>
+#include <usrp2_basic.h>
+#include <stdexcept>
+
+class usrp2_source_base : public gr_sync_block {
+  
+protected:
+  usrp2_source_base(const std::string &name,
+                   gr_io_signature_sptr output_signature,
+                   const std::string &ifc = "eth0",
+                   const std::string &mac = "")
+    throw (std::runtime_error);
+
+  usrp2_basic *d_u2;
+  u2_mac_addr_t d_addr;
+
+public:
+  ~usrp2_source_base();
+  
+  int work(int noutput_items,
+          gr_vector_const_void_star &input_items,
+          gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SOURCE_BASE_H */

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.cc 
(from rev 8382, 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.cc)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.cc  
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.cc  
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,49 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp2_source_c.h>
+#include <gr_io_signature.h>
+
+usrp2_source_c_sptr
+usrp2_make_source_c(const std::string &ifc,
+                   const std::string &mac) 
+  throw (std::runtime_error)
+{
+  return usrp2_source_c_sptr(new usrp2_source_c(ifc, mac));
+}
+
+usrp2_source_c::usrp2_source_c(const std::string &ifc,
+                              const std::string &mac) 
+  throw (std::runtime_error)
+  : usrp2_source_base("usrp2_source_c",
+                     gr_make_io_signature(1, 1, sizeof(gr_complex)),
+                     ifc, mac)
+{
+}
+
+usrp2_source_c::~usrp2_source_c()
+{
+}

Copied: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.h (from 
rev 8382, usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.h)
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.h   
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/gr-usrp2/usrp2_source_c.h   
2008-05-11 17:31:02 UTC (rev 8387)
@@ -0,0 +1,51 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SOURCE_C_H
+#define INCLUDED_USRP2_SOURCE_C_H
+
+#include <usrp2_source_base.h>
+
+class usrp2_source_c;
+typedef boost::shared_ptr<usrp2_source_c> usrp2_source_c_sptr;
+
+usrp2_source_c_sptr
+usrp2_make_source_c(const std::string &ifc="eth0",
+                   const std::string &mac="") 
+  throw (std::runtime_error);
+
+class usrp2_source_c : public usrp2_source_base {
+
+private:
+  friend usrp2_source_c_sptr
+  usrp2_make_source_c(const std::string &ifc,
+                     const std::string &mac) throw (std::runtime_error);
+
+protected:
+  usrp2_source_c(const std::string &ifc="eth0",
+                const std::string &mac="") throw (std::runtime_error);
+
+public:
+  ~usrp2_source_c();
+};
+
+#endif /* INCLUDED_USRP2_SOURCE_C_H */


Property changes on: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib
___________________________________________________________________
Name: svn:ignore
   - .libs
*-stamp
*.a
*.bin
*.dump
*.log
*.rom
.deps
Makefile
Makefile.in
aclocal.m4
autom4te.cache
blink_leds
blink_leds2
build
compile
config.h
config.h.in
config.log
config.status
configure
depcomp
eth_test
gen_eth_packets
ibs_rx_test
ibs_tx_test
install-sh
libtool
ltmain.sh
missing
py-compile
rcv_eth_packets
run_tests.sh
stamp-h1
test1
test_phy_comm
timer_test
buf_ram_test
buf_ram_zero
hello
usrp2.cc
usrp2.py

   + .libs
.deps
Makefile
Makefile.in
usrp2.cc
usrp2.py


Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am     
2008-05-11 17:25:08 UTC (rev 8386)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am     
2008-05-11 17:31:02 UTC (rev 8387)
@@ -20,14 +20,12 @@
 INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES)
 
 lib_LTLIBRARIES = \
-       libusrp2.la \
-       libgr_usrp2.la
+       libusrp2.la
 
 noinst_LTLIBRARIES = \
        libpfring.la
 
 
-# Non-GNU Radio applications link against this library
 libusrp2_la_SOURCES = \
        gri_ethernet.cc \
        gri_ethernet_pfring.cc \
@@ -43,73 +41,11 @@
        libpfring.la \
        $(GR_OMNITHREAD_LIBS)
 
-
-# C++ only GNU Radio applications link against this library
-libgr_usrp2_la_SOURCES = \
-       usrp2_sink_base.cc \
-       usrp2_sink_c.cc \
-       usrp2_source_base.cc \
-       usrp2_source_c.cc
-
-libgr_usrp2_la_LIBADD = \
-       libusrp2.la
-
-
-# Combined list of development headers for all libraries
 include_HEADERS = \
        gri_ethernet.h \
        gri_ethernet_pfring.h \
        gri_if_stats.h \
        gri_pktfilter.h \
        strtod_si.h \
-       usrp2_basic.h \
-       usrp2_sink_base.h \
-       usrp2_sink_c.h \
-       usrp2_source_base.h \
-       usrp2_source_c.h
+       usrp2_basic.h
 
-# Export C++ GNU Radio driver to Python via SWIG
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
-SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(SWIGGRFLAGS) $(WITH_SWIG_INCLUDES) \
-       $(WITH_INCLUDES)
-
-LOCAL_IFILES = \
-       usrp2.i                         
-
-BUILT_SOURCES =        \
-       usrp2.cc \
-       usrp2.py                        
-
-ourpython_PYTHON = \
-       usrp2.py
-
-ourlib_LTLIBRARIES = \
-       _usrp2.la
-
-_usrp2_la_SOURCES = \
-       usrp2.cc
-
-_usrp2_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-_usrp2_la_LIBADD = \
-       $(PYTHON_LDFLAGS) \
-       libgr_usrp2.la \
-       $(GNURADIO_CORE_LIBS) \
-       -lstdc++                        
-
-_usrp2_la_CPPFLAGS = $(PYTHON_CPPFLAGS)
-
-usrp2.cc usrp2.py: $(LOCAL_IFILES)
-       $(SWIG) $(SWIGPYTHONARGS) -module usrp2 -o usrp2.cc $(LOCAL_IFILES)
-
-swiginclude_HEADERS = \
-       $(LOCAL_IFILES)
-
-# Don't distribute output of swig
-dist-hook:
-       @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
-       @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done
-
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc *~

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h

Deleted: 
usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.cc

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_base.h

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.cc

Deleted: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_source_c.h





reply via email to

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