Skip to content

Commit

Permalink
RPC: Add linux light rpc to build script
Browse files Browse the repository at this point in the history
Add a target for building the linux lighting app with
RPCs enabled.
  • Loading branch information
Rob Oliver committed Jun 17, 2022
1 parent 8ef608d commit 7a706fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/common/pigweed/rpc_services/Descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Descriptor : public pw_rpc::nanopb::Descriptor::Service<Descriptor>
EndpointId endpoint_id = emberAfEndpointFromIndex(index);
if (endpoint_id == 0)
continue;
chip_rpc_Endpoint out{ endpoint : endpoint_id };
chip_rpc_Endpoint out{ .endpoint = endpoint_id };
writer.Write(out);
}
}
Expand All @@ -99,7 +99,7 @@ class Descriptor : public pw_rpc::nanopb::Descriptor::Service<Descriptor>
for (uint8_t cluster_index = 0; cluster_index < cluster_count; cluster_index++)
{
const EmberAfCluster * cluster = emberAfGetNthCluster(endpoint, cluster_index, server);
chip_rpc_Cluster out{ cluster_id : cluster->clusterId };
chip_rpc_Cluster out{ .cluster_id = cluster->clusterId };
writer.Write(out);
}
writer.Finish();
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def HostTargets():
app_targets.append(target.Extend('thermostat', app=HostApp.THERMOSTAT))
app_targets.append(target.Extend('minmdns', app=HostApp.MIN_MDNS))
app_targets.append(target.Extend('light', app=HostApp.LIGHT))
app_targets.append(target.Extend('light-rpc', app=HostApp.LIGHT, enable_rpcs=True))
app_targets.append(target.Extend('lock', app=HostApp.LOCK))
app_targets.append(target.Extend('shell', app=HostApp.SHELL))
app_targets.append(target.Extend(
Expand Down
5 changes: 4 additions & 1 deletion scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class HostBuilder(GnBuilder):
def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ipv4=True,
enable_ble=True, enable_wifi=True, use_tsan=False, use_asan=False, separate_event_loop=True,
use_libfuzzer=False, use_clang=False, interactive_mode=True, extra_tests=False,
use_platform_mdns=False):
use_platform_mdns=False, enable_rpcs: bool=False):
super(HostBuilder, self).__init__(
root=os.path.join(root, 'examples', app.ExamplePath()),
runner=runner)
Expand All @@ -207,6 +207,9 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip
self.board = board
self.extra_gn_options = []

if enable_rpcs:
self.extra_gn_options.append('import("//with_pw_rpc.gni")')

if not enable_ipv4:
self.extra_gn_options.append('chip_inet_config_enable_ipv4=false')

Expand Down

0 comments on commit 7a706fe

Please sign in to comment.