[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3682 - gnuradio/branches/developers/jcorgan/pager/gr-
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r3682 - gnuradio/branches/developers/jcorgan/pager/gr-pager/src |
Date: |
Thu, 28 Sep 2006 09:25:29 -0600 (MDT) |
Author: jcorgan
Date: 2006-09-28 09:25:29 -0600 (Thu, 28 Sep 2006)
New Revision: 3682
Modified:
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.h
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.
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-28 07:31:21 UTC (rev 3681)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
2006-09-28 15:25:29 UTC (rev 3682)
@@ -25,7 +25,6 @@
#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()
@@ -111,23 +110,58 @@
// Parse vector information word for address @ offset 'i'
gr_int32 viw = d_datawords[j];
- int vtype = (viw >> 4) & 0x00000007;
+ d_type = (page_type_t)((viw >> 4) & 0x00000007);
int mw1 = (viw >> 7) & 0x00000007F;
int len = (viw >> 14) & 0x0000007F;
- if (is_numeric_page(vtype))
+ if (is_numeric_page(d_type))
len &= 0x07;
int mw2 = mw1+len;
if (mw1 == 0 && mw2 == 0)
continue; // Invalid VIW
- if (is_tone_page(vtype))
+ if (is_tone_page(d_type))
mw1 = mw2 = 0;
if (mw1 > 87 || mw2 > 87)
continue; // Invalid offsets
- printf("%09i: %s\n", d_capcode, page_types[vtype]);
+ printf("%09i: ", d_capcode);
+
+ if (is_alphanumeric_page(d_type))
+ parse_alphanumeric(mw1, mw2-1);
+ else if (is_numeric_page(d_type))
+ parse_numeric(mw1, mw2);
+ else if (is_tone_page(d_type))
+ parse_tone_only();
+ else
+ parse_unknown(mw1, mw2);
+
+ printf("\n");
}
}
+
+void pager_flex_parse::parse_alphanumeric(int mw1, int mw2)
+{
+ printf("ALPHA");
+
+ for (int i = mw1; i < mw2; i++) {
+
+ }
+}
+
+void pager_flex_parse::parse_numeric(int mw1, int mw2)
+{
+ printf("NUMERIC");
+}
+
+void pager_flex_parse::parse_tone_only()
+{
+ printf("TONE");
+}
+
+void pager_flex_parse::parse_unknown(int mw1, int mw2)
+{
+ printf("UNKNOWN");
+}
Modified:
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
2006-09-28 07:31:21 UTC (rev 3681)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
2006-09-28 15:25:29 UTC (rev 3682)
@@ -23,6 +23,7 @@
#define INCLUDED_PAGER_FLEX_PARSE_H
#include <gr_sync_block.h>
+#include <pageri_flex_modes.h>
class pager_flex_parse;
typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr;
@@ -44,12 +45,17 @@
int d_count; // Count of received codewords
gr_int32 d_datawords[88]; // 11 blocks of 8 32-bit words
+ page_type_t d_type; // Current page type
int d_capcode; // Current page destination address
- int d_laddr; // Current page has long address
+ bool d_laddr; // Current page has long address
void parse_data(); // Handle a frame's worth of data
void parse_capcode(gr_int32 aw1, gr_int32 aw2);
-
+ void parse_alphanumeric(int mw1, int mw2);
+ void parse_numeric(int mw1, int mw2);
+ void parse_tone_only();
+ void parse_unknown(int mw1, int mw2);
+
public:
int work(int noutput_items,
gr_vector_const_void_star &input_items,
Modified:
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
2006-09-28 07:31:21 UTC (rev 3681)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
2006-09-28 15:25:29 UTC (rev 3682)
@@ -170,27 +170,24 @@
d_count = 0;
}
-void print_fiw(gr_int32 fiw)
+void pager_flex_sync::parse_fiw()
{
+ // Nothing is done with these now, but these will end up getting
+ // passed as metadata when mblocks are available
+
// Bits 31-28 are frame number related, but unknown function
// This might be a checksum
- int unknown2 = pageri_reverse_bits8((fiw >> 24) & 0xF0);
+ d_unknown2 = pageri_reverse_bits8((d_fiw >> 24) & 0xF0);
// Cycle is bits 27-24, reversed
- int cycle = pageri_reverse_bits8((fiw >> 20) & 0xF0);
+ d_cycle = pageri_reverse_bits8((d_fiw >> 20) & 0xF0);
// Frame is bits 23-17, reversed
- int frame = pageri_reverse_bits8((fiw >> 16) & 0xFE);
+ d_frame = pageri_reverse_bits8((d_fiw >> 16) & 0xFE);
// Bits 16-11 are some sort of marker, usually identical across
// many frames but sometimes changes between frames or modes
- int unknown1 = (fiw >> 11) & 0x3F;
-
- // Bits 10-0 are BCH 'parity' bits, ignored
-
-// printf("FIW=0x%08X CYC=%i FRM=%i UNK1=0x%02X UNK2=0x%02X\n",
-// fiw, cycle, frame, unknown1, unknown2);
-// fflush(stdout);
+ d_unknown1 = (d_fiw >> 11) & 0x3F;
}
int pager_flex_sync::output_symbol(unsigned char sym)
@@ -301,7 +298,7 @@
if (++d_count == 48) {
// FIW is accumulated, call BCH to error correct it
pageri_bch3221(d_fiw);
- print_fiw(d_fiw);
+ parse_fiw();
enter_sync2();
}
}
Modified:
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.h
2006-09-28 07:31:21 UTC (rev 3681)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.h
2006-09-28 15:25:29 UTC (rev 3682)
@@ -51,6 +51,7 @@
int index_avg(int start, int end);
bool test_sync(unsigned char sym);
+ void parse_fiw();
int output_symbol(unsigned char sym);
// Simple state machine
@@ -71,6 +72,10 @@
bool d_hibit; // Alternating bit indicator for 3200 bps
gr_int32 d_fiw; // Frame information word
+ int d_frame; // Current FLEX frame
+ int d_cycle; // Current FLEX cycle
+ int d_unknown1;
+ int d_unknown2;
unsigned char d_bit_a;
unsigned char d_bit_b;
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-28 07:31:21 UTC (rev 3681)
+++
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.cc
2006-09-28 15:25:29 UTC (rev 3682)
@@ -23,27 +23,15 @@
const flex_mode_t flex_modes[] =
{
- { 0x870C78F3, 1600, 2, true, false, false, false, 1 },
- { 0xB0684F97, 1600, 4, true, true, false, false, 2 },
-// { 0xUNKNOWN, 3200, 2, true, false, true, false, 2 },
- { 0xDEA0215F, 3200, 4, true, true, true, true, 4 },
- { 0x4C7CB383, 3200, 4, true, true, true, true, 4 }
+ { 0x870C78F3, 1600, 2 },
+ { 0xB0684F97, 1600, 4 },
+// { 0xUNKNOWN, 3200, 2 },
+ { 0xDEA0215F, 3200, 4 },
+ { 0x4C7CB383, 3200, 4 }
};
-const int num_flex_modes = sizeof(flex_modes);
+const int num_flex_modes = sizeof(flex_modes)/sizeof(flex_modes[0]);
-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-28 07:31:21 UTC (rev 3681)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_flex_modes.h
2006-09-28 15:25:29 UTC (rev 3682)
@@ -31,11 +31,6 @@
gr_int32 sync; // Outer synchronization code
unsigned int baud; // Baudrate of SYNC2 and DATA
unsigned int levels; // FSK encoding of SYNC2 and DATA
- bool phase_a; // PHASEA is transmitted
- bool phase_b; // PHASEB is transmitted
- bool phase_c; // PHASEC is transmitted
- bool phase_d; // PHASED is transmitted
- int phases; // number of phases transmitted
}
flex_mode_t;
@@ -56,18 +51,22 @@
}
page_type_t;
-extern const char *page_types[];
+inline bool is_alphanumeric_page(page_type_t type)
+{
+ return (type == FLEX_ALPHANUMERIC ||
+ type == FLEX_SECURE);
+}
-inline bool is_numeric_page(int vtype)
+inline bool is_numeric_page(page_type_t type)
{
- return (vtype == FLEX_STANDARD_NUMERIC ||
- vtype == FLEX_SPECIAL_NUMERIC ||
- vtype == FLEX_NUMBERED_NUMERIC);
+ return (type == FLEX_STANDARD_NUMERIC ||
+ type == FLEX_SPECIAL_NUMERIC ||
+ type == FLEX_NUMBERED_NUMERIC);
}
-inline bool is_tone_page(int vtype)
+inline bool is_tone_page(page_type_t type)
{
- return (vtype == FLEX_TONE);
+ return (type == FLEX_TONE);
}
#endif // INCLUDED_PAGERI_FLEX_MODES_H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3682 - gnuradio/branches/developers/jcorgan/pager/gr-pager/src,
jcorgan <=