aboutsummaryrefslogtreecommitdiffstats
path: root/apps/grgsm_livemon
diff options
context:
space:
mode:
Diffstat (limited to 'apps/grgsm_livemon')
-rwxr-xr-xapps/grgsm_livemon56
1 files changed, 28 insertions, 28 deletions
diff --git a/apps/grgsm_livemon b/apps/grgsm_livemon
index 765ebae..cb63bdc 100755
--- a/apps/grgsm_livemon
+++ b/apps/grgsm_livemon
@@ -5,7 +5,7 @@
# Title: Gr-gsm Livemon
# Author: Piotr Krysik
# Description: Interactive monitor of a single C0 channel with analysis performed by Wireshark (command to run wireshark: sudo wireshark -k -f udp -Y gsmtap -i lo)
-# Generated: Mon Jan 23 21:28:25 2017
+# Generated: Sun Jul 23 19:07:48 2017
##################################################
if __name__ == '__main__':
@@ -38,7 +38,7 @@ import time
class grgsm_livemon(gr.top_block, Qt.QWidget):
- def __init__(self, args="", fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, osr=4):
+ def __init__(self, args="", gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, fc=941.8e6):
gr.top_block.__init__(self, "Gr-gsm Livemon")
Qt.QWidget.__init__(self)
self.setWindowTitle("Gr-gsm Livemon")
@@ -65,12 +65,12 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
# Parameters
##################################################
self.args = args
- self.fc = fc
self.gain = gain
+ self.osr = osr
self.ppm = ppm
self.samp_rate = samp_rate
self.shiftoff = shiftoff
- self.osr = osr
+ self.fc = fc
##################################################
# Variables
@@ -161,7 +161,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
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(
+ self.gsm_bcch_ccch_sdcch4_demapper_0 = grgsm.gsm_bcch_ccch_sdcch4_demapper(
timeslot_nr=0,
)
self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False)
@@ -171,14 +171,14 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
##################################################
# Connections
##################################################
- self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
+ 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, '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_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'))
@@ -199,14 +199,6 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
def set_args(self, args):
self.args = args
- def get_fc(self):
- return self.fc
-
- def set_fc(self, fc):
- self.fc = fc
- self.set_fc_slider(self.fc)
- self.gsm_input_0.set_fc(self.fc)
-
def get_gain(self):
return self.gain
@@ -214,6 +206,12 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.gain = gain
self.set_g_slider(self.gain)
+ def get_osr(self):
+ return self.osr
+
+ def set_osr(self, osr):
+ self.osr = osr
+
def get_ppm(self):
return self.ppm
@@ -227,25 +225,27 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
+ self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate)
self.gsm_input_0.set_samp_rate_in(self.samp_rate)
self.qtgui_freq_sink_x_0.set_frequency_range(self.fc_slider, self.samp_rate)
self.rtlsdr_source_0.set_sample_rate(self.samp_rate)
- self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate)
def get_shiftoff(self):
return self.shiftoff
def set_shiftoff(self, shiftoff):
self.shiftoff = shiftoff
+ self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate)
self.rtlsdr_source_0.set_center_freq(self.fc_slider-self.shiftoff, 0)
self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0)
- self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate)
- def get_osr(self):
- return self.osr
+ def get_fc(self):
+ return self.fc
- def set_osr(self, osr):
- self.osr = osr
+ def set_fc(self, fc):
+ self.fc = fc
+ self.set_fc_slider(self.fc)
+ self.gsm_input_0.set_fc(self.fc)
def get_ppm_slider(self):
return self.ppm_slider
@@ -276,12 +276,12 @@ def argument_parser():
"", "--args", dest="args", type="string", default="",
help="Set Device Arguments [default=%default]")
parser.add_option(
- "-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(939.4e6),
- help="Set fc [default=%default]")
- parser.add_option(
"-g", "--gain", dest="gain", type="eng_float", default=eng_notation.num_to_str(30),
help="Set gain [default=%default]")
parser.add_option(
+ "", "--osr", dest="osr", type="intx", default=4,
+ help="Set OverSampling Ratio [default=%default]")
+ parser.add_option(
"-p", "--ppm", dest="ppm", type="eng_float", default=eng_notation.num_to_str(0),
help="Set ppm [default=%default]")
parser.add_option(
@@ -289,10 +289,10 @@ def argument_parser():
help="Set samp_rate [default=%default]")
parser.add_option(
"-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
- help="Set shiftoff [default=%default]")
+ help="Set Frequency Shiftoff [default=%default]")
parser.add_option(
- "", "--osr", dest="osr", type="intx", default=4,
- help="Set OSR [default=%default]")
+ "-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(941.8e6),
+ help="Set GSM channel's central frequency [default=%default]")
return parser
@@ -306,7 +306,7 @@ def main(top_block_cls=grgsm_livemon, options=None):
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
- tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, osr=options.osr)
+ tb = top_block_cls(args=options.args, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, fc=options.fc)
tb.start()
tb.show()