Harald Welte has submitted this change and it was merged.

Change subject: fake_trx/ctrl_if_(bb|bts).py: log link info at start-up
......................................................................


fake_trx/ctrl_if_(bb|bts).py: log link info at start-up

Change-Id: I4ebeed7271d91ab2e45199e0fb59776c00ad833c
---
M src/target/fake_trx/ctrl_if_bb.py
M src/target/fake_trx/ctrl_if_bts.py
M src/target/fake_trx/udp_link.py
3 files changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/target/fake_trx/ctrl_if_bb.py 
b/src/target/fake_trx/ctrl_if_bb.py
index c0c2fb7..33263e5 100644
--- a/src/target/fake_trx/ctrl_if_bb.py
+++ b/src/target/fake_trx/ctrl_if_bb.py
@@ -33,8 +33,8 @@
        pm = None
 
        def __init__(self, remote_addr, remote_port, bind_port):
-               print("[i] Init CTRL interface for BB")
                CTRLInterface.__init__(self, remote_addr, remote_port, 
bind_port)
+               print("[i] Init CTRL interface for BB (%s)" % self.desc_link())
 
        def parse_cmd(self, request):
                # Power control
diff --git a/src/target/fake_trx/ctrl_if_bts.py 
b/src/target/fake_trx/ctrl_if_bts.py
index e0a6ada..449df45 100644
--- a/src/target/fake_trx/ctrl_if_bts.py
+++ b/src/target/fake_trx/ctrl_if_bts.py
@@ -34,8 +34,8 @@
        pm = None
 
        def __init__(self, remote_addr, remote_port, bind_port):
-               print("[i] Init CTRL interface for BTS")
                CTRLInterface.__init__(self, remote_addr, remote_port, 
bind_port)
+               print("[i] Init CTRL interface for BTS (%s)" % self.desc_link())
 
        def parse_cmd(self, request):
                # Power control
diff --git a/src/target/fake_trx/udp_link.py b/src/target/fake_trx/udp_link.py
index dda901c..0174ae3 100644
--- a/src/target/fake_trx/udp_link.py
+++ b/src/target/fake_trx/udp_link.py
@@ -34,10 +34,15 @@
                # Save remote info
                self.remote_addr = remote_addr
                self.remote_port = remote_port
+               self.bind_port = bind_port
 
        def __del__(self):
                self.sock.close()
 
+       def desc_link(self):
+               return "L:%u <-> R:%s:%u" \
+                       % (self.bind_port, self.remote_addr, self.remote_port)
+
        def send(self, data):
                if type(data) not in [bytearray, bytes]:
                        data = data.encode()

-- 
To view, visit https://gerrit.osmocom.org/7010
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ebeed7271d91ab2e45199e0fb59776c00ad833c
Gerrit-PatchSet: 5
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to