I am completing a RPC wrapper on top of nanoPb. I looked and did not see anyone doing this? Has this not been done yet?
From the .protoc file I am auto-generating the "C" code that creates:
1) function to unpack a message header and get msg ID
2) dispatch function that calls the that message's pb-decoder function
3) Decoder that extracts arguments and calls the RPC stub function
4) RPC stub function return results are packed via nano-pb into a reply message wrapped with a reply header
The host code to talk to the target leverages the GRPC framework to serialize/serialize messages. Just have to add header to message and send it out BLE/RS-232 port & then uses GRPC classes to decode msg.