aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-10 00:51:36 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2018-09-13 15:35:44 +0200
commit641133e5d84d2ab972c8b9b13b4e2fca0a10d63f (patch)
tree169933189c3a16950c1fad490a02340c6b9355b8
parent216558454d4b7d912ec6e206c3ed15251b03821f (diff)
apps/grgsm_trx: print bind / remote address and port
-rw-r--r--python/trx/ctrl_if_bb.py3
-rw-r--r--python/trx/radio_if.py4
-rw-r--r--python/trx/udp_link.py6
3 files changed, 11 insertions, 2 deletions
diff --git a/python/trx/ctrl_if_bb.py b/python/trx/ctrl_if_bb.py
index f5a9fa3..fe0002e 100644
--- a/python/trx/ctrl_if_bb.py
+++ b/python/trx/ctrl_if_bb.py
@@ -27,10 +27,11 @@ from ctrl_if import ctrl_if
class ctrl_if_bb(ctrl_if):
def __init__(self, remote_addr, remote_port, bind_addr, bind_port, tb, pm):
- print("[i] Init CTRL interface")
ctrl_if.__init__(self, remote_addr, remote_port,
bind_addr, bind_port)
+ print("[i] Init CTRL interface (%s)" % self.desc_link())
+
# Set link to the follow graph (top block)
self.tb = tb
# Power measurement
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 1c7f003..d2afcf6 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -84,7 +84,9 @@ class radio_if(gr.top_block):
trx_bind_addr, trx_remote_addr,
trx_base_port):
- print("[i] Init Radio interface")
+ print("[i] Init Radio interface (L:%s:%u <-> R:%s:%u)"
+ % (trx_bind_addr, trx_base_port + 2,
+ trx_remote_addr, trx_base_port + 102))
# PHY specific variables
self.sample_rate = phy_sample_rate
diff --git a/python/trx/udp_link.py b/python/trx/udp_link.py
index efa701b..ad84e5a 100644
--- a/python/trx/udp_link.py
+++ b/python/trx/udp_link.py
@@ -47,6 +47,12 @@ class udp_link:
data, addr = self.sock.recvfrom(128)
self.handle_rx(data.decode(), addr)
+ def desc_link(self):
+ (bind_addr, bind_port) = self.sock.getsockname()
+
+ return "L:%s:%u <-> R:%s:%u" \
+ % (bind_addr, bind_port, self.remote_addr, self.remote_port)
+
def send(self, data, remote = None):
if type(data) not in [bytearray, bytes]:
data = data.encode()