fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17967 )


Change subject: PCU: refactor f_pcuif_rx_imm_ass(): also handle PCH SAPI
......................................................................

PCU: refactor f_pcuif_rx_imm_ass(): also handle PCH SAPI

Change-Id: Ia5d162c1d8bbee43a6e9fab784d8675187f15be1
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 21 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/67/17967/1

diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 1d13b8e..be15f5a 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -237,27 +237,35 @@
 }

 private function f_pcuif_rx_imm_ass(out GsmRrMessage rr_imm_ass,
+                                   template PCUIF_Sapi sapi := 
PCU_IF_SAPI_AGCH,
                                    template GsmRrMessage t_imm_ass := ?,
                                    uint8_t bts_nr := 0)
 runs on RAW_PCU_Test_CT return boolean {
        var PCUIF_Message pcu_msg;
+       var octetstring data;
        timer T;

        T.start(2.0);
        alt {
        [] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := 0, ts_nr 
:= 0,
-                                        sapi := PCU_IF_SAPI_AGCH, data := ?))
-                                       -> value pcu_msg {
-               rr_imm_ass := dec_GsmRrMessage(pcu_msg.u.data_req.data);
-               log("Rx Immediate Assignment: ", rr_imm_ass);
-
-               if (match(rr_imm_ass, t_imm_ass)) {
-                       setverdict(pass);
-                       return true;
+                                        sapi := sapi, data := ?)) -> value 
pcu_msg {
+               /* On PCH the payload is prefixed with paging group (3 octets): 
skip it.
+                * TODO: add an additional template parameter, so we can match 
it. */
+               if (pcu_msg.u.data_req.sapi == PCU_IF_SAPI_PCH) {
+                       data := substr(pcu_msg.u.data_req.data, 3, 
pcu_msg.u.data_req.len - 3);
+               } else {
+                       data := pcu_msg.u.data_req.data;
                }

-               /* Not for us? Wait for more. */
-               repeat;
+               rr_imm_ass := dec_GsmRrMessage(data);
+               if (not match(rr_imm_ass, t_imm_ass)) {
+                       /* Not for us? Wait for more. */
+                       repeat;
+               }
+
+               log("Rx Immediate Assignment: ", rr_imm_ass);
+               setverdict(pass);
+               return true;
                }
        [] BTS.receive { repeat; }
        [] T.timeout {
@@ -293,7 +301,9 @@
        if (is_11bit != 0) { ra := 127; }

        /* Expect Immediate (TBF) Assignment on TS0/AGCH */
-       return f_pcuif_rx_imm_ass(rr_imm_ass, tr_IMM_TBF_ASS(?, ra, fn), 
bts_nr);
+       return f_pcuif_rx_imm_ass(rr_imm_ass, PCU_IF_SAPI_AGCH,
+                                 tr_IMM_TBF_ASS(?, ra, fn),
+                                 bts_nr := bts_nr);
 }

 private function f_imm_ass_verify_ul_tbf_ass(GsmRrMessage rr_imm_ass, out 
PacketUlAssign ul_tbf_ass)

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17967
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia5d162c1d8bbee43a6e9fab784d8675187f15be1
Gerrit-Change-Number: 17967
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to