diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index f45b4257c..dab1785f5 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -54,9 +54,10 @@ type port RSL_DCHAN_PT message { signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); +signature RSLEM_suspend(boolean suspend); type port RSLEM_PROC_PT procedure { - inout RSLEM_register, RSLEM_unregister; + inout RSLEM_register, RSLEM_unregister, RSLEM_suspend; } with { extension "internal" }; /*********************************************************************** @@ -276,6 +277,8 @@ function main() runs on RSL_Emulation_CT { var uint8_t trx_nr; var integer cid; var integer i; + /* special synchronization handling during hand-over */ + var boolean dchan_suspended := false; f_conn_table_init(); @@ -348,7 +351,7 @@ function main() runs on RSL_Emulation_CT { IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, ts_RSL_CHAN_ACT_ACK(chan_nr, 23))); } - [] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeDR(?))) -> value rx_rsl { + [not dchan_suspended] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeDR(?))) -> value rx_rsl { /* dispatch to channel based on ChanId */ cid := f_cid_by_chan_nr(f_trx_by_streamId(rx_rsl.streamId), rx_rsl.rsl.ies[0].body.chan_nr); @@ -359,7 +362,7 @@ function main() runs on RSL_Emulation_CT { } } - [] IPA_PT.receive { + [not dchan_suspended] IPA_PT.receive { setverdict(fail, "Received unknown primitive from IPA"); self.stop; } @@ -389,6 +392,17 @@ function main() runs on RSL_Emulation_CT { RSL_PROC.reply(RSLEM_unregister:{trx_nr, chan_nr, vc_conn}); } + [] RSL_PROC.getcall(RSLEM_suspend:{true}) { + log("Suspending DChan"); + dchan_suspended := true; + RSL_PROC.reply(RSLEM_suspend:{true}); + } + + [] RSL_PROC.getcall(RSLEM_suspend:{false}) { + log("Resuming DChan"); + dchan_suspended := false; + RSL_PROC.reply(RSLEM_suspend:{false}); + } } } @@ -420,5 +434,22 @@ runs on RSL_DchanHdlr { } } +/* resume handling of RSL DChan messages from IPA until f_rslem_resume() is called */ +function f_rslem_suspend(RSLEM_PROC_PT PT) +runs on RSL_DchanHdlr { + PT.call(RSLEM_suspend:{true}) { + [] PT.getreply(RSLEM_suspend:{true}) {}; + } +} + +/* resume handling of RSL DChan messages after f_rslem_suspend() is called */ +function f_rslem_resume(RSLEM_PROC_PT PT) +runs on RSL_DchanHdlr { + PT.call(RSLEM_suspend:{false}) { + [] PT.getreply(RSLEM_suspend:{false}) {}; + } +} + + }