Skip to content

tzijnge/test_jekyll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LotusRPC 🌼

Automated build Code Smells Code style: Ruff linting: pylint

Quality gate

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++"]
Loading

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 generationlrpcg produces all C++ server code in one command
  • CLI clientlrpcc lets 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):

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:

About

just testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors