Skip to content

Commit

Permalink
Terms and Conditions sample app
Browse files Browse the repository at this point in the history
* Updated chip-cert-bins to include chip-terms-and-conditions-app

```bash
$ export ZAP_DEVELOPMENT_PATH=/workspace/zap
$ /workspace/connectedhomeip/scripts/tools/zap/generate.py examples/terms-and-conditions-app/common/terms-and-conditions-app.zap
$ ./scripts/build/build_examples.py --target linux-x64-terms-and-conditions build
$ ./scripts/build/build_examples.py --target linux-arm64-terms-and-conditions build
```
  • Loading branch information
swan-amazon committed Oct 30, 2024
1 parent 2448a99 commit a5df341
Show file tree
Hide file tree
Showing 16 changed files with 5,061 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ jobs:
--target linux-x64-fabric-admin-rpc-ipv6only-clang \
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-terms-and-conditions \
--target linux-x64-python-bindings \
build \
--copy-artifacts-to objdir-clone \
Expand All @@ -514,6 +515,7 @@ jobs:
echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-clang/fabric-admin" >> /tmp/test_env.yaml
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml
echo "TERMS_AND_CONDITIONS_APP: out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app" >> /tmp/test_env.yaml
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
Expand Down
25 changes: 25 additions & 0 deletions examples/terms-and-conditions-app/linux/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2024 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")
}
33 changes: 33 additions & 0 deletions examples/terms-and-conditions-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2024 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}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")

executable("chip-terms-and-conditions-app") {
sources = [ "main.cpp" ]

deps = [
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/examples/terms-and-conditions-app/terms-and-conditions-common",
"${chip_root}/src/lib",
]

output_dir = root_out_dir
}

group("default") {
deps = [ ":chip-terms-and-conditions-app" ]
}
23 changes: 23 additions & 0 deletions examples/terms-and-conditions-app/linux/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2024 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_project_config_include = "<CHIPProjectAppConfig.h>"

chip_project_config_include_dirs = [
"//include",
"${chip_root}/config/standalone",
]
1 change: 1 addition & 0 deletions examples/terms-and-conditions-app/linux/build_overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
*
* Copyright (c) 2024 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.
*/

#pragma once

#define CHIP_CONFIG_TC_REQUIRED 1
#define CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS 1
#define CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS_VERSION 1

#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF3
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x801E

// Inherit defaults from config/standalone/CHIPProjectConfig.h
#include <CHIPProjectConfig.h>
34 changes: 34 additions & 0 deletions examples/terms-and-conditions-app/linux/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
*
* Copyright (c) 2024 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 <AppMain.h>

void ApplicationInit() {}

void ApplicationShutdown() {}

int main(int argc, char * argv[])
{
if (ChipLinuxAppInit(argc, argv) != 0)
{
return -1;
}

ChipLinuxAppMainLoop();
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 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}/src/app/chip_data_model.gni")

chip_data_model("terms-and-conditions-common") {
zap_file = "terms-and-conditions-app.zap"
is_server = true
}
Loading

0 comments on commit a5df341

Please sign in to comment.