diff options
author | Johnathan Corgan | 2011-03-16 08:18:30 -0700 |
---|---|---|
committer | Johnathan Corgan | 2011-03-16 08:18:30 -0700 |
commit | 4cd06fadac972d4cac559c15488bc39823063afe (patch) | |
tree | 6fe57896bc216d8c9e672194f2e4e0e75aedb645 /gr-uhd/swig/uhd_swig.i | |
parent | 4ad736e21f45f64fd616bb53f54e45e1c63e7330 (diff) | |
parent | 1d70ed2bd928d52a383e688949cc7f747dd584fa (diff) | |
download | gnuradio-4cd06fadac972d4cac559c15488bc39823063afe.tar.gz gnuradio-4cd06fadac972d4cac559c15488bc39823063afe.tar.bz2 gnuradio-4cd06fadac972d4cac559c15488bc39823063afe.zip |
Merge remote branch 'gnuradio/next'
* gnuradio/next: (806 commits)
gruel: added missing ignores
gruel: fixed swig interface file to dereference pmt_t.
qtgui: fix distcheck error
gruel: fixing structure. Passes make check.
gruel: SWIGing Gruel into Python to access PMTs.
gnuradio-examples: add C++ audio examples using new gr-audio
created gruel/attributes.h to house compiler specific attribute macros
audio: remove obsoleted individual top-level components
gr-audio: added README and default config fix
volk: simplify the get new method for the aligned pool
grc: moved all usrp1 and usrp2 stuff out of grc and into gr-usrp*/grc
grc: swap store the subprocess object rather than the pid when executing
qtgui: removed python directory that was added, never used
uhd: use %ignore to hide warnings and fix errors
Added/updated ignore files.
Fixing gr_filter_design program to import from gnuradio Python package.
audio: high prio for platform specific audio osx
audio: added windows and osx audio source files
audio: added config checks for other audios, added jack and port
audio: make prefs look like old audio, removed old audio.py
...
Diffstat (limited to 'gr-uhd/swig/uhd_swig.i')
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i new file mode 100644 index 000000000..3ffcc7aea --- /dev/null +++ b/gr-uhd/swig/uhd_swig.i @@ -0,0 +1,134 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010-2011 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. + */ + +// Defined during configure; avoids trying to locate +// header files if UHD was not installed. +#ifdef GR_HAVE_UHD + +#define GR_UHD_API + +//////////////////////////////////////////////////////////////////////// +// Language independent exception handler +//////////////////////////////////////////////////////////////////////// +%include exception.i + +%exception { + try { + $action + } + catch(std::exception &e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + +} + +//////////////////////////////////////////////////////////////////////// +// standard includes +//////////////////////////////////////////////////////////////////////// +%include "gnuradio.i" + +//////////////////////////////////////////////////////////////////////// +// block headers +//////////////////////////////////////////////////////////////////////// +%{ +#include <gr_uhd_usrp_source.h> +#include <gr_uhd_usrp_sink.h> +%} + +//////////////////////////////////////////////////////////////////////// +// used types +//////////////////////////////////////////////////////////////////////// +%template(string_vector_t) std::vector<std::string>; + +%include <uhd/config.hpp> + +%include <uhd/utils/pimpl.hpp> + +%ignore uhd::dict::operator[]; //ignore warnings about %extend +%include <uhd/types/dict.hpp> +%template(string_string_dict_t) uhd::dict<std::string, std::string>; //define after dict + +%include <uhd/types/device_addr.hpp> + +%include <uhd/types/io_type.hpp> + +%template(range_vector_t) std::vector<uhd::range_t>; //define before range +%include <uhd/types/ranges.hpp> + +%include <uhd/types/tune_request.hpp> + +%include <uhd/types/tune_result.hpp> + +%include <uhd/types/io_type.hpp> + +%include <uhd/types/time_spec.hpp> + +%include <uhd/types/clock_config.hpp> + +%include <uhd/types/metadata.hpp> + +%ignore uhd::device::register_device; //causes compile to choke in MSVC +%include <uhd/device.hpp> +%template(device_addr_vector_t) std::vector<uhd::device_addr_t>; + +%include <uhd/types/sensors.hpp> + +//////////////////////////////////////////////////////////////////////// +// swig dboard_iface for python access +//////////////////////////////////////////////////////////////////////// +%include stdint.i +%include <uhd/types/serial.hpp> +%include <uhd/usrp/dboard_iface.hpp> + +%template(dboard_iface_sptr) boost::shared_ptr<uhd::usrp::dboard_iface>; + +//////////////////////////////////////////////////////////////////////// +// block magic +//////////////////////////////////////////////////////////////////////// +GR_SWIG_BLOCK_MAGIC(uhd,usrp_source) +%include <gr_uhd_usrp_source.h> + +GR_SWIG_BLOCK_MAGIC(uhd,usrp_sink) +%include <gr_uhd_usrp_sink.h> + +//////////////////////////////////////////////////////////////////////// +// helpful constants +//////////////////////////////////////////////////////////////////////// +%{ +static const size_t ALL_MBOARDS = uhd::usrp::multi_usrp::ALL_MBOARDS; +%} +static const size_t ALL_MBOARDS; + +#if SWIGGUILE +%scheme %{ +(load-extension-global "libguile-gnuradio-uhd_swig" "scm_init_gnuradio_uhd_swig_module") +%} + +%goops %{ +(use-modules (gnuradio gnuradio_core_runtime)) +%} +#endif /* SWIGGUILE */ + +#endif /* GR_HAVE_UHD */ |