Skip to content

Commit

Permalink
[RPC] Added descriptor service to all-clusters-app RPC
Browse files Browse the repository at this point in the history
- Tested with rpc_tool none-of-the-above test
  • Loading branch information
pankore committed Jun 22, 2022
1 parent 2ac3ee7 commit ae98cca
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ pw_proto_library(button_service
pw_protobuf.common_proto
)

pw_proto_library(descriptor_service
SOURCES
${chip_dir}/examples/common/pigweed/protos/descriptor_service.proto
PREFIX
descriptor_service
STRIP_PREFIX
${chip_dir}/examples/common/pigweed/protos
DEPS
pw_protobuf.common_proto
)

pw_proto_library(device_service
SOURCES
${chip_dir}/examples/common/pigweed/protos/device_service.proto
Expand Down Expand Up @@ -202,6 +213,7 @@ if (matter_enable_rpc)
target_link_libraries(${chip_main} PUBLIC
attributes_service.nanopb_rpc
button_service.nanopb_rpc
descriptor_service.nanopb_rpc
device_service.nanopb_rpc
lighting_service.nanopb_rpc
locking_service.nanopb_rpc
Expand Down Expand Up @@ -240,6 +252,7 @@ list(

-DPW_RPC_ATTRIBUTE_SERVICE=1
-DPW_RPC_BUTTON_SERVICE=1
-DPW_RPC_DESCRIPTOR_SERVICE=1
-DPW_RPC_DEVICE_SERVICE=1
-DPW_RPC_LIGHTING_SERVICE=1
-DPW_RPC_LOCKING_SERVICE=1
Expand Down
12 changes: 12 additions & 0 deletions examples/platform/ameba/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "pigweed/rpc_services/Button.h"
#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE

#if defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE
#include "pigweed/rpc_services/Descriptor.h"
#endif // defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE

#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
#include "pigweed/rpc_services/Device.h"
#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
Expand Down Expand Up @@ -104,6 +108,10 @@ Attributes attributes_service;
AmebaButton button_service;
#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE

#if defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE
Descriptor descriptor_service;
#endif // defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE

#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
AmebaDevice device_service;
#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
Expand All @@ -126,6 +134,10 @@ void RegisterServices(pw::rpc::Server & server)
server.RegisterService(button_service);
#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE

#if defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE
server.RegisterService(descriptor_service);
#endif // defined(PW_RPC_DESCRIPTOR_SERVICE) && PW_RPC_DESCRIPTOR_SERVICE

#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
server.RegisterService(device_service);
#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
Expand Down

0 comments on commit ae98cca

Please sign in to comment.