bts: Introduce f_rsl_transceive() and reduce code duplication
Change-Id: I56de61e08bd1508a0531f720561ead84d1075de3
This commit is contained in:
parent
2a7e7163c1
commit
1eba37487b
|
@ -225,34 +225,36 @@ runs on ConnHdlr {
|
||||||
fn.apply(id);
|
fn.apply(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_rsl_transceive(template RSL_Message tx, template RSL_Message exp_rx, charstring id)
|
||||||
function f_rsl_chan_act(RSL_IE_ChannelMode mode) runs on ConnHdlr {
|
runs on ConnHdlr {
|
||||||
RSL.send(ts_RSL_CHAN_ACT(g_chan_nr, mode));
|
timer T := 3.0;
|
||||||
|
RSL.send(tx);
|
||||||
|
T.start;
|
||||||
alt {
|
alt {
|
||||||
[] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) {
|
[] RSL.receive(exp_rx) {
|
||||||
g_Tmeas_exp.start;
|
T.stop;
|
||||||
|
setverdict(pass);
|
||||||
}
|
}
|
||||||
[] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) {
|
[] T.timeout {
|
||||||
setverdict(fail, "Unexpected RF CHAN ACT NACK");
|
setverdict(fail, "Timeout expecting " & id);
|
||||||
|
self.stop;
|
||||||
|
}
|
||||||
|
[] RSL.receive {
|
||||||
|
setverdict(fail, "Unexpected RSL message received");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_rsl_chan_act(RSL_IE_ChannelMode mode) runs on ConnHdlr {
|
||||||
|
f_rsl_transceive(ts_RSL_CHAN_ACT(g_chan_nr, mode), tr_RSL_CHAN_ACT_ACK(g_chan_nr),
|
||||||
|
"RSL CHAN ACT");
|
||||||
|
}
|
||||||
|
|
||||||
function f_rsl_chan_deact() runs on ConnHdlr {
|
function f_rsl_chan_deact() runs on ConnHdlr {
|
||||||
timer T := 3.0;
|
f_rsl_transceive(ts_RSL_RF_CHAN_REL(g_chan_nr), tr_RSL_RF_CHAN_REL_ACK(g_chan_nr),
|
||||||
RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
|
"RF CHAN REL");
|
||||||
T.start;
|
|
||||||
alt {
|
|
||||||
[] RSL.receive(tr_RSL_RF_CHAN_REL_ACK(g_chan_nr)) {
|
|
||||||
g_Tmeas_exp.stop;
|
|
||||||
}
|
|
||||||
[] T.timeout {
|
|
||||||
setverdict(fail, "Timeout waiting for RF CHAN REL ACK");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private template ConnHdlrPars t_Pars(template RslChannelNr chan_nr,
|
private template ConnHdlrPars t_Pars(template RslChannelNr chan_nr,
|
||||||
template RSL_IE_ChannelMode chan_mode,
|
template RSL_IE_ChannelMode chan_mode,
|
||||||
float t_guard := 20.0) := {
|
float t_guard := 20.0) := {
|
||||||
|
@ -1001,20 +1003,8 @@ testcase TC_rsl_ie_content_error() runs on test_CT {
|
||||||
|
|
||||||
/* Send IPA DLCX to inactive lchan */
|
/* Send IPA DLCX to inactive lchan */
|
||||||
function f_TC_ipa_dlcx_not_active(charstring id) runs on ConnHdlr {
|
function f_TC_ipa_dlcx_not_active(charstring id) runs on ConnHdlr {
|
||||||
timer T := 3.0;
|
f_rsl_transceive(ts_RSL_IPA_DLCX(g_chan_nr, 0), tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?),
|
||||||
RSL.send(ts_RSL_IPA_DLCX(g_chan_nr, 0));
|
"IPA DLCX ACK");
|
||||||
T.start;
|
|
||||||
alt {
|
|
||||||
[] RSL.receive(tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?)) {
|
|
||||||
setverdict(pass);
|
|
||||||
}
|
|
||||||
[] RSL.receive(tr_RSL_IPA_DLCX_NACK(g_chan_nr, ?)) {
|
|
||||||
setverdict(fail);
|
|
||||||
}
|
|
||||||
[] T.timeout {
|
|
||||||
setverdict(fail, "Timeout expecting RF_CHAN_REL_ACK");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
testcase TC_ipa_dlcx_not_active() runs on test_CT {
|
testcase TC_ipa_dlcx_not_active() runs on test_CT {
|
||||||
var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
|
var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
|
||||||
|
|
Loading…
Reference in New Issue