apps/trx: handle SETSLOT command
Currently, this command is used only to (re)configure built-in
timeslot filter of 'TRX Interface' block. Channel configuration
number, provided as the second parameter of command, is ignored.
diff --git a/apps/trx/ctrl_if_bb.py b/apps/trx/ctrl_if_bb.py
index 90d6740..1705cf1 100644
--- a/apps/trx/ctrl_if_bb.py
+++ b/apps/trx/ctrl_if_bb.py
@@ -94,6 +94,28 @@
# TODO: is not implemented yet
return 0
+ # Timeslot management
+ elif self.verify_cmd(request, "SETSLOT", 2):
+ print("[i] Recv SETSLOT cmd")
+
+ # Obtain TS index
+ tn = int(request[1])
+ if tn not in range(0, 8):
+ print("[!] TS index should be in range: 0..7")
+ return -1
+
+ # Ignore timeslot type for now
+ # Value 0 means 'drop all'
+ config = -1 if int(request[2]) == 0 else tn
+
+ 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)
+
+ return 0
+
# Misc
elif self.verify_cmd(request, "ECHO", 0):
print("[i] Recv ECHO cmd")
diff --git a/apps/trx/radio_if.py b/apps/trx/radio_if.py
index 9029f85..c162f69 100644
--- a/apps/trx/radio_if.py
+++ b/apps/trx/radio_if.py
@@ -98,9 +98,6 @@
self.gsm_clck_ctrl = grgsm.clock_offset_control(
shift_fc, self.samp_rate, osr = 4)
- # TODO: implement configurable TS filter
- self.gsm_ts_filter = grgsm.burst_timeslot_filter(0)
-
self.gsm_trx_if = grgsm.trx(self.trx_remote_addr,
str(self.trx_base_port))
@@ -118,9 +115,6 @@
(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_if, 'bursts'))
def check_available(self):