pager_flex_sync.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef INCLUDED_PAGER_FLEX_SYNC_H
00023 #define INCLUDED_PAGER_FLEX_SYNC_H
00024
00025 #include <gr_block.h>
00026
00027 class pager_flex_sync;
00028 typedef boost::shared_ptr<pager_flex_sync> pager_flex_sync_sptr;
00029 typedef std::vector<gr_int64> gr_int64_vector;
00030
00031 pager_flex_sync_sptr pager_make_flex_sync();
00032
00038 class pager_flex_sync : public gr_block
00039 {
00040 private:
00041
00042 friend pager_flex_sync_sptr pager_make_flex_sync();
00043 pager_flex_sync();
00044
00045
00046 void enter_idle();
00047 void enter_syncing();
00048 void enter_sync1();
00049 void enter_sync2();
00050 void enter_data();
00051
00052 int index_avg(int start, int end);
00053 bool test_sync(unsigned char sym);
00054 void parse_fiw();
00055 int output_symbol(unsigned char sym);
00056
00057
00058 enum state_t { ST_IDLE, ST_SYNCING, ST_SYNC1, ST_SYNC2, ST_DATA };
00059 state_t d_state;
00060
00061 int d_index;
00062 int d_start;
00063 int d_center;
00064 int d_end;
00065 int d_count;
00066
00067 int d_mode;
00068 int d_baudrate;
00069 int d_levels;
00070 int d_spb;
00071 bool d_hibit;
00072
00073 gr_int32 d_fiw;
00074 int d_frame;
00075 int d_cycle;
00076 int d_unknown1;
00077 int d_unknown2;
00078
00079 unsigned char d_bit_a;
00080 unsigned char d_bit_b;
00081 unsigned char d_bit_c;
00082 unsigned char d_bit_d;
00083
00084 unsigned char *d_phase_a;
00085 unsigned char *d_phase_b;
00086 unsigned char *d_phase_c;
00087 unsigned char *d_phase_d;
00088
00089 gr_int64_vector d_sync;
00090
00091 public:
00092 void forecast(int noutput_items, gr_vector_int &inputs_required);
00093
00094 int general_work(int noutput_items,
00095 gr_vector_int &ninput_items,
00096 gr_vector_const_void_star &input_items,
00097 gr_vector_void_star &output_items);
00098 };
00099
00100 #endif