aboutsummaryrefslogtreecommitdiffstats
path: root/bts/BTS_Tests.ttcn
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-07-14 01:56:15 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-07-14 21:07:50 +0700
commita9894281ef9434402224c0dcbcce9f7d70821ea7 (patch)
treeab874347f4a2c1487cd6debeac47441093cf9204 /bts/BTS_Tests.ttcn
parent6c71c17fc502c822f76487bfb8fca83e5f0aeedb (diff)
BTS_Tests: implement optional frequency hopping support
Diffstat (limited to 'bts/BTS_Tests.ttcn')
-rw-r--r--bts/BTS_Tests.ttcn52
1 files changed, 52 insertions, 0 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1cecf4e4..7c6886de 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -111,6 +111,10 @@ modulepar {
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 @@ friend function f_init_l1ctl() runs on test_CT {
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 @@ runs on test_CT return ConnHdlr {
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;
}