Change in osmo-ttcn3-hacks[master]: BTS: manually compose Rest Octets for SI Type 3 and 4

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue May 5 19:30:43 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18027 )

Change subject: BTS: manually compose Rest Octets for SI Type 3 and 4
......................................................................

BTS: manually compose Rest Octets for SI Type 3 and 4

Finally, we can get rid of hard-coded octetstrings and control
every field of the Rest Octets we're sending to the IUT.

Note that template 'ts_SI4_default' did not contain any Rest
Octets at all, thus the GPRS indicator was (and still is)
absent. This will be fixed in a follow up change.

Change-Id: I0a95b34b495267edf1f48692e24fcd5ede8ccdd1
Signed-off-by: Vadim Yanitskiy <axilirator at gmail.com>
---
M bts/BTS_Tests.ttcn
M library/GSM_RestOctets.ttcn
M library/Osmocom_Types.ttcn
3 files changed, 78 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 6f43a44..3ed3655 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -225,6 +225,28 @@
 	lac := 42
 }
 
+private template (value) GPRSIndicator ts_GPRSIndicator_def := {
+	ra_colour := 0,
+	si13_pos := '0'B
+}
+
+private template (value) SI3RestOctets ts_SI3RestOctets_def
+modifies ts_SI3RestOctets := {
+	gprs_ind := {
+		presence := CSN1_H,
+		ind := ts_GPRSIndicator_def
+	}
+}
+
+private template (value) SI4RestOctets ts_SI4RestOctets_def
+modifies ts_SI4RestOctets := {
+	gprs_ind := {
+		/* FIXME: GPRS Indicator shall be present here too */
+		presence := CSN1_L,
+		ind := omit
+	}
+}
+
 /* Default SYSTEM INFORMATION 3 */
 template (value) SystemInformation ts_SI3_default := {
 	header := ts_RrHeader(SYSTEM_INFORMATION_TYPE_3, 18),
@@ -251,7 +273,7 @@
 			},
 			cell_sel_par := ts_CellSelPar_default,
 			rach_control := ts_RachCtrl_default,
-			rest_octets := '2C2B2B2B'O /* GPRS present */
+			rest_octets := enc_SI3RestOctets(valueof(ts_SI3RestOctets_def))
 		}
 	}
 }
@@ -276,7 +298,7 @@
 			rach_control := ts_RachCtrl_default,
 			cbch_chan_desc := omit,
 			cbch_mobile_alloc := omit,
-			rest_octets := ''O
+			rest_octets := enc_SI4RestOctets(valueof(ts_SI4RestOctets_def))
 		}
 	}
 }
diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn
index 045d177..531528c 100644
--- a/library/GSM_RestOctets.ttcn
+++ b/library/GSM_RestOctets.ttcn
@@ -142,4 +142,54 @@
 	with { extension "prototype(convert) decode(RAW)" };
 
 
+/* Basic templates to be extended in place */
+template (value) SI3RestOctets ts_SI3RestOctets := {
+	sel_params := {
+		presence := CSN1_L,
+		params := omit
+	},
+	pwr_offset := {
+		presence := CSN1_L,
+		offset := omit
+	},
+	si_2ter_ind := CSN1_L,
+	early_cm_ind := CSN1_L,
+	sched_where := {
+		presence := CSN1_L,
+		where := omit
+	},
+	gprs_ind := {
+		presence := CSN1_L,
+		ind := omit
+	},
+	umts_early_cm_ind := CSN1_L,
+	si2_quater_ind := {
+		presence := CSN1_L,
+		ind := omit
+	},
+	iu_mode_ind := omit,
+	si21_ind := {
+		presence := CSN1_L,
+		pos := omit
+	}
+}
+
+template (value) SI4RestOctets ts_SI4RestOctets := {
+	sel_params := {
+		presence := CSN1_L,
+		params := omit
+	},
+	pwr_offset := {
+		presence := CSN1_L,
+		offset := omit
+	},
+	gprs_ind := {
+		presence := CSN1_L,
+		ind := omit
+	},
+	s_presence := CSN1_L,
+	s := omit
+}
+
+
 } with { encode "RAW"; variant "FIELDORDER(msb)" }
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index 3b2ca17..16395df 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -40,6 +40,10 @@
 	const uint16_t c_UINT16_MAX := 65535;
 	const uint32_t c_UINT32_MAX := 4294967295;
 
+	/* CSN.1 L/H placeholders */
+	const BIT1 CSN1_L := '0'B;
+	const BIT1 CSN1_H := '1'B;
+
 	type record Arfcn {
 		boolean		pcs,
 		uint15_t	arfcn

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18027
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a95b34b495267edf1f48692e24fcd5ede8ccdd1
Gerrit-Change-Number: 18027
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200505/90c6ab75/attachment.htm>


More information about the gerrit-log mailing list