RLCMAC_EncDec: Fix handling of optional LlcBlockHdr

Whenever the OPTIONAL<> construct is used for a member of a record,
we have to add an extra set of parenthsis in order to avoid bogus
"has no RAW decode method" error messages.

It seems the OPTIONAL inherits from Base_Type which will print
"which has no RAW decoding method" from its RAW_decode().

Change-Id: Idfaa11db0e2db4be144800b5bccc44d0515220d7
This commit is contained in:
Harald Welte 2018-03-08 23:21:17 +01:00
parent a35a9ca4d4
commit 439e546539
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ OCTETSTRING enc__RlcmacDlDataBlock(const RlcmacDlDataBlock& si)
in.blocks()[i].hdr()().e() = false;
else
in.blocks()[i].hdr()().e() = true;
in.blocks()[i].hdr().encode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
in.blocks()[i].hdr()().encode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
}
}
if (in.blocks().is_bound()) {
@ -65,7 +65,7 @@ RlcmacDlDataBlock dec__RlcmacDlDataBlock(const OCTETSTRING& stream)
while (1) {
/* decode one more extension octet with LlcBlocHdr inside */
LlcBlock lb;
lb.hdr().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
lb.hdr()().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
ret_val.blocks()[num_llc_blocks++] = lb;
/* if E == '1'B, we can proceed further */
@ -214,7 +214,7 @@ RlcmacUlDataBlock dec__RlcmacUlDataBlock(const OCTETSTRING& stream)
while (1) {
/* decode one more extension octet with LlcBlocHdr inside */
LlcBlock lb;
lb.hdr().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
lb.hdr()().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
ret_val.blocks()[num_llc_blocks++] = lb;
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);