RLCMAC: Fix encoding/decoding of 'union' types
We must supply hand-written C++ functions for encoding/decoding
the union types.
diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn
index 6231a54..52aaef8 100644
--- a/library/RLCMAC_Types.ttcn
+++ b/library/RLCMAC_Types.ttcn
@@ -204,10 +204,11 @@
ctrl, mac_hdr.payload_type = MAC_PT_RLCMAC_OPT)"
};
- external function enc_RlcmacUlBlock(in RlcmacUlBlock si) return octetstring
- with { extension "prototype(convert) encode(RAW)" };
- external function dec_RlcmacUlBlock(in octetstring stream) return RlcmacUlBlock
- with { extension "prototype(convert) decode(RAW)" };
+ /* as the sub-types (RlcmacDl*Block) are not using the RAW coder, we cannot
+ * use auto-generated functions here, as they would decode those sub-types
+ * based on the RAW coder, not baed on the manual C++ functions */
+ external function enc_RlcmacUlBlock(in RlcmacUlBlock si) return octetstring;
+ external function dec_RlcmacUlBlock(in octetstring stream) return RlcmacUlBlock;
type union RlcmacDlBlock {
RlcmacDlDataBlock data,
@@ -218,9 +219,10 @@
ctrl, mac_hdr.payload_type = MAC_PT_RLCMAC_OPT)"
};
- external function enc_RlcmacDlBlock(in RlcmacDlBlock si) return octetstring
- with { extension "prototype(convert) encode(RAW)" };
- external function dec_RlcmacDlBlock(in octetstring stream) return RlcmacDlBlock
- with { extension "prototype(convert) decode(RAW)" };
+ /* as the sub-types (RlcmacDl*Block) are not using the RAW coder, we cannot
+ * use auto-generated functions here, as they would decode those sub-types
+ * based on the RAW coder, not baed on the manual C++ functions */
+ external function enc_RlcmacDlBlock(in RlcmacDlBlock si) return octetstring;
+ external function dec_RlcmacDlBlock(in octetstring stream) return RlcmacDlBlock;
} with { encode "RAW"; variant "FIELDORDER(msb)" }