⚠ WARNING: This project is work in progress
RPC framework for embedded systems based on ETL. Define your interface once in YAML; LotusRPC generates all C++ server code and a Python client. No dynamic memory allocations, no exceptions, no RTTI.
graph LR
C["Client\nPC · Python"] <-->|"function call / return"| T["Transport\nserial · BT · TCP · …"]
T <-->|bytes| S["Server\nMCU · C++"]
- No dynamic memory — stack-only, no heap, no exceptions, no RTTI
- Transport agnostic — any byte-oriented channel (serial, Bluetooth, TCP, …)
- YAML definitions — schema-validated, editor-friendly, easy to parse or extend
- Code generation —
lrpcgproduces all C++ server code in one command - CLI client —
lrpcclets any team member call remote functions without writing code - Streams — client-to-server and server-to-client data streams, finite or infinite
- C++11 compatible — works on any platform with a modern C++ compiler
Install:
pip install lotusrpcDefine your interface (math.lrpc.yaml):
name: math
settings:
namespace: ex
services:
- name: calc
functions:
- name: add
params:
- { name: a, type: int32_t }
- { name: b, type: int32_t }
returns:
- { name: result, type: int32_t }Generate C++ server code:
lrpcg cpp -d math.lrpc.yaml -o generated/Implement the server — derive from the generated shim and implement the pure virtual function:
#include "math/math.hpp"
class CalcService : public ex::calc_shim {
protected:
int32_t add(int32_t a, int32_t b) override { return a + b; }
};Subclass the generated server to provide a transport, register your service, and feed incoming bytes:
class MathServer : public ex::math {
void lrpcTransmit(lrpc::span<const uint8_t> bytes) override {
uart_write(bytes.data(), bytes.size()); // your hardware here
}
};
CalcService calc;
MathServer server;
server.registerService(calc);
// In your receive loop:
server.lrpcReceive(incoming_byte);Call from the command line:
lrpcc calc add 3 7 # result = 10Full documentation is at tzijnge.github.io/LotusRpc, including:
- Getting started — complete walkthrough
- C++ API reference — generated server and shim classes
- Interface definition reference — all YAML options
- Examples — math service and STM32 example