Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python2 |
Piotr Krysik | 773a194 | 2016-05-20 12:45:54 +0200 | [diff] [blame] | 2 | # -*- coding: utf-8 -*- |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 3 | # @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | # @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com> |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +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 | # | ||||
Piotr Krysik | 773a194 | 2016-05-20 12:45:54 +0200 | [diff] [blame] | 22 | ################################################## |
23 | # GNU Radio Python Flow Graph | ||||
24 | # Title: BCCH + CCCH demapper | ||||
25 | # Author: Piotr Krysik | ||||
26 | # Description: Demapper for BCCH + CCCH control channels. This corresponds to channel combination iv specified in GSM 05.02, section 6.4 | ||||
Piotr Krysik | e5bd4b8 | 2016-05-23 09:43:05 +0200 | [diff] [blame] | 27 | # Generated: Mon May 23 09:32:44 2016 |
Piotr Krysik | 773a194 | 2016-05-20 12:45:54 +0200 | [diff] [blame] | 28 | ################################################## |
29 | |||||
30 | from gnuradio import gr | ||||
31 | from gnuradio.filter import firdes | ||||
32 | import grgsm | ||||
33 | |||||
34 | |||||
35 | class gsm_bcch_ccch_demapper(grgsm.hier_block): | ||||
36 | |||||
37 | def __init__(self, timeslot_nr=0): | ||||
38 | grgsm.hier_block.__init__( | ||||
39 | self, "BCCH + CCCH demapper", | ||||
40 | gr.io_signature(0, 0, 0), | ||||
41 | gr.io_signature(0, 0, 0), | ||||
42 | ) | ||||
43 | self.message_port_register_hier_in("bursts") | ||||
44 | self.message_port_register_hier_out("bursts") | ||||
45 | |||||
46 | ################################################## | ||||
47 | # Parameters | ||||
48 | ################################################## | ||||
49 | self.timeslot_nr = timeslot_nr | ||||
50 | |||||
51 | ################################################## | ||||
52 | # Blocks | ||||
53 | ################################################## | ||||
Piotr Krysik | e5bd4b8 | 2016-05-23 09:43:05 +0200 | [diff] [blame] | 54 | self.gsm_universal_ctrl_chans_demapper_0 = grgsm.universal_ctrl_chans_demapper(timeslot_nr, ([0,0,2,2,2,2,6,6,6,6,0,0,12,12,12,12,16,16,16,16,0,0,22,22,22,22,26,26,26,26,0,0,32,32,32,32,36,36,36,36,0,0,42,42,42,42,46,46,46,46,0,]), ([0,0,1,1,1,1,2,2,2,2,0,0,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,0,]), ([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,0,0,3,3,3,3,4,4,4,4,0,0,5,5,5,5,6,6,6,6,0,0,7,7,7,7,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,0,0,3,3,3,3,4,4,4,4,0,0,5,5,5,5,6,6,6,6,0,0,7,7,7,7,8,8,8,8,0]), ([0,0,0,0,0,0,6,6,6,6,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,37,37,37,41,41,41,41,0,0,47,47,47,47]), ([2,2,2,2,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,2,2,2,2,]), ([0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,0,0,3,3,3,3,0,0,0,0,0,0,2,2,2,2,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,0,0,3,3,3,3])) |
Piotr Krysik | 773a194 | 2016-05-20 12:45:54 +0200 | [diff] [blame] | 55 | |
56 | ################################################## | ||||
57 | # Connections | ||||
58 | ################################################## | ||||
59 | self.msg_connect((self.gsm_universal_ctrl_chans_demapper_0, 'bursts'), (self, 'bursts')) | ||||
60 | self.msg_connect((self, 'bursts'), (self.gsm_universal_ctrl_chans_demapper_0, 'bursts')) | ||||
61 | |||||
62 | def get_timeslot_nr(self): | ||||
63 | return self.timeslot_nr | ||||
64 | |||||
65 | def set_timeslot_nr(self, timeslot_nr): | ||||
66 | self.timeslot_nr = timeslot_nr |