3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 %feature("autodoc", "1"); // generate python docstrings
25 %include "exception.i"
26 %import "gnuradio.i" // the common stuff
29 #include <gnuradio_swig_bug_workaround.h>
30 #include "usrp2_source_16sc.h"
31 #include "usrp2_source_32fc.h"
32 #include "usrp2_sink_16sc.h"
33 #include "usrp2_sink_32fc.h"
36 %include <usrp2/tune_result.h>
38 // ----------------------------------------------------------------
40 class usrp2_base : public gr_sync_block
43 usrp2_base() throw (std::runtime_error);
48 std::string mac_addr() const;
51 // ----------------------------------------------------------------
53 class usrp2_source_base : public usrp2_base
56 usrp2_source_base() throw (std::runtime_error);
61 bool set_gain(double gain);
62 %rename(_real_set_center_freq) set_center_freq;
63 bool set_center_freq(double frequency, usrp2::tune_result *r);
64 bool set_decim(int decimation_factor);
67 // ----------------------------------------------------------------
69 GR_SWIG_BLOCK_MAGIC(usrp2,source_32fc)
71 usrp2_source_32fc_sptr
72 usrp2_make_source_32fc(const std::string ifc="eth0",
73 const std::string mac="")
74 throw (std::runtime_error);
76 class usrp2_source_32fc : public usrp2_source_base
79 usrp2_source_32fc(const std::string &ifc, const std::string &mac);
85 // ----------------------------------------------------------------
87 GR_SWIG_BLOCK_MAGIC(usrp2,source_16sc)
89 usrp2_source_16sc_sptr
90 usrp2_make_source_16sc(const std::string ifc="eth0",
91 const std::string mac="")
92 throw (std::runtime_error);
94 class usrp2_source_16sc : public usrp2_source_base
97 usrp2_source_16sc(const std::string &ifc, const std::string &mac);
100 ~usrp2_source_16sc();
103 // ----------------------------------------------------------------
105 class usrp2_sink_base : public usrp2_base
108 usrp2_sink_base() throw (std::runtime_error);
113 bool set_gain(double gain);
114 %rename(_real_set_center_freq) set_center_freq;
115 bool set_center_freq(double frequency, usrp2::tune_result *r);
116 bool set_interp(int interp_factor);
119 // ----------------------------------------------------------------
121 GR_SWIG_BLOCK_MAGIC(usrp2,sink_32fc)
124 usrp2_make_sink_32fc(const std::string ifc="eth0",
125 const std::string mac="")
126 throw (std::runtime_error);
128 class usrp2_sink_32fc : public usrp2_sink_base
131 usrp2_sink_32fc(const std::string &ifc, const std::string &mac);
137 // ----------------------------------------------------------------
139 GR_SWIG_BLOCK_MAGIC(usrp2,sink_16sc)
142 usrp2_make_sink_16sc(const std::string ifc="eth0",
143 const std::string mac="")
144 throw (std::runtime_error);
146 class usrp2_sink_16sc : public usrp2_sink_base
149 usrp2_sink_16sc(const std::string &ifc, const std::string &mac);
155 // ----------------------------------------------------------------
157 // create a more pythonic interface
160 def __set_center_freq(self, freq):
162 r = self._real_set_center_freq(freq, tr)
168 usrp2_source_32fc_sptr.set_center_freq = __set_center_freq
169 usrp2_source_16sc_sptr.set_center_freq = __set_center_freq
170 usrp2_sink_32fc_sptr.set_center_freq = __set_center_freq
171 usrp2_sink_16sc_sptr.set_center_freq = __set_center_freq