-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing CLI tv-casting-app for Linux (#8824)
* Introducing Linux CLI based tv-casting-app * Adding zap/gen files for tv-casting-app * Updating tv-casting zap/gen * Including CHIPCommissionableNodeController.h.h in BUILD.gn * Updates to AdvertiseCommissionableNode call args * Moving zap/gen files to zzz_generated dir for tv-casting-app * Making user input to select commissioner for UDC async * Addressing typos, adding comments for tv-casting-app * Using constexpr and other minor edits
- Loading branch information
1 parent
809b81a
commit 2937f1a
Showing
36 changed files
with
28,943 additions
and
46 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2020 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" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
import("//args.gni") | ||
} |
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,42 @@ | ||
# Copyright (c) 2020 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") | ||
import("//build_overrides/chip.gni") | ||
|
||
import("${chip_root}/build/chip/tools.gni") | ||
|
||
assert(chip_build_tools) | ||
|
||
executable("chip-tv-casting-app") { | ||
sources = [ | ||
"${chip_root}/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h", | ||
"main.cpp", | ||
] | ||
|
||
deps = [ | ||
"${chip_root}/examples/platform/linux:app-main", | ||
"${chip_root}/examples/tv-casting-app/tv-casting-common", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/third_party/inipp", | ||
] | ||
|
||
cflags = [ "-Wconversion" ] | ||
|
||
output_dir = root_out_dir | ||
} | ||
|
||
group("linux") { | ||
deps = [ ":chip-tv-casting-app" ] | ||
} |
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,23 @@ | ||
# | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# All rights reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
from generic_node_image | ||
RUN apt-get install -y libglib2.0 | ||
COPY out/debug/chip-tv-casting-app /usr/bin/ | ||
COPY entrypoint.sh / | ||
|
||
ENTRYPOINT ["/entrypoint.sh", "server"] |
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,53 @@ | ||
# CHIP TV Casting App Example | ||
|
||
This is a CHIP TV Casting app that can be used to cast content to a TV. This app | ||
discovers TVs on the local network that act as commissioners, lets the user | ||
select one, sends the TV a User Directed Commissioning request, enters | ||
commisioning mode, advertises itself as a Commissionable Node and gets | ||
commissioned. Then it allows the user to send CHIP ContentLauncher commands to | ||
the TV. | ||
|
||
<hr> | ||
|
||
- [CHIP TV Casting App Example](#chip-tv-casting-app-example) | ||
- [Building](#building) | ||
- [Running the Complete Example on Linux](#running-the-complete-example-on-linux) | ||
|
||
<hr> | ||
|
||
<a name="building"></a> | ||
|
||
## Building | ||
|
||
- Install tool chain | ||
|
||
$ sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev ninja-build python3-venv python3-dev unzip | ||
|
||
- Build the example application: | ||
|
||
$ cd ~/connectedhomeip/examples/tv-casting-app/linux | ||
$ git submodule update --init | ||
$ source third_party/connectedhomeip/scripts/activate.sh | ||
$ gn gen out/debug | ||
$ ninja -C out/debug | ||
|
||
- To delete generated executable, libraries and object files use: | ||
|
||
$ cd ~/connectedhomeip/examples/tv-casting-app/linux | ||
$ rm -rf out/ | ||
|
||
<a name="running-the-complete-example-on-linux"></a> | ||
|
||
## Running the Complete Example on Linux | ||
|
||
- Pre-requisite: Build and run the tv-app | ||
|
||
$ cd ~/connectedhomeip/examples/tv-app/linux | ||
$ out/debug/chip-tv-app | ||
|
||
- Run the tv-casting-app | ||
|
||
$ cd ~/connectedhomeip/examples/tv-casting-app/linux | ||
$ out/debug/chip-tv-casting-app | ||
|
||
Follow the on-screen prompts on the tv-casting-app console |
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,25 @@ | ||
# Copyright (c) 2020 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}/config/standalone/args.gni") | ||
|
||
chip_device_project_config_include = "<CHIPProjectAppConfig.h>" | ||
chip_project_config_include = "<CHIPProjectAppConfig.h>" | ||
chip_system_project_config_include = "<SystemProjectConfig.h>" | ||
|
||
chip_project_config_include_dirs = | ||
[ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] | ||
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Copyright (c) 2020 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. | ||
# | ||
|
||
set -ex | ||
|
||
service dbus start | ||
sleep 1 | ||
/usr/sbin/otbr-agent -I wpan0 spinel+hdlc+uart:///dev/ttyUSB0 & | ||
sleep 1 | ||
ot-ctl panid 0x1234 | ||
ot-ctl ifconfig up | ||
ot-ctl thread start | ||
|
||
chip-tv-casting-app |
Oops, something went wrong.