blob: 44a3830b2f534aae8a33261bc0afa5e7f675ff33 [file] [log] [blame]
Roman Khassraf5bd14f22015-06-24 17:59:13 +02001/* -*- c++ -*- */
2/*
3 * @file
Piotr Krysika6268a52017-08-23 16:02:19 +02004 * @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com>
Roman Khassraf5bd14f22015-06-24 17:59:13 +02005 * @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_IMMEDIATE_ASSIGNMENT_IMPL_H
24#define INCLUDED_GSM_EXTRACT_IMMEDIATE_ASSIGNMENT_IMPL_H
25
26#include <grgsm/misc_utils/extract_immediate_assignment.h>
Roman Khassraf95c6f9d2015-07-12 19:02:32 +020027#include <map>
28#include <vector>
Roman Khassraf5bd14f22015-06-24 17:59:13 +020029
30namespace gr {
31 namespace gsm {
32
Roman Khassraf95c6f9d2015-07-12 19:02:32 +020033 class immediate_assignment
34 {
35 public:
36 uint32_t frame_nr;
37 std::string channel_type;
38 uint8_t timeslot;
39 uint8_t subchannel;
40 uint8_t hopping;
41 uint8_t maio;
42 uint8_t hsn;
43 uint16_t arfcn;
44 uint8_t timing_advance;
45 std::string mobile_allocation;
46
47 immediate_assignment() : frame_nr(0), channel_type("unknown"), timeslot(0), subchannel(0),
48 hopping(false), maio(0), hsn(0), arfcn(0), timing_advance(0), mobile_allocation("") {};
49 ~immediate_assignment() {};
50 };
51
52 typedef std::map<uint32_t, immediate_assignment> immediate_assignment_map;
53
Roman Khassraf5bd14f22015-06-24 17:59:13 +020054 class extract_immediate_assignment_impl : public extract_immediate_assignment
55 {
Roman Khassraf95c6f9d2015-07-12 19:02:32 +020056 private:
57 void process_message(pmt::pmt_t msg);
58 immediate_assignment_map d_assignment_map;
Roman Khassrafa212ca22015-07-12 21:19:35 +020059 bool d_print_immediate_assignments;
Roman Khassraf2b5ca482015-07-13 10:28:17 +020060 bool d_ignore_gprs;
Roman Khassraf1669e932015-07-13 11:18:22 +020061 bool d_unique_references;
Roman Khassraf95c6f9d2015-07-12 19:02:32 +020062 public:
63 virtual std::vector<int> get_frame_numbers();
64 virtual std::vector<std::string> get_channel_types();
65 virtual std::vector<int> get_timeslots();
66 virtual std::vector<int> get_subchannels();
67 virtual std::vector<int> get_hopping();
68 virtual std::vector<int> get_maios();
69 virtual std::vector<int> get_hsns();
70 virtual std::vector<int> get_arfcns();
71 virtual std::vector<int> get_timing_advances();
72 virtual std::vector<std::string> get_mobile_allocations();
Roman Khassraf1669e932015-07-13 11:18:22 +020073 extract_immediate_assignment_impl(bool print_immediate_assignments=false,
74 bool ignore_gprs=false, bool unique_references=false);
Roman Khassraf95c6f9d2015-07-12 19:02:32 +020075 ~extract_immediate_assignment_impl();
Roman Khassraf5bd14f22015-06-24 17:59:13 +020076 };
77 } // namespace gsm
78} // namespace gr
79
80#endif /* INCLUDED_GSM_EXTRACT_IMMEDIATE_ASSIGNMENT_IMPL_H */