aboutsummaryrefslogtreecommitdiffstats
path: root/apps/grgsm_livemon
diff options
context:
space:
mode:
Diffstat (limited to 'apps/grgsm_livemon')
-rwxr-xr-xapps/grgsm_livemon37
1 files changed, 13 insertions, 24 deletions
diff --git a/apps/grgsm_livemon b/apps/grgsm_livemon
index 389e2a0..799dd30 100755
--- a/apps/grgsm_livemon
+++ b/apps/grgsm_livemon
@@ -25,7 +25,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: Sun Jul 23 19:07:48 2017
+# Generated: Sat Aug 26 12:54:55 2017
##################################################
if __name__ == '__main__':
@@ -58,7 +58,7 @@ import time
class grgsm_livemon(gr.top_block, Qt.QWidget):
- def __init__(self, args="", fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, collector="localhost", collectorport="4729"):
+ def __init__(self, args="", fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, serverport="4729"):
gr.top_block.__init__(self, "Gr-gsm Livemon")
Qt.QWidget.__init__(self)
self.setWindowTitle("Gr-gsm Livemon")
@@ -91,8 +91,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.ppm = ppm
self.samp_rate = samp_rate
self.shiftoff = shiftoff
- self.collector = collector
- self.collectorport = collectorport
+ self.serverport = serverport
##################################################
# Variables
@@ -186,19 +185,18 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
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)
- self.blocks_socket_pdu_0 = 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_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.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, '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_sdcch4_demapper_0, 'bursts'))
self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements'))
@@ -269,17 +267,11 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.rtlsdr_source_0.set_center_freq(self.fc_slider-self.shiftoff, 0)
self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0)
- def get_collector(self):
- return self.collector
+ def get_serverport(self):
+ return self.serverport
- def set_collector(self, collector):
- self.collector = collector
-
- def get_collectorport(self):
- return self.collectorport
-
- def set_collectorport(self, collectorport):
- self.collectorport = collectorport
+ def set_serverport(self, serverport):
+ self.serverport = serverport
def get_ppm_slider(self):
return self.ppm_slider
@@ -328,11 +320,8 @@ def argument_parser():
"-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
help="Set Frequency Shiftoff [default=%default]")
parser.add_option(
- "", "--collector", dest="collector", type="string", default="localhost",
- help="Set IP or DNS name of collector point [default=%default]")
- parser.add_option(
- "", "--collectorport", dest="collectorport", type="string", default="4729",
- help="Set UDP port number of collector [default=%default]")
+ "", "--serverport", dest="serverport", type="string", default="4729",
+ help="Set UDP server listening port [default=%default]")
return parser
@@ -346,7 +335,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, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, collector=options.collector, collectorport=options.collectorport)
+ tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, serverport=options.serverport)
tb.start()
tb.show()