RLCMAC: Fix unbound spb value in decoded egprs data blocks
That field is only present in Header Type 3 blocks.
Change-Id: Ie05576d7d7c18933dd9abcdc055cbfe1e4e54756
diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index ac22def..97bd0be 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -545,6 +545,7 @@
ret_val.bsn2__offset() = egprs1->bsn2_lo << 7 | egprs1->bsn2_hi;
ret_val.pr() = egprs1->pr;
ret_val.cps() = egprs1->cps;
+ ret_val.spb() = OMIT_VALUE;
ttcn_buffer.increase_pos(sizeof(*egprs1));
return ret_val;
@@ -571,6 +572,7 @@
ret_val.bsn2__offset() = 0; /*TODO: mark optional and not set ? */
ret_val.pr() = egprs2->pr;
ret_val.cps() = egprs2->cps;
+ ret_val.spb() = OMIT_VALUE;
ttcn_buffer.increase_pos(sizeof(*egprs2));
return ret_val;
diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn
index 3110a66..fe47231 100644
--- a/library/RLCMAC_Types.ttcn
+++ b/library/RLCMAC_Types.ttcn
@@ -238,9 +238,9 @@
uint11_t bsn1,
uint8_t bsn2_offset,
uint2_t pr, /* power reduction */
- uint2_t spb,
+ uint2_t spb optional,
uint4_t cps
- } with { variant "" };
+ } with { variant (spb) "PRESENCE(header_type=RLCMAC_HDR_TYPE_3)" };
/* Manual C++ Decoder: */
type record RlcmacDlEgprsDataBlock {
CodingScheme mcs, /* Provided by C++ Decoder */
@@ -295,9 +295,10 @@
uint4_t cps,
boolean pfi_ind,
BIT1 rsb,
- BIT2 spb
+ BIT2 spb optional
} with {
variant (pfi_ind) "FIELDLENGTH(1)"
+ variant (spb) "PRESENCE(header_type=RLCMAC_HDR_TYPE_3)"
};
/* Manual C++ Decoder: 10.3a.2.1 EGPRS Uplink RLC data block */
type record RlcmacUlEgprsDataBlock {