commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: jcorgan
Subject: [Commit-gnuradio] r3628 - gnuradio/branches/developers/jcorgan/pager/gr-pager/src
Date: Sat, 23 Sep 2006 19:13:07 -0600 (MDT)

Author: jcorgan
Date: 2006-09-23 19:13:07 -0600 (Sat, 23 Sep 2006)
New Revision: 3628

Modified:
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.h
Log:
Work in progress. Now iterates through individual pages in data frame,
identifying short and long capcodes and page type.


Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
2006-09-23 19:01:36 UTC (rev 3627)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
2006-09-24 01:13:07 UTC (rev 3628)
@@ -25,6 +25,7 @@
 
 #include <pager_flex_parse.h>
 #include <pageri_bch3221.h>
+#include <pageri_flex_modes.h>
 #include <gr_io_signature.h>
 
 pager_flex_parse_sptr pager_make_flex_parse()
@@ -75,11 +76,31 @@
        return;
 
     // Vector start index is bits 15-10
-    int vector_index = (biw >> 10) & 0x3f;
     // Address start address is bits 9-8, plus one for offset
-    int address_index = ((biw >> 8) & 0x03) + 1;
+    int vector_offset = (biw >> 10) & 0x3f;
+    int address_offset = ((biw >> 8) & 0x03) + 1;
     
-    int num = vector_index - address_index;
-    
-    printf("BIW=%08X A=%i V=%i N=%i\n", biw, address_index, vector_index, num);
+    printf("BIW=%08X A=%i V=%i\n", biw, address_offset, vector_offset);
+
+    // Iterate through pages and dispatch to appropriate handler
+    for (int index = address_offset; index < vector_offset; index++) {
+       // Vector information word is sequential @ vector_offet
+       int vector_index = vector_offset + index - address_offset;
+
+       // CAPCODE is @ index and maybe also index+1 if long address
+       gr_int32 address_word = d_datawords[index];
+       bool long_address = (address_word < 0x008001L) ||
+                           (address_word > 0x1E0000L) ||
+                           (address_word > 0x1E7FFEL); 
+
+       gr_int32 vector_word = d_datawords[vector_index];
+       int vector_type = (vector_word >> 4) & 0x00000007L;
+
+       printf("%i: AW=0x%08X (%s) VW=0x%08X TYPE=%i (%s)\n", index, 
address_word,
+           long_address ? "L" : "S", vector_word, vector_type, 
page_types[vector_type]);
+
+       if (long_address)
+           index++;
+
+    }
 }

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.cc    
    2006-09-23 19:01:36 UTC (rev 3627)
+++ 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.cc    
    2006-09-24 01:13:07 UTC (rev 3628)
@@ -32,6 +32,18 @@
 
 const int num_flex_modes = sizeof(flex_modes);
 
+const char *page_types[] =
+{
+    "Secure",
+    "Unknown",
+    "Tone Only",
+    "Standard Numeric",
+    "Special Format Numeric",
+    "Text",
+    "Binary",
+    "Numbered Numeric"
+};
+
 int find_flex_mode(gr_int32 sync_code)
 {
     for (int i = 0; i < num_flex_modes; i++)

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.h 
2006-09-23 19:01:36 UTC (rev 3627)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.h 
2006-09-24 01:13:07 UTC (rev 3628)
@@ -42,6 +42,9 @@
 extern const flex_mode_t flex_modes[];
 extern const int num_flex_modes;
 
+extern const char *page_types[];
+extern const int num_page_types;
+
 int find_flex_mode(gr_int32 sync_code);
 
 #endif // INCLUDED_PAGERI_FLEX_MODES_H





reply via email to

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