Update the server-to-client RPC packet types so that the packet type
unambiguously indicates whether it is the first or last packet. This is
already the case for client-to-server RPC packet types.
- Have RESPONSE always be the last packet in the stream. For RPCs
without a server stream, it includes a payload. Remove
SERVER_STREAM_END.
- Introduce the SERVER_STREAM packet, to parallel the CLIENT_STREAM
packet.
- Update the server and client code and tests. Test that old-style
streaming RPCs still work correctly.
- Refactor the duplicate MessageOutput class into a FakeChannelOutput
used by both Nanopb and raw RPCs.
- In C++, don't encode default-valued payload and status fields.
Change-Id: I218772dad6c2981dda5f032f298ea43ee5e08b4d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/49822
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
This file rename was done in a separate change from the class rename so
Git would detect these as file moves rather than new files.
Change-Id: I37b6168b142197628b6694736ce0fbe36e44b263
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/49201
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
This adds a class which wraps both an RPC client and server, simplifying
setup and usage in systems that require both.
Change-Id: I00e3cbeef91b8703c432800f58a96db5faff63f4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/40624
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
- Allow specifying prefix and strip_prefix arguments for proto files.
The proto directory tree is built as specified in the out directory.
- Only invoke protoc from the default toolchain. This prevents duplicate
protoc invocations.
- Prevent duplicate pw_proto_library Python package definitions anywhere
in the build.
- Replace implicit handling of standalone external protos with a
python_package_as_module option.
Change-Id: Id37d8b4d83294f7d3142a389e74ceea96dd4d620
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/34640
Reviewed-by: Alexei Frolov <frolv@google.com>
For compatibility with Python packaging, each pw_protobuf_library target
must have a unique root directory for its protos. If this is violated,
the setup.py for the Python package is generated multiple times,
resulting in flaky builds.
This change ensures that no two pw_proto_library targets generate the
same Python package and fixes existing conflicts in the Pigweed repo.
Change-Id: Icbc13ceeb2fd329bc4fbf1e14ec039e98dc7e483
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/31740
Reviewed-by: Alexei Frolov <frolv@google.com>
This adds an channel output wrapper which synchronizes a ChannelOutput's
operations with a sync::Mutex, and updates the host target's system RPC server
to use it.
Change-Id: I3d2407a8c81a8f0370fd714ded850293d7030209
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/28540
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
- Split the CMake build into separate libraries so that the socket
stream code is not automatically built.
- Fix public/private deps in the GN build.
- Add pw_rpc/system_server/CMakeLists.txt.
- In the CMake presubmit step, install Nanopb and build CMake's pw_apps.
Change-Id: Id29673d5d26e30e1b196768b8667805ec3094e3e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/27581
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
- Add proto.cmake and the pw_proto_library function. Like the GN
version, this generates code for .proto files.
- Provide CMakeLists.txt for pw_protobuf, pw_rpc, and pw_hdlc_lite.
- Add a Nanopb wrapper CMakeLists.txt with a cache variable for Nanopb,
similar to the variable for GN.
Change-Id: I15d09af8aa3575a86fc360787b117988a75f569e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22841
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
- Define CMake cache variables (similar to gn args) for facade backends.
- Create simple initial toolchain files for GCC and Clang.
- Misc updates to pigweed.cmake and pw_build/CMakeLists.txt.
- Add or expand various CMakeLists.txt files.
- Watch CMake files in watch.py to support using CMake in pw watch.
Change-Id: I490d157485d02811a11f6a3589a0508ea1851f58
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22840
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>