Hi,
Putting multiple messages into same stream is unfortunately unaddressed
in protobuf format in general. Though I agree that nanopb documentation
could at least explain the situation better. Google's protobuf docs have
a very small mention of message delimiting here:
https://protobuf.dev/programming-guides/techniques/
Nanopb directly supports delimiting with null bytes or with varint length
prefix. User code can use other delimiting methods as well.
If you reuse the same stream, it will just append the new message there.
If there is no delimiter, you cannot decode the messages separately.
For encoding/decoding with buffer, consider reseting the stream to mean "restart
from the start of the buffer".
--
Petteri