This example shows basic usage of eRPC framework.
To build and run this example, you need to install all the necessary requirements for each programming language. For C/C++
, you need to install Cmake and a compiler. For Python
, you need to install Python and erpc from pip or source. For Java
, you need to have JDK21
and Maven
. For more information, please check the source folder for each programming language (erpc_c
, erpc_python
, erpc_java
).
Run these commands in this folder based on needs with correct path to erpcgen application
C/C++ shim code:
erpcgen -gc -o ./c/shim/ hello_world.erpc
Python shim code:
erpcgen -gpy -o ./py/shim/ hello_world.erpc
Java shim code:
erpcgen -gjava -p org.example.hello_world -o ./java/src/main/java/org/example/ ./hello_world.erpc
First run server, then client.
This example use CMake to create executables. In erpc/ run cmake -B ./build
(or cmake --preset mingw64
on win with local mingw) to generate Cmake project. Then run cmake --build ./build/ --target menuconfig
and enable Build eRPC Examples -> hello_world example (optionally disable erpcgen and eRPC C lib). This can be also done by enabling in erpc/prj.conf.
Execute cmake --build ./build/
to build the example.
Cmake generates four executables (client
, server
, client_cpp
, server_cpp
) in build/examples/hello_world.
To run python example go to folder py/ and run python main_server.py
or python main_client.py
Go to folder java/. Then execute mvn package
to install dependency and create .jar
file. Then run java -jar .\target\hello_world-1.0.jar client
or java -jar .\target\hello_world-1.0.jar server
.
If you have any problem with Java or Maven, check erpc_java/readme.md.