esa / asn1scc

ASN1SCC: An open source ASN.1 compiler for embedded systems
https://www.thanassis.space/asn1.html
Other
272 stars 58 forks source link

Streaming mode is not usable in C #226

Closed ar-nelson closed 2 years ago

ar-nelson commented 2 years ago

Although a streaming mode API (fetchData and pushData) exists in the generated C code, it is not usable. A flag called INTERNAL_FETH_DATA (typo?) is #defined in asn1crt_encoding.c and then immediately used in an #ifdef block to define no-op versions of fetchData and pushData; there is no way for the user to supply their own versions of these functions. This #ifdef block is marked // DEBUG, so this may be leftover debug code?

I have already submitted a pull request that attempts to fix this issue: https://github.com/ttsiodras/asn1scc/pull/225

usr3-1415 commented 2 years ago

Hi! Thanks for the pull request, It was indeed a bug that appeared when the code was ported from .Net 4.6 to .Net core. I made another commit (on top of your pull request) so that when the argument -sm is present then instead of changing asn1crt_encoding.c it now adds -DASN1SCC_STREAMING in the Makefile.

The command-line argument -sm is also required for the Ada backend.