GNU Radio 3.6.5 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 <pager_api.h> 00026 #include <gr_sync_block.h> 00027 #include <gr_msg_queue.h> 00028 #include <pageri_flex_modes.h> 00029 #include <sstream> 00030 00031 class pager_flex_parse; 00032 typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr; 00033 00034 PAGER_API pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); 00035 00036 #define FIELD_DELIM ((unsigned char)128) 00037 00038 /*! 00039 * \brief flex parse description 00040 * \ingroup pager_blk 00041 */ 00042 class PAGER_API pager_flex_parse : public gr_sync_block 00043 { 00044 private: 00045 // Constructors 00046 friend PAGER_API pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq); 00047 pager_flex_parse(gr_msg_queue_sptr queue, float freq); 00048 00049 std::ostringstream d_payload; 00050 gr_msg_queue_sptr d_queue; // Destination for decoded pages 00051 00052 int d_count; // Count of received codewords 00053 gr_int32 d_datawords[88]; // 11 blocks of 8 32-bit words 00054 00055 page_type_t d_type; // Current page type 00056 int d_capcode; // Current page destination address 00057 bool d_laddr; // Current page has long address 00058 float d_freq; // Channel frequency 00059 00060 void parse_data(); // Handle a frame's worth of data 00061 void parse_capcode(gr_int32 aw1, gr_int32 aw2); 00062 void parse_alphanumeric(int mw1, int mw2, int j); 00063 void parse_numeric(int mw1, int mw2, int j); 00064 void parse_tone_only(); 00065 void parse_unknown(int mw1, int mw2); 00066 00067 public: 00068 int work(int noutput_items, 00069 gr_vector_const_void_star &input_items, 00070 gr_vector_void_star &output_items); 00071 }; 00072 00073 #endif /* INCLUDED_PAGER_FLEX_PARSE_H */