|author||pigweed-integration-roller <firstname.lastname@example.org>||Tue Sep 15 23:14:44 2020 +0000|
|committer||CQ Bot Account <email@example.com>||Tue Sep 15 23:15:03 2020 +0000|
[roll third_party/pigweed] pw_rpc: Isolate pw_rpc server from proto library - Completely isolate the pw_rpc server library from the protobuf implementation. The core pw_rpc server code compiles the same regardless of which method implementations are used. This opens up the possibility of using different protobuf libraries in the same server. - No longer get pw_rpc/internal/method.h from the protobuf library implementation. Rename pw_rpc/internal/base_method.h to pw_rpc/internal/method.h and BaseMethod to Method. - Rename the Nanopb method implementation to NanopbMethod and the test implementation to TestMethod. Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18241 Rolled-Commits: d159142e990ebdf..cbd09c248c3aaa1 CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I55463c36ecfff278240cf602f094943c38918ee4 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/sample_project/+/18245 Reviewed-by: Pigweed Integration Roller <firstname.lastname@example.org> Commit-Queue: Pigweed Integration Roller <email@example.com>
This repository outlines the recommended way of using Pigweed in a new or existing project. Feel free to fork this repository, or read it as a reference.
For more information see the Pigweed Getting started guide
Check back for more complex examples and features coming soon!
The preferred method to add the Pigweed source is to use git submodules and place the Pigweed source repository in
third_party/pigweed. If you forked this repository, don't forget to run
git submodule init and
git submodule update.
bootstrap.bat for Windows, and
bootstrap.sh for Unix systems call the respective Pigweed bootstrap scripts. Feel free to modify them to set up your development environment for the first time.
After the initial setup, use the
activate.bat in Windows or
activate.sh in Unix to enter the environment in a shell.
Make the project yours with your own banner. Create your own banner and place it in
Generate the build files with
gn gen out once, unless the build configuration has changed. Then, use ninja to build everything with
ninja -C out.
The sample application in
source/main.cc uses the sample module
simple_counter. Look at
source/simple_counter/BUILD.gn to see how these are built respectively. The key part is in the root
BUILD.gn, which creates the host target using the host toolchain. A toolchain is required for each target.
Build the project and run the application.
simple_counter module has tests defined in
source/simple_counter_tests.cc. Look at
source/simple_counter/BUILD.gn for an example of how a test is defined. The root
BUILD.gn groups all the host tests together.
Build the project and run the tests.
Logs entries in the sample app are tokenized to save binary space. See the Pigweed
pw_tokenizer for more information.
First, create the tokens database using the binary or the .elf file.
python -m pw_tokenizer.database create --database source/tokenizer_database.csv out/host_clang_debug/obj/source/bin/hello_world
Running the app shows log entries similiar to
$kgjLdg==. These can be saved to a file and then detokenized.
python -m pw_tokenizer.detokenize base64 source/tokenizer_database.csv -i log.txt
Or can be detokenized in realtime.
./out/host_clang_debug/obj/source/bin/hello_world | python -m pw_tokenizer.detokenize base64 source/tokenizer_database.csv