Decoding a series of messages is very similar to the method used for other encoding rules.
Short pseudo-code is shown below. As in the encoding example,
rtxMemReset
is used at the end of the loop to avoid
allocating new memory for dynamic data structures. This helps to
improve performance.
/* initialize context, et c. */ for ( ; ; ) { /* initialize data structure */ /* call asn1JsonDec_<name> function */ /* perform operations on decoded structure */ /* reset memory: */ stat = rtxMemReset (&ctxt); }
More details may be found in the sample programs included in the ASN1C software development kit.