From 5afe885d2614a7508d02c802861172ac137362b0 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 27 May 2020 14:40:51 +0700 Subject: library/L1CTL_PortType: refactor L1CTL channel establishment - Get rid of f_L1CTL_DM_EST_REQ, it's not really needed. - Derive ts_L1CTL_DM_EST_REQ_H0 from ts_L1CTL_DM_EST_REQ. - Turn all its params into (value) templates. - Turn it into a (value) template itself. - Pass GsmArfcn directly to ts_L1CTL_DM_EST_REQ_H0. Change-Id: I4f275e22d4309a23b4ed301a0779c4ecb92023a8 Related: OS#4546 --- library/L1CTL_PortType.ttcn | 8 +++----- library/L1CTL_Types.ttcn | 20 ++++++++++++++++---- library/LAPDm_RAW_PT.ttcn | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'library') diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index c595b034..cc2ff932 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -201,14 +201,12 @@ module L1CTL_PortType { } T.stop; } - function f_L1CTL_DM_EST_REQ(L1CTL_PT pt, Arfcn arfcn, RslChannelNr chan_nr, GsmTsc tsc) { - pt.send(ts_L1CTL_DM_EST_REQ(arfcn, chan_nr, tsc)); - } /* Send DM_EST_REQ from parameters derived from IMM ASS */ function f_L1CTL_DM_EST_REQ_IA(L1CTL_PT pt, ImmediateAssignment imm_ass) { - f_L1CTL_DM_EST_REQ(pt, { false, imm_ass.chan_desc.arfcn }, imm_ass.chan_desc.chan_nr, - imm_ass.chan_desc.tsc); + pt.send(ts_L1CTL_DM_EST_REQ_H0(imm_ass.chan_desc.chan_nr, + imm_ass.chan_desc.tsc, + imm_ass.chan_desc.arfcn)); } /* Send DM_REL_REQ from parameters derived from IMM ASS */ diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index e939f722..0870a203 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -548,7 +548,9 @@ module L1CTL_Types { } } - template L1ctlUlMessage ts_L1CTL_DM_EST_REQ(Arfcn arfcn, RslChannelNr chan_nr, GsmTsc tsc) := { + /* Base template to be inherited by ts_L1CTL_DM_EST_REQ_H0 and ts_L1CTL_DM_EST_REQ_H1 */ + private template (value) L1ctlUlMessage ts_L1CTL_DM_EST_REQ(template (value) RslChannelNr chan_nr, + template (value) GsmTsc tsc) := { header := ts_L1ctlHeader(L1CTL_DM_EST_REQ), ul_info := { chan_nr := chan_nr, @@ -560,15 +562,25 @@ module L1CTL_Types { payload := { dm_est_req := { tsc := tsc, - h := 0, - arfcn := arfcn, - hopping := omit, tch_mode := 0, audio_mode := t_L1CTL_AudioModeNone } } } + template (value) L1ctlUlMessage ts_L1CTL_DM_EST_REQ_H0(template (value) RslChannelNr chan_nr, + template (value) GsmTsc tsc, + template (value) GsmArfcn arfcn) + modifies ts_L1CTL_DM_EST_REQ := { + payload := { + dm_est_req := { + h := 0, + arfcn := { false, arfcn }, + hopping := omit + } + } + } + template L1ctlUlMessage ts_L1CTL_DM_REL_REQ(RslChannelNr chan_nr) := { header := ts_L1ctlHeader(L1CTL_DM_REL_REQ), ul_info := { diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index 75d18d91..394deab3 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -246,7 +246,7 @@ module LAPDm_RAW_PT { set_ph_state(PH_STATE_TUNING_DCH); /* store/save channel description */ chan_desc.chan_nr := chan_nr; - f_L1CTL_DM_EST_REQ(L1CTL,arfcn, chan_nr, tsc); + L1CTL.send(ts_L1CTL_DM_EST_REQ_H0(chan_nr, tsc, arfcn.arfcn)); set_ph_state(PH_STATE_DCH); } -- cgit v1.2.3