aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-17 19:27:53 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-17 20:30:39 +0100
commit24135bd27fa9971c8e467a5f30b276bb7ccda0f8 (patch)
tree62caf7e5d6feba4d9658fb6cf79bf3760b2c33cc /library
parent2caa1062514013e3f7c53dcad9789b70fdc5cad3 (diff)
bsc: Fix encoding of 2-digit MNC (paging tests)
The TTCN-3 data types are abstract data types, Encoding artefacts like 'F' for padding shouldn't be seen by the user. Hence, let's pass a 2-digit-long or 3-digit-long hexstring into the encoder functions and let them determine if they should introduce any 'F' for padding or not. Change-Id: If4d3dfc16381493d7e710be746ed963975051fc1
Diffstat (limited to 'library')
-rw-r--r--library/BSSMAP_Templates.ttcn4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 5d2bff26..5d138996 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -665,8 +665,8 @@ template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := {
}
private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 {
- if (mnc[0] == 'f'H) {
- return hex2oct(mcc[1] & mcc[0] & mnc[0] & mcc[2] & mnc[2] & mnc[1]);
+ if (lengthof(mnc) == 2) {
+ return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]);
} else {
return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]);
}