From 180a037a41d8872e760ac3f0a55888e3ee178386 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 19 Jan 2019 10:22:59 +0700 Subject: python/trx: introduce and use Transceiver class Change-Id: I6dc88edbb69a68746cc8e01206dc86f7ea2fa80f --- python/trx/radio_if.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'python/trx/radio_if.py') diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py index ed5a8de..ec9cd5f 100644 --- a/python/trx/radio_if.py +++ b/python/trx/radio_if.py @@ -47,9 +47,6 @@ class RadioInterface(gr.top_block): tx_freq = None osr = 4 - # Application state flags - trx_started = False - # GSM timings (in microseconds [uS]) # One timeslot duration is 576.9 μs = 15/26 ms, # or 156.25 symbol periods (a symbol period is 48/13 μs) @@ -304,6 +301,20 @@ class RadioInterface(gr.top_block): self.phy_sink.set_gain(gain, 0) self.tx_gain = gain + def set_slot(self, slot, config): + print("[i] Configure timeslot filter to: %s" + % ("drop all" if config == 0 else "tn=%d" % slot)) + + if config == 0: + # Value 0 is used for deactivation + self.ts_filter.set_policy(grgsm.FILTER_POLICY_DROP_ALL) + else: + # FIXME: ideally, we should (re)configure the Receiver + # block, but there is no API for that, and hard-coded + # timeslot configuration is used... + self.ts_filter.set_policy(grgsm.FILTER_POLICY_DEFAULT) + self.ts_filter.set_tn(slot) + def set_ta(self, ta): print("[i] Setting TA value %d" % ta) advance_time_sec = ta * self.GSM_SYM_PERIOD_uS * 1e-6 -- cgit v1.2.3