diff options
author | jcorgan | 2008-09-23 02:17:38 +0000 |
---|---|---|
committer | jcorgan | 2008-09-23 02:17:38 +0000 |
commit | 7bd129934e980a8e9391f327e89ba56dd3ae95f4 (patch) | |
tree | e26969f8d2842bca7f67df7f5ab875bfef206855 /gr-usrp2/src/usrp2.i | |
parent | 20f913ec2e71888a451250ba841c980638221c65 (diff) | |
download | gnuradio-7bd129934e980a8e9391f327e89ba56dd3ae95f4.tar.gz gnuradio-7bd129934e980a8e9391f327e89ba56dd3ae95f4.tar.bz2 gnuradio-7bd129934e980a8e9391f327e89ba56dd3ae95f4.zip |
Adds usrp2.sink_32fc, usrp2.sink_16sc, refactoring, cleanup
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9641 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-usrp2/src/usrp2.i')
-rw-r--r-- | gr-usrp2/src/usrp2.i | 118 |
1 files changed, 73 insertions, 45 deletions
diff --git a/gr-usrp2/src/usrp2.i b/gr-usrp2/src/usrp2.i index fba6c18e3..ae13ab25b 100644 --- a/gr-usrp2/src/usrp2.i +++ b/gr-usrp2/src/usrp2.i @@ -23,109 +23,135 @@ %feature("autodoc", "1"); // generate python docstrings %include "exception.i" -%import "gnuradio.i" // the common stuff +%import "gnuradio.i" // the common stuff %{ #include <gnuradio_swig_bug_workaround.h> -//#include "usrp2_sink_32fc.h" #include "usrp2_source_16sc.h" #include "usrp2_source_32fc.h" +#include "usrp2_sink_16sc.h" +#include "usrp2_sink_32fc.h" %} %include <usrp2/tune_result.h> -#if 0 // ---------------------------------------------------------------- -class usrp2_sink_base : public gr_sync_block { - +class usrp2_base : public gr_sync_block +{ protected: - usrp2_sink_base(const std::string &name, - gr_io_signature_sptr input_signature) - throw (std::runtime_error); + usrp2_base() throw (std::runtime_error); public: - ~usrp2_sink_base(); + ~usrp2_base(); + std::string mac_addr() const; }; // ---------------------------------------------------------------- -GR_SWIG_BLOCK_MAGIC(usrp2,sink_32fc) - -usrp2_sink_32fc_sptr -usrp2_make_sink_32fc() throw (std::runtime_error); - -class usrp2_sink_32fc : public usrp2_sink_base { - +class usrp2_source_base : public usrp2_base +{ protected: - usrp2_sink_32fc(); + usrp2_source_base() throw (std::runtime_error); public: - ~usrp2_sink_32fc(); + ~usrp2_source_base(); + bool set_gain(double gain); + %rename(_real_set_center_freq) set_center_freq; + bool set_center_freq(double frequency, usrp2::tune_result *r); + bool set_decim(int decimation_factor); }; -#endif // ---------------------------------------------------------------- -class usrp2_source_base : public gr_sync_block { +GR_SWIG_BLOCK_MAGIC(usrp2,source_32fc) +usrp2_source_32fc_sptr +usrp2_make_source_32fc(const std::string ifc="eth0", + const std::string mac="") + throw (std::runtime_error); + +class usrp2_source_32fc : public usrp2_source_base +{ protected: - usrp2_source_base(const char *name, - gr_io_signature_sptr output_signature) - throw (std::runtime_error); + usrp2_source_32fc(const std::string &ifc, const std::string &mac); public: - ~usrp2_source_base(); + ~usrp2_source_32fc(); }; // ---------------------------------------------------------------- -GR_SWIG_BLOCK_MAGIC(usrp2,source_32fc) +GR_SWIG_BLOCK_MAGIC(usrp2,source_16sc) -usrp2_source_32fc_sptr -usrp2_make_source_32fc(const std::string ifc, const std::string mac) +usrp2_source_16sc_sptr +usrp2_make_source_16sc(const std::string ifc="eth0", + const std::string mac="") throw (std::runtime_error); -class usrp2_source_32fc : public usrp2_source_base { +class usrp2_source_16sc : public usrp2_source_base +{ +protected: + usrp2_source_16sc(const std::string &ifc, const std::string &mac); +public: + ~usrp2_source_16sc(); + + std::string mac_addr(); +}; + +// ---------------------------------------------------------------- + +class usrp2_sink_base : public usrp2_base +{ protected: - usrp2_source_32fc(const std::string &ifc, const std::string &mac); + usrp2_sink_base() throw (std::runtime_error); public: - ~usrp2_source_32fc(); + ~usrp2_sink_base(); bool set_gain(double gain); %rename(_real_set_center_freq) set_center_freq; bool set_center_freq(double frequency, usrp2::tune_result *r); - bool set_decim(int decimation_factor); - - std::string mac_addr(); + bool set_interp(int interp_factor); }; // ---------------------------------------------------------------- -GR_SWIG_BLOCK_MAGIC(usrp2,source_16sc) +GR_SWIG_BLOCK_MAGIC(usrp2,sink_32fc) -usrp2_source_16sc_sptr -usrp2_make_source_16sc(const std::string ifc, const std::string mac) +usrp2_sink_32fc_sptr +usrp2_make_sink_32fc(const std::string ifc="eth0", + const std::string mac="") throw (std::runtime_error); -class usrp2_source_16sc : public usrp2_source_base { - +class usrp2_sink_32fc : public usrp2_sink_base +{ protected: - usrp2_source_16sc(const std::string &ifc, const std::string &mac); + usrp2_sink_32fc(const std::string &ifc, const std::string &mac); public: - ~usrp2_source_16sc(); + ~usrp2_sink_32fc(); +}; - bool set_gain(double gain); - %rename(_real_set_center_freq) set_center_freq; - bool set_center_freq(double frequency, usrp2::tune_result *r); - bool set_decim(int decimation_factor); +// ---------------------------------------------------------------- - std::string mac_addr(); +GR_SWIG_BLOCK_MAGIC(usrp2,sink_16sc) + +usrp2_sink_16sc_sptr +usrp2_make_sink_16sc(const std::string ifc="eth0", + const std::string mac="") + throw (std::runtime_error); + +class usrp2_sink_16sc : public usrp2_sink_base +{ +protected: + usrp2_sink_16sc(const std::string &ifc, const std::string &mac); + +public: + ~usrp2_sink_16sc(); }; // ---------------------------------------------------------------- @@ -143,4 +169,6 @@ def __set_center_freq(self, freq): usrp2_source_32fc_sptr.set_center_freq = __set_center_freq usrp2_source_16sc_sptr.set_center_freq = __set_center_freq +usrp2_sink_32fc_sptr.set_center_freq = __set_center_freq +usrp2_sink_16sc_sptr.set_center_freq = __set_center_freq %} |