Skip to content

Commit

Permalink
apps/grgsm_trx: print bind / remote address and port
Browse files Browse the repository at this point in the history
Change-Id: If750d476f3972f1ab5c5b637438d14d40b1e3d87
  • Loading branch information
axilirator committed Aug 10, 2018
1 parent 473b35b commit 2adbee4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/trx/ctrl_if_bb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion python/trx/radio_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def __init__(self, phy_args, phy_sample_rate,
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
Expand Down
6 changes: 6 additions & 0 deletions python/trx/udp_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def loop(self):
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()
Expand Down

0 comments on commit 2adbee4

Please sign in to comment.