def __init__(self, fc=943.6e6, shiftoff=400e3, ppm=0, gain=30, samp_rate=2000000.052982): gr.top_block.__init__(self, "Decode Raw Nogui") ################################################## # Parameters ################################################## self.fc = fc self.shiftoff = shiftoff self.ppm = ppm self.gain = gain self.samp_rate = samp_rate ################################################## # Blocks ################################################## self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, "/tmp/gsm_raw", False) ################################################## # Connections ################################################## self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.blocks_file_source_0, 0), (self.blocks_rotator_cc_0, 0)) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.gsm_bcch_ccch_demapper_0, "bursts", self.gsm_control_channels_decoder_0, "bursts") self.msg_connect(self.gsm_clock_offset_control_0, "ppm", self.gsm_input_0, "ppm_in") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_decryption_0, "bursts", self.gsm_control_channels_decoder_0_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_bcch_ccch_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_sdcch8_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "measurements", self.gsm_clock_offset_control_0, "measurements") self.msg_connect(self.gsm_sdcch8_demapper_0, "bursts", self.gsm_decryption_0, "bursts")
def __init__(self): gr.top_block.__init__(self, "Uplink decoding demo") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 ################################################## # Blocks ################################################## self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(timeslot_nr=1) self.gsm_receiver_with_uplink_0 = grgsm.receiver(4, ([0]), ([2]), True) self.gsm_message_printer_0_0 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0_0 = grgsm.gsm_input(ppm=0, osr=4, fc=947.8e6 - 45e6, samp_rate_in=samp_rate) self.gsm_input_0 = grgsm.gsm_input(ppm=0, osr=4, fc=947.8e6, samp_rate_in=samp_rate) self.gsm_decryption_0_3 = grgsm.decryption(([0x46, 0x77, 0x2D, 0x54, 0xA3, 0xA3, 0xC3, 0x1C]), 1) self.gsm_control_channels_decoder_0_1_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0_1 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(947.8e6) self.blocks_socket_pdu_0_0_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_file_source_0_0 = blocks.file_source(gr.sizeof_gr_complex * 1, "sms_multirtl_uplink_tail", False) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex * 1, "sms_multirtl_downlink_tail", False) ################################################## # Connections ################################################## self.msg_connect((self.gsm_clock_offset_control_0, "ppm"), (self.gsm_input_0, "ppm_in")) self.msg_connect((self.gsm_clock_offset_control_0, "ppm"), (self.gsm_input_0_0, "ppm_in")) self.msg_connect((self.gsm_control_channels_decoder_0_1, "msgs"), (self.blocks_socket_pdu_0_0_0, "pdus")) self.msg_connect((self.gsm_control_channels_decoder_0_1, "msgs"), (self.gsm_message_printer_0_0, "msgs")) self.msg_connect((self.gsm_control_channels_decoder_0_1_0, "msgs"), (self.blocks_socket_pdu_0_0_0, "pdus")) self.msg_connect((self.gsm_control_channels_decoder_0_1_0, "msgs"), (self.gsm_message_printer_0_0, "msgs")) self.msg_connect((self.gsm_decryption_0_3, "bursts"), (self.gsm_control_channels_decoder_0_1_0, "bursts")) self.msg_connect( (self.gsm_receiver_with_uplink_0, "measurements"), (self.gsm_clock_offset_control_0, "measurements") ) self.msg_connect((self.gsm_receiver_with_uplink_0, "C0"), (self.gsm_sdcch8_demapper_0, "bursts")) self.msg_connect((self.gsm_sdcch8_demapper_0, "bursts"), (self.gsm_control_channels_decoder_0_1, "bursts")) self.msg_connect((self.gsm_sdcch8_demapper_0, "bursts"), (self.gsm_decryption_0_3, "bursts")) self.connect((self.blocks_file_source_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_file_source_0_0, 0), (self.gsm_input_0_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_with_uplink_0, 0)) self.connect((self.gsm_input_0_0, 0), (self.gsm_receiver_with_uplink_0, 1))
def test_004_a53(self): """ An assignment command for a TCH channel, encrypted with A5/3 """ framenumbers_input = [435897, 435898, 435899, 435900] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001001000010110001000001101001010100000011100011011110101011101001111101100010100111111010000100000100101101111000010001100001000100101100101010000", "0000011101010011010110101000011011101010100001011001100011001101001111101100010100111111000110011001110101110111000100101001111100110100011011011000", "0000000000110011000001110101110101111011011111000111101001011101001111101100010100111111101100010011010000010001101101000110000011011000011100011000", "0000000001110011001010110101100110100111110010000101001011111101001111101100010100111111101110001101111111001001001000101101010110010101010110100000", ] bursts_expected = [ "0001101100011001110111101010110000001111000010110011000110101101001111101100010100111111100010000011100010101001010110101100001111101111110010011000", "0001101001110110000111000011111110011011001001101010011000001101001111101100010100111111110010001001001001101011111010010100100011100110110000011000", "0001000001110000001011101010011010010100010010100110010010001101001111101100010100111111010011011101010110100000111111011111100000010100000111000000", "0000001000001010010001010000101011101100100100001010011101111101001111101100010100111111000001001001100100101010000011101010100001110000100000001000" ] key = [0xAD, 0x2C, 0xB3, 0x83, 0x2F, 0x4A, 0x6C, 0xF1] a5_version = 3 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run() # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_001_a51(self): """ A system information message on the SACCH of TCH/F, encrypted with A5/1 """ framenumbers_input = [1259192, 1259218, 1259244, 1259270] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001100001000111100111101111100101000100101011000010011110011101001111101100010100111111100000110100011111101011101100100111110011000100010001010000", "0001000101000000001001111110000110010110110111110111101000001101001111101100010100111111001110001001110101110001010001000111011010010001011011000000", "0001001101101101000111001000101011001101001110110001001100111101001111101100010100111111111001001010011010011111010010010101011001001011011100110000", "0000010010100000001001101010100001011100010001101100111111101101001111101100010100111111101101001110100010101110010110101111100010010000110010110000" ] bursts_expected = [ "0000010111000110010001010000000101010011110101100000100000011101001111101100010100111111010110110000000001101110000101000000000101000100011000110000", "0000010110101100010100111101011001000000000101010011000100001101001111101100010100111111011001101001110000100001000110000000101100010111100111010000", "0000011110110111011011100001010000000000110100100000100001001101001111101100010100111111100010000000000000001101000000100000010011001110100000010000", "0000011000010001000000001101000001001001000010001000000000001101001111101100010100111111000010110001001110000000110111001110010000010111000111001000" ] key = [0x32, 0xE5, 0x45, 0x53, 0x20, 0x8C, 0xE0, 0x00] a5_version = 1 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run() # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_003_a53(self): """ A cp-ack message of a SMS, encrypted with A5/3 """ framenumbers_input = [1935011, 1935012, 1935013, 1935014] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001111001001110001101111101111111110100011010101100100001011101001111101100010100111111101101011110100011101111001000110110100101101011110010100000", "0001111000110011010110000111010010100101001100111011000001011101001111101100010100111111000100101000001011010001100000010100011000011111001111011000", "0000000110100101110010011101101100101110001100000000101001011101001111101100010100111111100100100010110110111011010101010001001100010100100100111000", "0000011100111011101010000111001010010001100110011011100101011101001111101100010100111111101110110100101101010100111101000000111001011011100010101000" ] bursts_expected = [ "0001000000000010100111000010010101001010011110010010101110011101001111101100010100111111011010111010111100110000011100111010001010100010100110000000", "0000101110001111011110100111101010000000101101101011101001011101001111101100010100111111010110100111001100100011000100100011110101001010110001001000", "0000001111011010110111000100111111000011001010100011000110011101001111101100010100111111100111100010011100000010110011100001101000000000000011001000", "0000011011100010001000101000101010010011010000100011110011001101001111101100010100111111010100100010010100111010101110001101101110101110011100101000" ] key = [0x41, 0xBC, 0x19, 0x30, 0xB6, 0x31, 0x8A, 0xC8] a5_version = 3 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run() # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_002_a51(self): """ A TMSI Reallocation command on SDCCH/8, encrypted with A5/1 """ framenumbers_input = [2569043, 2569044, 2569045, 2569046] timeslots_input = [4, 4, 4, 4] bursts_input = [ "0000111101111110011111000111000100110100001101100001000110011000110101110010000011010111010110101100100010011000000100111010001000011000010010010000", "0001010010001100110000000111100110101111001001101111000000101000110101110010000011010111001101001101000001000001110101101100101111010011001000111000", "0001110111101000110100001111000010100001101011000001010010011000110101110010000011010111101110000011100010110110101010100101010011011111111001000000", "0001111011000100011010100010000110001101111001000110010100001000110101110010000011010111000100101011110110000100110110001110010011110110110101100000" ] bursts_expected = [ "0001100000010010011110111110011111000000001010001111000000001000110101110010000011010111100101101010000001111010100010110111101011101011100000101000", "0001000101111101111110000010100001011011111010111110101011101000110101110010000011010111110110111101101111110000011011010111011111001011101000011000", "0000001000011110111110101011001000110000000000110110101100011000110101110010000011010111001010100101011111001000111100000100000111111000000101110000", "0001101010111110010001010110101100000011101100011111110100101000110101110010000011010111111000000001010010111001111111011001000000001001000011101000" ] key = [0xAD, 0x6A, 0x3E, 0xC2, 0xB4, 0x42, 0xE4, 0x00] a5_version = 1 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run() # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_002_a51 (self): """ A TMSI Reallocation command on SDCCH/8, encrypted with A5/1 """ framenumbers_input = [2569043, 2569044, 2569045, 2569046] timeslots_input = [4, 4, 4, 4] bursts_input = [ "0000111101111110011111000111000100110100001101100001000110011000110101110010000011010111010110101100100010011000000100111010001000011000010010010000", "0001010010001100110000000111100110101111001001101111000000101000110101110010000011010111001101001101000001000001110101101100101111010011001000111000", "0001110111101000110100001111000010100001101011000001010010011000110101110010000011010111101110000011100010110110101010100101010011011111111001000000", "0001111011000100011010100010000110001101111001000110010100001000110101110010000011010111000100101011110110000100110110001110010011110110110101100000" ] bursts_expected = [ "0001100000010010011110111110011111000000001010001111000000001000110101110010000011010111100101101010000001111010100010110111101011101011100000101000", "0001000101111101111110000010100001011011111010111110101011101000110101110010000011010111110110111101101111110000011011010111011111001011101000011000", "0000001000011110111110101011001000110000000000110110101100011000110101110010000011010111001010100101011111001000111100000100000111111000000101110000", "0001101010111110010001010110101100000011101100011111110100101000110101110010000011010111111000000001010010111001111111011001000000001001000011101000" ] key = [0xAD,0x6A,0x3E,0xC2,0xB4,0x42,0xE4,0x00] a5_version = 1 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run () # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_001_a51 (self): """ A system information message on the SACCH of TCH/F, encrypted with A5/1 """ framenumbers_input = [1259192, 1259218, 1259244, 1259270] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001100001000111100111101111100101000100101011000010011110011101001111101100010100111111100000110100011111101011101100100111110011000100010001010000", "0001000101000000001001111110000110010110110111110111101000001101001111101100010100111111001110001001110101110001010001000111011010010001011011000000", "0001001101101101000111001000101011001101001110110001001100111101001111101100010100111111111001001010011010011111010010010101011001001011011100110000", "0000010010100000001001101010100001011100010001101100111111101101001111101100010100111111101101001110100010101110010110101111100010010000110010110000" ] bursts_expected = [ "0000010111000110010001010000000101010011110101100000100000011101001111101100010100111111010110110000000001101110000101000000000101000100011000110000", "0000010110101100010100111101011001000000000101010011000100001101001111101100010100111111011001101001110000100001000110000000101100010111100111010000", "0000011110110111011011100001010000000000110100100000100001001101001111101100010100111111100010000000000000001101000000100000010011001110100000010000", "0000011000010001000000001101000001001001000010001000000000001101001111101100010100111111000010110001001110000000110111001110010000010111000111001000" ] key = [0x32,0xE5,0x45,0x53,0x20,0x8C,0xE0,0x00] a5_version = 1 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run () # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_003_a53 (self): """ A cp-ack message of a SMS, encrypted with A5/3 """ framenumbers_input = [1935011, 1935012, 1935013, 1935014] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001111001001110001101111101111111110100011010101100100001011101001111101100010100111111101101011110100011101111001000110110100101101011110010100000", "0001111000110011010110000111010010100101001100111011000001011101001111101100010100111111000100101000001011010001100000010100011000011111001111011000", "0000000110100101110010011101101100101110001100000000101001011101001111101100010100111111100100100010110110111011010101010001001100010100100100111000", "0000011100111011101010000111001010010001100110011011100101011101001111101100010100111111101110110100101101010100111101000000111001011011100010101000" ] bursts_expected = [ "0001000000000010100111000010010101001010011110010010101110011101001111101100010100111111011010111010111100110000011100111010001010100010100110000000", "0000101110001111011110100111101010000000101101101011101001011101001111101100010100111111010110100111001100100011000100100011110101001010110001001000", "0000001111011010110111000100111111000011001010100011000110011101001111101100010100111111100111100010011100000010110011100001101000000000000011001000", "0000011011100010001000101000101010010011010000100011110011001101001111101100010100111111010100100010010100111010101110001101101110101110011100101000" ] key = [0x41,0xBC,0x19,0x30,0xB6,0x31,0x8A,0xC8] a5_version = 3 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run () # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def test_004_a53 (self): """ An assignment command for a TCH channel, encrypted with A5/3 """ framenumbers_input = [435897, 435898, 435899, 435900] timeslots_input = [2, 2, 2, 2] bursts_input = [ "0001001000010110001000001101001010100000011100011011110101011101001111101100010100111111010000100000100101101111000010001100001000100101100101010000", "0000011101010011010110101000011011101010100001011001100011001101001111101100010100111111000110011001110101110111000100101001111100110100011011011000", "0000000000110011000001110101110101111011011111000111101001011101001111101100010100111111101100010011010000010001101101000110000011011000011100011000", "0000000001110011001010110101100110100111110010000101001011111101001111101100010100111111101110001101111111001001001000101101010110010101010110100000", ] bursts_expected = [ "0001101100011001110111101010110000001111000010110011000110101101001111101100010100111111100010000011100010101001010110101100001111101111110010011000", "0001101001110110000111000011111110011011001001101010011000001101001111101100010100111111110010001001001001101011111010010100100011100110110000011000", "0001000001110000001011101010011010010100010010100110010010001101001111101100010100111111010011011101010110100000111111011111100000010100000111000000", "0000001000001010010001010000101011101100100100001010011101111101001111101100010100111111000001001001100100101010000011101010100001110000100000001000" ] key = [0xAD,0x2C,0xB3,0x83,0x2F,0x4A,0x6C,0xF1] a5_version = 3 src = grgsm.burst_source(framenumbers_input, timeslots_input, bursts_input) decryption = grgsm.decryption((key), a5_version) dst = grgsm.burst_sink() self.tb.msg_connect(src, "out", decryption, "bursts") self.tb.msg_connect(decryption, "bursts", dst, "in") self.tb.run () # have to convert tuple to list framenumbers_result = list(dst.get_framenumbers()) timeslots_result = list(dst.get_timeslots()) bursts_result = list(dst.get_burst_data()) self.assertEqual(framenumbers_input, framenumbers_result) self.assertEqual(timeslots_input, timeslots_result) self.assertEqual(bursts_expected, bursts_result)
def __init__(self, fc=943.6e6, shiftoff=400e3, ppm=0, gain=30, samp_rate=2000000.052982): gr.top_block.__init__(self, "Decode Bursts Nogui") ################################################## # Parameters ################################################## self.fc = fc self.shiftoff = shiftoff self.ppm = ppm self.gain = gain self.samp_rate = samp_rate ################################################## # Blocks ################################################## self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_burst_file_source_0 = grgsm.burst_file_source("/tmp/bursts") self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.gsm_sdcch8_demapper_0, "bursts", self.gsm_decryption_0, "bursts") self.msg_connect(self.gsm_decryption_0, "bursts", self.gsm_control_channels_decoder_0_0, "bursts") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_bcch_ccch_demapper_0, "bursts", self.gsm_control_channels_decoder_0, "bursts") self.msg_connect(self.gsm_burst_file_source_0, "out", self.gsm_bcch_ccch_demapper_0, "bursts") self.msg_connect(self.gsm_burst_file_source_0, "out", self.gsm_sdcch8_demapper_0, "bursts")
def __init__(self, fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3): gr.top_block.__init__(self, "Airprobe Rtlsdr") Qt.QWidget.__init__(self) self.setWindowTitle("Airprobe Rtlsdr") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "airprobe_rtlsdr") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.fc = fc self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff ################################################## # Variables ################################################## self.ppm_slider = ppm_slider = ppm self.g_slider = g_slider = gain self.fc_slider = fc_slider = fc ################################################## # Blocks ################################################## self._ppm_slider_range = Range(-150, 150, 1, ppm, 100) self._ppm_slider_win = RangeWidget(self._ppm_slider_range, self.set_ppm_slider, "PPM Offset", "counter", float) self.top_layout.addWidget(self._ppm_slider_win) self._g_slider_range = Range(0, 50, 0.5, gain, 100) self._g_slider_win = RangeWidget(self._g_slider_range, self.set_g_slider, "Gain", "counter", float) self.top_layout.addWidget(self._g_slider_win) self._fc_slider_range = Range(925e6, 1990e6, 2e5, fc, 100) self._fc_slider_win = RangeWidget(self._fc_slider_range, self.set_fc_slider, "Frequency", "counter_slider", float) self.top_layout.addWidget(self._fc_slider_win) self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(fc_slider-shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(ppm_slider, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(g_slider, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(shiftoff), 0) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype fc_slider, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if complex == type(float()): self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0))
def __init__(self, fc=943.6e6, shiftoff=400e3, ppm=0, gain=30, samp_rate=2000000.052982): gr.top_block.__init__(self, "Airprobe Rtlsdr Nogui") ################################################## # Parameters ################################################## self.fc = fc self.shiftoff = shiftoff self.ppm = ppm self.gain = gain self.samp_rate = samp_rate ################################################## # Blocks ################################################## self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(fc-shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) ################################################## # Connections ################################################## self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.gsm_bcch_ccch_demapper_0, "bursts", self.gsm_control_channels_decoder_0, "bursts") self.msg_connect(self.gsm_clock_offset_control_0, "ppm", self.gsm_input_0, "ppm_in") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_decryption_0, "bursts", self.gsm_control_channels_decoder_0_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_bcch_ccch_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_sdcch8_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "measurements", self.gsm_clock_offset_control_0, "measurements") self.msg_connect(self.gsm_sdcch8_demapper_0, "bursts", self.gsm_decryption_0, "bursts")
def __init__(self, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, fc=943.6e6): gr.top_block.__init__(self, "Decode Raw") Qt.QWidget.__init__(self) self.setWindowTitle("Decode Raw") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "decode_raw") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff self.fc = fc ################################################## # Variables ################################################## self.ppm_slider = ppm_slider = ppm self.g_slider = g_slider = gain self.fc_slider = fc_slider = fc ################################################## # Blocks ################################################## self._fc_slider_layout = Qt.QVBoxLayout() self._fc_slider_tool_bar = Qt.QToolBar(self) self._fc_slider_layout.addWidget(self._fc_slider_tool_bar) self._fc_slider_tool_bar.addWidget(Qt.QLabel("Frequency"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._fc_slider_counter = qwt_counter_pyslot() self._fc_slider_counter.setRange(925e6, 1990e6, 2e5) self._fc_slider_counter.setNumButtons(2) self._fc_slider_counter.setValue(self.fc_slider) self._fc_slider_tool_bar.addWidget(self._fc_slider_counter) self._fc_slider_counter.valueChanged.connect(self.set_fc_slider) self._fc_slider_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) self._fc_slider_slider.setRange(925e6, 1990e6, 2e5) self._fc_slider_slider.setValue(self.fc_slider) self._fc_slider_slider.setMinimumWidth(100) self._fc_slider_slider.valueChanged.connect(self.set_fc_slider) self._fc_slider_layout.addWidget(self._fc_slider_slider) self.top_layout.addLayout(self._fc_slider_layout) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype fc_slider, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self._ppm_slider_layout = Qt.QHBoxLayout() self._ppm_slider_layout.addWidget(Qt.QLabel("PPM Offset"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._ppm_slider_counter = qwt_counter_pyslot() self._ppm_slider_counter.setRange(-150, 150, 1) self._ppm_slider_counter.setNumButtons(2) self._ppm_slider_counter.setMinimumWidth(100) self._ppm_slider_counter.setValue(self.ppm_slider) self._ppm_slider_layout.addWidget(self._ppm_slider_counter) self._ppm_slider_counter.valueChanged.connect(self.set_ppm_slider) self.top_layout.addLayout(self._ppm_slider_layout) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self._g_slider_layout = Qt.QHBoxLayout() self._g_slider_layout.addWidget(Qt.QLabel("Gain"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._g_slider_counter = qwt_counter_pyslot() self._g_slider_counter.setRange(0, 50, 0.5) self._g_slider_counter.setNumButtons(2) self._g_slider_counter.setMinimumWidth(100) self._g_slider_counter.setValue(self.g_slider) self._g_slider_layout.addWidget(self._g_slider_counter) self._g_slider_counter.valueChanged.connect(self.set_g_slider) self.top_layout.addLayout(self._g_slider_layout) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, "/tmp/gsm_raw", False) ################################################## # Connections ################################################## self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.blocks_file_source_0, 0), (self.blocks_rotator_cc_0, 0)) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.gsm_bcch_ccch_demapper_0, "bursts", self.gsm_control_channels_decoder_0, "bursts") self.msg_connect(self.gsm_clock_offset_control_0, "ppm", self.gsm_input_0, "ppm_in") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_decryption_0, "bursts", self.gsm_control_channels_decoder_0_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_bcch_ccch_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "C0", self.gsm_sdcch8_demapper_0, "bursts") self.msg_connect(self.gsm_receiver_0, "measurements", self.gsm_clock_offset_control_0, "measurements") self.msg_connect(self.gsm_sdcch8_demapper_0, "bursts", self.gsm_decryption_0, "bursts")
def __init__(self): # Graphical initialisation gr.top_block.__init__(self, "Airprobe Rtlsdr") Qt.QWidget.__init__(self) self.setWindowTitle("Airprobe Rtlsdr") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass # Logging system (to specific file) logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', filename='graphical_sniffing_log', filemod='w', level=logging.INFO) # Windows setting self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "airprobe_rtlsdr") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.fc = 937755550 #937.7e6 self.gain = 30 self.ppm = 0 self.samp_rate = 2000000.052982 self.shiftoff = 400e3 ################################################## # Blocks ################################################## # Order : min value, max value, step, default value and ?) self._ppm_slider_range = Range(-150, 150, 1, self.ppm, 100) self._ppm_slider_win = RangeWidget(self._ppm_slider_range, self.set_ppm, "PPM Offset", "counter", float) self.top_layout.addWidget(self._ppm_slider_win) self._g_slider_range = Range(0, 50, 0.5, self.gain, 100) self._g_slider_win = RangeWidget(self._g_slider_range, self.set_gain, "Gain", "counter", float) self.top_layout.addWidget(self._g_slider_win) self._fc_slider_range = Range(925e6, 1990e6, 2e5, self.fc, 100) self._fc_slider_win = RangeWidget(self._fc_slider_range, self.set_fc, "Frequency", "counter_slider", float) self.top_layout.addWidget(self._fc_slider_win) # Initialisation of the rtlsdr module to communicate with the device self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + "") self.rtlsdr_source_0.set_sample_rate(self.samp_rate) self.rtlsdr_source_0.set_center_freq(self.fc - self.shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(self.ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(self.gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3 + abs(self.shiftoff), 0) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype self.fc, self.samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper( 1, ([0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44]), ([8, 8, 8, 8, 8, 8, 8, 8, 136, 136, 136, 136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer( pmt.intern(""), False) self.gsm_input_0 = grgsm.gsm_input( ppm=self.ppm, osr=4, fc=self.fc, samp_rate_in=self.samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder( ) self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control( self.fc - self.shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper( 0, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 2, 2, 2, 2, 2, 2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2 * pi * self.shiftoff / self.samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0))
def __init__(self, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, fc=943.6e6): gr.top_block.__init__(self, "Decode Bursts") Qt.QWidget.__init__(self) self.setWindowTitle("Decode Bursts") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "decode_bursts") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff self.fc = fc ################################################## # Variables ################################################## self.ppm_slider = ppm_slider = ppm self.g_slider = g_slider = gain self.fc_slider = fc_slider = fc ################################################## # Blocks ################################################## self._ppm_slider_layout = Qt.QHBoxLayout() self._ppm_slider_layout.addWidget(Qt.QLabel("PPM Offset"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._ppm_slider_counter = qwt_counter_pyslot() self._ppm_slider_counter.setRange(-150, 150, 1) self._ppm_slider_counter.setNumButtons(2) self._ppm_slider_counter.setMinimumWidth(100) self._ppm_slider_counter.setValue(self.ppm_slider) self._ppm_slider_layout.addWidget(self._ppm_slider_counter) self._ppm_slider_counter.valueChanged.connect(self.set_ppm_slider) self.top_layout.addLayout(self._ppm_slider_layout) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_burst_file_source_0 = grgsm.burst_file_source("/tmp/bursts") self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self._g_slider_layout = Qt.QHBoxLayout() self._g_slider_layout.addWidget(Qt.QLabel("Gain"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._g_slider_counter = qwt_counter_pyslot() self._g_slider_counter.setRange(0, 50, 0.5) self._g_slider_counter.setNumButtons(2) self._g_slider_counter.setMinimumWidth(100) self._g_slider_counter.setValue(self.g_slider) self._g_slider_layout.addWidget(self._g_slider_counter) self._g_slider_counter.valueChanged.connect(self.set_g_slider) self.top_layout.addLayout(self._g_slider_layout) self._fc_slider_layout = Qt.QVBoxLayout() self._fc_slider_tool_bar = Qt.QToolBar(self) self._fc_slider_layout.addWidget(self._fc_slider_tool_bar) self._fc_slider_tool_bar.addWidget(Qt.QLabel("Frequency"+": ")) class qwt_counter_pyslot(Qwt.QwtCounter): def __init__(self, parent=None): Qwt.QwtCounter.__init__(self, parent) @pyqtSlot('double') def setValue(self, value): super(Qwt.QwtCounter, self).setValue(value) self._fc_slider_counter = qwt_counter_pyslot() self._fc_slider_counter.setRange(925e6, 1990e6, 2e5) self._fc_slider_counter.setNumButtons(2) self._fc_slider_counter.setValue(self.fc_slider) self._fc_slider_tool_bar.addWidget(self._fc_slider_counter) self._fc_slider_counter.valueChanged.connect(self.set_fc_slider) self._fc_slider_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) self._fc_slider_slider.setRange(925e6, 1990e6, 2e5) self._fc_slider_slider.setValue(self.fc_slider) self._fc_slider_slider.setMinimumWidth(100) self._fc_slider_slider.valueChanged.connect(self.set_fc_slider) self._fc_slider_layout.addWidget(self._fc_slider_slider) self.top_layout.addLayout(self._fc_slider_layout) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.gsm_burst_file_source_0, "out", self.gsm_sdcch8_demapper_0, "bursts") self.msg_connect(self.gsm_burst_file_source_0, "out", self.gsm_bcch_ccch_demapper_0, "bursts") self.msg_connect(self.gsm_bcch_ccch_demapper_0, "bursts", self.gsm_control_channels_decoder_0, "bursts") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.blocks_socket_pdu_0, "pdus") self.msg_connect(self.gsm_control_channels_decoder_0_0, "msgs", self.gsm_message_printer_1, "msgs") self.msg_connect(self.gsm_decryption_0, "bursts", self.gsm_control_channels_decoder_0_0, "bursts") self.msg_connect(self.gsm_sdcch8_demapper_0, "bursts", self.gsm_decryption_0, "bursts")
def __init__(self): # Graphical initialisation gr.top_block.__init__(self, "Airprobe Rtlsdr") Qt.QWidget.__init__(self) self.setWindowTitle("Airprobe Rtlsdr") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass # Logging system (to specific file) logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', filename='graphical_sniffing_log', filemod='w', level=logging.INFO) # Windows setting self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "airprobe_rtlsdr") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.fc = 937755550 #937.7e6 self.gain = 30 self.ppm = 0 self.samp_rate = 2000000.052982 self.shiftoff = 400e3 ################################################## # Blocks ################################################## # Order : min value, max value, step, default value and ?) self._ppm_slider_range = Range(-150, 150, 1, self.ppm, 100) self._ppm_slider_win = RangeWidget(self._ppm_slider_range, self.set_ppm, "PPM Offset", "counter", float) self.top_layout.addWidget(self._ppm_slider_win) self._g_slider_range = Range(0, 50, 0.5, self.gain, 100) self._g_slider_win = RangeWidget(self._g_slider_range, self.set_gain, "Gain", "counter", float) self.top_layout.addWidget(self._g_slider_win) self._fc_slider_range = Range(925e6, 1990e6, 2e5, self.fc, 100) self._fc_slider_win = RangeWidget(self._fc_slider_range, self.set_fc, "Frequency", "counter_slider", float) self.top_layout.addWidget(self._fc_slider_win) # Initialisation of the rtlsdr module to communicate with the device self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.rtlsdr_source_0.set_sample_rate(self.samp_rate) self.rtlsdr_source_0.set_center_freq(self.fc-self.shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(self.ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(self.gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype self.fc, self.samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False) self.gsm_input_0 = grgsm.gsm_input( ppm=self.ppm, osr=4, fc=self.fc, samp_rate_in=self.samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(self.fc-self.shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*self.shiftoff/self.samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0))
def __init__(self, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, fc=939.4e6*0+948e6): gr.top_block.__init__(self, "Airprobe Bladerf") Qt.QWidget.__init__(self) self.setWindowTitle("Airprobe Bladerf") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "airprobe_bladerf") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff self.fc = fc ################################################## # Variables ################################################## self.ppm_slider = ppm_slider = ppm self.g_slider = g_slider = gain self.fc_slider = fc_slider = fc ################################################## # Blocks ################################################## self._ppm_slider_range = Range(-150, 150, 1, ppm, 100) self._ppm_slider_win = RangeWidget(self._ppm_slider_range, self.set_ppm_slider, "PPM Offset", "counter") self.top_layout.addWidget(self._ppm_slider_win) self._g_slider_range = Range(0, 50, 0.5, gain, 100) self._g_slider_win = RangeWidget(self._g_slider_range, self.set_g_slider, "Gain", "counter") self.top_layout.addWidget(self._g_slider_win) self._fc_slider_range = Range(925e6, 1990e6, 2e5, fc, 100) self._fc_slider_win = RangeWidget(self._fc_slider_range, self.set_fc_slider, "Frequency", "counter_slider") self.top_layout.addWidget(self._fc_slider_win) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype fc_slider, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if complex == type(float()): self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "bladerf=0" ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(fc_slider-shiftoff, 0) self.osmosdr_source_0.set_freq_corr(ppm_slider, 0) self.osmosdr_source_0.set_dc_offset_mode(2, 0) self.osmosdr_source_0.set_iq_balance_mode(2, 0) self.osmosdr_source_0.set_gain_mode(False, 0) self.osmosdr_source_0.set_gain(g_slider, 0) self.osmosdr_source_0.set_if_gain(20, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna("", 0) self.osmosdr_source_0.set_bandwidth(250e3+abs(shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff) self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.blocks_rotator_cc_0, 0))
def __init__(self, timeslot=0, subslot=None, chan_mode='BCCH', burst_file=None, cfile=None, fc=939.4e6, samp_rate=2e6, arfcn=None, a5=1, a5_kc=None, speech_file=None, speech_codec=None): gr.top_block.__init__(self, "Airprobe Decode") ################################################## # Parameters ################################################## self.timeslot = timeslot self.subslot = subslot self.chan_mode = chan_mode self.burst_file = burst_file self.cfile = cfile self.fc = fc self.samp_rate = samp_rate self.arfcn = arfcn self.a5 = a5 self.kc = a5_kc if len(a5_kc) < 8: self.kc = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] self.speech_file = speech_file self.speech_codec = speech_codec ################################################## # Blocks ################################################## if self.burst_file: self.burst_file_source = grgsm.burst_file_source(burst_file) elif self.cfile: self.file_source = blocks.file_source(gr.sizeof_gr_complex*1, self.cfile, False) self.receiver = grgsm.receiver(4, ([0]), ([])) self.input_adapter = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.offset_control = grgsm.clock_offset_control(fc) self.dummy_burst_filter = grgsm.dummy_burst_filter() self.timeslot_filter = grgsm.burst_timeslot_filter(self.timeslot) self.subslot_filter = None if self.chan_mode == 'BCCH_SDCCH4' and self.subslot is not None: self.subslot_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH4, self.subslot) elif self.chan_mode == 'SDCCH8' and self.subslot is not None: self.subslot_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH8, self.subslot) if self.chan_mode == 'BCCH': self.bcch_demapper = grgsm.universal_ctrl_chans_demapper(self.timeslot, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 2, 2, 2, 2, 2, 2])) elif self.chan_mode == 'BCCH_SDCCH4': self.bcch_sdcch4_demapper = grgsm.universal_ctrl_chans_demapper(self.timeslot, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 7, 7, 7, 7, 135, 135])) elif self.chan_mode == 'SDCCH8': self.sdcch8_demapper = grgsm.universal_ctrl_chans_demapper(self.timeslot, ([0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44]), ([8, 8, 8, 8, 8, 8, 8, 8, 136, 136, 136, 136])) elif self.chan_mode == 'TCHF': self.tch_f_demapper = grgsm.tch_f_chans_demapper(self.timeslot) self.tch_f_decoder = grgsm.tch_f_decoder(speech_codec, speech_file) if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.decryption = grgsm.decryption(self.kc, self.a5) self.cch_decoder_decrypted = grgsm.control_channels_decoder() if self.chan_mode == 'TCHF': self.decryption_tch_sacch = grgsm.decryption(self.kc, self.a5) self.cch_decoder = grgsm.control_channels_decoder() self.socket_pdu = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) ################################################## # Asynch Message Connections ################################################## if self.burst_file: self.msg_connect(self.burst_file_source, "out", self.dummy_burst_filter, "in") elif self.cfile: self.connect((self.file_source, 0), (self.input_adapter, 0)) self.connect((self.input_adapter, 0), (self.receiver, 0)) self.msg_connect(self.offset_control, "ppm", self.input_adapter, "ppm_in") self.msg_connect(self.receiver, "measurements", self.offset_control, "measurements") self.msg_connect(self.receiver, "C0", self.dummy_burst_filter, "in") self.msg_connect(self.dummy_burst_filter, "out", self.timeslot_filter, "in") if (self.chan_mode == 'BCCH_SDCCH4' or self.chan_mode == 'SDCCH8') and self.subslot_filter is not None: self.msg_connect(self.timeslot_filter, "out", self.subslot_filter, "in") if self.chan_mode == 'BCCH': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.bcch_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.bcch_demapper, "bursts") self.msg_connect(self.bcch_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") elif self.chan_mode == 'BCCH_SDCCH4': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.bcch_sdcch4_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.bcch_sdcch4_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.decryption, "bursts") self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts") self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus") self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") elif self.chan_mode == 'SDCCH8': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.sdcch8_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.sdcch8_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.sdcch8_demapper, "bursts", self.decryption, "bursts") self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts") self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus") self.msg_connect(self.sdcch8_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") elif self.chan_mode == 'TCHF': self.msg_connect(self.timeslot_filter, "out", self.tch_f_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.tch_f_demapper, "acch_bursts", self.decryption_tch_sacch, "bursts") self.msg_connect(self.tch_f_demapper, "tch_bursts", self.decryption, "bursts") self.msg_connect(self.decryption_tch_sacch, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.decryption, "bursts", self.tch_f_decoder, "bursts") else: self.msg_connect(self.tch_f_demapper, "acch_bursts", self.cch_decoder, "bursts") self.msg_connect(self.tch_f_demapper, "tch_bursts", self.tch_f_decoder, "bursts") self.msg_connect(self.tch_f_decoder, "msgs", self.socket_pdu, "pdus") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus")
def __init__(self, args="", collector="localhost", collectorport='4729', fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, serverport='4729', shiftoff=400e3): gr.top_block.__init__(self, "Gr-gsm Livemon") Qt.QWidget.__init__(self) self.setWindowTitle("Gr-gsm Livemon") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "grgsm_livemon") try: if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): self.restoreGeometry( self.settings.value("geometry").toByteArray()) else: self.restoreGeometry(self.settings.value("geometry")) except: pass ################################################## # Parameters ################################################## self.args = args self.collector = collector self.collectorport = collectorport self.fc = fc self.gain = gain self.osr = osr self.ppm = ppm self.samp_rate = samp_rate self.serverport = serverport self.shiftoff = shiftoff ################################################## # Variables ################################################## self.ppm_slider = ppm_slider = ppm self.gain_slider = gain_slider = gain self.fc_slider = fc_slider = fc ################################################## # Blocks ################################################## self._ppm_slider_range = Range(-150, 150, 0.1, ppm, 100) self._ppm_slider_win = RangeWidget(self._ppm_slider_range, self.set_ppm_slider, 'PPM Offset', "counter", float) self.top_grid_layout.addWidget(self._ppm_slider_win) self._gain_slider_range = Range(0, 100, 0.5, gain, 100) self._gain_slider_win = RangeWidget(self._gain_slider_range, self.set_gain_slider, 'Gain', "counter", float) self.top_grid_layout.addWidget(self._gain_slider_win) self._fc_slider_range = Range(800e6, 1990e6, 2e5, fc, 100) self._fc_slider_win = RangeWidget(self._fc_slider_range, self.set_fc_slider, 'Frequency', "counter_slider", float) self.top_grid_layout.addWidget(self._fc_slider_win) self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + 'str(grgsm.device.get_default_args(args))') self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(fc_slider - shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(ppm_slider, 0) self.rtlsdr_source_0.set_gain(gain_slider, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna('', 0) self.rtlsdr_source_0.set_bandwidth(250e3 + abs(shiftoff), 0) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype fc_slider, #fc samp_rate, #bw "", #name 1) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in range(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(timeslot_nr=1, ) self.gsm_receiver_0 = grgsm.receiver(osr, [1022], [], False) self.gsm_message_printer_1 = grgsm.message_printer( pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=ppm - int(ppm), osr=osr, fc=fc_slider - shiftoff, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption([], 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder( ) self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control( fc_slider - shiftoff, samp_rate, osr) self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper( timeslot_nr=0, ) self.blocks_socket_pdu_0_1 = blocks.socket_pdu('UDP_CLIENT', collector, collectorport, 1500, False) self.blocks_socket_pdu_0_0 = blocks.socket_pdu('UDP_SERVER', '127.0.0.1', serverport, 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2 * pi * shiftoff / samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.blocks_socket_pdu_0_0, 'pdus'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0))
def __init__(self, fc, gain, ppm, samp_rate, shiftoff): # Initiating the herited top_block class of the gnuradio project gr.top_block.__init__(self, "Airprobe Rtlsdr") # Settting parameters of the class self.fc = fc self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff # Initialisation of the rtlsdr module to communicate with the device self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + "") self.rtlsdr_source_0.set_sample_rate(self.samp_rate) self.rtlsdr_source_0.set_center_freq(self.fc - self.shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(self.ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(self.gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3 + abs(self.shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper( 1, ([0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44]), ([8, 8, 8, 8, 8, 8, 8, 8, 136, 136, 136, 136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) # Setting block to display received packets in the terminal self.gsm_message_printer_1 = grgsm.message_printer( pmt.intern(""), False) # Setting gr-gsm parameters to listen the network self.gsm_input_0 = grgsm.gsm_input( ppm=self.ppm, osr=4, fc=self.fc, samp_rate_in=self.samp_rate, ) # Getting the GSM packet decoder self.gsm_decryption_0 = grgsm.decryption(([]), 1) # Create the control channel decoder to receive GSM packets self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder( ) # Create a duplicate control channel to display in the terminal self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() # TODO comment self.gsm_clock_offset_control_0 = grgsm.clock_offset_control( self.fc - self.shiftoff) # Create the BCCH and CCCH channel "parser?" self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper( 0, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 2, 2, 2, 2, 2, 2])) # Creating a client socket connected to the loopback interface self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000) # Creating a server socket to use GSM packets without Wireshark or other traffic analyser #self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2 * pi * self.shiftoff / self.samp_rate) # Sending received traffic from the device to the BCCH and CCCH channel mapper self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) # Sending received traffic from the device to the Clock Offset controler self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) # Sending received traffic from the device to the SDCCH channel mapper self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) # TODO comment self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) # Sending SDCCH channel packets decoded to the GSM decrypter self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) # Sending decrypted GSM packets to the channel decoder self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) # Connecting the BCCH and CCCH channel mapper to the channel decoder self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) # Sending readable GSM packets to the client socket self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0))
def __init__(self, fc, gain, ppm, samp_rate, shiftoff): # Initiating the herited top_block class of the gnuradio project gr.top_block.__init__(self, "Airprobe Rtlsdr") # Settting parameters of the class self.fc = fc self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff # Initialisation of the rtlsdr module to communicate with the device self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.rtlsdr_source_0.set_sample_rate(self.samp_rate) self.rtlsdr_source_0.set_center_freq(self.fc-self.shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(self.ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(self.gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.universal_ctrl_chans_demapper(1, ([0,4,8,12,16,20,24,28,32,36,40,44]), ([8,8,8,8,8,8,8,8,136,136,136,136])) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([])) # Setting block to display received packets in the terminal self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False) # Setting gr-gsm parameters to listen the network self.gsm_input_0 = grgsm.gsm_input( ppm=self.ppm, osr=4, fc=self.fc, samp_rate_in=self.samp_rate, ) # Getting the GSM packet decoder self.gsm_decryption_0 = grgsm.decryption(([]), 1) # Create the control channel decoder to receive GSM packets self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() # Create a duplicate control channel to display in the terminal self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() # TODO comment self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(self.fc-self.shiftoff) # Create the BCCH and CCCH channel "parser?" self.gsm_bcch_ccch_demapper_0 = grgsm.universal_ctrl_chans_demapper(0, ([2,6,12,16,22,26,32,36,42,46]), ([1,2,2,2,2,2,2,2,2,2])) # Creating a client socket connected to the loopback interface self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000) # Creating a server socket to use GSM packets without Wireshark or other traffic analyser #self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*self.shiftoff/self.samp_rate) # Sending received traffic from the device to the BCCH and CCCH channel mapper self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) # Sending received traffic from the device to the Clock Offset controler self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) # Sending received traffic from the device to the SDCCH channel mapper self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) # TODO comment self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in')) # Sending SDCCH channel packets decoded to the GSM decrypter self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) # Sending decrypted GSM packets to the channel decoder self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) # Connecting the BCCH and CCCH channel mapper to the channel decoder self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) # Sending readable GSM packets to the client socket self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0))
def __init__(self, rec_len=1000000, samp_rate=2000000.052982, fc=941.8e6, shiftoff=400e3, args="", osr=4, collector="localhost", collectorport="4729", serverport="4729", gain=30, ppm=0): gr.top_block.__init__(self, "Gr-gsm Livemon") ################################################## # Parameters ################################################## self.rec_len = rec_len self.samp_rate = samp_rate self.fc = fc self.shiftoff = shiftoff self.args = args self.osr = osr self.collector = collector self.collectorport = collectorport self.serverport = serverport self.gain = gain self.ppm = ppm ################################################## # Blocks ################################################## self.rtlsdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + args) self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(fc - shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(False, 0) self.rtlsdr_source_0.set_gain(gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3 + abs(shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(timeslot_nr=1, ) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([]), False) self.gsm_message_printer_1 = grgsm.message_printer( pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=ppm - int(ppm), osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder( ) self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control( fc - shiftoff, samp_rate, osr) self.gsm_bcch_ccch_sdcch4_demapper_0 = grgsm.gsm_bcch_ccch_sdcch4_demapper( timeslot_nr=0, ) self.blocks_socket_pdu_0_1 = blocks.socket_pdu("UDP_CLIENT", collector, collectorport, 1500, False) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", serverport, 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2 * pi * shiftoff / samp_rate) self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex * 1, int(rec_len * samp_rate)) ################################################## # Connections ################################################## self.msg_connect((self.blocks_socket_pdu_0_0, 'pdus'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_bcch_ccch_sdcch4_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_sdcch4_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_head_0, 0), (self.blocks_rotator_cc_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_head_0, 0))
def __init__(self, timeslot=0, subslot=None, chan_mode='BCCH', burst_file=None, cfile=None, fc=939.4e6, samp_rate=2e6, arfcn=None, a5=1, a5_kc=None, speech_file=None, speech_codec=None, verbose=False): gr.top_block.__init__(self, "Airprobe Decode") ################################################## # Parameters ################################################## self.timeslot = timeslot self.subslot = subslot self.chan_mode = chan_mode self.burst_file = burst_file self.cfile = cfile self.fc = fc self.samp_rate = samp_rate self.arfcn = arfcn self.a5 = a5 self.kc = a5_kc if len(a5_kc) < 8: self.kc = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] self.speech_file = speech_file self.speech_codec = speech_codec self.verbose = verbose ################################################## # Blocks ################################################## if self.burst_file: self.burst_file_source = grgsm.burst_file_source(burst_file) elif self.cfile: self.file_source = blocks.file_source(gr.sizeof_gr_complex * 1, self.cfile, False) self.receiver = grgsm.receiver(4, ([0]), ([])) self.input_adapter = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.offset_control = grgsm.clock_offset_control(fc) self.dummy_burst_filter = grgsm.dummy_burst_filter() self.timeslot_filter = grgsm.burst_timeslot_filter(self.timeslot) self.subslot_filter = None if self.chan_mode == 'BCCH_SDCCH4' and self.subslot is not None: self.subslot_filter = grgsm.burst_sdcch_subslot_filter( grgsm.SS_FILTER_SDCCH4, self.subslot) elif self.chan_mode == 'SDCCH8' and self.subslot is not None: self.subslot_filter = grgsm.burst_sdcch_subslot_filter( grgsm.SS_FILTER_SDCCH8, self.subslot) if self.chan_mode == 'BCCH': self.bcch_demapper = grgsm.universal_ctrl_chans_demapper( self.timeslot, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 2, 2, 2, 2, 2, 2])) elif self.chan_mode == 'BCCH_SDCCH4': self.bcch_sdcch4_demapper = grgsm.universal_ctrl_chans_demapper( self.timeslot, ([2, 6, 12, 16, 22, 26, 32, 36, 42, 46]), ([1, 2, 2, 2, 7, 7, 7, 7, 135, 135])) elif self.chan_mode == 'SDCCH8': self.sdcch8_demapper = grgsm.universal_ctrl_chans_demapper( self.timeslot, ([0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44]), ([8, 8, 8, 8, 8, 8, 8, 8, 136, 136, 136, 136])) elif self.chan_mode == 'TCHF': self.tch_f_demapper = grgsm.tch_f_chans_demapper(self.timeslot) self.tch_f_decoder = grgsm.tch_f_decoder(speech_codec, speech_file) if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.decryption = grgsm.decryption(self.kc, self.a5) self.cch_decoder_decrypted = grgsm.control_channels_decoder() if self.chan_mode == 'TCHF': self.decryption_tch_sacch = grgsm.decryption(self.kc, self.a5) self.cch_decoder = grgsm.control_channels_decoder() self.socket_pdu = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) if self.verbose: self.message_printer = grgsm.message_printer( pmt.intern(""), True, True, False) ################################################## # Asynch Message Connections ################################################## if self.burst_file: self.msg_connect(self.burst_file_source, "out", self.dummy_burst_filter, "in") elif self.cfile: self.connect((self.file_source, 0), (self.input_adapter, 0)) self.connect((self.input_adapter, 0), (self.receiver, 0)) self.msg_connect(self.offset_control, "ppm", self.input_adapter, "ppm_in") self.msg_connect(self.receiver, "measurements", self.offset_control, "measurements") self.msg_connect(self.receiver, "C0", self.dummy_burst_filter, "in") self.msg_connect(self.dummy_burst_filter, "out", self.timeslot_filter, "in") if (self.chan_mode == 'BCCH_SDCCH4' or self.chan_mode == 'SDCCH8') and self.subslot_filter is not None: self.msg_connect(self.timeslot_filter, "out", self.subslot_filter, "in") if self.chan_mode == 'BCCH': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.bcch_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.bcch_demapper, "bursts") self.msg_connect(self.bcch_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs") elif self.chan_mode == 'BCCH_SDCCH4': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.bcch_sdcch4_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.bcch_sdcch4_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.decryption, "bursts") self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts") self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.cch_decoder_decrypted, "msgs", self.message_printer, "msgs") self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs") elif self.chan_mode == 'SDCCH8': if self.subslot_filter is not None: self.msg_connect(self.subslot_filter, "out", self.sdcch8_demapper, "bursts") else: self.msg_connect(self.timeslot_filter, "out", self.sdcch8_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.sdcch8_demapper, "bursts", self.decryption, "bursts") self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts") self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.cch_decoder_decrypted, "msgs", self.message_printer, "msgs") self.msg_connect(self.sdcch8_demapper, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs") elif self.chan_mode == 'TCHF': self.msg_connect(self.timeslot_filter, "out", self.tch_f_demapper, "bursts") if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]: self.msg_connect(self.tch_f_demapper, "acch_bursts", self.decryption_tch_sacch, "bursts") self.msg_connect(self.tch_f_demapper, "tch_bursts", self.decryption, "bursts") self.msg_connect(self.decryption_tch_sacch, "bursts", self.cch_decoder, "bursts") self.msg_connect(self.decryption, "bursts", self.tch_f_decoder, "bursts") else: self.msg_connect(self.tch_f_demapper, "acch_bursts", self.cch_decoder, "bursts") self.msg_connect(self.tch_f_demapper, "tch_bursts", self.tch_f_decoder, "bursts") self.msg_connect(self.tch_f_decoder, "msgs", self.socket_pdu, "pdus") self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus") if self.verbose: self.msg_connect(self.tch_f_decoder, "msgs", self.message_printer, "msgs") self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs")
def __init__(self, args="", fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, osr=4): gr.top_block.__init__(self, "Gr-gsm Livemon") ################################################## # Parameters ################################################## self.args = args self.fc = fc self.gain = gain self.ppm = ppm self.samp_rate = samp_rate self.shiftoff = shiftoff self.osr = osr print " [+] starting grgsm_livemon_headless..." print " [>] frequency: %s Hz (specify with -fc)" % fc print " [>] gain: %s dB (specify with --gain)" % gain print " [>] ppm: %s (specify with --ppm)" % ppm print " [>] sample rate: %s (specify with --samp_rate)" % samp_rate print " [>] shift offset: %s Hz (specify with --shiftoff)" % shiftoff self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + args ) self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(fc-shiftoff, 0) self.rtlsdr_source_0.set_freq_corr(self.ppm, 0) self.rtlsdr_source_0.set_dc_offset_mode(2, 0) self.rtlsdr_source_0.set_iq_balance_mode(2, 0) self.rtlsdr_source_0.set_gain_mode(True, 0) self.rtlsdr_source_0.set_gain(self.gain, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna("", 0) self.rtlsdr_source_0.set_bandwidth(250e3+abs(shiftoff), 0) self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper( timeslot_nr=1, ) self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([]), False) self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False, False, False) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=fc, samp_rate_in=samp_rate, ) self.gsm_decryption_0 = grgsm.decryption(([]), 1) self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder() self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder() self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff, samp_rate, osr) self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper( timeslot_nr=0, ) self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4730", 10000, False) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False) self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate) ################################################## # Connections ################################################## self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts')) self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.gsm_message_printer_1, 'msgs')) self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts')) self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts')) self.connect((self.blocks_rotator_cc_0, 0), (self.gsm_input_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) print " [+] go!"
def __init__(self, osr=4): gr.top_block.__init__(self, "Uplink decoding demo") ################################################## # Parameters ################################################## self.osr = osr ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1e6 ################################################## # Blocks ################################################## self.socket_pdu_server = blocks.socket_pdu("UDP_SERVER", '127.0.0.1', '4729', 10000, False) self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(timeslot_nr=1, ) self.gsm_receiver_with_uplink_0 = grgsm.receiver( 4, ([22]), ([2]), True) self.gsm_message_printer_0_0 = grgsm.message_printer( pmt.intern(""), False, False, False) self.gsm_input_0_0 = grgsm.gsm_input( ppm=0, osr=4, fc=947.8e6 - 45e6, samp_rate_in=samp_rate, ) self.gsm_input_0 = grgsm.gsm_input( ppm=0, osr=4, fc=947.8e6, samp_rate_in=samp_rate, ) self.gsm_decryption_0_3 = grgsm.decryption( ([0x46, 0x77, 0x2d, 0x54, 0xa3, 0xa3, 0xc3, 0x1c]), 1) self.gsm_control_channels_decoder_0_1_0 = grgsm.control_channels_decoder( ) self.gsm_control_channels_decoder_0_1 = grgsm.control_channels_decoder( ) self.gsm_clock_offset_control_0 = grgsm.clock_offset_control( 947.8e6, samp_rate, osr) self.blocks_socket_pdu_0_0_0 = blocks.socket_pdu( "UDP_CLIENT", '127.0.0.1', '4729', 10000, False) self.blocks_file_source_0_0 = blocks.file_source( gr.sizeof_gr_complex * 1, 'sms_multirtl_uplink_tail.cfile', False) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, 'sms_multirtl_downlink_tail.cfile', False) ################################################## # Connections ################################################## self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in')) self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0_0, 'ctrl_in')) self.msg_connect((self.gsm_control_channels_decoder_0_1, 'msgs'), (self.blocks_socket_pdu_0_0_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_1, 'msgs'), (self.gsm_message_printer_0_0, 'msgs')) self.msg_connect((self.gsm_control_channels_decoder_0_1_0, 'msgs'), (self.blocks_socket_pdu_0_0_0, 'pdus')) self.msg_connect((self.gsm_control_channels_decoder_0_1_0, 'msgs'), (self.gsm_message_printer_0_0, 'msgs')) self.msg_connect((self.gsm_decryption_0_3, 'bursts'), (self.gsm_control_channels_decoder_0_1_0, 'bursts')) self.msg_connect((self.gsm_receiver_with_uplink_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements')) self.msg_connect((self.gsm_receiver_with_uplink_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0_1, 'bursts')) self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0_3, 'bursts')) self.connect((self.blocks_file_source_0, 0), (self.gsm_input_0, 0)) self.connect((self.blocks_file_source_0_0, 0), (self.gsm_input_0_0, 0)) self.connect((self.gsm_input_0, 0), (self.gsm_receiver_with_uplink_0, 0)) self.connect((self.gsm_input_0_0, 0), (self.gsm_receiver_with_uplink_0, 1))