pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41724?usp=email )

Change subject: BSSAP_LE_Emulation: Support Tx RESET retries
......................................................................

BSSAP_LE_Emulation: Support Tx RESET retries

Have same code as we use in RAN_Emulation.ttcnpp.

Change-Id: I475f93ff0b8cbfa5aa4900d02ddcb2e97fa5ca6a
---
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSAP_LE_Emulation.ttcn
M smlc/BSC_ConnectionHandler.ttcn
3 files changed, 23 insertions(+), 12 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve




diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 3c6e1b0..f18e294 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -641,6 +641,7 @@
        unitdata_cb := refers(BSSAP_LE_UnitdataCallback),
        decode_dtap := false,
        role_ms := false,
+       bssap_le_reset_retries := 1,
        sccp_addr_local := omit,
        sccp_addr_peer := omit
 }
diff --git a/library/BSSAP_LE_Emulation.ttcn b/library/BSSAP_LE_Emulation.ttcn
index fe85e58..771caec 100644
--- a/library/BSSAP_LE_Emulation.ttcn
+++ b/library/BSSAP_LE_Emulation.ttcn
@@ -310,21 +310,29 @@

 private function f_bssap_le_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) 
runs on BSSAP_LE_Emulation_CT {
        timer T := 5.0;
+       var integer attempts := g_ran_ops.bssap_le_reset_retries;

-       BSSAP_LE.send(ts_BSSAP_LE_UNITDATA_req(peer, own, 
ts_BSSMAP_LE_Reset(GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE)));
-       T.start;
-       alt {
-       [] BSSAP_LE.receive(tr_BSSAP_LE_UNITDATA_ind(own, peer, 
tr_BSSMAP_LE_ResetAck)) {
-               log("BSSMAP-LE: Received RESET-ACK in response to RESET, we're 
ready to go!");
-               g_reset_ack_ready := true;
-               }
-       [] as_reset_ack();
-       [] BSSAP_LE.receive { repeat };
-       [] T.timeout {
-               setverdict(fail, "BSSMAP-LE: Timeout waiting for RESET-ACK 
after sending RESET");
-               mtc.stop;
+       while (attempts > 0) {
+               attempts := attempts - 1;
+
+               BSSAP_LE.send(ts_BSSAP_LE_UNITDATA_req(peer, own, 
ts_BSSMAP_LE_Reset(GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE)));
+               T.start;
+               alt {
+               [] BSSAP_LE.receive(tr_BSSAP_LE_UNITDATA_ind(own, peer, 
tr_BSSMAP_LE_ResetAck)) {
+                       log("BSSMAP-LE: Received RESET-ACK in response to 
RESET, we're ready to go!");
+                       g_reset_ack_ready := true;
+                       return;
+                       }
+               [] as_reset_ack();
+               [] BSSAP_LE.receive { repeat };
+               [] T.timeout {
+                       continue;
+                       }
                }
        }
+
+       setverdict(fail, "BSSMAP-LE: Timeout waiting for RESET-ACK after 
sending RESET");
+       mtc.stop;
 }

 private function f_bssap_l3_is_rr(PDU_BSSAP_LE bssap) return boolean {
@@ -339,6 +347,7 @@
        BssmapLeUnitdataCallback unitdata_cb optional,
        boolean decode_dtap,
        boolean role_ms,
+       integer bssap_le_reset_retries,
        /* needed for performing BSSMAP RESET */
        SCCP_PAR_Address sccp_addr_local optional,
        SCCP_PAR_Address sccp_addr_peer optional
diff --git a/smlc/BSC_ConnectionHandler.ttcn b/smlc/BSC_ConnectionHandler.ttcn
index bd787c7..fa5d66a 100644
--- a/smlc/BSC_ConnectionHandler.ttcn
+++ b/smlc/BSC_ConnectionHandler.ttcn
@@ -72,6 +72,7 @@
        unitdata_cb := refers(BSSAP_LE_UnitdataCallback),
        decode_dtap := false,
        role_ms := false,
+       bssap_le_reset_retries := 1,
        sccp_addr_local := omit,
        sccp_addr_peer := omit
 }

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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I475f93ff0b8cbfa5aa4900d02ddcb2e97fa5ca6a
Gerrit-Change-Number: 41724
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to