PCU: derive f_pcuif_rx_imm_ass() from f_establish_tbf()
Change-Id: I3b49927d0db49555e0bf2bb453449f614c7b9323
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 3f18400..8e1d349 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -236,29 +236,13 @@
desc.final_ack := final_ack;
}
-/* FIXME: properly encode RA (see TS 24.060, table 11.2.5.2) */
-private function f_establish_tbf(out GsmRrMessage rr_imm_ass, uint8_t bts_nr := 0,
- uint16_t ra := oct2int('3A'O), uint8_t is_11bit := 0,
- PCUIF_BurstType burst_type := BURST_TYPE_0,
- TimingAdvance ta := 0)
+private function f_pcuif_rx_imm_ass(out GsmRrMessage rr_imm_ass,
+ template GsmRrMessage t_imm_ass := ?,
+ uint8_t bts_nr := 0)
runs on RAW_PCU_Test_CT return boolean {
var PCUIF_Message pcu_msg;
- var GsmRrMessage rr_msg;
- var uint32_t fn;
timer T;
- /* FIXME: ask the BTS component to give us the current TDMA fn */
- fn := 1337 + ta;
-
- /* Send RACH.ind */
- log("Sending RACH.ind on fn=", fn, " with RA=", ra, ", TA=", ta);
- BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
- ra := ra, is_11bit := is_11bit,
- burst_type := burst_type,
- fn := fn, arfcn := 871,
- qta := ta * 4));
-
- /* Expect Immediate (TBF) Assignment on TS0/AGCH */
T.start(2.0);
alt {
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
@@ -267,9 +251,7 @@
rr_imm_ass := dec_GsmRrMessage(pcu_msg.u.data_req.data);
log("Rx Immediate Assignment: ", rr_imm_ass);
- /* Make sure this assignment is for us
- * TODO: Uplink or Downlink TBF? */
- if (match(rr_imm_ass, tr_IMM_TBF_ASS(?, ra, fn))) {
+ if (match(rr_imm_ass, t_imm_ass)) {
setverdict(pass);
return true;
}
@@ -286,6 +268,29 @@
return false;
}
+/* FIXME: properly encode RA (see TS 24.060, table 11.2.5.2) */
+private function f_establish_tbf(out GsmRrMessage rr_imm_ass, uint8_t bts_nr := 0,
+ uint16_t ra := oct2int('3A'O), uint8_t is_11bit := 0,
+ PCUIF_BurstType burst_type := BURST_TYPE_0,
+ TimingAdvance ta := 0)
+runs on RAW_PCU_Test_CT return boolean {
+ var uint32_t fn;
+
+ /* FIXME: ask the BTS component to give us the current TDMA fn */
+ fn := 1337 + ta;
+
+ /* Send RACH.ind */
+ log("Sending RACH.ind on fn=", fn, " with RA=", ra, ", TA=", ta);
+ BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
+ ra := ra, is_11bit := is_11bit,
+ burst_type := burst_type,
+ fn := fn, arfcn := 871,
+ qta := ta * 4));
+
+ /* Expect Immediate (TBF) Assignment on TS0/AGCH */
+ return f_pcuif_rx_imm_ass(rr_imm_ass, tr_IMM_TBF_ASS(?, ra, fn), bts_nr);
+}
+
private function f_imm_ass_verify_ul_tbf_ass(GsmRrMessage rr_imm_ass, out PacketUlAssign ul_tbf_ass)
runs on RAW_PCU_Test_CT return boolean {