commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3623 - gnuradio/branches/developers/jcorgan/pager/gr-


From: jcorgan
Subject: [Commit-gnuradio] r3623 - gnuradio/branches/developers/jcorgan/pager/gr-pager/src
Date: Fri, 22 Sep 2006 14:33:17 -0600 (MDT)

Author: jcorgan
Date: 2006-09-22 14:33:17 -0600 (Fri, 22 Sep 2006)
New Revision: 3623

Added:
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
Modified:
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager.i
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py
Log:
Work in progress.  Added FLEX message parsing block (no functionality).


Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am 
2006-09-22 20:04:34 UTC (rev 3622)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am 
2006-09-22 20:33:17 UTC (rev 3623)
@@ -77,6 +77,7 @@
     pager_slicer_fb.cc \
     pager_flex_sync.cc \
     pager_flex_deinterleave.cc \
+    pager_flex_parse.cc \
     pageri_flex_modes.cc \
     pageri_bch3221.cc
     # Additional source modules here
@@ -98,6 +99,7 @@
     pager_slicer_fb.h \
     pager_flex_sync.h \
     pager_flex_deinterleave.h \
+    pager_flex_parse.h \
     pageri_flex_modes.h \
     pageri_bch3221.h
     # Additional header files here

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py       
2006-09-22 20:04:34 UTC (rev 3622)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py       
2006-09-22 20:33:17 UTC (rev 3623)
@@ -55,21 +55,29 @@
         LPF = gr.fir_filter_fff(1, taps)
         SLICER = pager_swig.slicer_fb(.001, .00001) # Attack, decay
        SYNC = pager_swig.flex_sync(channel_rate)
-       self.DEINTA = pager_swig.flex_deinterleave()
-       self.DEINTB = pager_swig.flex_deinterleave()
-       self.DEINTC = pager_swig.flex_deinterleave()
-       self.DEINTD = pager_swig.flex_deinterleave()
-
         fg.connect(QUAD, LPF, SLICER, SYNC)
-       fg.connect((SYNC, 0), self.DEINTA)
-       fg.connect((SYNC, 1), self.DEINTB)
-       fg.connect((SYNC, 2), self.DEINTC)
-       fg.connect((SYNC, 3), self.DEINTD)
 
+       DEINTA = pager_swig.flex_deinterleave()
+       PARSEA = pager_swig.flex_parse()
+
+       DEINTB = pager_swig.flex_deinterleave()
+       PARSEB = pager_swig.flex_parse()
+
+       DEINTC = pager_swig.flex_deinterleave()
+       PARSEC = pager_swig.flex_parse()
+
+       DEINTD = pager_swig.flex_deinterleave()
+       PARSED = pager_swig.flex_parse()
+       
+       fg.connect((SYNC, 0), DEINTA, PARSEA)
+       fg.connect((SYNC, 1), DEINTB, PARSEB)
+       fg.connect((SYNC, 2), DEINTC, PARSEC)
+       fg.connect((SYNC, 3), DEINTD, PARSED)
+
        # Hack until fg converges back to one output and we can make a 
        # hier_block again.
-       self.OUTPUTA = self.DEINTA
-       self.OUTPUTB = self.DEINTB
-       self.OUTPUTC = self.DEINTC
-       self.OUTPUTD = self.DEINTD
+       self.OUTPUTA = PARSEA
+       self.OUTPUTB = PARSEB
+       self.OUTPUTC = PARSEC
+       self.OUTPUTD = PARSED
                
\ No newline at end of file

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager.i
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager.i     
2006-09-22 20:04:34 UTC (rev 3622)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager.i     
2006-09-22 20:33:17 UTC (rev 3623)
@@ -28,6 +28,7 @@
 #include "pager_slicer_fb.h"
 #include "pager_flex_sync.h"
 #include "pager_flex_deinterleave.h"
+#include "pager_flex_parse.h"
 #include <stdexcept>
 %}
 
@@ -74,3 +75,15 @@
 };
 
 // ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(pager,flex_parse);
+
+pager_flex_parse_sptr pager_make_flex_parse();
+
+class pager_flex_parse : public gr_block
+{
+private:
+    pager_flex_parse();
+
+public:
+};

Added: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
2006-09-22 20:33:17 UTC (rev 3623)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2004,2006 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 2, 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pager_flex_parse.h>
+#include <pageri_bch3221.h>
+#include <gr_io_signature.h>
+
+pager_flex_parse_sptr pager_make_flex_parse()
+{
+    return pager_flex_parse_sptr(new pager_flex_parse());
+}
+
+pager_flex_parse::pager_flex_parse() :
+    gr_block("flex_parse",
+    gr_make_io_signature(1, 1, sizeof(gr_int32)),
+    gr_make_io_signature(1, 1, sizeof(unsigned char)))
+{
+    set_output_multiple(1);
+    d_count = 0;
+}
+
+void pager_flex_parse::forecast(int noutput_items, gr_vector_int 
&inputs_required)
+{
+    // Get at least one codeword on the input
+    for (unsigned int i = 0; i < inputs_required.size(); i++)
+        inputs_required[i] = noutput_items;
+}
+
+void parse_biw(gr_int32 biw)
+{
+    if (biw == 0 || biw == 0xFFFFFFFF)
+       return;
+       
+    printf("BIW=%08X\n", biw);
+}
+
+int pager_flex_parse::general_work(int noutput_items,
+    gr_vector_int &ninput_items,
+    gr_vector_const_void_star &input_items,
+    gr_vector_void_star &output_items)
+{
+    const gr_int32 *in = (const gr_int32 *)input_items[0];
+    
+    unsigned char *out = (unsigned char *)output_items[0];
+    
+    int ninputs = ninput_items[0];
+
+    int i = 0, j = 0;
+    while (i < ninputs && j < noutput_items) {
+       gr_int32 code = *in++; i++;
+
+       // First codeword in a block is the Block Information Word
+       if (++d_count % 8 == 1)
+           parse_biw(code);
+    }
+
+    consume_each(i);
+    return j;
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h  
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h  
2006-09-22 20:33:17 UTC (rev 3623)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 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 2, 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.
+ */
+
+#ifndef INCLUDED_PAGER_FLEX_PARSE_H
+#define INCLUDED_PAGER_FLEX_PARSE_H
+
+#include <gr_block.h>
+
+class pager_flex_parse;
+typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr;
+
+pager_flex_parse_sptr pager_make_flex_parse();
+
+/*!
+ * \brief flex parse description
+ * \ingroup block
+ */
+
+class pager_flex_parse : public gr_block
+{
+private:
+    // Constructors
+    friend pager_flex_parse_sptr pager_make_flex_parse();
+    pager_flex_parse();
+
+    int d_count;       // Count of received codewords
+
+public:
+    void forecast(int noutput_items, gr_vector_int &inputs_required);
+
+    int general_work(int noutput_items,
+                     gr_vector_int &ninput_items,
+                     gr_vector_const_void_star &input_items, 
+                     gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_PAGER_FLEX_PARSE_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py        
2006-09-22 20:04:34 UTC (rev 3622)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py        
2006-09-22 20:33:17 UTC (rev 3623)
@@ -115,10 +115,10 @@
        
         FLEX = pager.flex_demod(self, 32000)      
 
-        SINKA = gr.file_sink(4, options.filename+'A')
-       SINKB = gr.file_sink(4, options.filename+'B')
-       SINKC = gr.file_sink(4, options.filename+'C')
-       SINKD = gr.file_sink(4, options.filename+'D')
+        SINKA = gr.file_sink(1, options.filename+'A')
+       SINKB = gr.file_sink(1, options.filename+'B')
+       SINKC = gr.file_sink(1, options.filename+'C')
+       SINKD = gr.file_sink(1, options.filename+'D')
 
         self.connect(USRP, CHAN)
        self.connect(CHAN, RFSQL)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]