summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-09-16 18:11:26 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-16 18:12:17 +0200
commitf097a8b94ee6a2f70d90709323b55d1bea7a4480 (patch)
tree7de40369e8a2e9e554c86aebab05ac10d686355e
parent42ca6b1c31296ee4f5f6a4a84a7d1b736eed416c (diff)
GSM_Types: Add CBCH_Block definition of TS 04.12
-rw-r--r--library/GSM_Types.ttcn42
-rw-r--r--library/General_Types.ttcn1
2 files changed, 43 insertions, 0 deletions
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 @@ module GSM_Types {
}
}
+
+/* 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 @@ group SimpleRAWEncodedTypes {
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)" };