diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-10-17 09:24:55 +0700 |
---|---|---|
committer | Piotr Krysik <ptrkrysik@users.noreply.github.com> | 2017-11-05 17:33:26 +0100 |
commit | 962e2d83bb0eb62e6d1222339977c2f5f23d0dbd (patch) | |
tree | b4d63645da09a45e857e3be0ec8d383ef8c062c1 /python/trx/ctrl_if_bb.py | |
parent | 8e9b3075d72f0b6cb09179e68530102e2d4eb28d (diff) |
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.
Diffstat (limited to 'python/trx/ctrl_if_bb.py')
-rw-r--r-- | python/trx/ctrl_if_bb.py | 19 |
1 files changed, 12 insertions, 7 deletions
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 @@ class ctrl_if_bb(ctrl_if): 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)) - - # HACK: configure built-in timeslot filter - self.tb.gsm_trx_if.ts_filter_set_tn(config) + % ("drop all" if config == 0 else "TS %d" % tn)) + + 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 |