summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-21 22:46:16 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-21 22:48:18 +0100
commit6fa1f73346fedff8055314645063de3251abe2bc (patch)
tree558496454605426ab9da537d8abdd407f838cde7
parente97eab4da4e34973844ca6ffafd03919becdf15d (diff)
MSC_ConnHdlr: Fix RlsChannelNr encoding in f_ChDesc2RslChanNr()
Make sure that the "tag" member of the RslChanelNr sub-structure is always initialized. This can be achieved without any extra code by using the existing templates rather than hand-coding it. Change-Id: I990ac8ac0ce51e11f1d683382c9fc2d4e1201aa7
-rw-r--r--bsc/MSC_ConnectionHandler.ttcn11
1 files changed, 5 insertions, 6 deletions
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 6bf3221..44def3b 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -477,20 +477,19 @@ runs on MSC_ConnHdlr {
/* Convert from Ericsson ChanDesc2 format to Osmocom RslChannelNr format */
function f_ChDesc2RslChanNr(ChannelDescription2_V ch_desc, out RslChannelNr chan_nr, out GsmArfcn arfcn) {
var BIT5 inp := ch_desc.channelTypeandTDMAOffset;
-
- chan_nr.tn := bit2int(ch_desc.timeslotNumber);
+ var uint3_t tn := bit2int(ch_desc.timeslotNumber);
if (match(inp, '00001'B)) { /* TCH/F */
- chan_nr.u.ch0 := RSL_CHAN_NR_Bm_ACCH;
+ chan_nr := valueof(t_RslChanNr_Bm(tn));
}
else if (match(inp, '0001?'B)) { /* TCH/H */
- chan_nr.u.lm.sub_chan := bit2int(substr(inp, 4, 1));
+ chan_nr := valueof(t_RslChanNr_Lm(tn, bit2int(substr(inp, 4, 1))));
}
else if (match(inp, '001??'B)) { /* SDCCH/4 */
- chan_nr.u.sdcch4.sub_chan := bit2int(substr(inp, 3, 2));
+ chan_nr := valueof(t_RslChanNr_SDCCH4(tn, bit2int(substr(inp, 3, 2))));
}
else if (match(inp, '01???'B)) { /* SDCCH/8 */
- chan_nr.u.sdcch8.sub_chan := bit2int(substr(inp, 2, 3));
+ chan_nr := valueof(t_RslChanNr_SDCCH8(tn, bit2int(substr(inp, 2, 3))));
}
else {
setverdict(fail, "Unknown ChDesc!");