-
Notifications
You must be signed in to change notification settings - Fork 215
erpcgen
This chapter describes how to get and use the eRPC generator (erpcgen), a tool that generates the shim code for a server and client side.
The generated shim code handles marshalling and unmarshalling a request. After unmarshalling, on the server side, the shim code implements a function call to the appropriate function (based on the request). An IDL (interface definition language) is used to tell the generator tool about data types and RPC services.
The tool can be found on eRPC releases section on github page.
- The erpcgen source files are located in the
erpc/erpcgen/src
directory. - On the Windows operating system, users can use Visual Studio Express 2013 or higher (steps for using Visual Studio are in the
erpc/erpcgen/VisualStudio_v12/ReadMe.txt
file). - To build the erpcgen application on Linux OS or macOS, the compiler (gcc, g++), make, flex/bison applications, and boost libraries are needed.
- If you are using the Linux OS or macOS, build the application using the command (which must be executed in the
erpc/
directory):
make erpcgen
The output erpcgen application is located in the erpc/Debug/<os_type>/erpcgen/
folder. The <os_type>
is set automatically, based on which build system is used.
When the erpcgen application is available, you can run it from the command line using the appropriate command line options. Pre-built applications are located in the
<os_type>
is Windows OS, Linux OS, or macOS.
Shows supported commands
Displays tool version
Sets output directory path prefix
- When the verbose option is not used, it prints only warnings and errors.
- When the verbose option is used once, it prints standard output information.
- When the verbose option is used twice or more, it prints debugging information.
Add search path for imports
Select the output language (default is C). Language can be c
(for C) or py
(for python).
The easiest way to use the eRPC generator is:
erpcgen <fileName>
For example:
erpcgen MyFirstErpcApp.erpc
If the IDL file is placed in a different directory than the eRPC generator application, and the requested output directory is also in different directory, then the following example can help set all the options and paths correctly in this case:
erpcgen –I <filePathToIDL> -o <filePathToErpcOutput> <fileName>
For example:
erpcgen –I MyProject/MyFirstErpcAppIDL –o MyProject/MyFirstErpcAppErpc MyFirstErpcApp.erpc
The IDL file can contains annotations data that controls how output files are generated. Also see section Annotations.