Change in gr-gsm[master]: apps/grgsm_trx: print bind / remote address and port

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Aug 10 08:20:47 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10426


Change subject: apps/grgsm_trx: print bind / remote address and port
......................................................................

apps/grgsm_trx: print bind / remote address and port

Change-Id: If750d476f3972f1ab5c5b637438d14d40b1e3d87
---
M python/trx/ctrl_if_bb.py
M python/trx/radio_if.py
M python/trx/udp_link.py
3 files changed, 11 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/26/10426/1

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 @@
 
 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 b6d1961..6374be7 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -84,7 +84,9 @@
 			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 @@
 			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()

-- 
To view, visit https://gerrit.osmocom.org/10426
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If750d476f3972f1ab5c5b637438d14d40b1e3d87
Gerrit-Change-Number: 10426
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180810/358e939e/attachment.htm>


More information about the gerrit-log mailing list