-
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.
[OIS] Add all-clusters-app Matter example (#27836)
Add all-clusters-app implementation for OIS. Create all-clusters-app integration tests. Extend build script, Vscode tasks, CI with all-clusters-app. Signed-off-by: ATmobica <[email protected]> Co-authored-by: Chris Swinchatt <[email protected]>
- Loading branch information
Showing
13 changed files
with
895 additions
and
0 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 @@ | ||
build/ |
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,68 @@ | ||
# | ||
# Copyright (c) 2023 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. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.21) | ||
|
||
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) | ||
get_filename_component(OPEN_IOT_SDK_CONFIG ${CHIP_ROOT}/config/openiotsdk REALPATH) | ||
get_filename_component(OPEN_IOT_SDK_EXAMPLE_COMMON ${CHIP_ROOT}/examples/platform/openiotsdk REALPATH) | ||
get_filename_component(ALL_CLUSTERS_COMMON ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${OPEN_IOT_SDK_CONFIG}/cmake) | ||
|
||
set(APP_TARGET chip-openiotsdk-all-clusters-app-example_ns) | ||
|
||
set(TFM_PROJECT_CONFIG_HEADER_FILE "${CMAKE_CURRENT_SOURCE_DIR}/tf-m-config/TfmProjectConfig.h") | ||
|
||
# Toolchain files need to exist before first call to project | ||
include(toolchain) | ||
|
||
project(${APP_TARGET} LANGUAGES C CXX ASM) | ||
|
||
include(sdk) | ||
|
||
add_executable(${APP_TARGET}) | ||
|
||
# Application CHIP build configuration | ||
include(chip) | ||
|
||
add_subdirectory(${OPEN_IOT_SDK_EXAMPLE_COMMON}/app ./app_build) | ||
|
||
chip_add_data_model(openiotsdk-app PUBLIC all-clusters) | ||
|
||
target_include_directories(${APP_TARGET} | ||
PRIVATE | ||
main/include | ||
${ALL_CLUSTERS_COMMON}/include | ||
) | ||
|
||
target_sources(${APP_TARGET} | ||
PRIVATE | ||
main/main_ns.cpp | ||
${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp | ||
${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp | ||
${ALL_CLUSTERS_COMMON}/src/binding-handler.cpp | ||
) | ||
|
||
target_link_libraries(${APP_TARGET} | ||
openiotsdk-startup | ||
openiotsdk-app | ||
) | ||
|
||
include(linker) | ||
set_target_link(${APP_TARGET}) | ||
|
||
sdk_post_build(${APP_TARGET}) |
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,100 @@ | ||
# Matter Open IoT SDK All-Clusters-App Example Application | ||
|
||
The Open IoT SDK All Clusters Example demonstrates various ZCL clusters control. | ||
|
||
The example behaves as a Matter accessory, device that can be paired into an | ||
existing Matter network and can be controlled by it. | ||
|
||
You can use this example as a reference for creating your own application. | ||
|
||
## Build-run-test-debug | ||
|
||
For information on how to build, run, test and debug this example and further | ||
information about the platform it is run on see | ||
[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). | ||
|
||
The example name to use in the scripts is `all-clusters-app`. | ||
|
||
## Example output | ||
|
||
When the example runs, these lines should be visible: | ||
|
||
``` | ||
[INF] [-] Open IoT SDK all-clusters-app example application start | ||
... | ||
[INF] [-] Open IoT SDK all-clusters-app example application run | ||
``` | ||
|
||
This means the all-clusters-app application launched correctly and you can | ||
follow traces in the terminal. | ||
|
||
### Commissioning | ||
|
||
Read the | ||
[Open IoT SDK commissioning guide](../../../docs/guides/openiotsdk_commissioning.md) | ||
to see how to use the Matter controller to commission and control the | ||
application. | ||
|
||
### AccessControl cluster usage | ||
|
||
The application fully supports the AccessControl cluster. For more details about | ||
access control please visit | ||
[Access Control Guide](../../../docs/guides/access-control-guide.md). Use | ||
cluster commands to trigger actions on the device. You can issue commands | ||
through the same Matter controller you used to perform the commissioning step | ||
above. | ||
|
||
Example command: | ||
|
||
``` | ||
chip-tool accesscontrol read acl 123 0 | ||
``` | ||
|
||
The numeric arguments are: device node ID and device endpoint ID, respectively. | ||
|
||
The device sent a response and you should see this line in the controller | ||
output: | ||
|
||
``` | ||
CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 3442030892 | ||
CHIP:TOO: ACL: 1 entries | ||
CHIP:TOO: [1]: { | ||
CHIP:TOO: Privilege: 5 | ||
CHIP:TOO: AuthMode: 2 | ||
CHIP:TOO: Subjects: 1 entries | ||
CHIP:TOO: [1]: 112233 | ||
CHIP:TOO: Targets: null | ||
CHIP:TOO: FabricIndex: 1 | ||
CHIP:TOO: } | ||
``` | ||
|
||
These are automatically installed ACL entries after commissioning. | ||
|
||
### BasicInformation cluster usage | ||
|
||
One of the fully supported clusters by this example is BasicInformation cluster. | ||
Use cluster commands to trigger actions on the device. You can issue commands | ||
through the same Matter controller you used to perform the commissioning step | ||
above. | ||
|
||
Example command: | ||
|
||
``` | ||
chip-tool basicinformation read vendor-id 123 0 | ||
``` | ||
|
||
The numeric arguments are: device node ID and device endpoint ID, respectively. | ||
|
||
The device send a response with its vendor ID number and you should see this | ||
line in the controller output: | ||
|
||
``` | ||
CHIP:TOO: VendorID: 65521 | ||
``` | ||
|
||
The `65521` value is the default `vendor ID` for Matter examples. | ||
|
||
**NOTE** | ||
|
||
More details about the `chip-tool` controller can be found | ||
[here](../../chip-tool/README.md). |
22 changes: 22 additions & 0 deletions
22
examples/all-clusters-app/openiotsdk/cmsis-config/RTE_Components.h
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) 2022 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. | ||
*/ | ||
|
||
#ifndef RTE_COMPONENTS_H | ||
#define RTE_COMPONENTS_H | ||
|
||
#endif // RTE_COMPONENTS_H |
Oops, something went wrong.