aboutsummaryrefslogtreecommitdiffstats
path: root/python/trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-19 12:14:28 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:31:27 +0200
commit25203809c14423e7e8cdf30062b59d110be9272b (patch)
treee388e5569a613be965b1c6027a3cf2777ca5d73d /python/trx
parent6ee957f904d0b97153a3729228e33780412515a5 (diff)
trx/radio_if.py: print type of RadioInterface
Diffstat (limited to 'python/trx')
-rw-r--r--python/trx/radio_if.py8
-rw-r--r--python/trx/radio_if_uhd.py4
2 files changed, 10 insertions, 2 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index c4d4bd1..0d844c0 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -60,14 +60,18 @@ class RadioInterface(gr.top_block):
# basically, the DL freq. of ARFCN 0
DUMMY_FREQ = 935e6
+ # Human-readable description
+ def __str__(self):
+ return "(generic)"
+
def __init__(self, phy_args, phy_sample_rate,
phy_rx_gain, phy_tx_gain, phy_ppm,
phy_rx_antenna, phy_tx_antenna,
phy_freq_offset, trx_bind_addr,
trx_remote_addr, trx_base_port):
- print("[i] Init Radio interface (L:%s:%u <-> R:%s:%u)"
- % (trx_bind_addr, trx_base_port + 2,
+ print("[i] Init %s Radio interface (L:%s:%u <-> R:%s:%u)"
+ % (self, trx_bind_addr, trx_base_port + 2,
trx_remote_addr, trx_base_port + 102))
# PHY specific variables
diff --git a/python/trx/radio_if_uhd.py b/python/trx/radio_if_uhd.py
index b431fb6..ef2e0ed 100644
--- a/python/trx/radio_if_uhd.py
+++ b/python/trx/radio_if_uhd.py
@@ -27,6 +27,10 @@ from gnuradio import uhd
from radio_if import RadioInterface
class RadioInterfaceUHD(RadioInterface):
+ # Human-readable description
+ def __str__(self):
+ return "UHD"
+
@property
def phy_proc_delay(self):
# FIXME: shall be measured (automatically?) for