pw_rpc: Replace PW_RPC_TEST_METHOD_CONTEXT macro
- Add a function to the generated RPC service that maps a pointer to a
derived class's method implementation to the internal::Method object.
- Rework ServiceTestUtilities into intenal::ServiceMethodTraits which
provides information about a service and method and compile time. This
class will be useful for both TestMethodContext and a non-test
RPC invocation function.
- Replace the PW_RPC_TEST_METHOD_CONTEXT macro with a class that takes
the method implementation function pointer.
Change-Id: I99fcf34c4377bbf22fd1311a4d24011a17b54f40
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15027
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_rpc/BUILD.gn b/pw_rpc/BUILD.gn
index 90fc36e..0067ecc 100644
--- a/pw_rpc/BUILD.gn
+++ b/pw_rpc/BUILD.gn
@@ -107,6 +107,7 @@
"public/pw_rpc/internal/base_method.h",
"public/pw_rpc/internal/call.h",
"public/pw_rpc/internal/channel.h",
+ "public/pw_rpc/internal/hash.h",
"public/pw_rpc/internal/packet.h",
]
friend = [ "./*" ]
@@ -119,18 +120,6 @@
implementation = "nanopb"
}
-pw_source_set("nanopb_test_method_context") {
- public_configs = [ ":default_config" ]
- public = [ "public/pw_rpc/test_method_context.h" ]
- sources = [ "public/pw_rpc/internal/hash.h" ]
- public_deps = [
- ":nanopb_server",
- dir_pw_containers,
- dir_pw_unit_test,
- ]
- friend = [ "nanopb:*" ]
-}
-
config("private_includes") {
include_dirs = [ "." ]
visibility = [ ":*" ]