summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-10 17:15:38 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-12 16:04:33 +0100
commitaca6e07cf71399c2afae48f01c02a7404e6bed62 (patch)
tree779eca801dcb97fc8b33facd7dde8e4598e9416b
parent3757e60d6f0da96d403fe798a767873797960a1c (diff)
L1CTL: Have proper timeout during reset
-rw-r--r--library/L1CTL_PortType.ttcn19
1 files changed, 16 insertions, 3 deletions
diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index 6c4fe70..ba47414 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -161,15 +161,28 @@ module L1CTL_PortType {
pt.send(ts_L1CTL_DM_EST_REQ({ false, imm_ass.chan_desc.arfcn }, imm_ass.chan_desc.chan_nr, imm_ass.chan_desc.tsc));
}
+ function f_L1CTL_RESET(L1CTL_PT pt, L1ctlResetType res_type := L1CTL_RES_T_FULL) {
+ timer T := 2.0;
+ pt.send(t_L1ctlResetReq(res_type));
+ T.start;
+ alt {
+ [] pt.receive(tr_L1CTL_MsgType(L1CTL_RESET_CONF)) { }
+ [] pt.receive { repeat; }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for RESET.conf");
+ self.stop;
+ }
+ }
+
+ }
+
function f_connect_reset(L1CTL_PT pt, charstring l1ctl_sock_path := m_l1ctl_sock_path) {
var f_UD_getMsgLen vl_f := refers(f_L1CTL_getMsgLen);
f_L1CTL_setGetMsgLen(pt, -1, vl_f, {});
pt.send(L1CTL_connect:{path:=l1ctl_sock_path});
pt.receive(L1CTL_connect_result:{result_code := SUCCESS, err:=omit});
f_L1CTL_setGetMsgLen(pt, 0, vl_f, {});
-
- pt.send(t_L1ctlResetReq(L1CTL_RES_T_FULL));
- pt.receive;
+ f_L1CTL_RESET(pt);
}
private function L1CTL_to_UD_connect(in L1CTL_connect pin, out UD_connect pout) {