piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
ptrkrysik | 529895b | 2014-12-02 18:07:38 +0100 | [diff] [blame] | 2 | /* |
| 3 | * @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com> |
ptrkrysik | 529895b | 2014-12-02 18:07:38 +0100 | [diff] [blame] | 5 | * @section LICENSE |
| 6 | * |
| 7 | * Gr-gsm is free software; you can redistribute it and/or modify |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 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. |
ptrkrysik | 529895b | 2014-12-02 18:07:38 +0100 | [diff] [blame] | 11 | * |
| 12 | * Gr-gsm is distributed in the hope that it will be useful, |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 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. |
ptrkrysik | 529895b | 2014-12-02 18:07:38 +0100 | [diff] [blame] | 16 | * |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 17 | * You should have received a copy of the GNU General Public License |
ptrkrysik | 529895b | 2014-12-02 18:07:38 +0100 | [diff] [blame] | 18 | * along with gr-gsm; see the file COPYING. If not, write to |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | * Boston, MA 02110-1301, USA. |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_H |
| 24 | #include "config.h" |
| 25 | #endif |
| 26 | |
| 27 | #include <gnuradio/io_signature.h> |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 28 | #include <grgsm/gsmtap.h> |
ptrkrysik | 402c1fa | 2014-12-03 22:09:29 +0100 | [diff] [blame] | 29 | #include <unistd.h> |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 30 | #include <map> |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 31 | #include <iterator> |
| 32 | #include <algorithm> |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 33 | #include <iostream> |
David Holm | 41b63f2 | 2015-08-22 16:52:42 +0200 | [diff] [blame] | 34 | #include <grgsm/endian.h> |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 35 | #include <boost/foreach.hpp> |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 36 | extern "C" { |
| 37 | #include <osmocom/gsm/gsm48_ie.h> |
| 38 | } |
| 39 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 40 | |
ptrkrysik | 402c1fa | 2014-12-03 22:09:29 +0100 | [diff] [blame] | 41 | #include "extract_system_info_impl.h" |
| 42 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 43 | namespace gr { |
| 44 | namespace gsm { |
| 45 | boost::mutex extract_mutex; |
| 46 | void extract_system_info_impl::process_bursts(pmt::pmt_t msg) |
| 47 | { |
ptrkrysik | a31a481 | 2014-12-15 09:10:01 +0100 | [diff] [blame] | 48 | pmt::pmt_t burst_plus_header_blob = pmt::cdr(msg); |
| 49 | gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(burst_plus_header_blob); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 50 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 51 | chan_info info; |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 52 | info.id = be16toh(header->arfcn); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 53 | info.pwr_db = header->signal_dbm; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 54 | |
| 55 | boost::mutex::scoped_lock lock(extract_mutex); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 56 | |
| 57 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 58 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 59 | } else { |
| 60 | d_c0_channels[info.id] = info; |
| 61 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | void extract_system_info_impl::process_sysinfo(pmt::pmt_t msg){ |
ptrkrysik | a31a481 | 2014-12-15 09:10:01 +0100 | [diff] [blame] | 65 | pmt::pmt_t message_plus_header_blob = pmt::cdr(msg); |
| 66 | uint8_t * message_plus_header = (uint8_t *)pmt::blob_data(message_plus_header_blob); |
| 67 | gsmtap_hdr * header = (gsmtap_hdr *)message_plus_header; |
| 68 | uint8_t * msg_elements = (uint8_t *)(message_plus_header+sizeof(gsmtap_hdr)); |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 69 | struct gsm_sysinfo_freq freq[1024]; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 70 | |
| 71 | if(msg_elements[2]==0x1b){ |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 72 | chan_info info; |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 73 | info.id = be16toh(header->arfcn); //take arfcn |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 74 | info.pwr_db = header->signal_dbm; |
ptrkrysik | a31a481 | 2014-12-15 09:10:01 +0100 | [diff] [blame] | 75 | info.cell_id = (msg_elements[3]<<8)+msg_elements[4]; //take cell id |
| 76 | info.lac = (msg_elements[8]<<8)+msg_elements[9]; //take lac |
Roman Khassraf | a1dd7ee | 2015-09-26 17:20:49 +0200 | [diff] [blame] | 77 | info.mcc = ((msg_elements[5] & 0xF) * 100) + (((msg_elements[5] & 0xF0) >> 4) * 10) + ((msg_elements[6] & 0xF)); // take mcc |
| 78 | info.mnc = (msg_elements[7] & 0xF) * 10 + (msg_elements[7]>>4); //take mnc |
Roman Khassraf | ddd096e | 2016-11-28 21:57:19 +0100 | [diff] [blame] | 79 | if (((msg_elements[6] & 0xF0) >> 4) < 10) // we have a 3 digit mnc, see figure 10.5.3 of 3GPP TS 24.008 |
| 80 | { |
| 81 | info.mnc *= 10; |
| 82 | info.mnc += (msg_elements[6] & 0xF0) >> 4; |
| 83 | } |
| 84 | |
Roman Khassraf | 9f4feb5 | 2015-09-26 18:44:56 +0200 | [diff] [blame] | 85 | info.ccch_conf = (msg_elements[10] & 0x7); // ccch_conf |
| 86 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 87 | boost::mutex::scoped_lock lock(extract_mutex); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 88 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 89 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 90 | } else { |
| 91 | d_c0_channels[info.id] = info; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 92 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 93 | } |
| 94 | else if(msg_elements[2]==0x1c){ |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 95 | chan_info info; |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 96 | info.id = be16toh(header->arfcn); //take arfcn |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 97 | info.pwr_db = header->signal_dbm; |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 98 | info.lac = (msg_elements[6]<<8)+msg_elements[7]; //take lac |
Piotr Krysik | 34935e9 | 2015-11-22 08:07:02 +0100 | [diff] [blame] | 99 | info.mcc = ((msg_elements[3] & 0xF) * 100) + (((msg_elements[3] & 0xF0) >> 4) * 10) + ((msg_elements[4] & 0xF)); // take mcc |
Roman Khassraf | a1dd7ee | 2015-09-26 17:20:49 +0200 | [diff] [blame] | 100 | info.mnc = (msg_elements[5] & 0xF) * 10 + (msg_elements[5]>>4); //take mnc |
Roman Khassraf | ddd096e | 2016-11-28 21:57:19 +0100 | [diff] [blame] | 101 | if (((msg_elements[4] & 0xF0) >> 4) < 10) // we have a 3 digit mnc, see figure 10.5.3 of 3GPP TS 24.008 |
| 102 | { |
| 103 | info.mnc *= 10; |
| 104 | info.mnc += (msg_elements[4] & 0xF0) >> 4; |
| 105 | } |
Roman Khassraf | a1dd7ee | 2015-09-26 17:20:49 +0200 | [diff] [blame] | 106 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 107 | boost::mutex::scoped_lock lock(extract_mutex); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 108 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 109 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 110 | } else { |
| 111 | d_c0_channels[info.id] = info; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 112 | } |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 113 | } |
| 114 | else if(msg_elements[2]==0x1a){ //System Information Type 2 |
| 115 | memset(freq, 0, sizeof(freq)); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 116 | chan_info info; |
| 117 | info.id = be16toh(header->arfcn); //take arfcn |
| 118 | info.pwr_db = header->signal_dbm; |
| 119 | boost::mutex::scoped_lock lock(extract_mutex); |
| 120 | //read neighbour cells |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 121 | gsm48_decode_freq_list(freq, &msg_elements[3], 16, 0xce, 0x01); |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 122 | |
| 123 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 124 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 125 | } else { |
| 126 | d_c0_channels[info.id] = info; |
| 127 | } |
ptrkrysik | 5e37674 | 2015-08-06 10:02:04 +0200 | [diff] [blame] | 128 | |
| 129 | for(int arfcn=0; arfcn<sizeof(freq); arfcn++){ |
| 130 | if(freq[arfcn].mask==0x01){ |
| 131 | d_c0_channels[info.id].neighbour_cells.insert(arfcn); |
| 132 | } |
| 133 | } |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 134 | } |
| 135 | else if(msg_elements[2]==0x02){ //System Information Type 2bis |
| 136 | memset(freq, 0, sizeof(freq)); |
| 137 | chan_info info; |
| 138 | info.id = be16toh(header->arfcn); //take arfcn |
| 139 | info.pwr_db = header->signal_dbm; |
| 140 | boost::mutex::scoped_lock lock(extract_mutex); |
| 141 | //read neighbour cells |
| 142 | gsm48_decode_freq_list(freq, &msg_elements[3], 16, 0xce, 0x01); |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 143 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 144 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 145 | } else { |
| 146 | d_c0_channels[info.id] = info; |
| 147 | } |
ptrkrysik | 5e37674 | 2015-08-06 10:02:04 +0200 | [diff] [blame] | 148 | |
| 149 | for(int arfcn=0; arfcn<sizeof(freq); arfcn++){ |
| 150 | if(freq[arfcn].mask==0x01){ |
| 151 | d_c0_channels[info.id].neighbour_cells.insert(arfcn); |
| 152 | } |
| 153 | } |
ptrkrysik | 0940538 | 2015-08-02 22:02:52 +0200 | [diff] [blame] | 154 | } |
| 155 | else if(msg_elements[2]==0x03){ //System Information Type 2ter |
| 156 | memset(freq, 0, sizeof(freq)); |
| 157 | chan_info info; |
| 158 | info.id = be16toh(header->arfcn); //take arfcn |
| 159 | info.pwr_db = header->signal_dbm; |
| 160 | boost::mutex::scoped_lock lock(extract_mutex); |
| 161 | //read neighbour cells |
| 162 | gsm48_decode_freq_list(freq, &msg_elements[3], 16, 0x8e, 0x01); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 163 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 164 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 165 | } else { |
| 166 | d_c0_channels[info.id] = info; |
| 167 | } |
ptrkrysik | 5e37674 | 2015-08-06 10:02:04 +0200 | [diff] [blame] | 168 | |
| 169 | for(int arfcn=0; arfcn<sizeof(freq); arfcn++){ |
| 170 | if(freq[arfcn].mask==0x01){ |
| 171 | d_c0_channels[info.id].neighbour_cells.insert(arfcn); |
| 172 | } |
| 173 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 174 | } |
Roman Khassraf | 74efd10 | 2015-09-27 10:49:23 +0200 | [diff] [blame] | 175 | else if(msg_elements[2]==0x19) |
| 176 | { //System Information Type 1 |
| 177 | memset(freq, 0, sizeof(freq)); |
| 178 | chan_info info; |
| 179 | info.id = be16toh(header->arfcn); //take arfcn |
| 180 | info.pwr_db = header->signal_dbm; |
| 181 | boost::mutex::scoped_lock lock(extract_mutex); |
| 182 | //read cell arfcn's |
Piotr Krysik | b31689d | 2017-06-11 20:30:56 +0200 | [diff] [blame] | 183 | gsm48_decode_freq_list(freq, &msg_elements[3], 16, 0x8e, 0x01); |
Roman Khassraf | 74efd10 | 2015-09-27 10:49:23 +0200 | [diff] [blame] | 184 | if(d_c0_channels.find(info.id) != d_c0_channels.end()){ |
| 185 | d_c0_channels[info.id].copy_nonzero_elements(info); |
| 186 | } else { |
| 187 | d_c0_channels[info.id] = info; |
| 188 | } |
| 189 | |
| 190 | for(int arfcn=0; arfcn<sizeof(freq); arfcn++){ |
| 191 | if(freq[arfcn].mask==0x01){ |
| 192 | d_c0_channels[info.id].cell_arfcns.insert(arfcn); |
| 193 | } |
| 194 | } |
| 195 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 196 | } |
| 197 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 198 | std::vector<int> extract_system_info_impl::get_chans() |
| 199 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 200 | std::vector<int> chans_ids; |
| 201 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 202 | chans_ids.push_back(i.second.id); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 203 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 204 | return chans_ids; |
| 205 | } |
| 206 | |
| 207 | std::vector<int> extract_system_info_impl::get_lac() |
| 208 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 209 | std::vector<int> lacs; |
| 210 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 211 | lacs.push_back(i.second.lac); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 212 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 213 | return lacs; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 214 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 215 | |
Roman Khassraf | a1dd7ee | 2015-09-26 17:20:49 +0200 | [diff] [blame] | 216 | std::vector<int> extract_system_info_impl::get_mcc() |
| 217 | { |
| 218 | std::vector<int> mccs; |
| 219 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 220 | mccs.push_back(i.second.mcc); |
| 221 | } |
| 222 | return mccs; |
| 223 | } |
| 224 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 225 | std::vector<int> extract_system_info_impl::get_mnc() |
| 226 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 227 | std::vector<int> mncs; |
| 228 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 229 | mncs.push_back(i.second.mnc); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 230 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 231 | return mncs; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 232 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 233 | |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 234 | std::vector<int> extract_system_info_impl::get_cell_id() |
| 235 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 236 | std::vector<int> cell_ids; |
| 237 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 238 | cell_ids.push_back(i.second.cell_id); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 239 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 240 | return cell_ids; |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | std::vector<int> extract_system_info_impl::get_pwrs() |
| 244 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 245 | std::vector<int> pwrs; |
| 246 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 247 | pwrs.push_back(i.second.pwr_db); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 248 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 249 | return pwrs; |
| 250 | } |
Roman Khassraf | a1dd7ee | 2015-09-26 17:20:49 +0200 | [diff] [blame] | 251 | |
Roman Khassraf | 9f4feb5 | 2015-09-26 18:44:56 +0200 | [diff] [blame] | 252 | std::vector<int> extract_system_info_impl::get_ccch_conf() |
| 253 | { |
| 254 | std::vector<int> ccch_confs; |
| 255 | BOOST_FOREACH(chan_info_map::value_type &i, d_c0_channels){ |
| 256 | ccch_confs.push_back(i.second.ccch_conf); |
| 257 | } |
| 258 | return ccch_confs; |
| 259 | } |
| 260 | |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 261 | std::vector<int> extract_system_info_impl::get_neighbours(int chan_id) |
| 262 | { |
| 263 | std::vector<int> neighbour_cells; |
| 264 | BOOST_FOREACH(int n, d_c0_channels[chan_id].neighbour_cells){ |
| 265 | neighbour_cells.push_back(n); |
| 266 | } |
| 267 | return neighbour_cells; |
| 268 | } |
Roman Khassraf | 74efd10 | 2015-09-27 10:49:23 +0200 | [diff] [blame] | 269 | |
| 270 | std::vector<int> extract_system_info_impl::get_cell_arfcns(int chan_id) |
| 271 | { |
| 272 | std::vector<int> cell_arfcns; |
| 273 | BOOST_FOREACH(int n, d_c0_channels[chan_id].cell_arfcns){ |
| 274 | cell_arfcns.push_back(n); |
| 275 | } |
| 276 | return cell_arfcns; |
| 277 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 278 | |
| 279 | void extract_system_info_impl::reset() |
| 280 | { |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 281 | d_c0_channels.clear(); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 282 | if(!empty_p(pmt::mp("bursts"))){ |
Piotr Krysik | d01e222 | 2016-08-18 18:58:46 +0200 | [diff] [blame] | 283 | // delete_head_blocking(pmt::mp("bursts")); |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 284 | } |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 285 | if(!empty_p(pmt::mp("msgs"))){ |
Piotr Krysik | d01e222 | 2016-08-18 18:58:46 +0200 | [diff] [blame] | 286 | // delete_head_blocking(pmt::mp("msgs")); |
ptrkrysik | e9539c1 | 2015-07-06 08:34:22 +0200 | [diff] [blame] | 287 | } |
piotr | dda2227 | 2014-08-04 11:31:54 +0200 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | extract_system_info::sptr |
| 291 | extract_system_info::make() |
| 292 | { |
| 293 | return gnuradio::get_initial_sptr |
| 294 | (new extract_system_info_impl()); |
| 295 | } |
| 296 | |
| 297 | /* |
| 298 | * The private constructor |
| 299 | */ |
| 300 | extract_system_info_impl::extract_system_info_impl() |
| 301 | : gr::block("extract_system_info", |
| 302 | gr::io_signature::make(0, 0, 0), |
| 303 | gr::io_signature::make(0, 0, 0)), |
| 304 | after_reset(false) |
| 305 | { |
| 306 | message_port_register_in(pmt::mp("bursts")); |
| 307 | set_msg_handler(pmt::mp("bursts"), boost::bind(&extract_system_info_impl::process_bursts, this, _1)); |
| 308 | message_port_register_in(pmt::mp("msgs")); |
| 309 | set_msg_handler(pmt::mp("msgs"), boost::bind(&extract_system_info_impl::process_sysinfo, this, _1)); |
| 310 | } |
| 311 | |
| 312 | /* |
| 313 | * Our virtual destructor. |
| 314 | */ |
| 315 | extract_system_info_impl::~extract_system_info_impl() |
| 316 | { |
| 317 | } |
| 318 | |
| 319 | |
| 320 | } /* namespace gsm */ |
| 321 | } /* namespace gr */ |
| 322 | |