summaryrefslogtreecommitdiff
path: root/gr-shd
diff options
context:
space:
mode:
Diffstat (limited to 'gr-shd')
-rw-r--r--gr-shd/.gitignore3
-rw-r--r--gr-shd/CMakeLists.txt8
-rw-r--r--gr-shd/Makefile.am31
-rw-r--r--gr-shd/apps/.gitignore3
-rw-r--r--gr-shd/apps/CMakeLists.txt6
-rw-r--r--gr-shd/apps/Makefile.am33
-rwxr-xr-xgr-shd/apps/shd_fft (renamed from gr-shd/apps/shd_fft.py)38
-rwxr-xr-xgr-shd/apps/shd_rx_cfile (renamed from gr-shd/apps/shd_rx_cfile.py)24
-rwxr-xr-xgr-shd/apps/shd_siggen (renamed from gr-shd/apps/shd_siggen.py)20
-rw-r--r--gr-shd/grc/.gitignore3
-rw-r--r--gr-shd/grc/CMakeLists.txt8
-rw-r--r--gr-shd/grc/Makefile.am43
-rw-r--r--gr-shd/include/.gitignore2
-rw-r--r--gr-shd/include/CMakeLists.txt8
-rw-r--r--gr-shd/include/Makefile.am27
-rw-r--r--gr-shd/include/gr_shd_api.h8
-rw-r--r--gr-shd/include/gr_shd_smini_sink.h52
-rw-r--r--gr-shd/include/gr_shd_smini_source.h66
-rw-r--r--gr-shd/lib/.gitignore2
-rw-r--r--gr-shd/lib/CMakeLists.txt8
-rw-r--r--gr-shd/lib/Makefile.am42
-rw-r--r--gr-shd/lib/gr_shd_smini_sink.cc78
-rw-r--r--gr-shd/lib/gr_shd_smini_source.cc38
-rw-r--r--gr-shd/swig/.gitignore8
-rw-r--r--gr-shd/swig/Makefile.am96
-rw-r--r--gr-shd/swig/Makefile.swig.gen145
-rw-r--r--gr-shd/swig/__init__.py8
-rw-r--r--gr-shd/swig/gnuradio/.gitignore2
-rwxr-xr-xgr-shd/swig/qa_shd.py12
-rw-r--r--gr-shd/swig/run_guile_tests.in14
-rw-r--r--gr-shd/swig/run_tests.in10
-rw-r--r--gr-shd/swig/shd.test37
-rw-r--r--gr-shd/swig/shd_swig.i18
33 files changed, 195 insertions, 706 deletions
diff --git a/gr-shd/.gitignore b/gr-shd/.gitignore
deleted file mode 100644
index a37fc0c1a..000000000
--- a/gr-shd/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/Makefile
-/Makefile.in
-/*.pc
diff --git a/gr-shd/CMakeLists.txt b/gr-shd/CMakeLists.txt
index a1b3b1a0b..7dad30cd8 100644
--- a/gr-shd/CMakeLists.txt
+++ b/gr-shd/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 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,
diff --git a/gr-shd/Makefile.am b/gr-shd/Makefile.am
deleted file mode 100644
index 2331831e0..000000000
--- a/gr-shd/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = include lib apps
-
-if PYTHON
-SUBDIRS += swig grc
-endif
-
-pkgconfigdir = $(libdir)/pkgconfig
-dist_pkgconfig_DATA = gnuradio-shd.pc
diff --git a/gr-shd/apps/.gitignore b/gr-shd/apps/.gitignore
deleted file mode 100644
index 22a4e7292..000000000
--- a/gr-shd/apps/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-
diff --git a/gr-shd/apps/CMakeLists.txt b/gr-shd/apps/CMakeLists.txt
index 3930abb57..d36121da1 100644
--- a/gr-shd/apps/CMakeLists.txt
+++ b/gr-shd/apps/CMakeLists.txt
@@ -24,9 +24,9 @@ include(GrPython)
########################################################################
GR_PYTHON_INSTALL(
PROGRAMS
- shd_fft.py
- shd_rx_cfile.py
- shd_siggen.py
+ shd_fft
+ shd_rx_cfile
+ shd_siggen
DESTINATION ${GR_RUNTIME_DIR}
COMPONENT "shd_python"
)
diff --git a/gr-shd/apps/Makefile.am b/gr-shd/apps/Makefile.am
deleted file mode 100644
index ac50e892e..000000000
--- a/gr-shd/apps/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- $(bin_SCRIPTS)
-
-ourpythondir = $(grpythondir)
-
-bin_SCRIPTS = \
- shd_fft.py \
- shd_rx_cfile.py \
- shd_siggen.py
-
diff --git a/gr-shd/apps/shd_fft.py b/gr-shd/apps/shd_fft
index 46832784d..60d07e55e 100755
--- a/gr-shd/apps/shd_fft.py
+++ b/gr-shd/apps/shd_fft
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 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.
-#
+#
from gnuradio import gr, gru
from gnuradio import shd
@@ -37,7 +37,7 @@ class app_top_block(stdgui2.std_top_block):
self.frame = frame
self.panel = panel
-
+
parser = OptionParser(option_class=eng_option)
parser.add_option("-a", "--address", type="string",
default="type=xmini",
@@ -66,7 +66,7 @@ class app_top_block(stdgui2.std_top_block):
sys.exit(1)
self.options = options
self.show_debug_info = True
-
+
self.src = shd.smini_source(device_addr=options.address,
io_type=shd.io_type.COMPLEX_FLOAT32,
num_channels=1)
@@ -88,7 +88,7 @@ class app_top_block(stdgui2.std_top_block):
else:
self.scope = fftsink2.fft_sink_c (panel,
fft_size=options.fft_size,
- sample_rate=input_rate,
+ sample_rate=input_rate,
ref_scale=options.ref_scale,
ref_level=20.0,
y_divs = 12,
@@ -100,7 +100,7 @@ class app_top_block(stdgui2.std_top_block):
self._build_gui(vbox)
self._setup_events()
-
+
# set initial values
if options.gain is None:
@@ -112,7 +112,7 @@ class app_top_block(stdgui2.std_top_block):
# if no freq was specified, use the mid-point
r = self.src.get_freq_range()
options.freq = float(r.start()+r.stop())/2
-
+
self.set_gain(options.gain)
if self.show_debug_info:
@@ -137,9 +137,9 @@ class app_top_block(stdgui2.std_top_block):
def _form_set_freq(kv):
return self.set_freq(kv['freq'])
-
+
vbox.Add(self.scope.win, 10, wx.EXPAND)
-
+
# add control area at the bottom
self.myform = myform = form.form()
hbox = wx.BoxSizer(wx.HORIZONTAL)
@@ -171,7 +171,7 @@ class app_top_block(stdgui2.std_top_block):
# FIXME figure out how to have this be a subpanel that is always
# created, but has its visibility controlled by foo.Show(True/False)
-
+
def _form_set_samp_rate(kv):
return self.set_samp_rate(kv['samprate'])
@@ -204,7 +204,7 @@ class app_top_block(stdgui2.std_top_block):
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
-
+
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
@@ -244,12 +244,12 @@ class app_top_block(stdgui2.std_top_block):
self.myform['fs@gbe'].set_value(input_rate)
# shd set_samp_rate never fails; always falls back to closest requested.
- return True
+ return True
def _setup_events(self):
if not self.options.waterfall and not self.options.oscilloscope:
self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
-
+
def evt_left_dclick(self, event):
(ux, uy) = self.scope.win.GetXY(event)
if event.CmdDown():
@@ -265,13 +265,13 @@ class app_top_block(stdgui2.std_top_block):
(freq, pwr) = points[ind]
target_freq = freq/self.scope.win._scale_factor
print ind, freq, pwr
- self.set_freq(target_freq)
+ self.set_freq(target_freq)
else:
# Re-center on clicked frequency
target_freq = ux/self.scope.win._scale_factor
self.set_freq(target_freq)
-
-
+
+
def main ():
app = stdgui2.stdapp(app_top_block, "SHD FFT", nstatus=1)
app.MainLoop()
diff --git a/gr-shd/apps/shd_rx_cfile.py b/gr-shd/apps/shd_rx_cfile
index 007bc809f..5b4178cf7 100755
--- a/gr-shd/apps/shd_rx_cfile.py
+++ b/gr-shd/apps/shd_rx_cfile
@@ -1,28 +1,28 @@
#!/usr/bin/env python
#
# Copyright 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.
-#
+#
"""
Read samples from a SHD device and write to file formatted as binary
-outputs single precision complex float values or complex short values
+outputs single precision complex float values or complex short values
(interleaved 16 bit signed short integers).
"""
@@ -50,7 +50,7 @@ class rx_cfile_block(gr.top_block):
io_type=shd.io_type.COMPLEX_FLOAT32,
num_channels=1)
self._sink = gr.file_sink(gr.sizeof_gr_complex, filename)
-
+
# Set receiver sample rate
self._src.set_samp_rate(options.samp_rate)
@@ -90,7 +90,7 @@ class rx_cfile_block(gr.top_block):
self.connect(self._src, self._head, self._sink)
input_rate = self._src.get_samp_rate()
-
+
if options.verbose:
print "Address:", options.address
print "Rx gain:", options.gain
@@ -106,7 +106,7 @@ class rx_cfile_block(gr.top_block):
else:
print "Writing 32-bit complex floats"
print "Output filename:", filename
-
+
def get_options():
usage="%prog: [options] output_filename"
parser = OptionParser(option_class=eng_option, usage=usage)
@@ -133,19 +133,19 @@ def get_options():
if len(args) != 1:
parser.print_help()
raise SystemExit, 1
-
+
if options.freq is None:
parser.print_help()
sys.stderr.write('You must specify the frequency with -f FREQ\n');
raise SystemExit, 1
-
+
return (options, args[0])
if __name__ == '__main__':
(options, filename) = get_options()
tb = rx_cfile_block(options, filename)
-
+
try:
tb.run()
except KeyboardInterrupt:
diff --git a/gr-shd/apps/shd_siggen.py b/gr-shd/apps/shd_siggen
index 112eeea15..9629d80d2 100755
--- a/gr-shd/apps/shd_siggen.py
+++ b/gr-shd/apps/shd_siggen
@@ -1,28 +1,28 @@
#!/usr/bin/env python
#
# Copyright 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.
-#
+#
"""
Read samples from a SHD device and write to file formatted as binary
-outputs single precision complex float values or complex short values
+outputs single precision complex float values or complex short values
(interleaved 16 bit signed short integers).
"""
@@ -74,14 +74,14 @@ class shd_siggen(gr.top_block):
# Create head block if needed and wire it up
self.connect(self._src, self._snk)
input_rate = self._snk.get_samp_rate()
-
+
if options.verbose:
print "Address:", options.address
print "Rx gain:", options.gain
print "Rx baseband frequency:", n2s(tr.actual_rf_freq)
print "Rx DDC frequency:", n2s(tr.actual_dsp_freq)
print "Rx Sample Rate:", n2s(input_rate)
-
+
def get_options():
usage="%prog: [options]"
parser = OptionParser(option_class=eng_option, usage=usage)
@@ -106,14 +106,14 @@ def get_options():
parser.print_help()
sys.stderr.write('You must specify the frequency with -f FREQ\n');
raise SystemExit, 1
-
+
return (options)
if __name__ == '__main__':
options = get_options()
tb = shd_siggen(options)
-
+
try:
tb.run()
except KeyboardInterrupt:
diff --git a/gr-shd/grc/.gitignore b/gr-shd/grc/.gitignore
deleted file mode 100644
index 2c261c55b..000000000
--- a/gr-shd/grc/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/shd_smini*.xml
-/Makefile
-/Makefile.in
diff --git a/gr-shd/grc/CMakeLists.txt b/gr-shd/grc/CMakeLists.txt
index f35d36ba3..67a8fc13f 100644
--- a/gr-shd/grc/CMakeLists.txt
+++ b/gr-shd/grc/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 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,
diff --git a/gr-shd/grc/Makefile.am b/gr-shd/grc/Makefile.am
deleted file mode 100644
index c44ad1b4e..000000000
--- a/gr-shd/grc/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-grcblocksdir = $(grc_blocksdir)
-
-generated_shd_smini_blocks = \
- shd_smini_source.xml \
- shd_smini_sink.xml
-
-BUILT_SOURCES += $(generated_shd_smini_blocks)
-
-dist_grcblocks_DATA = \
- shd_block_tree.xml \
- $(BUILT_SOURCES)
-
-########################################################################
-# Rules for generating the source and sink xml wrappers
-########################################################################
-EXTRA_DIST += $(srcdir)/gen_shd_smini_blocks.py
-
-$(generated_shd_smini_blocks): $(srcdir)/gen_shd_smini_blocks.py
- @echo "generating $@..."
- $(PYTHON) $< $@
diff --git a/gr-shd/include/.gitignore b/gr-shd/include/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-shd/include/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-shd/include/CMakeLists.txt b/gr-shd/include/CMakeLists.txt
index c4db1fd22..34349841c 100644
--- a/gr-shd/include/CMakeLists.txt
+++ b/gr-shd/include/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 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,
diff --git a/gr-shd/include/Makefile.am b/gr-shd/include/Makefile.am
deleted file mode 100644
index 2cb1597df..000000000
--- a/gr-shd/include/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-grinclude_HEADERS = \
- gr_shd_api.h \
- gr_shd_smini_source.h \
- gr_shd_smini_sink.h \ No newline at end of file
diff --git a/gr-shd/include/gr_shd_api.h b/gr-shd/include/gr_shd_api.h
index e6773c3f3..13b755cbd 100644
--- a/gr-shd/include/gr_shd_api.h
+++ b/gr-shd/include/gr_shd_api.h
@@ -1,18 +1,18 @@
/*
* Copyright 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,
diff --git a/gr-shd/include/gr_shd_smini_sink.h b/gr-shd/include/gr_shd_smini_sink.h
index 938958687..b807e5c87 100644
--- a/gr-shd/include/gr_shd_smini_sink.h
+++ b/gr-shd/include/gr_shd_smini_sink.h
@@ -1,18 +1,18 @@
/*
* Copyright 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,
@@ -34,30 +34,30 @@ GR_SHD_API boost::shared_ptr<shd_smini_sink> shd_make_smini_sink(
size_t num_channels
);
-class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
+class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
{
public:
-
+
/*!
* Set the subdevice specification.
* \param spec the subdev spec markup string
* \param mboard the motherboard index 0 to M-1
*/
virtual void set_subdev_spec(const std::string &spec, size_t mboard = 0) = 0;
-
+
/*!
* Set the sample rate for the smini device.
* \param rate a new rate in Sps
*/
virtual void set_samp_rate(double rate) = 0;
-
+
/*!
* Get the sample rate for the smini device.
* This is the actual sample rate and may differ from the rate set.
* \return the actual rate in Sps
*/
virtual double get_samp_rate(void) = 0;
-
+
/*!
* Tune the smini device to the desired center frequency.
* \param tune_request the tune request instructions
@@ -86,14 +86,14 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
* \return the frequency in Hz
*/
virtual double get_center_freq(size_t chan = 0) = 0;
-
+
/*!
* Get the tunable frequency range.
* \param chan the channel index 0 to N-1
* \return the frequency range in Hz
*/
virtual shd::freq_range_t get_freq_range(size_t chan = 0) = 0;
-
+
/*!
* Set the gain for the dboard.
* \param gain the gain in dB
@@ -116,7 +116,7 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
* \return the actual gain in dB
*/
virtual double get_gain(size_t chan = 0) = 0;
-
+
/*!
* Get the actual dboard gain setting of named stage.
* \param name the name of the gain stage
@@ -132,7 +132,7 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
* \return the actual gain in dB
*/
virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0;
-
+
/*!
* Get the settable gain range.
* \param chan the channel index 0 to N-1
@@ -148,7 +148,7 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
*/
virtual shd::gain_range_t get_gain_range(const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Set the antenna to use.
* \param ant the antenna string
@@ -156,21 +156,21 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
*/
virtual void set_antenna(const std::string &ant,
size_t chan = 0) = 0;
-
+
/*!
* Get the antenna in use.
* \param chan the channel index 0 to N-1
* \return the antenna string
*/
virtual std::string get_antenna(size_t chan = 0) = 0;
-
+
/*!
* Get a list of possible antennas.
* \param chan the channel index 0 to N-1
* \return a vector of antenna strings
*/
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
-
+
/*!
* Set the subdevice bandpass filter.
* \param chan the channel index 0 to N-1
@@ -186,14 +186,14 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
*/
virtual shd::sensor_value_t get_dboard_sensor(const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Get a list of possible daughterboard sensor names.
* \param chan the channel index 0 to N-1
* \return a vector of sensor names
*/
virtual std::vector<std::string> get_dboard_sensor_names(size_t chan = 0) = 0;
-
+
/*!
* Get a motherboard sensor value.
* \param name the name of the sensor
@@ -224,28 +224,28 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
* \return the clock rate in Hz
*/
virtual double get_clock_rate(size_t mboard = 0) = 0;
-
+
/*!
* Set the master clock rate.
* \param rate the new rate in Hz
* \param mboard the motherboard index 0 to M-1
*/
virtual void set_clock_rate(double rate, size_t mboard = 0) = 0;
-
+
/*!
* Get the current time registers.
* \param mboard the motherboard index 0 to M-1
* \return the current smini time
*/
virtual shd::time_spec_t get_time_now(size_t mboard = 0) = 0;
-
+
/*!
* Get the time when the last pps pulse occured.
* \param mboard the motherboard index 0 to M-1
* \return the current smini time
*/
virtual shd::time_spec_t get_time_last_pps(size_t mboard = 0) = 0;
-
+
/*!
* Sets the time registers immediately.
* \param time_spec the new time
@@ -259,19 +259,19 @@ class GR_SHD_API shd_smini_sink : virtual public gr_sync_block
* \param time_spec the new time
*/
virtual void set_time_next_pps(const shd::time_spec_t &time_spec) = 0;
-
+
/*!
* Sync the time registers with an unknown pps edge.
* \param time_spec the new time
*/
virtual void set_time_unknown_pps(const shd::time_spec_t &time_spec) = 0;
-
+
/*!
* Get access to the underlying shd dboard iface object.
* \return the dboard_iface object
*/
virtual shd::xmini::dboard_iface::sptr get_dboard_iface(size_t chan = 0) = 0;
-
+
/*!
* Get access to the underlying shd device object.
* \return the multi smini device object
diff --git a/gr-shd/include/gr_shd_smini_source.h b/gr-shd/include/gr_shd_smini_source.h
index 3e3dbf427..11c8563fe 100644
--- a/gr-shd/include/gr_shd_smini_source.h
+++ b/gr-shd/include/gr_shd_smini_source.h
@@ -1,18 +1,18 @@
/*
* Copyright 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,
@@ -37,7 +37,7 @@ GR_SHD_API boost::shared_ptr<shd_smini_source> shd_make_smini_source(
class GR_SHD_API shd_smini_source : virtual public gr_sync_block
{
public:
-
+
/*!
* Set the subdevice specification.
* \param spec the subdev spec markup string
@@ -45,7 +45,7 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual void set_subdev_spec(const std::string &spec,
size_t mboard = 0) = 0;
-
+
/*!
* Set the sample rate for the smini device.
* \param rate a new rate in Sps
@@ -58,7 +58,7 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
* \return the actual rate in Sps
*/
virtual double get_samp_rate(void) = 0;
-
+
/*!
* Tune the smini device to the desired center frequency.
* \param tune_request the tune request instructions
@@ -69,7 +69,7 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
const shd::tune_request_t tune_request,
size_t chan = 0
) = 0;
-
+
/*!
* Tune the smini device to the desired center frequency.
* This is a wrapper around set center freq so that in this case,
@@ -81,28 +81,28 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
shd::tune_result_t set_center_freq(double freq, size_t chan = 0){
return set_center_freq(shd::tune_request_t(freq), chan);
}
-
+
/*!
* Get the center frequency.
* \param chan the channel index 0 to N-1
* \return the frequency in Hz
*/
virtual double get_center_freq(size_t chan = 0) = 0;
-
+
/*!
* Get the tunable frequency range.
* \param chan the channel index 0 to N-1
* \return the frequency range in Hz
*/
virtual shd::freq_range_t get_freq_range(size_t chan = 0) = 0;
-
+
/*!
* Set the gain for the dboard.
* \param gain the gain in dB
* \param chan the channel index 0 to N-1
*/
virtual void set_gain(double gain, size_t chan = 0) = 0;
-
+
/*!
* Set the named gain on the dboard.
* \param gain the gain in dB
@@ -111,14 +111,14 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual void set_gain(double gain, const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Get the actual dboard gain setting.
* \param chan the channel index 0 to N-1
* \return the actual gain in dB
*/
virtual double get_gain(size_t chan = 0) = 0;
-
+
/*!
* Get the actual dboard gain setting of named stage.
* \param name the name of the gain stage
@@ -127,21 +127,21 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual double get_gain(const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Get the actual dboard gain setting of named stage.
* \param chan the channel index 0 to N-1
* \return the actual gain in dB
*/
virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0;
-
+
/*!
* Get the settable gain range.
* \param chan the channel index 0 to N-1
* \return the gain range in dB
*/
virtual shd::gain_range_t get_gain_range(size_t chan = 0) = 0;
-
+
/*!
* Get the settable gain range.
* \param name the name of the gain stage
@@ -150,7 +150,7 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual shd::gain_range_t get_gain_range(const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Set the antenna to use.
* \param ant the antenna string
@@ -158,21 +158,21 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual void set_antenna(const std::string &ant,
size_t chan = 0) = 0;
-
+
/*!
* Get the antenna in use.
* \param chan the channel index 0 to N-1
* \return the antenna string
*/
virtual std::string get_antenna(size_t chan = 0) = 0;
-
+
/*!
* Get a list of possible antennas.
* \param chan the channel index 0 to N-1
* \return a vector of antenna strings
*/
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
-
+
/*!
* Set the subdevice bandpass filter.
* \param bandwidth the filter bandwidth in Hz
@@ -180,7 +180,7 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual void set_bandwidth(double bandwidth,
size_t chan = 0) = 0;
-
+
/*!
* Get a daughterboard sensor value.
* \param name the name of the sensor
@@ -189,14 +189,14 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual shd::sensor_value_t get_dboard_sensor(const std::string &name,
size_t chan = 0) = 0;
-
+
/*!
* Get a list of possible daughterboard sensor names.
* \param chan the channel index 0 to N-1
* \return a vector of sensor names
*/
virtual std::vector<std::string> get_dboard_sensor_names(size_t chan = 0) = 0;
-
+
/*!
* Get a motherboard sensor value.
* \param name the name of the sensor
@@ -205,14 +205,14 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual shd::sensor_value_t get_mboard_sensor(const std::string &name,
size_t mboard = 0) = 0;
-
+
/*!
* Get a list of possible motherboard sensor names.
* \param mboard the motherboard index 0 to M-1
* \return a vector of sensor names
*/
virtual std::vector<std::string> get_mboard_sensor_names(size_t mboard = 0) = 0;
-
+
/*!
* Set the clock configuration.
* \param clock_config the new configuration
@@ -220,14 +220,14 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
*/
virtual void set_clock_config(const shd::clock_config_t &clock_config,
size_t mboard = 0) = 0;
-
+
/*!
* Get the master clock rate.
* \param mboard the motherboard index 0 to M-1
* \return the clock rate in Hz
*/
virtual double get_clock_rate(size_t mboard = 0) = 0;
-
+
/*!
* Set the master clock rate.
* \param rate the new rate in Hz
@@ -242,14 +242,14 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
* \return the current smini time
*/
virtual shd::time_spec_t get_time_now(size_t mboard = 0) = 0;
-
+
/*!
* Get the time when the last pps pulse occured.
* \param mboard the motherboard index 0 to M-1
* \return the current smini time
*/
virtual shd::time_spec_t get_time_last_pps(size_t mboard = 0) = 0;
-
+
/*!
* Sets the time registers immediately.
* \param time_spec the new time
@@ -263,19 +263,19 @@ class GR_SHD_API shd_smini_source : virtual public gr_sync_block
* \param time_spec the new time
*/
virtual void set_time_next_pps(const shd::time_spec_t &time_spec) = 0;
-
+
/*!
* Sync the time registers with an unknown pps edge.
* \param time_spec the new time
*/
virtual void set_time_unknown_pps(const shd::time_spec_t &time_spec) = 0;
-
+
/*!
* Get access to the underlying shd dboard iface object.
* \return the dboard_iface object
*/
virtual shd::xmini::dboard_iface::sptr get_dboard_iface(size_t chan = 0) = 0;
-
+
/*!
* Get access to the underlying shd device object.
* \return the multi smini device object
diff --git a/gr-shd/lib/.gitignore b/gr-shd/lib/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-shd/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-shd/lib/CMakeLists.txt b/gr-shd/lib/CMakeLists.txt
index e8528fddb..9ddf109af 100644
--- a/gr-shd/lib/CMakeLists.txt
+++ b/gr-shd/lib/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 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,
diff --git a/gr-shd/lib/Makefile.am b/gr-shd/lib/Makefile.am
deleted file mode 100644
index 7a887aebf..000000000
--- a/gr-shd/lib/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-AM_CPPFLAGS = \
- $(STD_DEFINES_AND_INCLUDES) \
- $(WITH_INCLUDES) \
- $(SHD_CPPFLAGS) \
- -Dgnuradio_shd_EXPORTS
-
-lib_LTLIBRARIES = libgnuradio-shd.la
-
-libgnuradio_shd_la_SOURCES = \
- gr_shd_smini_source.cc \
- gr_shd_smini_sink.cc
-
-libgnuradio_shd_la_LIBADD = \
- $(GNURADIO_CORE_LA) \
- $(SHD_LIBS)
-
-libgnuradio_shd_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-noinst_HEADERS =
diff --git a/gr-shd/lib/gr_shd_smini_sink.cc b/gr-shd/lib/gr_shd_smini_sink.cc
index c9fb222d0..658f5719e 100644
--- a/gr-shd/lib/gr_shd_smini_sink.cc
+++ b/gr-shd/lib/gr_shd_smini_sink.cc
@@ -1,18 +1,18 @@
/*
* Copyright 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,
@@ -52,11 +52,11 @@ public:
_dev->set_tx_rate(rate);
_sample_rate = this->get_samp_rate();
}
-
+
double get_samp_rate(void){
return _dev->get_tx_rate();
}
-
+
shd::tune_result_t set_center_freq(
const shd::tune_request_t tune_request, size_t chan)
{
@@ -67,142 +67,142 @@ public:
{
return _dev->get_tx_freq(chan);
}
-
+
shd::freq_range_t get_freq_range(size_t chan)
{
return _dev->get_tx_freq_range(chan);
}
-
+
void set_gain(double gain, size_t chan)
{
return _dev->set_tx_gain(gain, chan);
}
-
+
void set_gain(double gain, const std::string &name,
size_t chan)
{
return _dev->set_tx_gain(gain, name, chan);
}
-
+
double get_gain(size_t chan){
return _dev->get_tx_gain(chan);
}
-
+
double get_gain(const std::string &name, size_t chan)
{
return _dev->get_tx_gain(name, chan);
}
-
+
std::vector<std::string> get_gain_names(size_t chan)
{
return _dev->get_tx_gain_names(chan);
}
-
+
shd::gain_range_t get_gain_range(size_t chan)
{
return _dev->get_tx_gain_range(chan);
}
-
+
shd::gain_range_t get_gain_range(const std::string &name,
size_t chan)
{
return _dev->get_tx_gain_range(name, chan);
}
-
+
void set_antenna(const std::string &ant, size_t chan)
{
return _dev->set_tx_antenna(ant, chan);
}
-
+
std::string get_antenna(size_t chan)
{
return _dev->get_tx_antenna(chan);
}
-
+
std::vector<std::string> get_antennas(size_t chan)
{
return _dev->get_tx_antennas(chan);
}
-
+
void set_bandwidth(double bandwidth, size_t chan)
{
return _dev->set_tx_bandwidth(bandwidth, chan);
}
-
+
shd::sensor_value_t get_dboard_sensor(const std::string &name,
size_t chan)
{
return _dev->get_tx_sensor(name, chan);
}
-
+
std::vector<std::string> get_dboard_sensor_names(size_t chan)
{
return _dev->get_tx_sensor_names(chan);
}
-
+
shd::sensor_value_t get_mboard_sensor(const std::string &name,
size_t mboard)
{
return _dev->get_mboard_sensor(name, mboard);
}
-
+
std::vector<std::string> get_mboard_sensor_names(size_t mboard)
{
return _dev->get_mboard_sensor_names(mboard);
}
-
+
void set_clock_config(const shd::clock_config_t &clock_config,
size_t mboard)
{
return _dev->set_clock_config(clock_config, mboard);
}
-
+
double get_clock_rate(size_t mboard)
{
return _dev->get_master_clock_rate(mboard);
}
-
+
void set_clock_rate(double rate, size_t mboard)
{
return _dev->set_master_clock_rate(rate, mboard);
}
-
+
shd::time_spec_t get_time_now(size_t mboard = 0)
{
return _dev->get_time_now(mboard);
}
-
+
shd::time_spec_t get_time_last_pps(size_t mboard)
{
return _dev->get_time_last_pps(mboard);
}
-
+
void set_time_now(const shd::time_spec_t &time_spec,
size_t mboard)
{
return _dev->set_time_now(time_spec, mboard);
}
-
+
void set_time_next_pps(const shd::time_spec_t &time_spec)
{
return _dev->set_time_next_pps(time_spec);
}
-
+
void set_time_unknown_pps(const shd::time_spec_t &time_spec)
{
return _dev->set_time_unknown_pps(time_spec);
}
-
+
shd::xmini::dboard_iface::sptr get_dboard_iface(size_t chan)
{
return _dev->get_tx_dboard_iface(chan);
}
-
+
shd::xmini::multi_xmini::sptr get_device(void)
{
return _dev;
}
-
+
/*******************************************************************
* Work
******************************************************************/
@@ -214,7 +214,7 @@ public:
_metadata.start_of_burst = false;
_metadata.end_of_burst = false;
_metadata.has_time_spec = _has_time_spec;
-
+
size_t num_sent = _dev->get_device()->send(
input_items, noutput_items, _metadata,
_type, shd::device::SEND_MODE_FULL_BUFF, 1.0);
@@ -223,7 +223,7 @@ public:
_metadata.time_spec += shd::time_spec_t(0, num_sent, _sample_rate);
return num_sent;
}
-
+
//Send an empty start-of-burst packet to begin streaming.
//Set at a time in the near future to avoid late packets.
bool start(void)
@@ -232,13 +232,13 @@ public:
_metadata.end_of_burst = false;
_metadata.has_time_spec = _has_time_spec;
_metadata.time_spec = get_time_now() + shd::time_spec_t(0.01);
-
+
_dev->get_device()->send(
gr_vector_const_void_star(_nchan), 0, _metadata,
_type, shd::device::SEND_MODE_ONE_PACKET, 1.0);
return true;
}
-
+
//Send an empty end-of-burst packet to end streaming.
//Ending the burst avoids an underflow error on stop.
bool stop(void)
@@ -246,13 +246,13 @@ public:
_metadata.start_of_burst = false;
_metadata.end_of_burst = true;
_metadata.has_time_spec = false;
-
+
_dev->get_device()->send(
gr_vector_const_void_star(_nchan), 0, _metadata,
_type, shd::device::SEND_MODE_ONE_PACKET, 1.0);
return true;
}
-
+
protected:
shd::xmini::multi_xmini::sptr _dev;
const shd::io_type_t _type;
diff --git a/gr-shd/lib/gr_shd_smini_source.cc b/gr-shd/lib/gr_shd_smini_source.cc
index caf98f311..58559a623 100644
--- a/gr-shd/lib/gr_shd_smini_source.cc
+++ b/gr-shd/lib/gr_shd_smini_source.cc
@@ -1,18 +1,18 @@
/*
* Copyright 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,
@@ -48,7 +48,7 @@ public:
{
_dev = shd::xmini::multi_xmini::make(device_addr);
}
-
+
void set_subdev_spec(const std::string &spec, size_t mboard)
{
return _dev->set_rx_subdev_spec(spec, mboard);
@@ -85,7 +85,7 @@ public:
return _dev->set_rx_gain(gain, chan);
}
- void set_gain(double gain, const std::string &name,
+ void set_gain(double gain, const std::string &name,
size_t chan)
{
return _dev->set_rx_gain(gain, name, chan);
@@ -100,7 +100,7 @@ public:
{
return _dev->get_rx_gain(name, chan);
}
-
+
std::vector<std::string> get_gain_names(size_t chan)
{
return _dev->get_rx_gain_names(chan);
@@ -111,7 +111,7 @@ public:
return _dev->get_rx_gain_range(chan);
}
- shd::gain_range_t get_gain_range(const std::string &name,
+ shd::gain_range_t get_gain_range(const std::string &name,
size_t chan)
{
return _dev->get_rx_gain_range(name, chan);
@@ -136,8 +136,8 @@ public:
{
return _dev->set_rx_bandwidth(bandwidth, chan);
}
-
- shd::sensor_value_t get_dboard_sensor(const std::string &name,
+
+ shd::sensor_value_t get_dboard_sensor(const std::string &name,
size_t chan)
{
return _dev->get_rx_sensor(name, chan);
@@ -147,18 +147,18 @@ public:
{
return _dev->get_rx_sensor_names(chan);
}
-
+
shd::sensor_value_t get_mboard_sensor(const std::string &name,
size_t mboard)
{
return _dev->get_mboard_sensor(name, mboard);
}
-
+
std::vector<std::string> get_mboard_sensor_names(size_t mboard)
{
return _dev->get_mboard_sensor_names(mboard);
}
-
+
void set_clock_config(const shd::clock_config_t &clock_config,
size_t mboard)
{
@@ -232,23 +232,23 @@ public:
output_items, noutput_items, _metadata,
_type, shd::device::RECV_MODE_ONE_PACKET, 1.0);
}
-
+
//handle possible errors conditions
switch(_metadata.error_code) {
case shd::rx_metadata_t::ERROR_CODE_NONE:
//TODO insert tag for time stamp
break;
-
+
case shd::rx_metadata_t::ERROR_CODE_TIMEOUT:
//Assume that the user called stop() on the flow graph.
//However, a timeout can occur under error conditions.
return WORK_DONE;
-
+
case shd::rx_metadata_t::ERROR_CODE_OVERFLOW:
//ignore overflows and try work again
//TODO insert tag for overflow
return work(noutput_items, input_items, output_items);
-
+
default:
std::cout << boost::format("SHD source block got error code 0x%x"
) % _metadata.error_code << std::endl;
@@ -257,7 +257,7 @@ public:
return num_samps;
}
-
+
bool start(void)
{
//setup a stream command that starts streaming slightly in the future
@@ -268,7 +268,7 @@ public:
_dev->issue_stream_cmd(stream_cmd);
return true;
}
-
+
bool stop(void)
{
_dev->issue_stream_cmd(shd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
diff --git a/gr-shd/swig/.gitignore b/gr-shd/swig/.gitignore
deleted file mode 100644
index 23ae38f9b..000000000
--- a/gr-shd/swig/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/shd_swig.cc
-/shd_swig.py
-/Makefile
-/Makefile.in
-/guile
-/python
-/run_guile_tests
-/run_tests
diff --git a/gr-shd/swig/Makefile.am b/gr-shd/swig/Makefile.am
deleted file mode 100644
index 1d491956b..000000000
--- a/gr-shd/swig/Makefile.am
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Copyright 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.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-TESTS =
-EXTRA_DIST += run_tests.in run_guile_tests.in $(nobase_guile_DATA)
-DISTCLEANFILES += run_tests run_guile_tests
-
-noinst_PYTHON = qa_shd.py
-noinst_GUILE = shd.test
-
-AM_CPPFLAGS = \
- $(STD_DEFINES_AND_INCLUDES) \
- $(PYTHON_CPPFLAGS) \
- $(SHD_CPPFLAGS) \
- $(WITH_INCLUDES)
-
-shd_swig_swig_args = $(SHD_CPPFLAGS)
-
-if GUILE
-nobase_guile_DATA = \
- gnuradio/shd.scm
-endif
-
-# ----------------------------------------------------------------
-# The SWIG library
-
-TOP_SWIG_DOC_IFILES = \
- shd_swig_doc.i
-
-TOP_SWIG_IFILES = \
- $(TOP_SWIG_DOC_IFILES) \
- shd_swig.i
-
-BUILT_SOURCES += \
- $(TOP_SWIG_DOC_IFILES)
-
-EXTRA_DIST += \
- $(TOP_SWIG_DOC_IFILES)
-
-$(TOP_SWIG_DOC_IFILES):
- `echo "" > $@`
-
-# Install so that they end up available as:
-# import gnuradio.shd
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio/shd
-shd_swig_pythondir_category = \
- gnuradio/shd
-
-# additional libraries for linking with the SWIG-generated library
-shd_swig_la_swig_libadd = \
- $(top_builddir)/gr-shd/lib/libgnuradio-shd.la
-
-# additional Python files to be installed along with the SWIG-generated one
-shd_swig_python = \
- __init__.py
-
-# additional SWIG files to be installed
-shd_swig_swiginclude_headers = \
- $(TOP_SWIG_DOC_IFILES)
-
-shd_swig_swig_args = $(SHD_CPPFLAGS)
-
-## If SHD was installed, defined GR_HAVE_SHD for swigging headers
-if GR_DEFINE_HAVE_SHD
- shd_swig_swig_args += -DGR_HAVE_SHD
-endif
-
-if PYTHON
-TESTS += run_tests
-endif
-
-if GUILE
-TESTS += run_guile_tests
-endif
diff --git a/gr-shd/swig/Makefile.swig.gen b/gr-shd/swig/Makefile.swig.gen
deleted file mode 100644
index ebe843bbe..000000000
--- a/gr-shd/swig/Makefile.swig.gen
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- Makefile -*-
-#
-# Copyright 2009 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.
-#
-
-# Makefile.swig.gen for shd_swig.i
-
-## Default install locations for these files:
-##
-## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/shd_swig
-## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/shd_swig
-##
-## The following can be overloaded to change the install location, but
-## this has to be done in the including Makefile.am -before-
-## Makefile.swig is included.
-
-shd_swig_pythondir_category ?= gnuradio/shd_swig
-shd_swig_pylibdir_category ?= $(shd_swig_pythondir_category)
-shd_swig_pythondir = $(pythondir)/$(shd_swig_pythondir_category)
-shd_swig_pylibdir = $(pyexecdir)/$(shd_swig_pylibdir_category)
-
-# The .so libraries for the guile modules get installed whereever guile
-# is installed, usually /usr/lib/guile/gnuradio/
-# FIXME: determince whether these should be installed with gnuradio.
-shd_swig_scmlibdir = $(libdir)
-
-# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/shd_swig
-# FIXME: determince whether these should be installed with gnuradio.
-shd_swig_scmdir = $(guiledir)
-
-## SWIG headers are always installed into the same directory.
-
-shd_swig_swigincludedir = $(swigincludedir)
-
-## This is a template file for a "generated" Makefile addition (in
-## this case, "Makefile.swig.gen"). By including the top-level
-## Makefile.swig, this file will be used to generate the SWIG
-## dependencies. Assign the variable TOP_SWIG_FILES to be the list of
-## SWIG .i files to generated wrappings for; there can be more than 1
-## so long as the names are unique (no sorting is done on the
-## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
-## file will generate .cc, .py, and possibly .h files -- meaning that
-## all of these files will have the same base name (that provided for
-## the SWIG .i file).
-##
-## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
-## right thing. For more info, see <
-## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
-
-## Other cleaned files: dependency files generated by SWIG or this Makefile
-
-MOSTLYCLEANFILES += $(DEPDIR)/*.S*
-
-## Various SWIG variables. These can be overloaded in the including
-## Makefile.am by setting the variable value there, then including
-## Makefile.swig .
-
-shd_swig_swiginclude_HEADERS = \
- shd_swig.i \
- $(shd_swig_swiginclude_headers)
-
-if PYTHON
-shd_swig_pylib_LTLIBRARIES = \
- _shd_swig.la
-
-_shd_swig_la_SOURCES = \
- python/shd_swig.cc \
- $(shd_swig_la_swig_sources)
-
-shd_swig_python_PYTHON = \
- shd_swig.py \
- $(shd_swig_python)
-
-_shd_swig_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(shd_swig_la_swig_libadd)
-
-_shd_swig_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(shd_swig_la_swig_ldflags)
-
-_shd_swig_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(shd_swig_la_swig_cxxflags)
-
-python/shd_swig.cc: shd_swig.py
-shd_swig.py: shd_swig.i
-
-# Include the python dependencies for this file
--include python/shd_swig.d
-
-endif # end of if python
-
-if GUILE
-
-shd_swig_scmlib_LTLIBRARIES = \
- libguile-gnuradio-shd_swig.la
-libguile_gnuradio_shd_swig_la_SOURCES = \
- guile/shd_swig.cc \
- $(shd_swig_la_swig_sources)
-nobase_shd_swig_scm_DATA = \
- gnuradio/shd_swig.scm \
- gnuradio/shd_swig-primitive.scm
-libguile_gnuradio_shd_swig_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(shd_swig_la_swig_libadd)
-libguile_gnuradio_shd_swig_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(shd_swig_la_swig_ldflags)
-libguile_gnuradio_shd_swig_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(shd_swig_la_swig_cxxflags)
-
-guile/shd_swig.cc: gnuradio/shd_swig.scm
-gnuradio/shd_swig.scm: shd_swig.i
-gnuradio/shd_swig-primitive.scm: gnuradio/shd_swig.scm
-
-# Include the guile dependencies for this file
--include guile/shd_swig.d
-
-endif # end of GUILE
-
-
diff --git a/gr-shd/swig/__init__.py b/gr-shd/swig/__init__.py
index d34eb214a..a9dea9420 100644
--- a/gr-shd/swig/__init__.py
+++ b/gr-shd/swig/__init__.py
@@ -1,18 +1,18 @@
#
# Copyright 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,
diff --git a/gr-shd/swig/gnuradio/.gitignore b/gr-shd/swig/gnuradio/.gitignore
deleted file mode 100644
index adf5c3727..000000000
--- a/gr-shd/swig/gnuradio/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-shd_swig-primitive.scm
-shd_swig.scm
diff --git a/gr-shd/swig/qa_shd.py b/gr-shd/swig/qa_shd.py
index 538de918c..a589fee43 100755
--- a/gr-shd/swig/qa_shd.py
+++ b/gr-shd/swig/qa_shd.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005,2008,2010 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.
-#
+#
from gnuradio import gr, gr_unittest
import shd_swig
@@ -35,6 +35,6 @@ class test_shd(gr_unittest.TestCase):
"""Just see if we can import the module...
They may not have a SHD device connected, etc. Don't try to run anything"""
pass
-
+
if __name__ == '__main__':
gr_unittest.run(test_shd, "test_shd.xml")
diff --git a/gr-shd/swig/run_guile_tests.in b/gr-shd/swig/run_guile_tests.in
deleted file mode 100644
index 5d08b0dd5..000000000
--- a/gr-shd/swig/run_guile_tests.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-. @top_builddir@/setup_guile_test_env
-
-# 1st argument is absolute path to hand coded guile source directory
-# 2nd argument is absolute path to component C++ shared library build directory
-# 3nd argument is absolute path to component SWIG build directory
-
-add_local_paths \
- @srcdir@ \
- @abs_builddir@ \
- @abs_builddir@
-
-@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@
diff --git a/gr-shd/swig/run_tests.in b/gr-shd/swig/run_tests.in
deleted file mode 100644
index 580296374..000000000
--- a/gr-shd/swig/run_tests.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1st parameter is absolute path to component source directory
-# 2nd parameter is absolute path to component build directory
-# 3rd parameter is path to Python QA directory
-
-@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-shd \
- @abs_top_builddir@/gr-shd \
- @srcdir@
diff --git a/gr-shd/swig/shd.test b/gr-shd/swig/shd.test
deleted file mode 100644
index 7b118a081..000000000
--- a/gr-shd/swig/shd.test
+++ /dev/null
@@ -1,37 +0,0 @@
-;;; -*- Scheme -*-
-;;;
-;;; Copyright 2010 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 this program. If not, see <http://www.gnu.org/licenses/>.
-;;;
-
-;;; If you're using Emacs's Scheme mode:
-;;; (put 'with-test-prefix 'scheme-indent-function 1)
-
-;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests.
-;;; See also the very end of the file, where the test-equal, test-eqv
-;;; and test-eq macros are defined.
-
-(define-module (test-module)
- #:use-module (oop goops)
- #:use-module (gnuradio core)
- #:use-module (gnuradio test-suite lib)
- #:duplicates (merge-generics replace check))
-
-;;; Just see if we can import the module...
-;;; They may not have a SHD device attached, powered up etc.
-
-(use-modules (gnuradio shd))
diff --git a/gr-shd/swig/shd_swig.i b/gr-shd/swig/shd_swig.i
index 4ff200ec6..9d5dae51c 100644
--- a/gr-shd/swig/shd_swig.i
+++ b/gr-shd/swig/shd_swig.i
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 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,
@@ -125,14 +125,4 @@ static const size_t ALL_MBOARDS = shd::xmini::multi_xmini::ALL_MBOARDS;
%}
static const size_t ALL_MBOARDS;
-#if SWIGGUILE
-%scheme %{
-(load-extension-global "libguile-gnuradio-shd_swig" "scm_init_gnuradio_shd_swig_module")
-%}
-
-%goops %{
-(use-modules (gnuradio gnuradio_core_runtime))
-%}
-#endif /* SWIGGUILE */
-
#endif /* GR_HAVE_SHD */