Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 1 | module BTS_Simulation { |
| 2 | |
| 3 | /* Start an IPA client and bind the RSL Emulation on top; we assume that OML |
| 4 | * is handled elsewhere! */ |
| 5 | |
| 6 | import from IPL4asp_Types all; |
| 7 | import from IPA_Emulation all; |
| 8 | import from RSL_Emulation all; |
| 9 | import from RSL_Tests all; |
| 10 | |
| 11 | type component BTS_CT { |
| 12 | var IPA_Emulation_CT vc_IPA; |
| 13 | var RSL_Emulation_CT vc_RSL; |
| 14 | var IPA_CCM_Parameters ccm_pars; |
| 15 | } |
| 16 | |
| 17 | function main(charstring bsc_host, PortNumber bsc_port, charstring id) runs on BTS_CT |
| 18 | { |
| 19 | vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); |
| 20 | vc_RSL := RSL_Emulation_CT.create(id & "-RSL"); |
| 21 | ccm_pars := c_IPA_default_ccm_pars; |
| 22 | ccm_pars.name := "Osmocom TTCN-3 BTS Simulator"; |
| 23 | ccm_pars.unit_id := "1234/0/0"; |
| 24 | |
| 25 | map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); |
| 26 | connect(vc_IPA:IPA_RSL_PORT, vc_RSL:IPA_PT); |
| 27 | |
| 28 | vc_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1, ccm_pars)); |
| 29 | vc_RSL.start(RSL_Emulation.main()); |
| 30 | |
| 31 | var RSL_Tests_CT vc_DCHAN; |
| 32 | vc_DCHAN := RSL_Tests_CT.create(id & "-DCHAN"); |
| 33 | connect(vc_DCHAN:RSL, vc_RSL:CLIENT_PT); |
| 34 | vc_DCHAN.start(RSL_Tests.test_mahlzeit('901700123456789'H)); |
| 35 | |
| 36 | |
| 37 | /* wait until termination of respective component */ |
| 38 | vc_RSL.done; |
| 39 | vc_IPA.done; |
| 40 | } |
| 41 | |
| 42 | |
| 43 | |
| 44 | } |