I’ve been looking into the protocol buffers and nanopb implementation. I would like to use it to provision configuration which would be potentially split into multiple packets to nodes. It would be easy to just receive all packets first into some buffer and then process it. But I would prefer to process it as stream without need of extra buffer. But there is big problem caused by different philosophy of nanopb and Tower SDK.
Nanopb uses callback function to fetch more data from stream. But as far as I know, as SDK is not multithreaded, this callback function cannot just wait for the data, as it would block the whole scheduller loop including incoming radio.
For this to work, I would probably need some kind of “cooperative multitasking”, that is from nanopb callback switch context to scheduller and after receiving the data (or timeout) switch context back to nanopb.
Is something like this feasible with SDK? Or use some workaround?