aboutsummaryrefslogtreecommitdiffstats
path: root/python/trx/udp_link.py
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-10 00:51:36 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-08-10 16:38:59 +0700
commit2adbee48bf323a980a585da3a832ce053bb43a9c (patch)
tree1d438325a3cc565a448fd15c1126bb8916c1b435 /python/trx/udp_link.py
parent473b35be863e240747ae3dfcc006d3a4eb4be619 (diff)
apps/grgsm_trx: print bind / remote address and portv0.42.1
Diffstat (limited to 'python/trx/udp_link.py')
-rw-r--r--python/trx/udp_link.py6
1 files changed, 6 insertions, 0 deletions
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()