diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-01-19 10:22:59 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-01-19 11:29:35 +0700 |
commit | 180a037a41d8872e760ac3f0a55888e3ee178386 (patch) | |
tree | a49a24b46914a6f32a358c904b09840758c50002 /python/trx/radio_if.py | |
parent | baebe451cd90e16de491d5e69a36fd2493802cba (diff) |
python/trx: introduce and use Transceiver class
Change-Id: I6dc88edbb69a68746cc8e01206dc86f7ea2fa80f
Diffstat (limited to 'python/trx/radio_if.py')
-rw-r--r-- | python/trx/radio_if.py | 17 |
1 files changed, 14 insertions, 3 deletions
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 |