A code generator for remote procedure calls on embedded systems
Project description
LotusRPC 🌼
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++"]
Features
- 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
Quick start
Install:
pip install lotusrpc
Define your interface (math.lrpc.yaml):
[!NOTE] By convention, LotusRPC definition files use the
.lrpc.yamlextension.
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 = 10
Documentation
Full documentation is at tzijnge.github.io/LotusRpc, including:
- Getting started — complete walkthrough
- Interface definition reference — all YAML options
- C++ API reference — generated server and shim classes
- Python API — client library and definition model
- Examples — math service and STM32 example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lotusrpc-1.0.0.tar.gz.
File metadata
- Download URL: lotusrpc-1.0.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84ad150f752a52b7a7d3666570c9badafc6fd3213f2139d1393a75df2adc697e
|
|
| MD5 |
5f977d77cc16d5fd600be263e120538c
|
|
| BLAKE2b-256 |
3e0545edef88e304484580af2dcb7273070517e12426aa95538e04edc8bcff52
|
Provenance
The following attestation bundles were made for lotusrpc-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on tzijnge/LotusRpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lotusrpc-1.0.0.tar.gz -
Subject digest:
84ad150f752a52b7a7d3666570c9badafc6fd3213f2139d1393a75df2adc697e - Sigstore transparency entry: 1822594014
- Sigstore integration time:
-
Permalink:
tzijnge/LotusRpc@07e1ccf480579b4a41718e83c19fb8461338a027 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/tzijnge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@07e1ccf480579b4a41718e83c19fb8461338a027 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lotusrpc-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lotusrpc-1.0.0-py3-none-any.whl
- Upload date:
- Size: 76.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39d0a1263860b7511da973254c39929b428c05a4db8be6e3b95879ed4868d1ea
|
|
| MD5 |
0e8863ee46a528b3717e79e1227ae7f3
|
|
| BLAKE2b-256 |
e54f3383e4bb38531d2c9d4b33a519fc1a413c1d225b63c976aafb794ee9c209
|
Provenance
The following attestation bundles were made for lotusrpc-1.0.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on tzijnge/LotusRpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lotusrpc-1.0.0-py3-none-any.whl -
Subject digest:
39d0a1263860b7511da973254c39929b428c05a4db8be6e3b95879ed4868d1ea - Sigstore transparency entry: 1822594086
- Sigstore integration time:
-
Permalink:
tzijnge/LotusRpc@07e1ccf480579b4a41718e83c19fb8461338a027 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/tzijnge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@07e1ccf480579b4a41718e83c19fb8461338a027 -
Trigger Event:
push
-
Statement type: