bts: Update transmitted MS power as requested by BTS

New generic ms power loop algo takes into account the MS Power sent by
MS over L1 SACCH Header. As a result, the test infra must now update its
transmitted value according to what is requested by the BTS as if it was
a real MS in order for algo to output expected results.

Requires osmocom-bb I975cfc5f5d63eb32a7f8932a7f6a544c9a12233c to have
transmitted MS power values for dummy Meas Results updated as requested
over L1CTL.

Change-Id: I287761202093fbc1064f9868efe6f7f6155253ca
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 779f7c3..4ba8f55 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2016,9 +2016,11 @@
 	T2.start;
 	alt {
 	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
-		if( not(oct2int(l1_dl.payload.data_ind.payload[0]) > (pwr_var+6))){
+		/* Update sent MS power to follow what BTS requests */
+		f_L1CTL_PARAM(L1CTL, g_pars.l1_pars.ms_actual_ta, oct2int(l1_dl.payload.data_ind.payload[0]));
+		if (oct2int(l1_dl.payload.data_ind.payload[0]) < (pwr_var + 6)) {
 			repeat;
-			}
+		}
 		T2.stop;
 		}
 	[] L1CTL.receive { repeat; }
@@ -2035,9 +2037,11 @@
 	T4.start;
 	alt {
 	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
-		if( not(oct2int(l1_dl.payload.data_ind.payload[0]) <= (pwr_var))){
+		/* Update sent MS power to follow what BTS requests */
+		f_L1CTL_PARAM(L1CTL, g_pars.l1_pars.ms_actual_ta, oct2int(l1_dl.payload.data_ind.payload[0]));
+		if (oct2int(l1_dl.payload.data_ind.payload[0]) > pwr_var) {
 			repeat;
-			}
+		}
 		T4.stop;
 		setverdict(pass, "Power level in L1 decreased/increased as expected");
 		}
@@ -2077,7 +2081,11 @@
 	timer T1 := 10.0;
 	T1.start;
 	alt {
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl { repeat; }
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
+		/* Update sent MS power to follow what BTS requests */
+		f_L1CTL_PARAM(L1CTL, g_pars.l1_pars.ms_actual_ta, oct2int(l1_dl.payload.data_ind.payload[0]));
+		repeat;
+		}
 	[] L1CTL.receive { repeat; }
 	[] T1.timeout {
 		if( oct2int(l1_dl.payload.data_ind.payload[0]) != pwr_var){
@@ -2119,7 +2127,11 @@
 	timer T1 := 10.0;
 	T1.start;
 	alt {
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl { repeat; }
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
+		/* Update sent MS power to follow what BTS requests */
+		f_L1CTL_PARAM(L1CTL, g_pars.l1_pars.ms_actual_ta, oct2int(l1_dl.payload.data_ind.payload[0]));
+		repeat;
+		}
 	[] L1CTL.receive { repeat; }
 	[] T1.timeout {
 		var int8_t rcv := oct2int(l1_dl.payload.data_ind.payload[0]);
@@ -2166,7 +2178,11 @@
 	timer T1 := 10.0;
 	T1.start;
 	alt {
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl { repeat; }
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
+		/* Update sent MS power to follow what BTS requests */
+		f_L1CTL_PARAM(L1CTL, g_pars.l1_pars.ms_actual_ta, oct2int(l1_dl.payload.data_ind.payload[0]));
+		repeat;
+		}
 	[] L1CTL.receive { repeat; }
 	[] T1.timeout {
 		if( f_power_level_is_lowest_dbm(oct2int(l1_dl.payload.data_ind.payload[0])) ){