GNU Radio's GSM Package
extract_system_info_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * @file
4  * @author Piotr Krysik <ptrkrysik@gmail.com>
5  * @section LICENSE
6  *
7  * Gr-gsm is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * Gr-gsm is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with gr-gsm; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_GSM_EXTRACT_SYSTEM_INFO_IMPL_H
24 #define INCLUDED_GSM_EXTRACT_SYSTEM_INFO_IMPL_H
25 
27 
28 
29 
30 namespace gr {
31  namespace gsm {
32 
33  class chan_info {
34  public:
35  unsigned int id;
36  int8_t pwr_db;
37  unsigned int arfcn;
38  float freq;
39  unsigned int lac;
40  unsigned int cell_id;
41  unsigned int mnc;
42 
43  chan_info() : id(-1), pwr_db(0), arfcn(0), freq(0), lac(0), cell_id(0), mnc(0){}
44  chan_info(const chan_info & info) : id(info.id), pwr_db(info.pwr_db), arfcn(info.arfcn), freq(info.freq), lac(info.lac), cell_id(info.cell_id), mnc(info.mnc){}
46  };
47 
48 
49  struct compare_id {
50  inline bool operator()(const chan_info &a, const chan_info &b) const
51  {
52  return a.id < b.id;
53  }
54  };
55  struct compare_pwr {
56  inline bool operator()(const chan_info &a, const chan_info &b) const
57  {
58  return a.pwr_db < b.pwr_db;
59  }
60  };
61 
62 
64  {
65  private:
66  void process_bursts(pmt::pmt_t burst);
67  void process_sysinfo(pmt::pmt_t msg);
68  std::set<chan_info, compare_id> d_c0_channels;
69  bool after_reset;
70  public:
71  virtual void show();
72  virtual std::vector<int> get_chans();
73  virtual std::vector<int> get_pwrs();
74  virtual std::vector<int> get_lac();
75  virtual std::vector<int> get_cell_id();
76  virtual std::vector<int> get_mnc();
77  virtual void reset();
80  };
81  } // namespace gsm
82 } // namespace gr
83 
84 #endif /* INCLUDED_GSM_EXTRACT_SYSTEM_INFO_IMPL_H */
85 
bool operator()(const chan_info &a, const chan_info &b) const
Definition: extract_system_info_impl.h:56
chan_info()
Definition: extract_system_info_impl.h:43
chan_info(const chan_info &info)
Definition: extract_system_info_impl.h:44
unsigned int mnc
Definition: extract_system_info_impl.h:41
unsigned int arfcn
Definition: extract_system_info_impl.h:37
unsigned int lac
Definition: extract_system_info_impl.h:39
Definition: extract_system_info_impl.h:55
virtual std::vector< int > get_lac()
float freq
Definition: extract_system_info_impl.h:38
Definition: extract_system_info_impl.h:33
Definition: control_channels_decoder.h:30
virtual std::vector< int > get_pwrs()
<+description of block+>
Definition: extract_system_info.h:38
Definition: extract_system_info_impl.h:63
Definition: extract_system_info_impl.h:49
unsigned int cell_id
Definition: extract_system_info_impl.h:40
int8_t pwr_db
Definition: extract_system_info_impl.h:36
unsigned int id
Definition: extract_system_info_impl.h:35
~chan_info()
Definition: extract_system_info_impl.h:45
virtual std::vector< int > get_chans()
bool operator()(const chan_info &a, const chan_info &b) const
Definition: extract_system_info_impl.h:50
virtual std::vector< int > get_cell_id()
virtual std::vector< int > get_mnc()