From d079845710e3e88f5502c08cb4f704c5fa5041ba Mon Sep 17 00:00:00 2001 From: Cervenka Dusan Date: Wed, 13 Dec 2023 15:48:19 +0100 Subject: [PATCH] Fixing/improving markdown files Signed-off-by: Cervenka Dusan --- .github/ISSUE_TEMPLATE/bug_report.md | 14 +- .github/ISSUE_TEMPLATE/feature_request.md | 10 +- .github/ISSUE_TEMPLATE/question.md | 4 +- .github/PULL_REQUEST_TEMPLATE.md | 16 +- LICENSE | 36 +-- README.md | 233 +++++++++++++----- doxygen/mainpage_erpc.md | 2 +- erpc_python/readme.md | 16 +- erpcgen/test/readme.md | 28 ++- examples/matrix_multiply_tcp_python/readme.md | 42 ++-- .../styles/VSC/vsc-extension-quickstart.md | 8 +- 11 files changed, 254 insertions(+), 155 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8091dfb3..911ad255 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,37 +7,37 @@ assignees: '' --- -**Describe the bug** +## Describe the bug -**To Reproduce** +## To Reproduce -**Expected behavior** +## Expected behavior -**Screenshots** +## Screenshots -**Desktop (please complete the following information):** +## Desktop (please complete the following information) - OS: - eRPC Version: -**Steps you didn't forgot to do** +## Steps you didn't forgot to do - [ ] I checked if there is no related issue opened/closed. - [ ] I checked that there doesn't exist opened PR which is solving this issue. -**Additional context** +## Additional context diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 430d3d04..b525e537 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,27 +7,27 @@ assignees: '' --- -**Is your feature request related to a problem? Please describe.** +## Is your feature request related to a problem? Please describe -**Describe the solution you'd like** +## Describe the solution you'd like -**Describe alternatives you've considered** +## Describe alternatives you've considered -**Steps you didn't forgot to do** +## Steps you didn't forgot to do - [ ] I checked if there is no related issue opened/closed. - [ ] I checked that there doesn't exist opened PR which is solving this issue. -**Additional context** +## Additional context diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 88ba296b..1f85d3b3 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -7,12 +7,12 @@ assignees: '' --- -**If you didn't find answer in existing open/closed issues you may ask here** +## If you didn't find answer in existing open/closed issues you may ask here -**Steps you didn't forgot to do** +## Steps you didn't forgot to do - [ ] I checked if there is no related issue opened/closed. - [ ] I checked that there doesn't exist opened/closed PR which is solving this issue. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 65e6ffe7..6e792f9d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,36 +1,36 @@ # Pull request -**Choose Correct** +## Choose Correct - [ ] bug - [ ] feature -**Describe the pull request** +## Describe the pull request -**To Reproduce** +## To Reproduce -**Expected behavior** +## Expected behavior -**Screenshots** +## Screenshots -**Desktop (please complete the following information):** +## Desktop (please complete the following information): - OS: - eRPC Version: -**Steps you didn't forgot to do** +## Steps you didn't forgot to do - [ ] I checked if other PR isn't solving this issue. - [ ] I read Contribution details and did appropriate actions. @@ -38,7 +38,7 @@ If applicable, add screenshots to help explain your problem. - [ ] PR code is formatted. - [ ] Allow edits from maintainers pull request option is set (recommended). -**Additional context** +## Additional context diff --git a/LICENSE b/LICENSE index cfe35768..5aff2d75 100644 --- a/LICENSE +++ b/LICENSE @@ -1,37 +1,15 @@ +BSD 3-Clause License + Copyright 2014-2016 Freescale Semiconductor, Inc. Copyright 2016-2023 NXP All rights reserved. -The BSD 3 Clause License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. +Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 52bab81c..f32462d2 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,57 @@ # eRPC +![GitHub all releases](https://img.shields.io/github/downloads/EmbeddedRPC/erpc/total) +[![GitHub License](https://img.shields.io/github/license/EmbeddedRPC/erpc)](/LICENSE) [![Version](https://img.shields.io/github/v/release/EmbeddedRPC/erpc)](https://github.com/EmbeddedRPC/erpc/releases/latest) +![GitHub language count](https://img.shields.io/github/languages/count/EmbeddedRPC/erpc) +![GitHub top language](https://img.shields.io/github/languages/top/EmbeddedRPC/erpc) +![GitHub repo size](https://img.shields.io/github/repo-size/EmbeddedRPC/erpc) +![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/EmbeddedRPC/erpc) +[![GitHub forks](https://img.shields.io/github/forks/EmbeddedRPC/erpc)](https://github.com/EmbeddedRPC/erpc/forks) +![GitHub Repo stars](https://img.shields.io/github/stars/EmbeddedRPC/erpc) +![GitHub watchers](https://img.shields.io/github/watchers/EmbeddedRPC/erpc) +![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/EmbeddedRPC/erpc) +![GitHub commits difference between two branches/tags/commits](https://img.shields.io/github/commits-difference/EmbeddedRPC/erpc?base=main&head=develop&label=master%20behind%20develop%20commits) [![Contributors](https://img.shields.io/github/contributors/EmbeddedRPC/erpc)](https://github.com/EmbeddedRPC/erpc/graphs/contributors) [![Issues](https://img.shields.io/github/issues/EmbeddedRPC/erpc)](https://github.com/EmbeddedRPC/erpc/issues) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/EmbeddedRPC/erpc/pulls) -[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/EmbeddedRPC/erpc) - -- [eRPC](#erpc) - - [About](#about) - - [Releases](#releases) - - [Edge releases](#edge-releases) - - [Documentation](#documentation) - - [Examples](#examples) - - [References](#references) - - [Directories](#directories) - - [Building and installing](#building-and-installing) - - [Requirements](#requirements) - - [Windows](#windows) - - [Linux and Cygwin](#linux-and-cygwin) - - [Mac OS X](#mac-os-x) - - [Building](#building) - - [Installing for Python](#installing-for-python) - - [Known issues and limitations](#known-issues-and-limitations) - - [Code providing](#code-providing) +[![PRs Welcome](https://img.shields.io/github/issues-pr/EmbeddedRPC/erpc)](https://github.com/EmbeddedRPC/erpc/pulls) + +* [eRPC](#erpc) + * [About](#about) + * [Releases](#releases) + * [Edge releases](#edge-releases) + * [Documentation](#documentation) + * [Examples](#examples) + * [References](#references) + * [Directories](#directories) + * [Building and installing](#building-and-installing) + * [Requirements](#requirements) + * [Windows](#windows) + * [Linux](#linux) + * [Mac OS X](#mac-os-x) + * [Building](#building) + * [Installing for Python](#installing-for-python) + * [Known issues and limitations](#known-issues-and-limitations) + * [Code providing](#code-providing) ## About +[![Open enhancement issues](https://img.shields.io/github/issues/EmbeddedRPC/erpc/enhancement?labelColor=blue&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) +[![Closed enhancement issues](https://img.shields.io/github/issues-closed/EmbeddedRPC/erpc/enhancement?labelColor=blue&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement) +[![Open enhancement PRs](https://img.shields.io/github/issues-pr/EmbeddedRPC/erpc/enhancement?labelColor=blue&color=black)](https://github.com/EmbeddedRPC/erpc/pulls?q=is%3Apr+is%3Aopen+label%3Aenhancement) +[![Closed enhancement PRs](https://img.shields.io/github/issues-pr-closed/EmbeddedRPC/erpc/enhancement?labelColor=blue&color=black)](https://github.com/EmbeddedRPC/erpc/pulls?q=is%3Apr+is%3Aclosed+label%3Aenhancement) + +[![Open bug issues](https://img.shields.io/github/issues/EmbeddedRPC/erpc/bug?labelColor=darkred&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aopen+label%3Abug) +[![Closed bug issues](https://img.shields.io/github/issues-closed/EmbeddedRPC/erpc/bug?labelColor=darkred&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aclosed+label%3Abug) +[![Open bug PRs](https://img.shields.io/github/issues-pr/EmbeddedRPC/erpc/bug?labelColor=darkred&color=black)](https://github.com/EmbeddedRPC/erpc/pulls?q=is%3Apr+is%3Aopen+label%3Abug) +[![Closed bug PRs](https://img.shields.io/github/issues-pr-closed/EmbeddedRPC/erpc/bug?labelColor=darkred&color=black)](https://github.com/EmbeddedRPC/erpc/pulls?q=is%3Apr+is%3Aclosed+label%3Abug) + +[![Open question issues](https://img.shields.io/github/issues/EmbeddedRPC/erpc/question?labelColor=darkviolet&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aopen+label%3Aquestion) +[![Closed question issues](https://img.shields.io/github/issues-closed/EmbeddedRPC/erpc/question?labelColor=darkviolet&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aclosed+label%3Aquestion) + +[![Open help-wanted issues](https://img.shields.io/github/issues/EmbeddedRPC/erpc/help%20wanted?labelColor=darkgreen&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aopen+label%3A%22help%20wanted%22) +[![Closed help-wanted issues](https://img.shields.io/github/issues-closed/EmbeddedRPC/erpc/help%20wanted?labelColor=darkgreen&color=black)](https://github.com/EmbeddedRPC/erpc/issues?q=is%3Aissue+is%3Aclosed+label%3A%22help%20wanted%22) + eRPC (Embedded RPC) is an open source Remote Procedure Call (RPC) system for multichip embedded systems and heterogeneous multicore SoCs. Unlike other modern RPC systems, such as the excellent [Apache Thrift](http://thrift.apache.org), eRPC distinguishes itself by being designed for tightly coupled systems, using plain C for remote functions, and having a small code size (<5kB). It is not intended for high performance distributed systems over a network. @@ -36,7 +62,7 @@ A code generator tool called `erpcgen` is included. It accepts input IDL files, Example `.erpc` file: -```java +```C++ // Define a data type. enum LEDName { kRed, kGreen, kBlue } @@ -51,13 +77,53 @@ Client side usage: ```C void example_client(void) { - // Initialize client running over UART. - erpc_client_init( - erpc_transport_cmsis_uart_init(Driver_USART0), - erpc_mbf_dynamic_init()); + erpc_transport_t transport; + erpc_mbf_t message_buffer_factory; + erpc_client_t client_manager; + + /* Init eRPC client infrastructure */ + transport = erpc_transport_cmsis_uart_init(Driver_USART0); + message_buffer_factory = erpc_mbf_dynamic_init(); + client_manager = erpc_client_init(transport, message_buffer_factory); + + /* init eRPC client IO service */ + initIO_client(client_manager); // Now we can call the remote function to turn on the green LED. set_led(kGreen, true); + + /* deinit objects */ + deinitIO_client(); + erpc_client_deinit(client_manager); + erpc_mbf_dynamic_deinit(message_buffer_factory); + erpc_transport_tcp_deinit(transport); +} +``` + +```C++ +void example_client(void) { + erpc_transport_t transport; + erpc_mbf_t message_buffer_factory; + erpc_client_t client_manager; + + /* Init eRPC client infrastructure */ + transport = erpc_transport_cmsis_uart_init(Driver_USART0); + message_buffer_factory = erpc_mbf_dynamic_init(); + client_manager = erpc_client_init(transport, message_buffer_factory); + + /* scope for client service */ + { + /* init eRPC client IO service */ + IO_client client(client_manager); + + // Now we can call the remote function to turn on the green LED. + client.set_led(kGreen, true); + } + + /* deinit objects */ + erpc_client_deinit(client_manager); + erpc_mbf_dynamic_deinit(message_buffer_factory); + erpc_transport_tcp_deinit(transport); } ``` @@ -70,22 +136,68 @@ void set_led(LEDName whichLed, bool onOrOff) { } void example_server(void) { - // Initialize server running over UART. - erpc_server_init( - erpc_transport_cmsis_uart_init(Driver_USART0), - erpc_mbf_dynamic_init()); + erpc_transport_t transport; + erpc_mbf_t message_buffer_factory; + erpc_server_t server; + erpc_service_t service = create_IO_service(); + + /* Init eRPC server infrastructure */ + transport = erpc_transport_cmsis_uart_init(Driver_USART0); + message_buffer_factory = erpc_mbf_dynamic_init(); + server = erpc_server_init(transport, message_buffer_factory); - // Add the IO service. - erpc_add_service_to_server(create_IO_service()); + /* add custom service implementation to the server */ + erpc_add_service_to_server(server, service); // Run the server. erpc_server_run(); + + /* deinit objects */ + destroy_IO_service(service); + erpc_server_deinit(server); + erpc_mbf_dynamic_deinit(message_buffer_factory); + erpc_transport_tcp_deinit(transport); +} +``` + +```C++ +// Implement the remote function. +class IO : public IO_interface +{ + /* eRPC call definition */ + void set_led(LEDName whichLed, bool onOrOff) override { + // implementation goes here + } +} + +void example_server(void) { + erpc_transport_t transport; + erpc_mbf_t message_buffer_factory; + erpc_server_t server; + IO IOImpl; + IO_service io(&IOImpl); + + /* Init eRPC server infrastructure */ + transport = erpc_transport_cmsis_uart_init(Driver_USART0); + message_buffer_factory = erpc_mbf_dynamic_init(); + server = erpc_server_init(transport, message_buffer_factory); + + /* add custom service implementation to the server */ + erpc_add_service_to_server(server, &io); + + /* poll for requests */ + erpc_status_t err = server.run(); + + /* deinit objects */ + erpc_server_deinit(server); + erpc_mbf_dynamic_deinit(message_buffer_factory); + erpc_transport_tcp_deinit(transport); } ``` A number of transports are supported, and new transport classes are easy to write. -Supported transports: +Supported transports can be found in [erpc/erpc_c/transport](/erpc_c/transports) folder. E.g: * CMSIS UART * NXP Kinetis SPI and DSPI @@ -114,7 +226,7 @@ Edge releases can by found on [eRPC CircleCI](https://app.circleci.com/pipelines ## Examples -[Example IDL](examples/README.md) is available in the `examples/` folder. +[Example IDL](examples/README.md) is available in the [examples/](/examples/) folder. Plenty of eRPC multicore and multiprocessor examples can be also found in NXP MCUXpressoSDK packages. Visit [https://mcuxpresso.nxp.com](https://mcuxpresso.nxp.com) to configure, build and download these packages. @@ -145,53 +257,48 @@ This section provides links to interesting erpc-based projects, articles, blogs ## Directories -`doc` - Documentation. +[doc](/doc) - Documentation. -`doxygen` - Configuration and support files for running Doxygen over the eRPC C++ infrastructure and erpcgen code. +[doxygen](/doxygen) - Configuration and support files for running Doxygen over the eRPC C++ infrastructure and erpcgen code. -`erpc_c` - Holds C/C++ infrastructure for eRPC. This is the code you will include in your application. +[erpc_c](/erpc_c) - Holds C/C++ infrastructure for eRPC. This is the code you will include in your application. -`erpc_python` - Holds Python version of the eRPC infrastructure. +[erpc_python](/erpc_python) - Holds Python version of the eRPC infrastructure. -`erpcgen` - Holds source code for erpcgen and makefiles or project files to build erpcgen on Windows, Linux, and OS X. +[erpcgen](/erpcgen) - Holds source code for erpcgen and makefiles or project files to build erpcgen on Windows, Linux, and OS X. -`erpcsniffer` - Holds source code for erpcsniffer application. +[erpcsniffer](/erpcsniffer) - Holds source code for erpcsniffer application. -`examples` - Several example IDL files. +[examples](/examples) - Several example IDL files. -`mk` - Contains common makefiles for building eRPC components. +[mk](/mk) - Contains common makefiles for building eRPC components. -`test` - Client/server tests. These tests verify the entire communications path from client to server and back. +[test](/test) - Client/server tests. These tests verify the entire communications path from client to server and back. -`utilities` - Holds utilities which bring additional benefit to eRPC apps developers. +[utilities](/utilities) - Holds utilities which bring additional benefit to eRPC apps developers. ## Building and installing -These build instructions apply to host PCs and embedded Linux. For bare metal or RTOS embedded environments, you should copy the `erpc_c` directory into your application sources. +These build instructions apply to host PCs and embedded Linux. For bare metal or RTOS embedded environments, you should copy the [erpc_c](/erpc_c) directory into your application sources. The primary build system is makefile based. It builds a static library of the eRPC C/C++ infrastructure, the `erpcgen` executable, and optionally the unit tests. The makefiles are compatible with gcc or clang on Linux, OS X, and Cygwin. A Windows build -of erpcgen using Visual Studio is also available in the `erpcgen/VisualStudio_v14/` directory. -There is also an Xcode project file in the `erpcgen/` directory which can be used to build erpcgen -for OS X. +of erpcgen using Visual Studio is also available in the [erpcgen/VisualStudio_v14](erpcgen/VisualStudio_v14) directory. +There is also an Xcode project file in the [erpcgen](/erpcgen) directory, which can be used to build erpcgen for OS X. ### Requirements #### Windows -Steps are described in [`erpcgen/VisualStudio_v14/readme_erpcgen.txt`](erpcgen/VisualStudio_v14/readme_erpcgen.txt). - -#### Linux and Cygwin +* Related to Visual Studio: steps are described in [`erpcgen/VisualStudio_v14/readme_erpcgen.txt`](erpcgen/VisualStudio_v14/readme_erpcgen.txt). +* mingw compilation can be used too -Install these packages: +#### Linux -* bison: GNU yacc-compatible parser generator -* flex: A fast lexical analyzer generator -* make: the GNU version of the 'make' utility -* python: Python language interpreter 3.6+ work -* gcc-7: GNU C compiler (recommended version) -* g++-7: GNU C++ compiler (recommended version) +```bash +./install_dependencies.sh +``` Mandatory for case, when build for different architecture is needed @@ -199,10 +306,9 @@ Mandatory for case, when build for different architecture is needed #### Mac OS X -Install these packages with [homebrew](http://brew.sh/): - -* bison: GNU yacc-compatible parser generator (version 3.7.3 is recommended) -* flex: A fast lexical analyzer generator (version 2.6.4 is recommended) +```bash +./install_dependencies.sh +``` ### Building @@ -230,7 +336,8 @@ List of top level Makefile targets: * `erpc`: build the liberpc.a static library * `erpcgen`: build the erpcgen tool -* `test`: build the unit tests under the `test/` directory +* `erpcsniffer`: build the sniffer tool +* `test`: build the unit tests under the [test](/test) directory * `all`: build all of the above * `install`: install liberpc.a, erpcgen, and include files @@ -238,7 +345,7 @@ eRPC code is validated with respect to the C++ 11 standard. ### Installing for Python -To install the Python infrastructure for eRPC see instructions in the [erpc_python folder readme](erpc_python/readme.md). +To install the Python infrastructure for eRPC see instructions in the [erpc python readme](/erpc_python/readme.md). ## Known issues and limitations diff --git a/doxygen/mainpage_erpc.md b/doxygen/mainpage_erpc.md index a3179645..468cafa5 100644 --- a/doxygen/mainpage_erpc.md +++ b/doxygen/mainpage_erpc.md @@ -9,7 +9,7 @@ When a remote function is called by the client, the function's parameters and an Here is a block diagram of an RPC system: -![](./rpc_block_diagram.png) +![rpc block diagram](./rpc_block_diagram.png) This diagram only shows one direction of communication. It leaves out the reply from the server to send the invoked function's return value. This reply uses basically the same sequence of events, but flows back from the server to the client. diff --git a/erpc_python/readme.md b/erpc_python/readme.md index a8f2b06e..57d09477 100644 --- a/erpc_python/readme.md +++ b/erpc_python/readme.md @@ -7,29 +7,27 @@ protocol level. Also, the classes mirror those in the C++ infrastructure. ## Contents -`erpc` - Python package for eRPC infrastructure. +[erpc](erpc) - Python package for eRPC infrastructure. -`setup.py` - setuptools setup script that installs the erpc package. +[setup.py](setup.py) - setuptools setup script that installs the erpc package. -`setup.cfg, README_Pypi.md` - necessary files for the pypi support. +[setup.cfg](setup.cfg), [README_Pypi.md](README_Pypi.md) - necessary files for the pypi support. ## Installation Pip package installer needs to be installed in your Python version. Use following way for Python3 pip installation: ```sh -sudo apt-get install python3-pip -/usr/bin$ sudo rm python -/usr/bin$ sudo ln -s python3 python +sudo apt-get install python3 python3-pip ``` -To install the eRPC Python infrastructure, run the setup.py script like this (based on your system admin rights are required): +To install the eRPC Python infrastructure from pypi: ```sh -python setup.py install +pip install erpc ``` -Alternatively, you may use pip to install the package, like this: +To install the eRPC Python infrastructure from local folder ([erpc/erpc_python](/erpc_python)): ```sh pip install . diff --git a/erpcgen/test/readme.md b/erpcgen/test/readme.md index c63fa4bf..19033d76 100644 --- a/erpcgen/test/readme.md +++ b/erpcgen/test/readme.md @@ -2,10 +2,7 @@ This file documents the parser and output test system for erpcgen. -This test system is built on py.test using its extensive plugin hooks. To run the tests, just run -py.test in `erpc/erpcgen/test/` directory. It's safer to run py.test with parameter source -directory (from erpcgen directory run: "pytest test"). This prevent on windows to execute -boost test in boost folder. +This test system is built on py.test using its extensive plugin hooks. ## Setup @@ -23,7 +20,19 @@ the VisualStudio project. ## Running Run the tests by running the py.test executable. The tests can be run from either the -`erpc/erpcgen/` or `erpc/erpcgen/test/` directories. +[erpc/erpcgen/](/erpcgen) or [erpc/erpcgen/test/](.) directories. The tests can be also run from root folder defining directory with tests as next parameter. + +Run all tests: + +```bash +$ pytest erpcgen/test +``` + +Run one test + +```bash +$ pytest erpcgen/test/test_union_py.yml +``` Use the `--help` option of py.test to see all available command line options. Useful options are `-s` to turn off output capturing and `-v` to list each test case by name as it runs. The `-k` @@ -35,13 +44,12 @@ such as `--ev=3`. Default verbosity is 0. ## Config -The tests use a config file. The standard config is `erpc/erpcgen/test/config.py`. It tries to -figure out the erpcgen executable location based on the OS. If you need to override this, you can -create a `config_local.py` that defines the config variables listed below. +The tests use a config file. The standard config is [erpc/erpcgen/test/config.py](config.py). It tries to figure out the erpcgen executable location based on the OS. If you need to override this, you can create a `config_local.py` that defines the config variables listed below. Config variables: -- `CC` = C/C++ compiler path, defaults to "gcc" +- `CC` = C compiler path, defaults to "gcc" +- `CXX` = C++ compiler path, defaults to "g++" - `ERPCGEN` = absolute path to the erpcgen executable - `RUN_KEEP_COUNT` = number of historical test runs to retain, not including the most recent run @@ -195,7 +203,7 @@ Here, both not pattern searches range from the last matching character of the po also shows a `not_re` pattern that requires a regular expression to not match within the search range. -## Parametrizatio +## Parametrization If the test spec dictionary has a `params` key, then the spec will be parametrized. The `params` key must have a dictionary value with parameter names for keys. Under each of the parameter names diff --git a/examples/matrix_multiply_tcp_python/readme.md b/examples/matrix_multiply_tcp_python/readme.md index 96f51031..97d34155 100644 --- a/examples/matrix_multiply_tcp_python/readme.md +++ b/examples/matrix_multiply_tcp_python/readme.md @@ -1,38 +1,45 @@ # Overview + This example demonstrates usage of eRPC between two PC's or boards (e.g. i.MX) with Python using TCP transport layer. One side acts like a server and the second as a client. When client starts, it generates two random matrixes and sends them to the server. Server then performs matrix multiplication and sends the result matrix back to the client. Client then prints the result matrix. Example can be ran on Personal computer or on boards with Python installed, e.g. i.MX (i.MX7SD, i.MX6SX, etc.) -# eRPC documentation -eRPC is open-source project stored on github: https://github.com/EmbeddedRPC/erpc -eRPC documentation can be also found in: https://github.com/EmbeddedRPC/erpc/wiki +## eRPC documentation + +- eRPC is open-source project stored on github: [https://github.com/EmbeddedRPC/erpc](https://github.com/EmbeddedRPC/erpc) +- eRPC documentation can be also found in: [https://github.com/EmbeddedRPC/erpc/wiki](https://github.com/EmbeddedRPC/erpc/wiki) + +## Prerequisites -# Prerequisites - Python 3.6+ -# eRPC installation\ -1. run `python setup.py install` in folder `erpc/erpc_python/` +## eRPC installation + +1. run `python setup.py install` in folder [erpc/erpc_python/](/erpc_python) 2. `pip install erpc`: only major eRPC versions are available through pypi -# Example files -- `matrix_multiply.py`: main example file -- `service/erpc_matrix_multiply.erpc`: eRPC IDL file for example -- `service/erpc_matrix_multiply/`: eRPC output shim code generated from IDL file +## Example files + +- [matrix_multiply.py](matrix_multiply.py): main example file +- [service/erpc_matrix_multiply.erpc](service/erpc_matrix_multiply.erpc): eRPC IDL file for example +- [service/erpc_matrix_multiply](service/erpc_matrix_multiply): eRPC output shim code generated from IDL file + +## Running the example -# Running the example -- Run `matrix_multiply.py` with `-s` (or `--server`) parameter to run server -- Run `matrix_multiply.py` with `-c` (or `--client`) parameter to run client +- Run [matrix_multiply.py](matrix_multiply.py) with `-s` (or `--server`) parameter to run server +- Run [matrix_multiply.py](matrix_multiply.py) with `-c` (or `--client`) parameter to run client - Both server and client has to have specified host and port with `-t` (`--host`) and `-p` (`--port`) parameters. By default is host set as localhost and port as 40. -## Example: -``` +### Example + +```bash python matrix_multiply.py --server --host 192.168.1.10 --port 40 python matrix_multiply.py --client --host 192.168.1.10 --port 40 ``` The log below shows the output of the *eRPC Matrix Multiply* example in the terminal window: -``` +```bash $ python matrix_multiply.py --server eRPC Matrix Multiply TCP example Server created on localhost:40 @@ -64,8 +71,9 @@ Result matrix 2055 1290 0680 0721 1848 3147 2226 3742 3531 3585 1147 1988 2731 2047 2535 +``` - +```bash $ python matrix_multiply.py --client eRPC Matrix Multiply TCP example Client connecting to a host on localhost:40 diff --git a/utilities/styles/VSC/vsc-extension-quickstart.md b/utilities/styles/VSC/vsc-extension-quickstart.md index ea360ba6..9e338f3b 100644 --- a/utilities/styles/VSC/vsc-extension-quickstart.md +++ b/utilities/styles/VSC/vsc-extension-quickstart.md @@ -3,13 +3,13 @@ ## What's in the folder * This folder contains all of the files necessary for your extension. -* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. -* `syntaxes/erpc.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. -* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. +* [package.json](package.json) - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. +* [syntaxes/erpc.tmLanguage.json](syntaxes/erpc.tmLanguage.json) - this is the Text mate grammar file that is used for tokenization. +* [language-configuration.json](language-configuration.json) - this is the language configuration, defining the tokens that are used for comments and brackets. ## Get up and running straight away -* Make sure the language configuration settings in `language-configuration.json` are accurate. +* Make sure the language configuration settings in [language-configuration.json](language-configuration.json) are accurate. * Press `F5` to open a new window with your extension loaded. * Create a new file with a file name suffix matching your language. * Verify that syntax highlighting works and that the language configuration settings are working.