Open nnWhisperer opened 4 years ago
Hi @nnWhisperer,
How could we split the stream successfully into uper_decode'able packets?
From asn1c-usage.pdf.
4.2 Decoding BER
The decoder is restartable (stream-oriented). That means that in case the buffer has less data than expected, the decoder will process whatever is available and ask for more data to be provided using the RC_WMORE return .code. Note that in the RC_WMORE case the decoder may have processed less data than it is available in the buffer, which means that you must be able to arrange the next buffer to contain the unprocessed part of the previous buffer.
Hi @velichkov, I have actually read the manual, however I'm using per and uper is not restartable, as I had mentioned uper_encode keyword.
Yes PER encodings are not restartable but the same technique is used for PER as well. Have a look at skeletons/converter-example.c
Hi, Thank you for the great work developing the project. I have generated uper_encode'd packets and am able to decode them correctly. Now, I am trying to send the packet buffer over a tcp stream, and having problems while decoding from the stream. As tcp is a stream protocol, some parts of the packet may arrive later, or may be appended with a part of other packet. How could we split the stream successfully into uper_decode'able packets? I am sure it is an already thought-out problem, however I have not been able to find an answer in the previous issues. Thank you,