diff --git a/examples/all-clusters-app/tizen/.gn b/examples/all-clusters-app/tizen/.gn new file mode 100644 index 00000000000000..c50b81609edec2 --- /dev/null +++ b/examples/all-clusters-app/tizen/.gn @@ -0,0 +1,26 @@ +# 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 = { + target_os = "tizen" + import("//args.gni") +} diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn new file mode 100644 index 00000000000000..d860d723befcfe --- /dev/null +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -0,0 +1,77 @@ +# 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("//build_overrides/tizen.gni") + +import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/app/common_flags.gni") + +import("${tizen_sdk_build_root}/tizen_sdk.gni") +assert(chip_build_tools) + +source_set("chip-all-clusters-common") { + sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", + ] + + deps = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common", + "${chip_root}/src/lib/shell:shell_core", + ] + + include_dirs = + [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] +} + +executable("chip-all-clusters-app") { + sources = [ + "include/CHIPProjectAppConfig.h", + "src/main.cpp", + ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/tizen:app-main", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/zzz_generated/all-clusters-app", + "include", + ] + + output_dir = root_out_dir +} + +tizen_sdk_package("chip-all-clusters-app:tpk") { + deps = [ ":chip-all-clusters-app" ] + manifest = rebase_path("tizen-manifest.xml") + sign_security_profile = "CHIP" +} + +group("tizen") { + deps = [ ":chip-all-clusters-app" ] +} + +group("tizen:tpk") { + deps = [ ":chip-all-clusters-app:tpk" ] +} + +group("default") { + deps = [ ":tizen" ] +} diff --git a/examples/all-clusters-app/tizen/args.gni b/examples/all-clusters-app/tizen/args.gni new file mode 100644 index 00000000000000..41e334d3bd52d8 --- /dev/null +++ b/examples/all-clusters-app/tizen/args.gni @@ -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 = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/all-clusters-app/tizen/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-app/tizen/build_overrides b/examples/all-clusters-app/tizen/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/all-clusters-app/tizen/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h b/examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..cecc041dc2d34b --- /dev/null +++ b/examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h @@ -0,0 +1,31 @@ +/* + * + * 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include diff --git a/examples/all-clusters-app/tizen/src/main.cpp b/examples/all-clusters-app/tizen/src/main.cpp new file mode 100644 index 00000000000000..89002ef05bc3e0 --- /dev/null +++ b/examples/all-clusters-app/tizen/src/main.cpp @@ -0,0 +1,52 @@ +/* + * + * 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. + */ + +#include +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +// Network commissioning +namespace { +constexpr EndpointId kNetworkCommissioningEndpointMain = 0; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; +} // namespace + +void ApplicationInit() +{ + // Enable secondary endpoint only when we need it. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); +} + +int main(int argc, char * argv[]) +{ + TizenServiceAppMain app; + VerifyOrDie(app.Init(argc, argv) == 0); + + VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); + + return app.RunMainLoop(); +} diff --git a/examples/all-clusters-app/tizen/third_party/connectedhomeip b/examples/all-clusters-app/tizen/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/all-clusters-app/tizen/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/all-clusters-app/tizen/tizen-manifest.xml b/examples/all-clusters-app/tizen/tizen-manifest.xml new file mode 100644 index 00000000000000..dfd08655700512 --- /dev/null +++ b/examples/all-clusters-app/tizen/tizen-manifest.xml @@ -0,0 +1,17 @@ + + + + + + + + http://tizen.org/privilege/bluetooth + http://tizen.org/privilege/internet + http://tizen.org/privilege/network.get + + true + true + true + true + true + diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 5f529552dd5ffd..24724c702e7e70 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -557,6 +557,7 @@ def TizenTargets(): target = Target('tizen-arm', TizenBuilder, board=TizenBoard.ARM) + builder.targets.append(target.Extend('all-clusters', app=TizenApp.ALL_CLUSTERS)) builder.targets.append(target.Extend('all-clusters-minimal', app=TizenApp.ALL_CLUSTERS_MINIMAL)) builder.targets.append(target.Extend('chip-tool', app=TizenApp.CHIP_TOOL)) builder.targets.append(target.Extend('light', app=TizenApp.LIGHT)) diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index 3fdabd0fc27a9e..b256018d48accc 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -26,6 +26,11 @@ class TizenApp(Enum): + ALL_CLUSTERS = App( + 'chip-all-clusters-app', + 'examples/all-clusters-app/tizen', + ('chip-all-clusters-app', + 'chip-all-clusters-app.map')) ALL_CLUSTERS_MINIMAL = App( 'chip-all-clusters-minimal-app', 'examples/all-clusters-minimal-app/tizen', diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index e7becbbc0a94ab..31b5c69437dfbc 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -231,6 +231,8 @@ qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light telink-tlsr9518adk80d-light-switch +tizen-arm-all-clusters +tizen-arm-all-clusters-asan (NOGLOB: Reduce default build variants) tizen-arm-all-clusters-minimal tizen-arm-all-clusters-minimal-asan (NOGLOB: Reduce default build variants) tizen-arm-all-clusters-minimal-no-ble (NOGLOB: Reduce default build variants) @@ -239,6 +241,12 @@ tizen-arm-all-clusters-minimal-no-ble-no-wifi (NOGLOB: Reduce default build vari tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan (NOGLOB: Reduce default build variants) tizen-arm-all-clusters-minimal-no-wifi (NOGLOB: Reduce default build variants) tizen-arm-all-clusters-minimal-no-wifi-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-no-wifi-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-wifi-asan (NOGLOB: Reduce default build variants) tizen-arm-chip-tool tizen-arm-chip-tool-asan (NOGLOB: Reduce default build variants) tizen-arm-chip-tool-no-ble (NOGLOB: Reduce default build variants) diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 162fd85c038a67..0cd4131a107229 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -1114,6 +1114,12 @@ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-light-switch -b tlsr9518adk80d {root}/examples/light-switch-app/telink' +# Generating tizen-arm-all-clusters +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters + +# Generating tizen-arm-all-clusters-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-asan + # Generating tizen-arm-all-clusters-minimal gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal @@ -1138,6 +1144,24 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa # Generating tizen-arm-all-clusters-minimal-no-wifi-asan gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-wifi-asan +# Generating tizen-arm-all-clusters-no-ble +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble + +# Generating tizen-arm-all-clusters-no-ble-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-asan + +# Generating tizen-arm-all-clusters-no-ble-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-no-wifi + +# Generating tizen-arm-all-clusters-no-ble-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-no-wifi-asan + +# Generating tizen-arm-all-clusters-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-wifi + +# Generating tizen-arm-all-clusters-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-wifi-asan + # Generating tizen-arm-chip-tool gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-chip-tool @@ -2256,6 +2280,12 @@ ninja -C {out}/telink-tlsr9518adk80d-light # Building telink-tlsr9518adk80d-light-switch ninja -C {out}/telink-tlsr9518adk80d-light-switch +# Building tizen-arm-all-clusters +ninja -C {out}/tizen-arm-all-clusters + +# Building tizen-arm-all-clusters-asan +ninja -C {out}/tizen-arm-all-clusters-asan + # Building tizen-arm-all-clusters-minimal ninja -C {out}/tizen-arm-all-clusters-minimal @@ -2280,6 +2310,24 @@ ninja -C {out}/tizen-arm-all-clusters-minimal-no-wifi # Building tizen-arm-all-clusters-minimal-no-wifi-asan ninja -C {out}/tizen-arm-all-clusters-minimal-no-wifi-asan +# Building tizen-arm-all-clusters-no-ble +ninja -C {out}/tizen-arm-all-clusters-no-ble + +# Building tizen-arm-all-clusters-no-ble-asan +ninja -C {out}/tizen-arm-all-clusters-no-ble-asan + +# Building tizen-arm-all-clusters-no-ble-no-wifi +ninja -C {out}/tizen-arm-all-clusters-no-ble-no-wifi + +# Building tizen-arm-all-clusters-no-ble-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-no-ble-no-wifi-asan + +# Building tizen-arm-all-clusters-no-wifi +ninja -C {out}/tizen-arm-all-clusters-no-wifi + +# Building tizen-arm-all-clusters-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-no-wifi-asan + # Building tizen-arm-chip-tool ninja -C {out}/tizen-arm-chip-tool diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index bc02fb970af64c..ea1d511153e29d 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -109,6 +109,7 @@ qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light telink-tlsr9518adk80d-light-switch +tizen-arm-all-clusters tizen-arm-all-clusters-minimal tizen-arm-chip-tool tizen-arm-light