Roman Khassraf | 5bd14f2 | 2015-06-24 17:59:13 +0200 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
| 2 | /* |
| 3 | * @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | * @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com> |
Roman Khassraf | 5bd14f2 | 2015-06-24 17:59:13 +0200 | [diff] [blame] | 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_IMMEDIATE_ASSIGNMENT_IMPL_H |
| 24 | #define INCLUDED_GSM_EXTRACT_IMMEDIATE_ASSIGNMENT_IMPL_H |
| 25 | |
| 26 | #include <grgsm/misc_utils/extract_immediate_assignment.h> |
Roman Khassraf | 95c6f9d | 2015-07-12 19:02:32 +0200 | [diff] [blame] | 27 | #include <map> |
| 28 | #include <vector> |
Roman Khassraf | 5bd14f2 | 2015-06-24 17:59:13 +0200 | [diff] [blame] | 29 | |
| 30 | namespace gr { |
| 31 | namespace gsm { |
| 32 | |
Roman Khassraf | 95c6f9d | 2015-07-12 19:02:32 +0200 | [diff] [blame] | 33 | 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 Khassraf | 5bd14f2 | 2015-06-24 17:59:13 +0200 | [diff] [blame] | 54 | class extract_immediate_assignment_impl : public extract_immediate_assignment |
| 55 | { |
Roman Khassraf | 95c6f9d | 2015-07-12 19:02:32 +0200 | [diff] [blame] | 56 | private: |
| 57 | void process_message(pmt::pmt_t msg); |
| 58 | immediate_assignment_map d_assignment_map; |
Roman Khassraf | a212ca2 | 2015-07-12 21:19:35 +0200 | [diff] [blame] | 59 | bool d_print_immediate_assignments; |
Roman Khassraf | 2b5ca48 | 2015-07-13 10:28:17 +0200 | [diff] [blame] | 60 | bool d_ignore_gprs; |
Roman Khassraf | 1669e93 | 2015-07-13 11:18:22 +0200 | [diff] [blame] | 61 | bool d_unique_references; |
Roman Khassraf | 95c6f9d | 2015-07-12 19:02:32 +0200 | [diff] [blame] | 62 | 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 Khassraf | 1669e93 | 2015-07-13 11:18:22 +0200 | [diff] [blame] | 73 | extract_immediate_assignment_impl(bool print_immediate_assignments=false, |
| 74 | bool ignore_gprs=false, bool unique_references=false); |
Roman Khassraf | 95c6f9d | 2015-07-12 19:02:32 +0200 | [diff] [blame] | 75 | ~extract_immediate_assignment_impl(); |
Roman Khassraf | 5bd14f2 | 2015-06-24 17:59:13 +0200 | [diff] [blame] | 76 | }; |
| 77 | } // namespace gsm |
| 78 | } // namespace gr |
| 79 | |
| 80 | #endif /* INCLUDED_GSM_EXTRACT_IMMEDIATE_ASSIGNMENT_IMPL_H */ |