-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace lighting_console with chip_rpc.console (#8302)
Create a single rpc console which has all chip RPC protos to talk to any chip RPC enabled device, this avoids needing to create a new console for every app. Also update Pigweed, and integrate the new console changes and UI. Move the protos from the ipv6only and lock-app examples into common folders. Update all the example docs to use the new console.
- Loading branch information
Showing
30 changed files
with
302 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "${build_root}/config/BUILDCONFIG.gn" | ||
|
||
default_args = { | ||
chip_enable_pw_rpc = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/pigweed.gni") | ||
|
||
group("default") { | ||
deps = [ | ||
"py:chip_rpc.install", | ||
"py:chip_rpc_wheel", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# CHIP RPC CONSOLE | ||
|
||
This python application provides a console for interacting with rpc-enabled chip | ||
devices. | ||
|
||
The console uses the [pigweed pw_console](https://pigweed.dev/pw_console/), but | ||
with customizations to work better with CHIP, including containing all rpc proto | ||
files required for CHIP. | ||
|
||
- [CHIP RPC CONSOLE](#chip-rpc-console) | ||
- [Building](#building) | ||
- [Running](#running) | ||
|
||
--- | ||
|
||
## Building | ||
|
||
If this is the first time using the checkout the environment must first be | ||
bootstrapped to install all dependencies. | ||
|
||
$ source ./scripts/bootstrap.sh | ||
|
||
If bootstrap has previously be run simply activate. | ||
|
||
$ source ./scripts/activate.sh | ||
|
||
The python console is built and installed in the venv using gn: | ||
|
||
$ gn gen out/debug | ||
$ ninja -C out/debug | ||
|
||
After building the output directory also contains a folder | ||
(chip_rpc_console_wheels), with all the wheels required for the tool. These | ||
can be used to install the console without needing the sdk. Simply install | ||
all the wheels in the folder: | ||
$ pip install chip_rpc_console_wheels/*.whl | ||
|
||
## Running | ||
|
||
To start the console provide the path to the device, for example: | ||
|
||
$ python -m chip_rpc.console --device /dev/ttyUSB0 | ||
|
||
An example RPC command: | ||
|
||
$ rpcs.chip.rpc.DeviceCommon.GetDeviceInfo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../build_overrides/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/common/pigweed/rpc_console/third_party/connectedhomeip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") | ||
|
||
if (chip_enable_pw_rpc) { | ||
import("//build_overrides/pigweed.gni") | ||
import("$dir_pw_protobuf_compiler/proto.gni") | ||
|
||
pw_proto_library("wifi_service") { | ||
sources = [ "wifi_service/wifi_service.proto" ] | ||
inputs = [ "wifi_service/wifi_service.options" ] | ||
deps = [ "$dir_pw_protobuf:common_protos" ] | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.