Skip to content

Commit

Permalink
[Tizen] Platform build for all-clusters app
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Jul 8, 2022
1 parent 2912d04 commit 4019d77
Show file tree
Hide file tree
Showing 13 changed files with 293 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/all-clusters-app/tizen/.gn
Original file line number Diff line number Diff line change
@@ -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")
}
77 changes: 77 additions & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
@@ -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" ]
}
25 changes: 25 additions & 0 deletions examples/all-clusters-app/tizen/args.gni
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/all-clusters-app/tizen/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/build_overrides
31 changes: 31 additions & 0 deletions examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
@@ -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 <CHIPProjectConfig.h>
52 changes: 52 additions & 0 deletions examples/all-clusters-app/tizen/src/main.cpp
Original file line number Diff line number Diff line change
@@ -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 <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/util/af.h>

#include <TizenServiceAppMain.h>
#include <binding-handler.h>

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();
}
17 changes: 17 additions & 0 deletions examples/all-clusters-app/tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="6.0" package="org.tizen.matter.example.allclusters" version="1.0.0">
<profile name="mobile" />
<service-application appid="org.tizen.matter.example.allclusters" exec="chip-all-clusters-app" type="capp" multiple="false" taskmanage="false" nodisplay="true">
<label>Matter All Clusters Example</label>
</service-application>
<privileges>
<privilege>http://tizen.org/privilege/bluetooth</privilege>
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/network.get</privilege>
</privileges>
<feature name="http://tizen.org/feature/network.bluetooth">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le.gatt.server">true</feature>
<feature name="http://tizen.org/feature/network.service_discovery.dnssd">true</feature>
<feature name="http://tizen.org/feature/network.wifi">true</feature>
</manifest>
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/tizen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
48 changes: 48 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/glob_star_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4019d77

Please sign in to comment.