misc_utils/trx_burst_if: get rid of built-in timeslot filter
Since the API of 'Timeslot Filter' block was exposed, we can
get rid of built-in timeslot filter and use the proper methods.
diff --git a/python/trx/ctrl_if_bb.py b/python/trx/ctrl_if_bb.py
index b08f62c..77e02d0 100644
--- a/python/trx/ctrl_if_bb.py
+++ b/python/trx/ctrl_if_bb.py
@@ -22,6 +22,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import grgsm
from ctrl_if import ctrl_if
class ctrl_if_bb(ctrl_if):
@@ -107,14 +108,18 @@
return -1
# Ignore timeslot type for now
- # Value 0 means 'drop all'
- config = -1 if int(request[2]) == 0 else tn
-
+ config = int(request[2])
print("[i] Configure timeslot filter to: %s"
- % ("drop all" if config == -1 else "TS %d" % tn))
+ % ("drop all" if config == 0 else "TS %d" % tn))
- # HACK: configure built-in timeslot filter
- self.tb.gsm_trx_if.ts_filter_set_tn(config)
+ if config == 0:
+ # Value 0 means 'drop all'
+ self.tb.gsm_ts_filter.set_policy(
+ grgsm.FILTER_POLICY_DROP_ALL)
+ else:
+ self.tb.gsm_ts_filter.set_policy(
+ grgsm.FILTER_POLICY_DEFAULT)
+ self.tb.gsm_ts_filter.set_tn(tn)
return 0
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 661025a..5791f42 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -98,6 +98,9 @@
self.gsm_clck_ctrl = grgsm.clock_offset_control(
shift_fc, self.samp_rate, osr = 4)
+ self.gsm_ts_filter = grgsm.burst_timeslot_filter(0)
+ self.gsm_ts_filter.set_policy(grgsm.FILTER_POLICY_DROP_ALL)
+
self.gsm_trx_burst_if = grgsm.trx_burst_if(
self.trx_remote_addr, str(self.trx_base_port))
@@ -115,6 +118,9 @@
(self.gsm_input, 'ctrl_in'))
self.msg_connect((self.gsm_receiver, 'C0'),
+ (self.gsm_ts_filter, 'in'))
+
+ self.msg_connect((self.gsm_ts_filter, 'out'),
(self.gsm_trx_burst_if, 'bursts'))
def check_available(self):