summaryrefslogtreecommitdiff
path: root/gr-digital/swig
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2011-07-21 23:35:03 -0400
committerTom Rondeau <trondeau@vt.edu>2011-07-21 23:35:03 -0400
commita444c2a5cf19333f981d007be7f6ecb96f85bb6a (patch)
treeb1d8698841d4dcafae36c418e1fb5fe1470db897 /gr-digital/swig
parentbe7f6400a03e0294aee51b084899b38ed0e83180 (diff)
digital: moving correlate_access_code to gr-digital.
Diffstat (limited to 'gr-digital/swig')
-rw-r--r--gr-digital/swig/Makefile.am1
-rw-r--r--gr-digital/swig/digital_correlate_access_code_bb.i60
-rw-r--r--gr-digital/swig/digital_swig.i18
3 files changed, 71 insertions, 8 deletions
diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am
index aad63ee449..df8f184b3f 100644
--- a/gr-digital/swig/Makefile.am
+++ b/gr-digital/swig/Makefile.am
@@ -64,6 +64,7 @@ digital_swig_swiginclude_headers = \
digital_constellation.i \
digital_constellation_receiver_cb.i \
digital_constellation_decoder_cb.i \
+ digital_correlate_access_code_bb.i \
digital_costas_loop_cc.i \
digital_cma_equalizer_cc.i \
digital_lms_dd_equalizer_cc.i \
diff --git a/gr-digital/swig/digital_correlate_access_code_bb.i b/gr-digital/swig/digital_correlate_access_code_bb.i
new file mode 100644
index 0000000000..01087b8e93
--- /dev/null
+++ b/gr-digital/swig/digital_correlate_access_code_bb.i
@@ -0,0 +1,60 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital,correlate_access_code_bb);
+
+/*!
+ * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
+ * \param threshold maximum number of bits that may be wrong
+ */
+digital_correlate_access_code_bb_sptr
+digital_make_correlate_access_code_bb (const std::string &access_code, int threshold)
+ throw(std::out_of_range);
+
+/*!
+ * \brief Examine input for specified access code, one bit at a time.
+ * \ingroup block
+ *
+ * input: stream of bits, 1 bit per input byte (data in LSB)
+ * output: stream of bits, 2 bits per output byte (data in LSB, flag in next higher bit)
+ *
+ * Each output byte contains two valid bits, the data bit, and the
+ * flag bit. The LSB (bit 0) is the data bit, and is the original
+ * input data, delayed 64 bits. Bit 1 is the
+ * flag bit and is 1 if the corresponding data bit is the first data
+ * bit following the access code. Otherwise the flag bit is 0.
+ */
+class digital_correlate_access_code_bb : public gr_sync_block
+{
+ friend digital_correlate_access_code_bb_sptr
+ digital_make_correlate_access_code_bb (const std::string &access_code, int threshold);
+ protected:
+ digital_correlate_access_code_bb(const std::string &access_code, int threshold);
+
+ public:
+ ~digital_correlate_access_code_bb();
+
+ /*!
+ * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
+ */
+ bool set_access_code (const std::string &access_code);
+};
diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i
index dd4f3c02ce..23459a1e57 100644
--- a/gr-digital/swig/digital_swig.i
+++ b/gr-digital/swig/digital_swig.i
@@ -23,23 +23,25 @@
%{
#include "digital_binary_slicer_fb.h"
+#include "digital_cma_equalizer_cc.h"
#include "digital_constellation.h"
+#include "digital_constellation_decoder_cb.h"
+#include "digital_constellation_receiver_cb.h"
+#include "digital_correlate_access_code_bb.h"
#include "digital_costas_loop_cc.h"
-#include "digital_cma_equalizer_cc.h"
-#include "digital_lms_dd_equalizer_cc.h"
#include "digital_kurtotic_equalizer_cc.h"
-#include "digital_constellation_receiver_cb.h"
-#include "digital_constellation_decoder_cb.h"
+#include "digital_lms_dd_equalizer_cc.h"
%}
%include "digital_binary_slicer_fb.i"
+%include "digital_cma_equalizer_cc.i"
%include "digital_constellation.i"
+%include "digital_constellation_decoder_cb.i"
+%include "digital_constellation_receiver_cb.i"
+%include "digital_correlate_access_code_bb.i"
%include "digital_costas_loop_cc.i"
-%include "digital_cma_equalizer_cc.i"
-%include "digital_lms_dd_equalizer_cc.i"
%include "digital_kurtotic_equalizer_cc.i"
-%include "digital_constellation_receiver_cb.i"
-%include "digital_constellation_decoder_cb.i"
+%include "digital_lms_dd_equalizer_cc.i"
#if SWIGGUILE
%scheme %{