Change in osmo-ttcn3-hacks[master]: GSM_Types: Add CBCH_Block definition of TS 04.12

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Sep 17 08:04:32 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10982 )

Change subject: GSM_Types: Add CBCH_Block definition of TS 04.12
......................................................................

GSM_Types: Add CBCH_Block definition of TS 04.12

Change-Id: Ib034aba11a0219959c4224238e559ba36e95cacf
---
M library/GSM_Types.ttcn
M library/General_Types.ttcn
2 files changed, 43 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index 53208e5..88be975 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -207,6 +207,48 @@
 		}
 	}
 
+
+/* TS 04.12 Section 3.3.1 Block type */
+type record CBCH_BlockType {
+	BIT1	spare,
+	BIT2	lpd,
+	boolean last_block,
+	uint4_t	seq_nr
+};
+template (value) CBCH_BlockType ts_CBCH_BlockType(template (value) uint4_t seq_nr, template (value) boolean last_block) := {
+	spare := '0'B,
+	lpd := '01'B,
+	last_block := last_block,
+	seq_nr := seq_nr
+};
+template CBCH_BlockType tr_CBCH_BlockType(template uint4_t seq_nr := ?, template boolean last_block := ?) := {
+	spare := '0'B,
+	lpd := '01'B,
+	last_block := last_block,
+	seq_nr := seq_nr
+};
+
+/* TS 04.12 Section 3.3 */
+type record CBCH_Block {
+	CBCH_BlockType	block_type,
+	OCT22		payload
+};
+template (value) CBCH_Block ts_CBCH_Block(template (value) uint4_t seq_nr, template (value) boolean last_block, template (value) OCT22 payload) := {
+	block_type := ts_CBCH_BlockType(seq_nr, last_block),
+	payload := payload
+};
+template CBCH_Block tr_CBCH_Block(template uint4_t seq_nr := ?, template boolean last_block := ?, template OCT22 payload := ?) := {
+	block_type := tr_CBCH_BlockType(seq_nr, last_block),
+	payload := payload
+};
+
+
+external function enc_CBCH_Block(in CBCH_Block msg) return octetstring
+	with { extension "prototype(convert) encode(RAW)" };
+external function dec_CBCH_Block(in octetstring stream) return CBCH_Block
+	with { extension "prototype(convert) decode(RAW)" };
+
+
 /* Convert RF signal level in dBm to RxLev (TS 45.008 Chapter 8.1.4) */
 function dbm2rxlev(integer dbm) return uint6_t {
 	var integer rxlev := dbm + 110;
diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn
index 83b2a42..612d5c7 100644
--- a/library/General_Types.ttcn
+++ b/library/General_Types.ttcn
@@ -233,6 +233,7 @@
   type octetstring OCT18 length(18) with { variant "FIELDLENGTH(18)" };
   type octetstring OCT19 length(19) with { variant "FIELDLENGTH(19)" };
   type octetstring OCT20 length(20) with { variant "FIELDLENGTH(20)" };
+  type octetstring OCT22 length(22) with { variant "FIELDLENGTH(22)" };
   type octetstring OCT32 length(32) with { variant "FIELDLENGTH(32)" };
   type octetstring OCT34 length(34) with { variant "FIELDLENGTH(34)" };
   type octetstring OCT46 length(46) with { variant "FIELDLENGTH(46)" };

-- 
To view, visit https://gerrit.osmocom.org/10982
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib034aba11a0219959c4224238e559ba36e95cacf
Gerrit-Change-Number: 10982
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180917/6d44b122/attachment.htm>


More information about the gerrit-log mailing list