From cbc947f709ff41b318a04af4b9fc7da1deb6305c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 22 Feb 2018 00:26:55 +0100 Subject: GSM_RR_Types: Add ts_IMM_ASS and ts_MEAS_REP which allows us to send RR IMMEDIATE ASSIGNMENT (DL/AGCH) and RR MEASUREMENT REPORT (UL/SACCH) messages from tests. Change-Id: Ic75041e84c15c77805ecafb823bf7108920675ca --- library/GSM_RR_Types.ttcn | 94 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) (limited to 'library/GSM_RR_Types.ttcn') diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn index eed58df4..2625a1f7 100644 --- a/library/GSM_RR_Types.ttcn +++ b/library/GSM_RR_Types.ttcn @@ -139,6 +139,12 @@ module GSM_RR_Types { RrMessageType message_type } with { variant "" }; + template RrL3Header t_RrL3Header(RrMessageType msg_type) := { + skip_indicator := 0, + rr_protocol_discriminator := 6, + message_type := msg_type + } + type record MaioHsn { } with { variant "" }; @@ -486,6 +492,31 @@ module GSM_RR_Types { variant (hh) "PRESENCE(presence = '11'B)" }; + type record MeasurementResults { + BIT1 ba_used, + BIT1 dtx_used, + uint6_t rxlev_full_srv_cell, + BIT1 threeg_ba_used, + BIT1 meas_valid, + uint6_t rxlev_sub_srv_cell, + BIT1 si23_ba_used, + uint3_t rxqual_full_srv_cell, + uint3_t rxqual_sub_srv_cell, + uint3_t no_ncell_m, + NcellReports ncell_reports optional + } with { variant (no_ncell_m) "LENGTHTO(ncell_reports)" + variant (no_ncell_m) "UNIT(elements)" + variant "PADDING(yes)" + variant "FIELDLENGTH(16)" + }; + + type record NcellReport { + uint6_t rxlev, + uint5_t bcch_freq, + uint6_t bsic + } with { variant ""}; + type record of NcellReport NcellReports; + /* 9.1.18 */ type record ImmediateAssignment { @@ -497,7 +528,7 @@ module GSM_RR_Types { TimingAdvance timing_advance, MobileAllocation mobile_allocation, /* TODO: starting time TLV */ - IaRestOctets rest_octets + IaRestOctets rest_octets optional } with { variant (chan_desc) "PRESENCE(ded_or_tbf.tbf = false)" variant (pkt_chan_desc) "PRESENCE(ded_or_tbf.tbf = true)" }; @@ -513,6 +544,11 @@ module GSM_RR_Types { ReqRefWaitInd4 payload } with { variant "" }; + /* 9.1.21 */ + type record MeasurementReport { + MeasurementResults meas_res + } with { variant "" }; + /* 9.1.22 */ type record PagingRequestType1 { ChannelNeeded12 chan_needed, @@ -607,6 +643,7 @@ module GSM_RR_Types { type union RrL3Union { PagingResponse paging_response, + MeasurementReport meas_rep, octetstring other }; @@ -615,8 +652,61 @@ module GSM_RR_Types { RrL3Union payload } with { variant (payload) "CROSSTAG( paging_response, header.message_type = PAGING_RESPONSE; - + meas_rep, header.message_type = MEASUREMENT_REPORT; other, OTHERWISE; )" } + external function enc_GsmRrL3Message(in GsmRrL3Message msg) return octetstring + with { extension "prototype(convert) encode(RAW)" }; + external function dec_GsmRrL3Message(in octetstring stream) return GsmRrL3Message + with { extension "prototype(convert) decode(RAW)" }; + + + template GsmRrMessage ts_IMM_ASS(uint8_t ra, GsmFrameNumber fn, TimingAdvance ta, + ChannelDescription ch_desc, MobileAllocation ma) := { + header := t_RrHeader(IMMEDIATE_ASSIGNMENT, 0), + payload := { + imm_ass := { + ded_or_tbf := { + spare := '0'B, + tma := false, + downlink := false, + tbf := false + }, + page_mode := PAGE_MODE_NORMAL, + chan_desc := ch_desc, + pkt_chan_desc := omit, + req_ref := f_compute_ReqRef(ra, fn), + timing_advance := ta, + mobile_allocation := ma, + rest_octets := omit + } + } + }; + + template (value) GsmRrL3Message ts_MEAS_REP(boolean valid, uint6_t rxl_f, uint6_t rxl_s, + uint3_t rxq_f, uint3_t rxq_s, + template (omit) NcellReports reps) := { + header := t_RrL3Header(MEASUREMENT_REPORT), + payload := { + meas_rep := { + meas_res := { + ba_used := '0'B, + dtx_used := '0'B, + rxlev_full_srv_cell := rxl_f, + threeg_ba_used := '0'B, + meas_valid := bool2bit(valid), + rxlev_sub_srv_cell := rxl_s, + si23_ba_used := '0'B, + rxqual_full_srv_cell := rxq_f, + rxqual_sub_srv_cell := rxq_s, + no_ncell_m := 0, + ncell_reports := reps + } + } + } + }; + + + } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- cgit v1.2.3