bts: new f_rsl_transceive_ret(): like f_rsl_transceive() with return value

Change-Id: I0cdc6b87566b9d101ecb12a77eac18a50689e088
This commit is contained in:
Harald Welte 2018-03-30 11:56:38 +02:00
parent 98eb1bf6d2
commit b1726c90dc
1 changed files with 13 additions and 4 deletions

View File

@ -393,14 +393,15 @@ runs on ConnHdlr {
fn.apply(id);
}
function f_rsl_transceive(template RSL_Message tx, template RSL_Message exp_rx, charstring id,
boolean ignore_other := false)
runs on ConnHdlr {
function f_rsl_transceive_ret(template RSL_Message tx, template RSL_Message exp_rx, charstring id,
boolean ignore_other := false)
runs on ConnHdlr return RSL_Message {
var RSL_Message rx;
timer T := 3.0;
RSL.send(tx);
T.start;
alt {
[] RSL.receive(exp_rx) {
[] RSL.receive(exp_rx) -> value rx {
T.stop;
setverdict(pass);
}
@ -413,9 +414,17 @@ runs on ConnHdlr {
[not ignore_other] as_l1_dcch();
[not ignore_other] RSL.receive {
setverdict(fail, "Unexpected RSL message received");
self.stop;
}
[ignore_other] RSL.receive { repeat; }
}
return rx;
}
function f_rsl_transceive(template RSL_Message tx, template RSL_Message exp_rx, charstring id,
boolean ignore_other := false)
runs on ConnHdlr {
var RSL_Message rx := f_rsl_transceive_ret(tx, exp_rx, id, ignore_other);
}
function f_rsl_chan_act(RSL_IE_ChannelMode mode) runs on ConnHdlr {