From d1209a6f04f35b1b97b539eb7d836491633a0c13 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 29 Jul 2017 12:55:06 +0200 Subject: Move "connect to L1CTL and RESET" function from LAPDm_RAW_PT to L1CTL_PortType --- lapdm/LAPDm_RAW_PT.ttcn | 6 +----- library/L1CTL_PortType.ttcn | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lapdm/LAPDm_RAW_PT.ttcn b/lapdm/LAPDm_RAW_PT.ttcn index 37824d3a..02b0b137 100644 --- a/lapdm/LAPDm_RAW_PT.ttcn +++ b/lapdm/LAPDm_RAW_PT.ttcn @@ -90,11 +90,7 @@ module LAPDm_RAW_PT { } private function f_init() runs on lapdm_CT { - L1CTL.send(L1CTL_connect:{path:=l1ctl_sock_path}); - L1CTL.receive(L1CTL_connect_result:{result_code := SUCCESS, err:=omit}); - - L1CTL.send(t_L1ctlResetReq(L1CTL_RES_T_SCHED)); - L1CTL.receive; + f_connect_reset(L1CTL, l1ctl_sock_path); set_ph_state(PH_STATE_NULL); } diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index 92d3d118..019e2a70 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -67,6 +67,13 @@ module L1CTL_PortType { pt.send(t_L1CTL_DM_EST_REQ({ false, imm_ass.chan_desc.arfcn }, imm_ass.chan_desc.chan_nr, imm_ass.chan_desc.tsc)); } + function f_connect_reset(L1CTL_PT pt, charstring l1ctl_sock_path := "/tmp/osmocom_l2") { + pt.send(L1CTL_connect:{path:=l1ctl_sock_path}); + pt.receive(L1CTL_connect_result:{result_code := SUCCESS, err:=omit}); + + pt.send(t_L1ctlResetReq(L1CTL_RES_T_SCHED)); + pt.receive; + } private function L1CTL_to_UD_connect(in L1CTL_connect pin, out UD_connect pout) { pout.path := pin.path; -- cgit v1.2.3