aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-19 10:18:10 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:31:27 +0200
commit6e7f2ce50c3a6962cccdcae445d66e5e34ac3b6b (patch)
tree72bd31e4801fd12a99bc4b001050aa91c60fc094
parent7d8a1caa0f286d29f58e9a0883a017bdf352a88d (diff)
trx/radio_if.py: introduce a new @property 'ready'
-rw-r--r--python/trx/radio_if.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 93080c4..e15add2 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -259,6 +259,16 @@ class RadioInterface(gr.top_block):
self.stop()
self.wait()
+ @property
+ def ready(self):
+ # RX / TX frequencies shall be set
+ if self.rx_freq is None:
+ return False
+ if self.tx_freq is None:
+ return False
+
+ return True
+
def calc_phase_inc(self, fc):
return self.ppm / 1.0e6 * 2 * pi * fc / self.sample_rate