Move f_hex_is_odd_length from BSSMAP_Templates to GSM_Types
It's a quite frequent requirement in encoding IMSI/BCD numbers, so
let's move it to the more generic GSM_Types module.
Change-Id: I6fb8d9a6f37c990f6901fb48b15312a157954fda
diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index e1d6b48..e57575d 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -160,4 +160,12 @@
sapi := sapi
};
+ function f_hex_is_odd_length(hexstring digits) return bitstring {
+ if (lengthof(digits) rem 2 == 1) {
+ return '1'B;
+ } else {
+ return '0'B;
+ }
+ }
+
} with { encode "RAW"; variant "FIELDORDER(msb)" }