There are two ways to tell the encoder to use the DEFINITE length form when encoding messages with BER.
1. You can set the DEFINITE flag before calling the encoder in your application code as follows:
2. Alternatively, you can specify the OSS.DEFINITE compiler directive in your ASN.1 specification. You can either apply this directive to a particular type in your specification or use it to set a global default. After adding the appropriate OSS.DEFINITE directive(s), you should re-ASN.1-compile your ASN.1 specification and then C compile the produced files along with your application code.
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.
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.
Our expert personnel can help you learn ASN.1!
We offer 4-day ASN.1 courses at our headquarters or your premises.