Change in osmo-ttcn3-hacks[master]: BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Oct 12 23:12:26 UTC 2020


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


Change subject: BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK
......................................................................

BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK

Change-Id: Id0d087a90394369ef60846baa4d02289e9d0be1e
---
M library/BSSAP_LE_Emulation.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)



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

diff --git a/library/BSSAP_LE_Emulation.ttcn b/library/BSSAP_LE_Emulation.ttcn
index 294ac62..d95506c 100644
--- a/library/BSSAP_LE_Emulation.ttcn
+++ b/library/BSSAP_LE_Emulation.ttcn
@@ -115,6 +115,7 @@
 	var charstring g_ran_id;
 	var integer g_next_e1_ts := 1;
 	var BssapLeOps g_ran_ops;
+	var boolean g_reset_ack_ready := false;
 };
 
 private function f_conn_id_known(integer sccp_conn_id)
@@ -315,6 +316,7 @@
 	alt {
 	[] BSSAP_LE.receive(tr_BSSAP_LE_UNITDATA_ind(own, peer, tr_BSSMAP_LE_ResetAck)) {
 		log("Received RESET-ACK in response to RESET, we're ready to go!");
+		g_reset_ack_ready := true;
 		}
 	[] as_reset_ack();
 	[] BSSAP_LE.receive { repeat };
@@ -348,6 +350,7 @@
 		log("Responding to inbound RESET with RESET-ACK");
 		BSSAP_LE.send(ts_BSSAP_LE_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress,
 			   ts_BSSMAP_LE_ResetAck));
+		g_reset_ack_ready := true;
 		repeat;
 	}
 }
@@ -549,6 +552,29 @@
 
 		[] PROC.getcall(BSSAP_LE_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) {
 			f_create_imsi(imsi, tmsi, vc_hdlr);
+
+			/* Wait for RESET-ACK if not received yet */
+			if (not g_reset_ack_ready) {
+				var integer wait_seconds := 10;
+				timer T_reset_ack := 1.0;
+				T_reset_ack.start;
+				alt {
+				[wait_seconds > 0] T_reset_ack.timeout {
+					if (g_reset_ack_ready) {
+						break;
+					}
+					wait_seconds := wait_seconds - 1;
+					T_reset_ack.start;
+					repeat;
+					}
+
+				[wait_seconds == 0] T_reset_ack.timeout {
+					setverdict(fail, "Timeout waiting for BSSMAP-LE RESET-ACK");
+					mtc.stop;
+					}
+				}
+			}
+
 			PROC.reply(BSSAP_LE_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr;
 			}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20624
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: Id0d087a90394369ef60846baa4d02289e9d0be1e
Gerrit-Change-Number: 20624
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201012/91339ba7/attachment.htm>


More information about the gerrit-log mailing list