If I compile and run my application using the space optimized encoder/decoder (SOED), it correctly reports an unknown record type, but the time optimizer (TOED) simply returns a value!= 0. Unfortunately, I need the time optimizer. Is there any way the Time optimizer compiler can handle this?

The difference you see is in the way error messages are handled by the space-optimized encoder/decoder (SOED) vs. the time-optimized encoder/decoder (TOED). The purpose of the TOED is to work quickly in production environments, and since in such an environment it is unlikely to be of much help to know where the error is, the default is to not produce a comprehensive error message. The purpose of the SOED, on the other hand, is to provide comprehensive tracing and debugging information, so the default for the SOED is to provide a full error message upon encountering an error.

You may change the behavior of the TOED so it prints errors by:

  • either calling the ossGetErrMsg() function after receiving a decode error, which will return a string containing a comprehensive error message
  • or setting the DEBUG_ERRORS flag with the ossSetDecodingFlags() function, which will cause ossDecode() to print out a comprehensive error message upon encountering a decoding error

If you are still in the development stage, where tracing and debugging are important, you would be better off using the SOED. When you believe that your application is ready to go, only then switch to the TOED and submit it to your test procedures. Remember that there is no need for changes to your application code when you switch from the SOED to the TOED; just recompile the ASN.1, recompile the application, and link with the TOED libraries.


The samples included with some of the Knowledge Center answers are meant for your general understanding of the OSS products. Different versions of the products might produce slightly different outputs. Consult the products documentation and samples for the most up-to-date products information and code examples.



Contact Support
contact Our office hours
24 hours/day, 7 days/week

  • Phone: 1-888-OSS-2761 (USA and Canada)
  • Phone: 1-732-302-9669 (International)
  • Fax: 1-732-302-0023
  • Email: support@oss.com
Free Trial
download

Test drive the OSS Nokalva ASN.1, LTE, and XML Tools now! Your trial includes complete software, documentation, sample programs, free 24x7 technical support and more.




Learn ASN.1
Learn ASN.1

Our expert personnel can help you learn ASN.1!

We offer 4-day ASN.1 courses at our headquarters or your premises.