library/RLCMAC_Types.ttcn: implement PTCCH/D message coding

Change-Id: I0e3dc3f4853799f1467a5f6726dac0d43c2eb93d
Related: SYS#4606
diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn
index 39c0c97..ad9d8f4 100644
--- a/library/RLCMAC_Types.ttcn
+++ b/library/RLCMAC_Types.ttcn
@@ -385,5 +385,61 @@
 		payload := data
 	}
 
+	/* PTCCH/D (Packet Timing Advance Control Channel) message.
+	 * TODO: add a spec. reference to the message format definition. */
+	type record PTCCHTimingAdvanceIE {
+		BIT1			spare ('0'B),
+		uint7_t			ta_val
+	} with { variant "" };
+	type record of PTCCHTimingAdvanceIE PTCCHTimingAdvanceIEs;
+	type record PTCCHDownlinkMsg {
+		PTCCHTimingAdvanceIEs	ta_idx length(16),
+		octetstring		padding length(7)
+	} with { variant "" };
+
+	external function enc_PTCCHDownlinkMsg(in PTCCHDownlinkMsg si) return octetstring
+		with { extension "prototype(convert) encode(RAW)" };
+	external function dec_PTCCHDownlinkMsg(in octetstring stream) return PTCCHDownlinkMsg
+		with { extension "prototype(convert) decode(RAW)" };
+
+	template PTCCHDownlinkMsg tr_PTCCHDownlinkMsg(
+		template (present) uint7_t tai0_ta := ?,
+		template (present) uint7_t tai1_ta := ?,
+		template (present) uint7_t tai2_ta := ?,
+		template (present) uint7_t tai3_ta := ?,
+		template (present) uint7_t tai4_ta := ?,
+		template (present) uint7_t tai5_ta := ?,
+		template (present) uint7_t tai6_ta := ?,
+		template (present) uint7_t tai7_ta := ?,
+		template (present) uint7_t tai8_ta := ?,
+		template (present) uint7_t tai9_ta := ?,
+		template (present) uint7_t tai10_ta := ?,
+		template (present) uint7_t tai11_ta := ?,
+		template (present) uint7_t tai12_ta := ?,
+		template (present) uint7_t tai13_ta := ?,
+		template (present) uint7_t tai14_ta := ?,
+		template (present) uint7_t tai15_ta := ?
+	) := {
+		ta_idx := {
+			{ spare := '0'B, ta_val := tai0_ta },
+			{ spare := '0'B, ta_val := tai1_ta },
+			{ spare := '0'B, ta_val := tai2_ta },
+			{ spare := '0'B, ta_val := tai3_ta },
+			{ spare := '0'B, ta_val := tai4_ta },
+			{ spare := '0'B, ta_val := tai5_ta },
+			{ spare := '0'B, ta_val := tai6_ta },
+			{ spare := '0'B, ta_val := tai7_ta },
+			{ spare := '0'B, ta_val := tai8_ta },
+			{ spare := '0'B, ta_val := tai9_ta },
+			{ spare := '0'B, ta_val := tai10_ta },
+			{ spare := '0'B, ta_val := tai11_ta },
+			{ spare := '0'B, ta_val := tai12_ta },
+			{ spare := '0'B, ta_val := tai13_ta },
+			{ spare := '0'B, ta_val := tai14_ta },
+			{ spare := '0'B, ta_val := tai15_ta }
+		},
+		padding := '2B2B2B2B2B2B2B'O
+	}
+
 
 } with { encode "RAW"; variant "FIELDORDER(msb)" }