Crystal-Photonics / RPC-Generator

Python script that generates code to call functions from one device on another using a network.
GNU Lesser General Public License v3.0
5 stars 3 forks source link

RPC-Generator

A python script that generates code to call functions from one device on another device using a network.

Current State

The project is in a usable state.

Idea

The RPC-generator implements serializing and deserializing of function calls and their arguments. When communicating with a device you normally need to make up a protocol, give each message an ID and serialize, deserialize and interpret arguments. This work is done for you by the RPC generator. You specify a server header whos functions should be made available to the client and the RPC-generator generates code for the client to call a remote function and code for the server to parse requests and execute them. You can use the RPC-generator twice to allow both participants to call functions of the other.

Dependencies

Required

Recommended

Internally used

Platform

Functionality

Given a server and client config the RPC-Generator will produce the following files:

Getting started

Generate a project using CMake inside Testprojects/ClientServer/Project or Testprojects/AliceBob/Project. Compile and run the ClientServer testproject to see one way communication and the AliceBob testproject to see 2-way communication over TCP sockets. Next you can add suitable functions in server.h and their implementation in the server to make them available. Next you may want to replace the network implementation inside network.cpp with communication over USB, Bluetooth, Comports or other network devices.

TODO