decode ioc in OER in runtime
diff --git a/skeletons/constr_SEQUENCE_oer.c b/skeletons/constr_SEQUENCE_oer.c
index 5fb697c..84b0db9 100644
--- a/skeletons/constr_SEQUENCE_oer.c
+++ b/skeletons/constr_SEQUENCE_oer.c
@@ -81,7 +81,6 @@
(void)opt_codec_ctx;
(void)constraints;
- (void)specs;
/*
* Create the target structure if it is not present already.
@@ -197,9 +196,33 @@
memb_ptr2 = &memb_tmpptr; /* Ensure this & remains in scope! */
}
- rval = elm->type->oer_decoder(opt_codec_ctx, elm->type,
- elm->oer_constraints, memb_ptr2, ptr,
- size);
+ if((elm->flags & ATF_OPEN_TYPE) && elm->type_selector) {
+ asn_TYPE_descriptor_t *et = elm->type_selector(td, st);
+ ssize_t ot_ret;
+ if(!et) {
+ ASN__DECODE_FAILED;
+ }
+ ot_ret = oer_open_type_get(opt_codec_ctx, et, NULL, memb_ptr2,
+ ptr, size);
+ switch(ot_ret) {
+ case -1:
+ rval.code = RC_FAIL;
+ rval.consumed = 0;
+ break;
+ case 0:
+ rval.code = RC_WMORE;
+ rval.consumed = 1;
+ break;
+ default:
+ rval.code = RC_OK;
+ rval.consumed = ot_ret;
+ break;
+ }
+ } else {
+ rval = elm->type->oer_decoder(opt_codec_ctx, elm->type,
+ elm->oer_constraints, memb_ptr2,
+ ptr, size);
+ }
switch(rval.code) {
case RC_OK:
ADVANCE(rval.consumed);
diff --git a/skeletons/file-dependencies b/skeletons/file-dependencies
index a509b38..d3c4d0e 100644
--- a/skeletons/file-dependencies
+++ b/skeletons/file-dependencies
@@ -41,6 +41,7 @@
COMMON-FILES: # THIS IS A SPECIAL SECTION
asn_application.h # Applications should include this file
+asn_ioc.h # Information Object Classes, runtime support
asn_system.h # Platform-dependent types
asn_codecs.h # Return types of encoders and decoders
asn_internal.h # Internal stuff