コード例 #1
0
    def __init__(self, burst_file, timeslot, subchannel, mode, fnr_start):
        gr.top_block.__init__(self, "Top Block")

        self.burst_file_source = grgsm.burst_file_source(burst_file)
        self.timeslot_filter = grgsm.burst_timeslot_filter(timeslot)
        self.fnr_filter_start = grgsm.burst_fnr_filter(grgsm.FILTER_GREATER_OR_EQUAL, fnr_start)
        # we only listen for a timespan of 12 SDCCH messages for the CMC
        self.fnr_filter_end = grgsm.burst_fnr_filter(grgsm.FILTER_LESS_OR_EQUAL, fnr_start + 51 * 10000)

        if mode == "BCCH_SDCCH4":
            self.subchannel_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH4, subchannel)
            self.demapper = grgsm.gsm_bcch_ccch_sdcch4_demapper(timeslot_nr=timeslot, )
        else:
            self.subchannel_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH8, subchannel)
            self.demapper = grgsm.gsm_sdcch8_demapper(timeslot_nr=timeslot, )

        self.demapper = grgsm.gsm_sdcch8_demapper(timeslot_nr=timeslot, )
        self.decoder = grgsm.control_channels_decoder()
        self.extract_cmc = grgsm.extract_cmc()

        self.msg_connect((self.burst_file_source, 'out'), (self.timeslot_filter, 'in'))
        self.msg_connect((self.timeslot_filter, 'out'), (self.subchannel_filter, 'in'))
        self.msg_connect((self.subchannel_filter, 'out'), (self.fnr_filter_start, 'in'))
        self.msg_connect((self.fnr_filter_start, 'out'), (self.fnr_filter_end, 'in'))
        self.msg_connect((self.fnr_filter_end, 'out'), (self.demapper, 'bursts'))
        self.msg_connect((self.demapper, 'bursts'), (self.decoder, 'bursts'))
        self.msg_connect((self.decoder, 'msgs'), (self.extract_cmc, 'msgs'))
コード例 #2
0
    def __init__(self, timeslot, burst_file, mode, show_gprs):
        gr.top_block.__init__(self, "Top Block")

        self.gsm_burst_file_source = grgsm.burst_file_source(burst_file)
        self.gsm_burst_timeslot_filter = grgsm.burst_timeslot_filter(timeslot)

        if mode == 'BCCH_SDCCH4':
            self.demapper = grgsm.gsm_bcch_ccch_sdcch4_demapper(
                timeslot_nr=timeslot, )
        else:
            self.demapper = grgsm.gsm_sdcch8_demapper(timeslot_nr=timeslot, )

        self.gsm_control_channels_decoder = grgsm.control_channels_decoder()
        self.gsm_extract_cmc = grgsm.extract_cmc()
        self.gsm_extract_immediate_assignment = grgsm.extract_immediate_assignment(
            False, not show_gprs, True)
        self.gsm_extract_system_info = grgsm.extract_system_info()

        self.msg_connect((self.gsm_burst_file_source, 'out'),
                         (self.gsm_burst_timeslot_filter, 'in'))
        self.msg_connect((self.gsm_burst_timeslot_filter, 'out'),
                         (self.demapper, 'bursts'))
        self.msg_connect((self.demapper, 'bursts'),
                         (self.gsm_control_channels_decoder, 'bursts'))
        self.msg_connect((self.gsm_control_channels_decoder, 'msgs'),
                         (self.gsm_extract_cmc, 'msgs'))
        self.msg_connect((self.gsm_control_channels_decoder, 'msgs'),
                         (self.gsm_extract_immediate_assignment, 'msgs'))
        self.msg_connect((self.gsm_control_channels_decoder, 'msgs'),
                         (self.gsm_extract_system_info, 'msgs'))
コード例 #3
0
    def __init__(self):
        gr.hier_block2.__init__(
            self, "Cmc Analyzer Block",
            gr.io_signature(0, 0, 0),
            gr.io_signature(0, 0, 0),
        )
        self.message_port_register_hier_in("in")

        self.decoder = grgsm.control_channels_decoder()
        self.extract_system_info = grgsm.extract_system_info()
        self.extract_cmc = grgsm.extract_cmc()
        self.collect_system_info = grgsm.collect_system_info()

        self.msg_connect((self.decoder, 'msgs'), (self.extract_cmc, 'msgs'))
        self.msg_connect((self.decoder, 'msgs'), (self.extract_system_info, 'msgs'))
        self.msg_connect((self.decoder, 'msgs'), (self.collect_system_info, 'msgs'))
        self.msg_connect((self, 'in'), (self.decoder, 'bursts'))