BTS_Tests: implement optional frequency hopping support
Change-Id: If0318fd320d4f112341465844555bf8d65b5f88f
Depends: I7822c3581fccba3277a63577e740e7486307635d
Related: SYS#4868, OS#4546
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1cecf4e..7c6886d 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -111,6 +111,10 @@
boolean mp_l1_supports_gprs := false;
/* how many transceivers do we expect to connect */
integer mp_transceiver_num := 1;
+ /* frequency hopping status */
+ boolean mp_freq_hop_enabled := false;
+ /* frequency hopping parameters */
+ FreqHopConfig mp_fh_config;
}
type record of RslChannelNr ChannelNrs;
@@ -510,6 +514,49 @@
private type function void_fn(charstring id) runs on ConnHdlr;
+private type record length(8) of FreqHopGroups FreqHopConfig;
+
+private type record of FreqHopGroup FreqHopGroups;
+private type record FreqHopGroup {
+ uint6_t hsn,
+ FreqHopGroupItems trx_maio
+};
+
+private type record of FreqHopGroupItem FreqHopGroupItems;
+private type record FreqHopGroupItem {
+ uint8_t trx_nr,
+ uint6_t maio
+};
+
+friend function f_resolve_fh_params(inout ConnHdlrPars pars, uint8_t trx_nr := 0)
+{
+ var FreqHopGroups groups := mp_fh_config[pars.chan_nr.tn];
+ var integer i, j;
+
+ for (i := 0; i < lengthof(groups); i := i + 1) {
+ var FreqHopGroup g := groups[i];
+ for (j := 0; j < lengthof(g.trx_maio); j := j + 1) {
+ var FreqHopGroupItem gi := g.trx_maio[j];
+ if (gi.trx_nr == trx_nr) {
+ pars.maio_hsn := valueof(ts_HsnMaio(g.hsn, gi.maio));
+ pars.ma := { }; /* to be composed below */
+ break;
+ }
+ }
+
+ if (ispresent(pars.maio_hsn)) {
+ /* Compose the Mobile Allocation */
+ for (j := 0; j < lengthof(g.trx_maio); j := j + 1) {
+ var FreqHopGroupItem gi := g.trx_maio[j];
+ pars.ma := pars.ma & { l1ctl_ma_def[gi.trx_nr] };
+ }
+
+ log("Freq. hopping parameters: ", pars.maio_hsn, pars.ma);
+ break; /* We're done */
+ }
+ }
+}
+
/* create a new test component */
friend function f_start_handler(void_fn fn, ConnHdlrPars pars,
boolean pcu_comp := false,
@@ -535,6 +582,11 @@
map(vc_conn:BTS_TRXC, system:BTS_TRXC);
}
+ /* Obtain frequency hopping parameters for a given timeslot */
+ if (mp_freq_hop_enabled and mp_transceiver_num > 1) {
+ f_resolve_fh_params(pars);
+ }
+
vc_conn.start(f_handler_init(fn, id, pars));
return vc_conn;
}
diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn
index 4d4a988..4242502 100644
--- a/bts/BTS_Tests_LAPDm.ttcn
+++ b/bts/BTS_Tests_LAPDm.ttcn
@@ -228,6 +228,12 @@
/* undo what f_start_handler is doing and pull LAPDm_CT into the loop */
unmap(self:L1CTL, system:L1CTL);
f_lapdm_init();
+
+ /* Obtain frequency hopping parameters for a given timeslot */
+ if (mp_freq_hop_enabled and mp_transceiver_num > 1) {
+ f_resolve_fh_params(g_pars);
+ }
+
/* activate the channel on the BTS side */
f_rsl_chan_act(g_pars.chan_mode, false, {});
/* activate the channel on the MS side */