aboutsummaryrefslogtreecommitdiffstats
path: root/apps/grgsm_livemon
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2017-08-26 12:24:34 +0200
committerPiotr Krysik <ptrkrysik@gmail.com>2017-08-26 12:24:34 +0200
commit85ec6ae4e7c304024e97138ba775115d2a68dd6e (patch)
tree655b4c89617211223d8faf74bfeefc1c389d27d3 /apps/grgsm_livemon
parent9091d2391cd78b1efde5ddc36e06dcbe572fbe19 (diff)
Applied changes with collector port and IP in python version of grgsm_livemon
Diffstat (limited to 'apps/grgsm_livemon')
-rwxr-xr-xapps/grgsm_livemon44
1 files changed, 32 insertions, 12 deletions
diff --git a/apps/grgsm_livemon b/apps/grgsm_livemon
index b77acbb..389e2a0 100755
--- a/apps/grgsm_livemon
+++ b/apps/grgsm_livemon
@@ -58,7 +58,7 @@ import time
class grgsm_livemon(gr.top_block, Qt.QWidget):
- def __init__(self, args="", gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, fc=941.8e6):
+ def __init__(self, args="", fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, collector="localhost", collectorport="4729"):
gr.top_block.__init__(self, "Gr-gsm Livemon")
Qt.QWidget.__init__(self)
self.setWindowTitle("Gr-gsm Livemon")
@@ -85,12 +85,14 @@ 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.fc = fc
+ self.collector = collector
+ self.collectorport = collectorport
##################################################
# Variables
@@ -185,7 +187,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
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", "127.0.0.1", "4729", 10000, False)
+ self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", collector, collectorport, 1500, False)
self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate)
##################################################
@@ -219,6 +221,14 @@ 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
@@ -259,13 +269,17 @@ 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_fc(self):
- return self.fc
+ def get_collector(self):
+ return self.collector
- def set_fc(self, fc):
- self.fc = fc
- self.set_fc_slider(self.fc)
- self.gsm_input_0.set_fc(self.fc)
+ def set_collector(self, collector):
+ self.collector = collector
+
+ def get_collectorport(self):
+ return self.collectorport
+
+ def set_collectorport(self, collectorport):
+ self.collectorport = collectorport
def get_ppm_slider(self):
return self.ppm_slider
@@ -296,6 +310,9 @@ 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(941.8e6),
+ help="Set GSM channel's central frequency [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(
@@ -311,8 +328,11 @@ 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(
- "-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(941.8e6),
- help="Set GSM channel's central frequency [default=%default]")
+ "", "--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]")
return parser
@@ -326,7 +346,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, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, fc=options.fc)
+ 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.start()
tb.show()