GNU Radio 3.4.2 C++ API
|
00001 /* 00002 * Copyright 2006 Free Software Foundation, Inc. 00003 * 00004 * This file is part of GNU Radio 00005 * 00006 * GNU Radio is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3, or (at your option) 00009 * any later version. 00010 * 00011 * GNU Radio is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with GNU Radio; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef INCLUDED_PAGER_FLEX_PARSE_H 00023 #define INCLUDED_PAGER_FLEX_PARSE_H 00024 00025 #include <gr_sync_block.h> 00026 #include <gr_msg_queue.h> 00027 #include <pageri_flex_modes.h> 00028 #include <sstream> 00029 00030 class pager_flex_parse; 00031 typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr; 00032 00033 pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); 00034 00035 #define FIELD_DELIM ((unsigned char)128) 00036 00037 /*! 00038 * \brief flex parse description 00039 * \ingroup pager_blk 00040 */ 00041 class pager_flex_parse : public gr_sync_block 00042 { 00043 private: 00044 // Constructors 00045 friend pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); 00046 pager_flex_parse(gr_msg_queue_sptr queue, float freq); 00047 00048 std::ostringstream d_payload; 00049 gr_msg_queue_sptr d_queue; // Destination for decoded pages 00050 00051 int d_count; // Count of received codewords 00052 gr_int32 d_datawords[88]; // 11 blocks of 8 32-bit words 00053 00054 page_type_t d_type; // Current page type 00055 int d_capcode; // Current page destination address 00056 bool d_laddr; // Current page has long address 00057 float d_freq; // Channel frequency 00058 00059 void parse_data(); // Handle a frame's worth of data 00060 void parse_capcode(gr_int32 aw1, gr_int32 aw2); 00061 void parse_alphanumeric(int mw1, int mw2, int j); 00062 void parse_numeric(int mw1, int mw2, int j); 00063 void parse_tone_only(); 00064 void parse_unknown(int mw1, int mw2); 00065 00066 public: 00067 int work(int noutput_items, 00068 gr_vector_const_void_star &input_items, 00069 gr_vector_void_star &output_items); 00070 }; 00071 00072 #endif /* INCLUDED_PAGER_FLEX_PARSE_H */