commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: jcorgan
Subject: [Commit-gnuradio] r8361 - in usrp2/branches/developers/jcorgan/gr-usrp2/host: . apps config lib
Date: Sat, 10 May 2008 14:02:46 -0600 (MDT)

Author: jcorgan
Date: 2008-05-10 14:02:46 -0600 (Sat, 10 May 2008)
New Revision: 8361

Added:
   usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_python.m4
   usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_scripting.m4
   usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_swig.m4
   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
Modified:
   usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.common
   usrp2/branches/developers/jcorgan/gr-usrp2/host/apps/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:
Work in progress on usrp2.

Adds (incomplete) skeleton versions of:

libgr_usrp2.so (C++ only GNU Radio interface to usrp2)
_usrp2.so (Python extension module to interface to usrp2)



Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.common
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.common     
2008-05-10 18:57:40 UTC (rev 8360)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/Makefile.common     
2008-05-10 20:02:46 UTC (rev 8361)
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# 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
@@ -22,3 +22,23 @@
   -I$(top_srcdir)/../firmware/include \
   -I$(top_srcdir)/lib \
   $(GNURADIO_CORE_CFLAGS)
+
+# includes
+grincludedir   = $(includedir)/gnuradio
+swigincludedir = $(grincludedir)/swig
+
+# Install Python modules in the appropriate subdirectory
+# This usually ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+
+grpythondir = $(pythondir)/gnuradio
+grpyexecdir = $(pyexecdir)/gnuradio
+
+# swig flags
+SWIGPYTHONFLAGS = $(PYTHON_CPPFLAGS) -fvirtual -python -modern
+SWIGGRFLAGS = -I$(swigincludedir) -I$(grincludedir)
+
+# Don't assume that make predefines $(RM), because BSD make does
+# not. We define it now in configure.ac using AM_PATH_PROG, but now
+# here have to add a -f to be like GNU make.
+RM=$(RM_PROG) -f

Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/apps/Makefile.am
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/apps/Makefile.am    
2008-05-10 18:57:40 UTC (rev 8360)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/apps/Makefile.am    
2008-05-10 20:02:46 UTC (rev 8361)
@@ -19,7 +19,9 @@
 
 INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES)
 
-LDADD = ../lib/libusrp2.la
+LDADD = \
+       ../lib/libusrp2.la \
+       $(GNURADIO_CORE_LIBS) # FIXME: Should only be needed by rx_samples but 
can't be LDADDed below (include errors!?)
 
 bin_PROGRAMS = \
        find_usrps \

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_python.m4
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_python.m4         
                (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_python.m4 
2008-05-10 20:02:46 UTC (rev 8361)
@@ -0,0 +1,128 @@
+dnl
+dnl Copyright 2003,2004,2005 Free Software Foundation, Inc.
+dnl 
+dnl This file is part of GNU Radio
+dnl 
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl 
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl 
+
+# PYTHON_DEVEL()
+#
+# Checks for Python and tries to get the include path to 'Python.h'.
+# It sets the $(PYTHON_CPPFLAGS), $(PYTHON_LDFLAGS) and $(pythondir) output 
variables,
+#
+AC_DEFUN([PYTHON_DEVEL],[
+       AC_REQUIRE([AM_PATH_PYTHON])
+       AC_REQUIRE([AC_CANONICAL_HOST])
+
+       AC_ARG_WITH(pythondir,
+                    AC_HELP_STRING([--with-pythondir=DIR], 
+                       [python installation directory (cross-compiling) 
[[default=$prefix/lib/python2.5/site-packages]]]),
+                   
[with_pythondir=${withval}],[with_pythondir=${prefix}/lib/python2.5/site-packages])
+
+       # if we're cross-compiling, asking the host python about any of
+       # this is completely useless...
+
+       if test x$cross_compiling != xno
+       then
+               pythondir=$with_pythondir
+               pyexecdir=$with_pythondir
+               AC_SUBST(PYTHON_CPPFLAGS)
+               AC_SUBST(PYTHON_LDFLAGS)
+        else
+
+           # For Fedora Core 5 and 6, see ticket:39 in Trac
+           if test -f '/etc/redhat-release'; then
+                   if  (echo $pyexecdir | grep -q lib64); then
+                           pythondir="$pyexecdir"
+                   fi
+           fi
+
+           # Check for Python include path
+           AC_MSG_CHECKING([for Python include path])
+           if test -z "$PYTHON" ; then
+                   AC_MSG_ERROR([cannot find Python path])
+           fi
+
+           # ask distutils which include path we should use
+           python_cmd='
+import distutils.sysconfig
+import os
+path = distutils.sysconfig.get_python_inc(plat_specific=False)
+if os.sep == "\\":
+  path = path.replace("\\", "/")
+print path
+'
+           python_path=`$PYTHON -c "$python_cmd"`
+           AC_MSG_RESULT([$python_path])
+           if test -z "$python_path" ; then
+                   AC_MSG_ERROR([cannot find Python include path])
+           fi
+
+           AC_SUBST(PYTHON_CPPFLAGS,[-I$python_path])
+
+           # Check for Python headers usability
+           python_save_CPPFLAGS=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+           AC_CHECK_HEADERS([Python.h], [],
+                           [AC_MSG_ERROR([cannot find usable Python headers])])
+           CPPFLAGS="$python_save_CPPFLAGS"
+
+           # Only set this on mingw and cygwin hosts, (only implemented
+           # for mingw host, for crosscompiling you need to trick this)
+
+           PYTHON_LDFLAGS=""
+           case $host_os in
+                *mingw* | *cygwin* )
+             AC_MSG_CHECKING([for Python LDFLAGS])
+
+           python_cmd='
+import distutils.sysconfig
+import os
+path = distutils.sysconfig.get_config_var("LIBPL")
+if path == None:
+  path = distutils.sysconfig.PREFIX + "/libs"
+if os.sep == "\\":
+  path = path.replace("\\", "/")
+print path
+'
+             python_stdlib_path=`$PYTHON -c "$python_cmd"`
+
+             python_version_nodot=`echo $PYTHON_VERSION | sed "s,\.,,"`
+             libpython_name="python$PYTHON_VERSION"
+
+             # Standard install of python for win32 has libpython24.a
+             # instead of libpython2.4.a so we check for the library
+             # without the dot in the version number.
+
+             python_stdlib_filename=`find $python_stdlib_path -type f -name 
libpython$python_version_nodot.* -print | sed "1q"`
+             if test -n "$python_stdlib_filename" ; then
+                   libpython_name="python$python_version_nodot"
+             fi
+
+             PYTHON_LDFLAGS="-L$python_stdlib_path -l$libpython_name"
+             AC_MSG_RESULT($PYTHON_LDFLAGS) 
+             # Replace all backslashes in PYTHON Paths with forward slashes
+             pythondir=`echo $pythondir |sed 's,\\\\,/,g'`
+             pkgpythondir=`echo $pkgpythondir |sed 's,\\\\,/,g'`
+             pyexecdir=`echo $pyexecdir |sed 's,\\\\,/,g'`
+             pkgpyexecdir=`echo $pkgpyexecdir |sed 's,\\\\,/,g'`
+             ;;
+           esac
+
+           AC_SUBST(PYTHON_LDFLAGS)
+       fi
+])

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_scripting.m4
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_scripting.m4      
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_scripting.m4      
2008-05-10 20:02:46 UTC (rev 8361)
@@ -0,0 +1,30 @@
+dnl
+dnl Copyright 2003 Free Software Foundation, Inc.
+dnl 
+dnl This file is part of GNU Radio
+dnl 
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl 
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl 
+
+AC_DEFUN([GR_SCRIPTING],[
+  AC_REQUIRE([AC_PROG_LN_S])
+  AC_REQUIRE([AC_PROG_CXX])
+  AC_REQUIRE([AC_PROG_LIBTOOL])
+
+  SWIG_PROG(1.3.31)
+  SWIG_ENABLE_CXX
+  SWIG_PYTHON
+])

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_swig.m4
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_swig.m4           
                (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/config/gr_swig.m4   
2008-05-10 20:02:46 UTC (rev 8361)
@@ -0,0 +1,85 @@
+dnl
+dnl Copyright 2003 Free Software Foundation, Inc.
+dnl 
+dnl This file is part of GNU Radio
+dnl 
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl 
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl 
+
+# SWIG_PROG([required-version])
+#
+# Checks for the SWIG program.  If found you can (and should) call SWIG via 
$(SWIG).
+# You can use the optional first argument to check if the version of the 
available SWIG
+# is greater or equal to the value of the argument.  It should have the format:
+# N[.N[.N]] (N is a number between 0 and 999.  Only the first N is mandatory.)
+AC_DEFUN([SWIG_PROG],[
+       AC_REQUIRE([AC_PROG_MAKE_SET])
+       AC_CHECK_PROG(SWIG,swig,[`which swig`])
+       if test -z "$SWIG" ; then
+               AC_MSG_ERROR([Cannot find 'swig' program.  SWIG version >= $1 
required])
+               SWIG=false
+       elif test -n "$1" ; then
+               AC_MSG_CHECKING([for SWIG version])
+               swig_version=`$SWIG -version 2>&1 | \
+                       awk '/^SWIG Version [[0-9]+\.[0-9]+\.[0-9]]+.*$/ { 
split($[3],a,"[[^.0-9]]"); print a[[1]] }'`
+               AC_MSG_RESULT([$swig_version])
+               if test -n "$swig_version" ; then
+                       swig_version=`echo $swig_version | \
+                               awk '{ split($[1],a,"\."); print 
[a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
+                       swig_required_version=`echo $1 | \
+                               awk '{ split($[1],a,"\."); print 
[a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
+                       if test $swig_required_version -gt $swig_version ; then
+                               AC_MSG_ERROR([SWIG version >= $1 required])
+                       fi
+               else
+                       AC_MSG_ERROR([cannot determine SWIG version])
+               fi
+       fi
+])
+
+# SWIG_ENABLE_CXX()
+#
+# Enable swig C++ support.  This effects all invocations of $(SWIG).
+AC_DEFUN([SWIG_ENABLE_CXX],[
+       AC_REQUIRE([SWIG_PROG])
+       AC_REQUIRE([AC_PROG_CXX])
+       if test "$SWIG" != "false" ; then
+               SWIG="$SWIG -c++"
+       fi
+])
+
+# SWIG_PYTHON([use-shadow-classes])
+#
+# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
+# $(SWIG_PYTHON_LIB) and $(SWIG_PYTHON_OPT) output variables.
+# $(SWIG_PYTHON_OPT) contains all necessary swig options to generate
+# code for Python.  If you need multi module support use
+# $(SWIG_PYTHON_LIB) (provided by the SWIG_MULTI_MODULE_SUPPORT()
+# macro) to link against the appropriate library.  It contains the
+# SWIG Python runtime library that is needed by the type check system
+# for example.
+
+AC_DEFUN([SWIG_PYTHON],[
+       AC_REQUIRE([SWIG_PROG])
+       AC_REQUIRE([PYTHON_DEVEL])
+       if test "$SWIG" != "false" ; then
+               AC_SUBST(SWIG_PYTHON_LIB,[-lswigpy])
+dnl            test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow=""
+dnl            AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
+               AC_SUBST(SWIG_PYTHON_OPT,[-python])
+       fi
+       AC_SUBST(SWIG_PYTHON_CPPFLAGS,[$PYTHON_CPPFLAGS])
+])

Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac        
2008-05-10 18:57:40 UTC (rev 8360)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/configure.ac        
2008-05-10 20:02:46 UTC (rev 8361)
@@ -88,7 +88,7 @@
 dnl GR_FORTRAN
 
 GR_NO_UNDEFINED                dnl do we need the -no-undefined linker flag
-dnl GR_SCRIPTING
+GR_SCRIPTING
 
 dnl AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
 dnl AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])
@@ -167,9 +167,9 @@
 dnl PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.0)
 dnl AC_SUBST(FFTW3F_LIBS)
 
-dnl PKG_CHECK_MODULES(GR_OMNITHREAD, gnuradio-omnithread >= 3.0)
-dnl AC_SUBST(GR_OMNITHREAD_LIBS)
-dnl AC_SUBST(GR_OMNITHREAD_CFLAGS)
+PKG_CHECK_MODULES(GR_OMNITHREAD, gnuradio-omnithread >= 3.0)
+AC_SUBST(GR_OMNITHREAD_LIBS)
+AC_SUBST(GR_OMNITHREAD_CFLAGS)
 
 dnl CFLAGS="${CFLAGS} $PTHREAD_CFLAGS"
 dnl CXXFLAGS="${CXXFLAGS} $PTHREAD_CFLAGS"
@@ -196,9 +196,7 @@
 
 dnl so we can use some utilities. FIXME hoist them out
 PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3)
-LIBS="$LIBS $GNURADIO_CORE_LIBS"
 
-
 # If this is being done from a subversion tree, create variables
 GR_SUBVERSION
 


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


   + .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


Modified: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am     
2008-05-10 18:57:40 UTC (rev 8360)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/Makefile.am     
2008-05-10 20:02:46 UTC (rev 8361)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# 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
@@ -19,13 +19,15 @@
 
 INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES)
 
-lib_LTLIBRARIES = libusrp2.la
-noinst_LTLIBRARIES = libpfring.la
+lib_LTLIBRARIES = \
+       libusrp2.la \
+       libgr_usrp2.la
 
-libpfring_la_SOURCES = \
-       pfring.c
+noinst_LTLIBRARIES = \
+       libpfring.la
 
 
+# Non-GNU Radio applications link against this library
 libusrp2_la_SOURCES = \
        gri_ethernet.cc \
        gri_ethernet_pfring.cc \
@@ -34,13 +36,77 @@
        strtod_si.c \
        usrp2_basic.cc
 
+libpfring_la_SOURCES = \
+       pfring.c
 
+libusrp2_la_LIBADD = \
+       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
+
+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_basic.h \
+       usrp2_sink_base.h \
+       usrp2_sink_c.h
 
-libusrp2_la_LIBADD = libpfring.la
+
+# 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 *~

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i                 
        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2.i 2008-05-10 
20:02:46 UTC (rev 8361)
@@ -0,0 +1,31 @@
+/* -*- 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
+%}
+

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc      
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.cc      
2008-05-10 20:02:46 UTC (rev 8361)
@@ -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;
+}

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h       
                        (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_base.h       
2008-05-10 20:02:46 UTC (rev 8361)
@@ -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 */

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc         
                (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.cc 
2008-05-10 20:02:46 UTC (rev 8361)
@@ -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()
+{
+}

Added: usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h
===================================================================
--- usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h          
                (rev 0)
+++ usrp2/branches/developers/jcorgan/gr-usrp2/host/lib/usrp2_sink_c.h  
2008-05-10 20:02:46 UTC (rev 8361)
@@ -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 */





reply via email to

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