diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml
index be2d372e88c177..4121768bd4cac5 100644
--- a/.github/workflows/examples-k32w.yaml
+++ b/.github/workflows/examples-k32w.yaml
@@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: ghcr.io/project-chip/chip-build-k32w:33
+ image: ghcr.io/project-chip/chip-build-k32w:38
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -46,7 +46,7 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
- platform: k32w
+ platform: nxp
- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
@@ -59,11 +59,8 @@ jobs:
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target k32w-k32w0-light-crypto-platform-tokenizer \
- --target k32w-k32w0-lock-crypto-platform-tokenizer \
- --target k32w-k32w0-lock-crypto-platform-low-power-nologs \
--target k32w-k32w0-contact-crypto-platform-tokenizer \
--target k32w-k32w0-contact-crypto-platform-low-power-nologs \
- --target k32w-k32w0-shell-crypto-platform \
--target k32w-k32w1-light-crypto-platform-openthread-ftd \
--target k32w-k32w1-contact-crypto-platform-low-power-nologs \
build \
@@ -79,12 +76,6 @@ jobs:
k32w k32w1+release light \
out/artifacts/k32w-k32w1-light-crypto-platform-openthread-ftd/chip-k32w1-light-example.elf \
/tmp/bloat_reports/
- - name: Get lock size stats
- run: |
- .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
- k32w k32w0+release lock \
- out/artifacts/k32w-k32w0-lock-crypto-platform-tokenizer/chip-k32w0x-lock-example.elf \
- /tmp/bloat_reports/
- name: Get contact size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
diff --git a/.github/workflows/examples-rw61x.yaml b/.github/workflows/examples-rw61x.yaml
new file mode 100644
index 00000000000000..42df03382b9249
--- /dev/null
+++ b/.github/workflows/examples-rw61x.yaml
@@ -0,0 +1,87 @@
+# 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.
+
+name: Build example - RW61X
+
+on:
+ push:
+ pull_request:
+ merge_group:
+
+concurrency:
+ group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
+ cancel-in-progress: true
+
+env:
+ CHIP_NO_LOG_TIMESTAMPS: true
+
+jobs:
+ rw61x:
+ name: RW61X
+
+ env:
+ BUILD_TYPE: gn_rw61x
+
+ runs-on: ubuntu-latest
+ if: github.actor != 'restyled-io[bot]'
+
+ container:
+ image: ghcr.io/project-chip/chip-build-rw61x:37
+ volumes:
+ - "/tmp/bloat_reports:/tmp/bloat_reports"
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Checkout submodules & Bootstrap
+ uses: ./.github/actions/checkout-submodules-and-bootstrap
+ with:
+ platform: rw61x
+
+ - name: Set up environment for size reports
+ uses: ./.github/actions/setup-size-reports
+ if: ${{ !env.ACT }}
+ with:
+ gh-context: ${{ toJson(github) }}
+
+ - name: Build RW61X all clusters example app
+ run: |
+ scripts/run_in_build_env.sh "\
+ ./scripts/build/build_examples.py \
+ --target rw61x-all-clusters-app-wifi \
+ build \
+ --copy-artifacts-to out/artifacts \
+ "
+
+ - name: Build RW61X thermostat example app
+ run: |
+ scripts/run_in_build_env.sh "\
+ ./scripts/build/build_examples.py \
+ --target rw61x-thermostat-wifi \
+ build \
+ --copy-artifacts-to out/artifacts \
+ "
+
+ - name: Build RW61X laundry-washer example app
+ run: |
+ scripts/run_in_build_env.sh "\
+ ./scripts/build/build_examples.py \
+ --target rw61x-laundry-washer-wifi \
+ build \
+ --copy-artifacts-to out/artifacts \
+ "
+ - name: Uploading Size Reports
+ uses: ./.github/actions/upload-size-reports
+ if: ${{ !env.ACT }}
+ with:
+ platform-name: RW61X
diff --git a/.gitmodules b/.gitmodules
index 06fb7f0e347951..fa3dfcfdaea9aa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -54,16 +54,16 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
- platforms = ameba,cc13xx_26xx,bouffalolab,esp32,k32w,infineon,qpg,cc32xx
+ platforms = ameba,cc13xx_26xx,bouffalolab,esp32,infineon,qpg,cc32xx
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
branch = int/CHIPSE_Release
- platforms = k32w
+ platforms = nxp
[submodule "third_party/openthread/ot-nxp"]
path = third_party/openthread/ot-nxp
url = https://github.com/NXP/ot-nxp.git
- platforms = k32w
+ platforms = nxp
[submodule "third_party/openthread/ot-qorvo"]
path = third_party/openthread/ot-qorvo
url = https://github.com/openthread/ot-qorvo.git
diff --git a/docs/examples/index.md b/docs/examples/index.md
index 2c9a0a4659b3bc..fc82f2a0bc9016 100644
--- a/docs/examples/index.md
+++ b/docs/examples/index.md
@@ -112,6 +112,15 @@ kotlin-matter-controller/README
virtual-device-app/**/README
```
+## Laundry washer example
+
+```{toctree}
+:glob:
+:maxdepth: 1
+
+laundry-washer-app/**/README
+```
+
## Lighting example
```{toctree}
diff --git a/docs/guides/nxp_k32w_android_commissioning.md b/docs/guides/nxp_k32w_android_commissioning.md
index 3f1c6d1171df3c..b39a2f2afd2c8c 100644
--- a/docs/guides/nxp_k32w_android_commissioning.md
+++ b/docs/guides/nxp_k32w_android_commissioning.md
@@ -3,7 +3,7 @@
This article describes how to use
[CHIPTool](../../examples/android/CHIPTool/README.md) for Android smartphones to
commission an NXP K32W061 DK6 running
-[NXP K32W Lock/Light Example Application](#building-and-programming-nxp-k32w-locklight-example-application)
+[NXP K32W Light Example Application](#building-and-programming-nxp-k32w-light-example-application)
onto a CHIP-enabled Thread network.
@@ -12,7 +12,7 @@ onto a CHIP-enabled Thread network.
- [Requirements](#requirements)
- [Building and programming OpenThread RCP firmware](#building-and-programming-openthread-rcp-firmware)
- [Configuring PC as Thread Border Router](#configuring-pc-as-a-thread-border-router)
-- [Building and programming NXP K32W Lock/Light Example Application](#building-and-programming-nxp-k32w-locklight-example-application)
+- [Building and programming NXP K32W Light Example Application](#building-and-programming-nxp-k32w-light-example-application)
- [Building and installing Android CHIPTool](#building-and-installing-android-chiptool)
- [Forming a Thread network on the Border Router](#forming-a-thread-network-on-the-border-router)
- [Preparing accessory device](#preparing-accessory-device)
@@ -44,7 +44,7 @@ with a spare Wi-Fi card and an
device.
The following diagram shows the connectivity between network components required
-to allow communication between devices running the CHIPTool and Lock/Light
+to allow communication between devices running the CHIPTool and Light
applications:
![nxp_hw_connectivity](../../examples/platform/nxp/k32w/k32w0/doc/images/nxp_hw_connectivity.JPG)
@@ -345,11 +345,7 @@ To make your PC work as a Thread Border Router, complete the following tasks:
-## Building and programming NXP K32W Lock/Light Example Application
-
-See
-[NXP K32W Lock Example Application README](../../examples/lock-app/nxp/k32w/k32w0/README.md)
-to learn how to build and program the lock example onto an K32W061 DK6.
+## Building and programming NXP K32W Light Example Application
See
[NXP K32W Light Example Application README](../../examples/lighting-app/nxp/k32w/k32w0/README.md)
@@ -491,11 +487,10 @@ section, complete the following steps:
2. Verify that the text box on the screen is not empty and contains the IPv6
address of the accessory device.
-3. Tap the following buttons to change the lock/light state:
+3. Tap the following buttons to change the light state:
- - _ON_ and _OFF_ buttons lock/turn on and unlock/turn off the door/light
- bulb, respectively.
- - _TOGGLE_ changes the lock/light state to the opposite.
+ - _ON_ and _OFF_ buttons turn on and turn off the light bulb, respectively.
+ - _TOGGLE_ changes the light state to the opposite.
-The _LED D3_ on the device turns on or off based on the changes of the
-lock/light state.
+The _LED D3_ on the device turns on or off based on the changes of the light
+state.
diff --git a/docs/guides/nxp_manufacturing_flow.md b/docs/guides/nxp_manufacturing_flow.md
index 64bafd53c89329..6cc3005b412289 100644
--- a/docs/guides/nxp_manufacturing_flow.md
+++ b/docs/guides/nxp_manufacturing_flow.md
@@ -1,8 +1,4 @@
----
-orphan: true
----
-
-# NXP manufacturing data guide
+# NXP Manufacturing data
By default, the example application is configured to use generic test
certificates and provisioning data embedded with the application code. It is
@@ -112,30 +108,30 @@ Here is the interpretation of the **required** parameters:
--pai_cert -> path to the PAI (der format) location
--spake2p_path -> path to the spake2p tool
--out -> name of the binary that will be used for storing all the generated data
-
-
```
Here is the interpretation of the **optional** parameters:
```shell
---dac_key_password -> Password to decode DAC key
---dac_key_use_sss_blob -> Used when --dac_key contains a path to an encrypted blob, instead of the
- actual DAC private key. The blob metadata size is 24, so the total length
- of the resulting value is private key length (32) + 24 = 56. False by default.
---spake2p_verifier -> SPAKE2+ verifier (passed as base64 encoded string). If this option is set,
- all SPAKE2+ inputs will be encoded in the final binary. The spake2p tool
- will not be used to generate a new verifier on the fly.
---aes128_key -> 128 bits AES key used to encrypt the whole dataset. Please make sure
- that the target application/board supports this feature: it has access to
- the private key and implements a mechanism which can be used to decrypt
- the factory data information.
---date -> Manufacturing Date (YYYY-MM-DD format)
---part_number -> Part number as string
---product_url -> Product URL as string
---product_label -> Product label as string
---serial_num -> Serial Number
---unique_id -> Unique id used for rotating device id generation
+--dac_key_password -> Password to decode DAC key
+--dac_key_use_sss_blob -> Used when --dac_key contains a path to an encrypted blob, instead of the
+ actual DAC private key. The blob metadata size is 24, so the total length
+ of the resulting value is private key length (32) + 24 = 56. False by default.
+--spake2p_verifier -> SPAKE2+ verifier (passed as base64 encoded string). If this option is set,
+ all SPAKE2+ inputs will be encoded in the final binary. The spake2p tool
+ will not be used to generate a new verifier on the fly.
+--aes128_key -> 128 bits AES key used to encrypt the whole dataset. Please make sure
+ that the target application/board supports this feature: it has access to
+ the private key and implements a mechanism which can be used to decrypt
+ the factory data information.
+--date -> Manufacturing Date (YYYY-MM-DD format)
+--part_number -> Part number as string
+--product_url -> Product URL as string
+--product_label -> Product label as string
+--serial_num -> Serial Number
+--unique_id -> Unique id used for rotating device id generation
+--product_finish -> Visible finish of the product
+--product_primary_color -> Representative color of the visible parts of the product
```
## 3. Write provisioning data
@@ -157,8 +153,18 @@ loadfile factory_data.bin 0xf4000
where `0xf4000` is the value of `__MATTER_FACTORY_DATA_START` in the
corresponding .map file (can be different if using a custom linker script).
-For the **RT1060**, **RT1170** and **RW61X** platform, the binary needs to be
-written using `MCUXpresso Flash Tool GUI` at the address value corresponding to
+For **RW61X** platform, the binary needs to be written in the internal flash at
+location given by `__MATTER_FACTORY_DATA_START`, using `JLink`:
+
+```
+loadfile factory_data.bin 0xBFFF000
+```
+
+where `0xBFFF000` is the value of `__FACTORY_DATA_START` in the corresponding
+.map file (can be different if using a custom linker script).
+
+For the **RT1060** and **RT1170** platform, the binary needs to be written using
+`MCUXpresso Flash Tool GUI` at the address value corresponding to
`__FACTORY_DATA_START` (the map file of the application should be checked to get
the exact value).
@@ -198,6 +204,8 @@ Also, demo **DAC**, **PAI** and **PAA** certificates needed in case
## 6. Increased security for DAC private key
+### 6.1 K32W1
+
Supported platforms:
- K32W1 - `src/plaftorm/nxp/k32w/k32w1/FactoryDataProviderImpl.h`
@@ -242,3 +250,29 @@ python3 ./scripts/tools/nxp/factory_data_generator/generate.py -i 10000 -s UXKLz
Please note that `--dac_key` now points to a binary file that contains the
encrypted blob.
+
+### 6.2 RW61X
+
+Supported platforms:
+
+- RW61X - `src/plaftorm/nxp/rt/rw61x/FactoryDataProviderImpl.h`
+
+For platforms that have a secure subsystem (`SE50`), the DAC private key can be
+converted to an encrypted blob. This blob will overwrite the DAC private key in
+factory data and will be imported in the `SE50` before to sign, by the factory
+data provider instance.
+
+The conversion process shall happen at manufacturing time and should be run one
+time only:
+
+- Write factory data binary.
+- Build the application with
+ `chip_with_factory_data=1 chip_convert_dac_private_key=1` set.
+- Write the application to the board and let it run.
+
+After the conversion process:
+
+- Make sure the application is built with `chip_with_factory_data=1`, but
+ without `chip_convert_dac_private_key` arg, since conversion already
+ happened.
+- Write the application to the board.
diff --git a/docs/guides/nxp_rw61x_ota_software_update.md b/docs/guides/nxp_rw61x_ota_software_update.md
index c3bd5227a054ed..9922909c5d1f7a 100644
--- a/docs/guides/nxp_rw61x_ota_software_update.md
+++ b/docs/guides/nxp_rw61x_ota_software_update.md
@@ -87,7 +87,8 @@ J-Link > erase 0x8000000, 0x88a0000
```
- Using MCUXPresso, import the `mcuboot_opensource` demo example from the SDK
- previously downloaded.
+ previously downloaded. The example can be found under the `ota_examples`
+ folder.
![mcuboot_demo](../../examples/platform/nxp/rt/rw61x/doc/images/mcuboot_demo.PNG)
- Before building the demo example, it should be specified that the
application to be run by the bootloader is monolithic. As a result, only one
@@ -100,7 +101,20 @@ Right click on the Project -> Properties -> C/C++ Build -> Settings -> Tool Sett
![rw610_mcuboot_monolithic](../../examples/platform/nxp/rt/rw61x/doc/images/mcuboot_monolithic_app.PNG)
-- Build the demo example project and program it to the target board.
+- Build the demo example project.
+
+```
+Right click on the Project -> Build Project
+```
+
+- Program the demo example to the target board.
+
+```
+Right click on the Project -> Debug -> As->SEGGER JLink probes -> OK -> Select elf file
+```
+
+Note : The mcuboot binary is loaded in flash at address 0x8000000.
+
- To run the flashed demo, either press the reset button of the device or use
the debugger IDE of MCUXpresso. If it runs successfully, the following logs
will be displayed on the terminal :
@@ -161,14 +175,14 @@ user@ubuntu: python3 imgtool.py sign --key ~/Desktop/SDK_RW612/boards/rdrw612bga
Notes :
-- If internal SDK is used instead, the key can be found in :
- "`~/Desktop/SDK_RW612/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-priv.pem`".
-- The arguments `slot-size` and `max-sectors` should be adjusted to the size
- of the partitions reserved for the primary and the secondary applications.
- (By default the size considered is 4.4 MB)
+- The arguments `slot-size` and `max-sectors` are aligned with the size of the
+ partitions reserved for the primary and the secondary applications. (By
+ default the size considered is 4.4 MB for each application). If the size of
+ these partitions are modified, the `slot-size` and `max-sectors` should be
+ adjusted accordingly.
- In this example, the image is signed with the private key provided by the
SDK as an example
- (`/path_to_sdk/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-priv.pem`),
+ (`SDK_RW612/boards/rdrw612bga/ota_examples/mcuboot_opensource/keys/sign-rsa2048-priv.pem`),
MCUBoot is built with its corresponding public key which would be used to
verify the integrity of the image. It is possible to generate a new pair of
keys using the following commands. This procedure should be done prior to
@@ -187,7 +201,7 @@ user@ubuntu: python3 imgtool.py getpub -k priv_key.pem
```
- The extracted public key can then be copied to the
- `/path_to_sdk/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-pub.c`,
+ `SDK_RW612/boards/rdrw612bga/ota_examples/mcuboot_opensource/keys/sign-rsa2048-pub.c`,
given as a value to the rsa_pub_key[] array.
The resulting output is the signed binary of the application version "1.0".
diff --git a/examples/all-clusters-app/nxp/common/main/AppTask.cpp b/examples/all-clusters-app/nxp/common/main/AppTask.cpp
index 9dc60db217cf9a..7f4c1f257d0405 100644
--- a/examples/all-clusters-app/nxp/common/main/AppTask.cpp
+++ b/examples/all-clusters-app/nxp/common/main/AppTask.cpp
@@ -2,7 +2,7 @@
*
* Copyright (c) 2021-2023 Project CHIP Authors
* Copyright (c) 2021 Google LLC.
- * Copyright 2023 NXP
+ * Copyright 2023-2024 NXP
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,463 +17,41 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include "AppTask.h"
-#include "AppEvent.h"
#include "CHIPDeviceManager.h"
-#include "DeviceCallbacks.h"
-#include "binding-handler.h"
-#include "lib/core/ErrorStr.h"
-#include
-#include
-#include
-
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
-#include
-#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
+#include "ICDUtil.h"
+#include
#include
-#include "AppFactoryData.h"
-#include "AppMatterButton.h"
-#include "AppMatterCli.h"
-
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
-#include "OTARequestorInitiator.h"
-#endif
-
-#if ENABLE_OTA_PROVIDER
-#include
-#endif
-
-#if CHIP_ENABLE_OPENTHREAD
-#include
-#endif
-
-#if TCP_DOWNLOAD
-#include "TcpDownload.h"
-#endif
-
-#ifndef APP_TASK_STACK_SIZE
-#define APP_TASK_STACK_SIZE ((configSTACK_DEPTH_TYPE) 6144 / sizeof(portSTACK_TYPE))
-#endif
-#ifndef APP_TASK_PRIORITY
-#define APP_TASK_PRIORITY 2
-#endif
-#define APP_EVENT_QUEUE_SIZE 10
-
-static QueueHandle_t sAppEventQueue;
-
using namespace chip;
-using namespace chip::TLV;
-using namespace ::chip::Credentials;
-using namespace ::chip::DeviceLayer;
-using namespace ::chip::DeviceManager;
-using namespace ::chip::app::Clusters;
-
-chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
-
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
-namespace {
-chip::app::Clusters::NetworkCommissioning::Instance
- sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */,
- &(::chip::DeviceLayer::NetworkCommissioning::NXPWiFiDriver::GetInstance()));
-} // namespace
-
-void NetWorkCommissioningInstInit()
-{
- sWiFiNetworkCommissioningInstance.Init();
-}
-#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
-
-AppTask AppTask::sAppTask;
-
-CHIP_ERROR AppTask::StartAppTask()
-{
- CHIP_ERROR err = CHIP_NO_ERROR;
- TaskHandle_t taskHandle;
-
- sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent));
- if (sAppEventQueue == NULL)
- {
- err = CHIP_ERROR_NO_MEMORY;
- ChipLogError(DeviceLayer, "Failed to allocate app event queue");
- assert(err == CHIP_NO_ERROR);
- }
-
- if (xTaskCreate(&AppTask::AppTaskMain, "AppTaskMain", APP_TASK_STACK_SIZE, &sAppTask, APP_TASK_PRIORITY, &taskHandle) != pdPASS)
- {
- err = CHIP_ERROR_NO_MEMORY;
- ChipLogError(DeviceLayer, "Failed to start app task");
- assert(err == CHIP_NO_ERROR);
- }
-
- return err;
-}
+using namespace chip::app::Clusters;
-#if CHIP_ENABLE_OPENTHREAD
-void LockOpenThreadTask(void)
+void AllClustersApp::AppTask::PreInitMatterStack()
{
- chip::DeviceLayer::ThreadStackMgr().LockThreadStack();
+ ChipLogProgress(DeviceLayer, "Welcome to NXP All Clusters Demo App");
}
-void UnlockOpenThreadTask(void)
+void AllClustersApp::AppTask::PostInitMatterStack()
{
- chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack();
+ chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&chip::NXP::App::GetICDUtil());
}
-#endif
-void AppTask::InitServer(intptr_t arg)
+void AllClustersApp::AppTask::PostInitMatterServerInstance()
{
- static chip::CommonCaseDeviceServerInitParams initParams;
- (void) initParams.InitializeStaticResourcesBeforeServerInit();
-
-#if CHIP_ENABLE_OPENTHREAD
- // Init ZCL Data Model and start server
- chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams;
- nativeParams.lockCb = LockOpenThreadTask;
- nativeParams.unlockCb = UnlockOpenThreadTask;
- nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance();
- initParams.endpointNativeParams = static_cast(&nativeParams);
-#endif
- VerifyOrDie((chip::Server::GetInstance().Init(initParams)) == CHIP_NO_ERROR);
-
- gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
- chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
-
-#ifdef DEVICE_TYPE_ALL_CLUSTERS
// Disable last fixed endpoint, which is used as a placeholder for all of the
// supported clusters so that ZAP will generated the requisite code.
emberAfEndpointEnableDisable(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1)), false);
-#endif /* DEVICE_TYPE_ALL_CLUSTERS */
-
-#if ENABLE_OTA_PROVIDER
- InitOTAServer();
-#endif
-}
-
-CHIP_ERROR AppTask::Init()
-{
- CHIP_ERROR err = CHIP_NO_ERROR;
-
- /* Init Chip memory management before the stack */
- chip::Platform::MemoryInit();
-
- /* Initialize Matter factory data before initializing the Matter stack */
- err = AppFactoryData_PreMatterStackInit();
-
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Pre Factory Data Provider init failed");
- goto exit;
- }
-
- /*
- * Initialize the CHIP stack.
- * Would also initialize all required platform modules
- */
- err = PlatformMgr().InitChipStack();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "PlatformMgr().InitChipStack() failed: %s", ErrorStr(err));
- goto exit;
- }
-
- /* Initialize Matter factory data after initializing the Matter stack */
- err = AppFactoryData_PostMatterStackInit();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Post Factory Data Provider init failed");
- goto exit;
- }
-
- /*
- * Register all application callbacks allowing to be informed of stack events
- */
- err = CHIPDeviceManager::GetInstance().Init(&deviceCallbacks);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "CHIPDeviceManager.Init() failed: %s", ErrorStr(err));
- goto exit;
- }
-
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
- ConnectivityMgrImpl().StartWiFiManagement();
-#endif
-
-#if CHIP_ENABLE_OPENTHREAD
- err = ThreadStackMgr().InitThreadStack();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Error during ThreadStackMgr().InitThreadStack()");
- goto exit;
- }
-
- err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
- if (err != CHIP_NO_ERROR)
- {
- goto exit;
- }
-#endif
-
- /*
- * Schedule an event to the Matter stack to initialize
- * the ZCL Data Model and start server
- */
- PlatformMgr().ScheduleWork(InitServer, 0);
-
- /* Init binding handlers */
- err = InitBindingHandlers();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "InitBindingHandlers failed: %s", ErrorStr(err));
- goto exit;
- }
-
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
- NetWorkCommissioningInstInit();
-#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
-
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
- /* If an update is under test make it permanent */
- OTARequestorInitiator::Instance().HandleSelfTest();
-#endif
-
- /* Register Matter CLI cmds */
- err = AppMatterCli_RegisterCommands();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Error during AppMatterCli_RegisterCommands");
- goto exit;
- }
- /* Register Matter buttons */
- err = AppMatterButton_registerButtons();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Error during AppMatterButton_registerButtons");
- goto exit;
- }
-
- err = DisplayDeviceInformation();
- if (err != CHIP_NO_ERROR)
- goto exit;
-
- /* Start a task to run the CHIP Device event loop. */
- err = PlatformMgr().StartEventLoopTask();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Error during PlatformMgr().StartEventLoopTask()");
- goto exit;
- }
-
-#if CHIP_ENABLE_OPENTHREAD
- // Start OpenThread task
- err = ThreadStackMgrImpl().StartThreadTask();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Error during ThreadStackMgrImpl().StartThreadTask()");
- goto exit;
- }
-#endif
-
-#if TCP_DOWNLOAD
- EnableTcpDownloadComponent();
-#endif
-
-exit:
- return err;
-}
-
-void AppTask::AppTaskMain(void * pvParameter)
-{
- AppTask * task = (AppTask *) pvParameter;
- CHIP_ERROR err;
- AppEvent event;
-
- ChipLogProgress(DeviceLayer, "Welcome to NXP All Clusters Demo App");
-
- err = task->Init();
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "AppTask.Init() failed");
- assert(err == CHIP_NO_ERROR);
- }
-
- while (true)
- {
- BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY);
- while (eventReceived == pdTRUE)
- {
- sAppTask.DispatchEvent(&event);
- eventReceived = xQueueReceive(sAppEventQueue, &event, 0);
- }
- }
-}
-
-CHIP_ERROR AppTask::DisplayDeviceInformation(void)
-{
- CHIP_ERROR err = CHIP_NO_ERROR;
- uint16_t discriminator;
- uint32_t setupPasscode;
- uint16_t vendorId;
- uint16_t productId;
- char currentSoftwareVer[ConfigurationManager::kMaxSoftwareVersionStringLength + 1];
-
- err = GetCommissionableDataProvider()->GetSetupDiscriminator(discriminator);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Couldn't get discriminator: %s", ErrorStr(err));
- goto exit;
- }
- ChipLogProgress(DeviceLayer, "Setup discriminator: %u (0x%x)", discriminator, discriminator);
-
- err = GetCommissionableDataProvider()->GetSetupPasscode(setupPasscode);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Couldn't get setupPasscode: %s", ErrorStr(err));
- goto exit;
- }
- ChipLogProgress(DeviceLayer, "Setup passcode: %lu (0x%lx)", setupPasscode, setupPasscode);
-
- err = GetDeviceInstanceInfoProvider()->GetVendorId(vendorId);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Couldn't get vendorId: %s", ErrorStr(err));
- goto exit;
- }
- ChipLogProgress(DeviceLayer, "Vendor ID: %u (0x%x)", vendorId, vendorId);
-
- err = GetDeviceInstanceInfoProvider()->GetProductId(productId);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Couldn't get productId: %s", ErrorStr(err));
- goto exit;
- }
- ChipLogProgress(DeviceLayer, "nProduct ID: %u (0x%x)", productId, productId);
-
- // QR code will be used with CHIP Tool
-#if CONFIG_NETWORK_LAYER_BLE
- PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE));
-#else
- PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork));
-#endif /* CONFIG_NETWORK_LAYER_BLE */
-
- err = ConfigurationMgr().GetSoftwareVersionString(currentSoftwareVer, sizeof(currentSoftwareVer));
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(DeviceLayer, "Get current software version error");
- goto exit;
- }
-
- ChipLogProgress(DeviceLayer, "Current Software Version: %s", currentSoftwareVer);
-
-exit:
- return err;
-}
-
-void AppTask::PostEvent(const AppEvent * aEvent)
-{
- if (sAppEventQueue != NULL)
- {
- if (!xQueueSend(sAppEventQueue, aEvent, 0))
- {
- ChipLogError(DeviceLayer, "Failed to post event to app task event queue");
- }
- }
-}
-
-void AppTask::DispatchEvent(AppEvent * aEvent)
-{
- if (aEvent->Handler)
- {
- aEvent->Handler(aEvent);
- }
- else
- {
- ChipLogProgress(DeviceLayer, "Event received with no handler. Dropping event.");
- }
-}
-
-void AppTask::StartCommissioning(intptr_t arg)
-{
- /* Check the status of the commissioning */
- if (ConfigurationMgr().IsFullyProvisioned())
- {
- ChipLogProgress(DeviceLayer, "Device already commissioned");
- }
- else if (chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
- {
- ChipLogProgress(DeviceLayer, "Commissioning window already opened");
- }
- else
- {
- chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
- }
-}
-
-void AppTask::StopCommissioning(intptr_t arg)
-{
- /* Check the status of the commissioning */
- if (ConfigurationMgr().IsFullyProvisioned())
- {
- ChipLogProgress(DeviceLayer, "Device already commissioned");
- }
- else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
- {
- ChipLogProgress(DeviceLayer, "Commissioning window not opened");
- }
- else
- {
- chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow();
- }
-}
-
-void AppTask::SwitchCommissioningState(intptr_t arg)
-{
- /* Check the status of the commissioning */
- if (ConfigurationMgr().IsFullyProvisioned())
- {
- ChipLogProgress(DeviceLayer, "Device already commissioned");
- }
- else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
- {
- chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
- }
- else
- {
- chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow();
- }
-}
-
-void AppTask::StartCommissioningHandler(void)
-{
- /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
- PlatformMgr().ScheduleWork(StartCommissioning, 0);
-}
-
-void AppTask::StopCommissioningHandler(void)
-{
- /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
- PlatformMgr().ScheduleWork(StopCommissioning, 0);
}
-void AppTask::SwitchCommissioningStateHandler(void)
+// This returns an instance of this class.
+AllClustersApp::AppTask & AllClustersApp::AppTask::GetDefaultInstance()
{
- /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
- PlatformMgr().ScheduleWork(SwitchCommissioningState, 0);
+ static AllClustersApp::AppTask sAppTask;
+ return sAppTask;
}
-void AppTask::FactoryResetHandler(void)
+chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask()
{
- /* Emit the ShutDown event before factory reset */
- chip::Server::GetInstance().GenerateShutDownEvent();
- chip::Server::GetInstance().ScheduleFactoryReset();
+ return AllClustersApp::AppTask::GetDefaultInstance();
}
diff --git a/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp b/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp
index 419ad3b3003b2e..527fa79702f6fb 100644
--- a/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp
+++ b/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp
@@ -24,154 +24,96 @@
**/
#include "DeviceCallbacks.h"
+#include
+#include
#include
+#include
#include
#include
#include
-#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
-#include "openthread-system.h"
-#include "ot_platform_common.h"
-#endif /* CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED */
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
-#include "OTARequestorInitiator.h"
-#endif
+using namespace chip::app;
+void OnTriggerEffect(::Identify * identify)
+{
+ switch (identify->mCurrentEffectIdentifier)
+ {
+ case Clusters::Identify::EffectIdentifierEnum::kBlink:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBlink");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kBreathe:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBreathe");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kOkay:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kOkay");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kChannelChange:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kChannelChange");
+ break;
+ default:
+ ChipLogProgress(Zcl, "No identifier effect");
+ return;
+ }
+}
Identify gIdentify0 = {
chip::EndpointId{ 1 },
[](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); },
[](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); },
- chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator,
- [](Identify *) { ChipLogProgress(Zcl, "onIdentifyTriggerEffect"); },
+ chip::app::Clusters::Identify::IdentifyTypeEnum::kNone,
+ OnTriggerEffect,
};
Identify gIdentify1 = {
chip::EndpointId{ 1 },
[](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); },
[](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); },
- chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator,
- [](Identify *) { ChipLogProgress(Zcl, "onIdentifyTriggerEffect"); },
+ chip::app::Clusters::Identify::IdentifyTypeEnum::kNone,
+ OnTriggerEffect,
};
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::System;
using namespace ::chip::DeviceLayer;
+using namespace chip::app::Clusters;
-void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
-{
- ChipLogDetail(DeviceLayer, "DeviceEventCallback: 0x%04x", event->Type);
- switch (event->Type)
- {
- case DeviceEventType::kWiFiConnectivityChange:
- OnWiFiConnectivityChange(event);
- break;
-
- case DeviceEventType::kInternetConnectivityChange:
- OnInternetConnectivityChange(event);
- break;
-
- case DeviceEventType::kInterfaceIpAddressChanged:
- OnInterfaceIpAddressChanged(event);
- break;
-
-#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
- case DeviceEventType::kCommissioningComplete:
- DeviceCallbacks::OnComissioningComplete(event);
- break;
-#endif
- case DeviceLayer::DeviceEventType::kDnssdInitialized:
- ChipLogProgress(DeviceLayer, "kDnssdInitialized");
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
- /* Initialize OTA Requestor */
- OTARequestorInitiator::Instance().InitOTA(reinterpret_cast(&OTARequestorInitiator::Instance()));
-#endif
- break;
- }
-}
-
-void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t type,
- uint16_t size, uint8_t * value)
+void AllClustersApp::DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId,
+ AttributeId attributeId, uint8_t type, uint16_t size,
+ uint8_t * value)
{
ChipLogProgress(DeviceLayer,
"endpointId " ChipLogFormatMEI " clusterId " ChipLogFormatMEI " attribute ID: " ChipLogFormatMEI
" Type: %u Value: %u, length %u",
ChipLogValueMEI(endpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId), type, *value, size);
-}
-
-void DeviceCallbacks::OnWiFiConnectivityChange(const ChipDeviceEvent * event)
-{
- if (event->WiFiConnectivityChange.Result == kConnectivity_Established)
- {
- ChipLogProgress(DeviceLayer, "WiFi connection established");
- }
- else if (event->WiFiConnectivityChange.Result == kConnectivity_Lost)
+ switch (clusterId)
{
- ChipLogProgress(DeviceLayer, "WiFi connection lost");
+ case Clusters::OnOff::Id:
+ OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
+ break;
}
}
-void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event)
+void AllClustersApp::DeviceCallbacks::OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId,
+ uint8_t * value)
{
- if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established)
- {
- char ip_addr[Inet::IPAddress::kMaxStringLength];
- event->InternetConnectivityChange.ipAddress.ToString(ip_addr);
- ChipLogProgress(DeviceLayer, "Server ready at: %s:%d", ip_addr, CHIP_PORT);
- }
- else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost)
- {
- ChipLogProgress(DeviceLayer, "Lost IPv4 connectivity...");
- }
- if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)
- {
- char ip_addr[Inet::IPAddress::kMaxStringLength];
- event->InternetConnectivityChange.ipAddress.ToString(ip_addr);
- ChipLogProgress(DeviceLayer, "IPv6 Server ready at: [%s]:%d", ip_addr, CHIP_PORT);
- }
- else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost)
+ switch (attributeId)
{
- ChipLogProgress(DeviceLayer, "Lost IPv6 connectivity...");
+ case Clusters::OnOff::Attributes::OnOff::Id:
+ break;
+
+ default:;
}
}
-void DeviceCallbacks::OnInterfaceIpAddressChanged(const ChipDeviceEvent * event)
+// This returns an instance of this class.
+AllClustersApp::DeviceCallbacks & AllClustersApp::DeviceCallbacks::GetDefaultInstance()
{
- switch (event->InterfaceIpAddressChanged.Type)
- {
- case InterfaceIpChangeType::kIpV4_Assigned:
- ChipLogProgress(DeviceLayer, "Interface IPv4 address assigned");
- break;
- case InterfaceIpChangeType::kIpV4_Lost:
- ChipLogProgress(DeviceLayer, "Interface IPv4 address lost");
- break;
- case InterfaceIpChangeType::kIpV6_Assigned:
- ChipLogProgress(DeviceLayer, "Interface IPv6 address assigned");
- break;
- case InterfaceIpChangeType::kIpV6_Lost:
- ChipLogProgress(DeviceLayer, "Interface IPv6 address lost");
- break;
- }
+ static AllClustersApp::DeviceCallbacks sDeviceCallbacks;
+ return sDeviceCallbacks;
}
-#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
-void DeviceCallbacks::OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event)
+chip::DeviceManager::CHIPDeviceManagerCallbacks & chip::NXP::App::GetDeviceCallbacks()
{
- /*
- * If a transceiver supporting a multiprotocol scenario is used, a check of the provisioning state is required,
- * so that we can inform the transceiver to stop BLE to give the priority to another protocol.
- * For example it is the case when a K32W0 transceiver supporting OT+BLE+Zigbee is used. When the device is already provisioned,
- * BLE is no more required and the transceiver needs to be informed so that Zigbee can be switched on and BLE switched off.
- *
- * If a transceiver does not support such vendor property the cmd would be ignored.
- */
- if (ConfigurationMgr().IsFullyProvisioned())
- {
- ChipLogDetail(DeviceLayer, "Provisioning complete, stopping BLE\n");
- ThreadStackMgrImpl().LockThreadStack();
- PlatformMgrImpl().StopBLEConnectivity();
- ThreadStackMgrImpl().UnlockThreadStack();
- }
+ return AllClustersApp::DeviceCallbacks::GetDefaultInstance();
}
-#endif
diff --git a/examples/all-clusters-app/nxp/common/main/include/AppEvent.h b/examples/all-clusters-app/nxp/common/main/include/AppEvent.h
index 8047da99982e23..a0dad141a27055 100644
--- a/examples/all-clusters-app/nxp/common/main/include/AppEvent.h
+++ b/examples/all-clusters-app/nxp/common/main/include/AppEvent.h
@@ -19,7 +19,7 @@
#pragma once
struct AppEvent;
-typedef void (*EventHandler)(AppEvent *);
+using EventHandler = void (*)(const AppEvent &);
struct AppEvent
{
diff --git a/examples/all-clusters-app/nxp/common/main/include/AppTask.h b/examples/all-clusters-app/nxp/common/main/include/AppTask.h
index e276e287aa92a6..9bda003e25344a 100644
--- a/examples/all-clusters-app/nxp/common/main/include/AppTask.h
+++ b/examples/all-clusters-app/nxp/common/main/include/AppTask.h
@@ -2,6 +2,7 @@
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2021-2023 Google LLC.
+ * Copyright 2024 NXP
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,47 +20,31 @@
#pragma once
-#include
-#include
-
-#include "AppEvent.h"
-#include "DeviceCallbacks.h"
-
-class AppTask
+#if CONFIG_APP_FREERTOS_OS
+#include "AppTaskFreeRTOS.h"
+#else
+#include "AppTaskZephyr.h"
+#endif
+namespace AllClustersApp {
+#if CONFIG_APP_FREERTOS_OS
+class AppTask : public chip::NXP::App::AppTaskFreeRTOS
+#else
+class AppTask : public chip::NXP::App::AppTaskZephyr
+#endif
{
public:
- CHIP_ERROR StartAppTask();
- static void AppTaskMain(void * pvParameter);
-
- void PostEvent(const AppEvent * event);
-
- /* Commissioning handlers */
- void StartCommissioningHandler(void);
- void StopCommissioningHandler(void);
- void SwitchCommissioningStateHandler(void);
-
- /* FactoryResetHandler */
- void FactoryResetHandler(void);
-
-private:
- DeviceCallbacks deviceCallbacks;
-
- friend AppTask & GetAppTask(void);
-
- CHIP_ERROR Init();
- void DispatchEvent(AppEvent * event);
- CHIP_ERROR DisplayDeviceInformation(void);
-
- /* Functions that would be called in the Matter task context */
- static void StartCommissioning(intptr_t arg);
- static void StopCommissioning(intptr_t arg);
- static void SwitchCommissioningState(intptr_t arg);
- static void InitServer(intptr_t arg);
-
- static AppTask sAppTask;
+ ~AppTask() override{};
+ void PreInitMatterStack(void) override;
+ void PostInitMatterStack(void) override;
+ void PostInitMatterServerInstance(void) override;
+ // This returns an instance of this class.
+ static AppTask & GetDefaultInstance();
};
-
-inline AppTask & GetAppTask(void)
-{
- return AppTask::sAppTask;
-}
+} // namespace AllClustersApp
+/**
+ * Returns the application-specific implementation of the AppTaskBase object.
+ *
+ * Applications can use this to gain access to features of the AppTaskBase
+ * that are specific to the selected application.
+ */
+chip::NXP::App::AppTaskBase & GetAppTask();
diff --git a/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h b/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h
index 2a37a2dfb99a94..748905b52ad736 100644
--- a/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h
+++ b/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2020-2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,24 +26,27 @@
#pragma once
#include "CHIPDeviceManager.h"
-#include
-#include
+#include "CommonDeviceCallbacks.h"
-class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
+namespace AllClustersApp {
+class DeviceCallbacks : public chip::NXP::App::CommonDeviceCallbacks
{
public:
- virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
- virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
- uint8_t type, uint16_t size, uint8_t * value);
+ // This returns an instance of this class.
+ static DeviceCallbacks & GetDefaultInstance();
+ void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
+ uint8_t type, uint16_t size, uint8_t * value);
private:
- void OnWiFiConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
- void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
- void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event);
- void OnInterfaceIpAddressChanged(const chip::DeviceLayer::ChipDeviceEvent * event);
void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
-#if CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
- void OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event);
-#endif
};
+
+/**
+ * Returns the application-specific implementation of the CommonDeviceCallbacks object.
+ *
+ * Applications can use this to gain access to features of the CommonDeviceCallbacks
+ * that are specific to the selected application.
+ */
+chip::DeviceManager::CHIPDeviceManagerCallbacks & GetDeviceCallbacks();
+} // namespace AllClustersApp
diff --git a/examples/all-clusters-app/nxp/common/main/main.cpp b/examples/all-clusters-app/nxp/common/main/main.cpp
index c2305cf9ac4eb6..b2aadab98ceb8b 100644
--- a/examples/all-clusters-app/nxp/common/main/main.cpp
+++ b/examples/all-clusters-app/nxp/common/main/main.cpp
@@ -37,7 +37,7 @@ extern "C" int main(int argc, char * argv[])
TaskHandle_t taskHandle;
PlatformMgrImpl().HardwareInit();
- GetAppTask().StartAppTask();
+ chip::NXP::App::GetAppTask().Start();
vTaskStartScheduler();
}
diff --git a/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn
index 6f167c92ce5be2..02cce50f266eb1 100644
--- a/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn
+++ b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn
@@ -35,24 +35,42 @@ assert(target_os == "freertos")
assert(nxp_platform == "rt/rw61x")
declare_args() {
- # This defines the device type as a "thermostat" by default,
- # use "all-clusters" in order to build the all-clusters-app
- nxp_device_type = "thermostat"
+ # Allows to start the tcp download test app
+ tcp_download = false
+
+ # Allows to start the wifi connect test app
+ wifi_connect = false
+
+ # The 2 params below are used only if tcp_download or wifi_connect are true, otherwise they're unused.
+ wifi_ssid = ""
+ wifi_password = ""
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
}
example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}"
+common_example_dir = "${chip_root}/examples/platform/nxp/common"
-if (nxp_device_type == "thermostat") {
- app_common_folder = "${nxp_device_type}/nxp/zap"
-} else {
- app_common_folder = "${nxp_device_type}-app/${nxp_device_type}-common"
+if (tcp_download == true && wifi_connect == true) {
+ assert("Cannot enable tcp_download and wifi_connect at the same time!")
}
+app_common_folder = "all-clusters-app/all-clusters-common"
+
# Create here the SDK instance.
# Particular sources/defines/includes could be added/changed depending on the target application.
rt_sdk("sdk") {
defines = []
+ # To be moved, temporary mbedtls config fix to build app with factory data
+ if (chip_enable_secure_dac_private_key_storage == 1) {
+ defines += [
+ "MBEDTLS_NIST_KW_C",
+ "MBEDTLS_PSA_CRYPTO_CLIENT",
+ ]
+ }
+
cflags = []
public_deps = []
public_configs = []
@@ -75,6 +93,15 @@ rt_sdk("sdk") {
# Indicate the default path to OpenThreadConfig.h
include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ]
+
+ # For matter with BR feature, increase FreeRTOS heap size
+ if (chip_enable_wifi && chip_enable_openthread) {
+ defines += [ "configTOTAL_HEAP_SIZE=(size_t)(160 * 1024)" ]
+ }
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
}
# Create the SDK driver instance.
@@ -85,12 +112,18 @@ rw61x_sdk_drivers("sdk_driver") {
rt_executable("all_cluster_app") {
output_name = "chip-rw61x-all-cluster-example"
- defines = [ "CONFIG_RENDEZVOUS_MODE=7" ]
+ defines = [
+ "CONFIG_RENDEZVOUS_MODE=7",
+ "CONFIG_APP_FREERTOS_OS=1",
+ ]
+
+ if (chip_enable_openthread) {
+ defines += [ "CONFIG_NET_L2_OPENTHREAD=1" ]
+ }
include_dirs = [
"../../common/main/include",
"../../common/main",
-
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/providers/",
]
@@ -98,34 +131,54 @@ rt_executable("all_cluster_app") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
- "../../common/main/AppFactoryDataDefaultImpl.cpp",
- "../../common/main/AppMatterButtonEmpty.cpp",
- "../../common/main/AppMatterCli.cpp",
"../../common/main/AppTask.cpp",
- "../../common/main/CHIPDeviceManager.cpp",
"../../common/main/DeviceCallbacks.cpp",
"../../common/main/ZclCallbacks.cpp",
"../../common/main/include/AppEvent.h",
"../../common/main/include/AppTask.h",
- "../../common/main/include/CHIPDeviceManager.h",
"../../common/main/include/DeviceCallbacks.h",
"../../common/main/main.cpp",
]
- deps = [ "${chip_root}/examples/${app_common_folder}" ]
-
- if (nxp_device_type == "all-clusters") {
- defines += [ "DEVICE_TYPE_ALL_CLUSTERS" ]
+ if (chip_enable_secure_dac_private_key_storage == 1) {
+ sources += [
+ "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp",
+ ]
+ } else {
sources += [
- "${chip_root}/examples/${app_common_folder}/src/EnergyEvseDelegateImpl.cpp",
- "${chip_root}/examples/${app_common_folder}/src/EnergyEvseManager.cpp",
- "${chip_root}/examples/${app_common_folder}/src/bridged-actions-stub.cpp",
- "${chip_root}/examples/${app_common_folder}/src/energy-evse-stub.cpp",
- "${chip_root}/examples/${app_common_folder}/src/smco-stub.cpp",
- "${chip_root}/examples/${app_common_folder}/src/static-supported-modes-manager.cpp",
+ "${common_example_dir}/factory_data/source/AppFactoryDataDefaultImpl.cpp",
]
}
+ # App common files
+ include_dirs += [
+ "${common_example_dir}/icd/include",
+ "${common_example_dir}/matter_button/include",
+ "${common_example_dir}/matter_cli/include",
+ "${common_example_dir}/device_manager/include",
+ "${common_example_dir}/device_callbacks/include",
+ "${common_example_dir}/app_task/include",
+ "${common_example_dir}/factory_data/include",
+ ]
+
+ sources += [
+ "${common_example_dir}/app_task/source/AppTaskBase.cpp",
+ "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp",
+ "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp",
+ "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp",
+ "${common_example_dir}/icd/source/ICDUtil.cpp",
+ "${common_example_dir}/matter_button/source/AppMatterButtonEmpty.cpp",
+ "${common_example_dir}/matter_cli/source/AppMatterCli.cpp",
+ ]
+
+ deps = [ "${chip_root}/examples/${app_common_folder}" ]
+
+ sources += [
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
+ ]
+
if (chip_enable_matter_cli) {
defines += [ "ENABLE_CHIP_SHELL" ]
deps += [
@@ -135,17 +188,53 @@ rt_executable("all_cluster_app") {
}
if (chip_enable_ota_requestor) {
+ include_dirs += [ "${common_example_dir}/ota_requestor/include" ]
sources += [
- "${chip_root}/examples/platform/nxp/common/OTARequestorInitiator.cpp",
- "${chip_root}/examples/platform/nxp/common/OTARequestorInitiator.h",
+ "${common_example_dir}/ota_requestor/source/OTARequestorInitiator.cpp",
+ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorCommon.cpp",
+ ]
+ }
+
+ if (wifi_connect) {
+ defines += [
+ "WIFI_CONNECT_TASK=1",
+ "WIFI_CONNECT=1",
+ ]
+
+ if (!chip_enable_matter_cli) {
+ assert(wifi_ssid != "" && wifi_password != "",
+ "WiFi SSID and password must be specified at build time!")
+ }
+
+ if (wifi_ssid != "") {
+ defines += [ "WIFI_SSID=\"${wifi_ssid}\"" ]
+ }
+
+ if (wifi_password != "") {
+ defines += [ "WIFI_PASSWORD=\"${wifi_password}\"" ]
+ }
+
+ include_dirs += [ "${common_example_dir}/wifi_connect/include" ]
+ sources += [ "${common_example_dir}/wifi_connect/source/WifiConnect.cpp" ]
+ }
+
+ if (tcp_download) {
+ defines += [ "CONFIG_CHIP_TCP_DOWNLOAD=1" ]
+ defines += [
+ "WIFI_CONNECT=1",
+ "WIFI_SSID=\"${wifi_ssid}\"",
+ "WIFI_PASSWORD=\"${wifi_password}\"",
]
- include_dirs += [ "${chip_root}/examples/platform/nxp/common" ]
+
+ include_dirs += [ "${common_example_dir}/tcp_download_test/include" ]
+ sources +=
+ [ "${common_example_dir}/tcp_download_test/source/TcpDownload.cpp" ]
}
# In case a dedicated assert function needs to be supported the flag sdk_fsl_assert_support should be set to false
# The would add to the build a dedicated application assert implementation.
if (!sdk_fsl_assert_support) {
- sources += [ "../../common/main/AppAssert.cpp" ]
+ sources += [ "${common_example_dir}/app_assert/source/AppAssert.cpp" ]
}
cflags = [ "-Wconversion" ]
diff --git a/examples/all-clusters-app/nxp/rt/rw61x/README.md b/examples/all-clusters-app/nxp/rt/rw61x/README.md
index d5b436d9fee8e1..8a6889909dffa3 100644
--- a/examples/all-clusters-app/nxp/rt/rw61x/README.md
+++ b/examples/all-clusters-app/nxp/rt/rw61x/README.md
@@ -25,13 +25,13 @@ commissioning and different cluster control.
The RW61x all-cluster application provides a working demonstration of the
RW610/RW612 board integration, built using the Project CHIP codebase and the NXP
-RW612 SDK. The example supports basic ZCL commands and acts as a thermostat
-device-type.
+RW612 SDK.
The example supports:
- Matter over Wi-Fi
- Matter over Openthread
+- Matter over Wi-Fi with OpenThread Border Router support.
### Hardware requirements
@@ -46,6 +46,12 @@ For Matter over WiFi configuration :
- BLE antenna (to plug in Ant1)
- Wi-Fi antenna (to plug in Ant2)
+For Matter over Wi-Fi with OpenThread Border Router :
+
+- [`NXP RD-RW612-BGA`] board
+- BLE/15.4 antenna (to plug in Ant1)
+- Wi-Fi antenna (to plug in Ant2)
+
## Building
@@ -56,22 +62,26 @@ distribution (the demo-application was compiled on Ubuntu 20.04).
- Follow instruction in [BUILDING.md](../../../../../docs/guides/BUILDING.md)
to setup the environment to be able to build Matter.
-- Download [RD-RW612 SDK v2.13.1](https://mcuxpresso.nxp.com/en/select).
+- Download
+ [RD-RW612 SDK for Project CHIP](https://mcuxpresso.nxp.com/en/select).
Creating an nxp.com account is required before being able to download the
SDK. Once the account is created, login and follow the steps for downloading
SDK. The SDK Builder UI selection should be similar with the one from the
- image below. In case you do not have access to the SDK, please ask your NXP
- representative.
+ image below.
![MCUXpresso SDK Download](../../../../platform/nxp/rt/rw61x/doc/images/mcux-sdk-download.PNG)
(Note: All SDK components should be selected. If size is an issue Azure RTOS
component can be omitted.)
+ Please refer to Matter release notes for getting the latest released SDK.
+
- Start building the application.
```
user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_SDK_ROOT=/home/user/Desktop/SDK_RW612/
+user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive
+user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/bootstrap.sh
user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/all-clusters-app/nxp/rt/rw61x/
```
@@ -87,13 +97,26 @@ user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x
#### Building with Matter over Thread configuration on RW612
-- Build the Openthread configuration with BLE commissioning.
+- Build Matter-over-Thread configuration with BLE commissioning.
```
user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ gn gen --args="chip_enable_openthread=true chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=true is_sdk_package=true" out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ ninja -C out/debug
```
+#### Building with Matter over Wifi + OpenThread Border Router configuration on RW612
+
+This configuration requires enabling the Matter CLI in order to control the
+Thread network on the Border Router.
+
+- Build Matter with Border Router configuration with BLE commissioning
+ (ble-wifi) :
+
+```
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw610$ gn gen --args="chip_enable_wifi=true chip_enable_openthread=true chip_enable_matter_cli=true is_sdk_package=true openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-nxp/openthread-br\"" out/debug
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw610$ ninja -C out/debug
+```
+
#### General information
The resulting output file can be found in
@@ -108,8 +131,8 @@ Optional GN options that can be added when building an application:
- To switch the SDK type used, the argument `is_=true` must be added
to the _gn gen_ command (with being either sdk_package or
sdk_internal).
-- By default, the RW612 A1 board revision will be chosen. To switch to an A0
- revision, the argument `board_version=\"A0\"` must be added to the _gn gen_
+- By default, the RW612 A1 board revision will be chosen. To switch to an A2
+ revision, the argument `board_version=\"A2\"` must be added to the _gn gen_
command.
- To build the application in debug mode, the argument
`is_debug=true optimize_debug=false` must be added to the _gn gen_ command.
@@ -120,7 +143,7 @@ Optional GN options that can be added when building an application:
- To build the application with the OTA Requestor enabled, the arguments
`chip_enable_ota_requestor=true no_mcuboot=false` must be added to the _gn
gen_ command. (More information about the OTA Requestor feature in
- [OTA Requestor README](README_OTA_Requestor.md)))
+ [OTA Requestor README](../../../../../docs/guides/nxp_rw61x_ota_software_update.md)
## Manufacturing data
@@ -133,6 +156,21 @@ The all cluster app demonstrates the usage of encrypted Matter manufacturing
data storage. Matter manufacturing data should be encrypted using an AES 128
software key before flashing them to the device flash.
+Using DAC private key secure usage: Experimental feature, contain some
+limitation: potential concurrent access issue during sign with dac key operation
+due to the lack of protection between multiple access to `ELS` crypto module.
+The argument `chip_enable_secure_dac_private_key_storage=1` must be added to the
+_gn gen_ command to enable secure private DAC key usage with S50.
+`chip_with_factory_data=1` must have been added to the _gn gen_ command
+
+DAC private key generation: The argument `chip_convert_dac_private_key=1` must
+be added to the _gn gen_ command to enable DAC private plain key conversion to
+blob with S50. `chip_enable_secure_dac_private_key_storage=1` must have been
+added to the _gn gen_ command
+
+`ELS` contain concurrent access risks. They must be fixed before enabling it by
+default.
+
## Flashing and debugging
@@ -213,6 +251,16 @@ The "ble-wifi" pairing method can be used in order to commission the device.
The "ble-thread" pairing method can be used in order to commission the device.
+#### Matter over wifi with openthread border router configuration :
+
+In order to create or join a Thread network on the Matter Border Router, the
+`otcli` commands from the matter CLI can be used. For more information about
+using the matter shell, follow instructions from
+['Testing the all-clusters application with Matter CLI'](#testing-the-all-clusters-application-with-matter-cli-enabled).
+
+In this configuration, the device can be commissioned over Wi-Fi with the
+'ble-wifi' pairing method.
+
### Testing the all-clusters application without Matter CLI:
1. Prepare the board with the flashed `All-cluster application` (as shown
@@ -284,6 +332,41 @@ Here are described steps to use the all-cluster-app with the Matter CLI enabled
it is described
[here](../../../../chip-tool/README.md#using-the-client-to-send-matter-commands).
+For Matter with OpenThread Border Router support, the matter CLI can be used to
+start/join the Thread network, using the following ot-cli commands. (Note that
+setting channel, panid, and network key is not enough anymore because of an Open
+Thread stack update. We first need to initialize a new dataset.)
+
+```
+> otcli dataset init new
+Done
+> otcli dataset
+Active Timestamp: 1
+Channel: 25
+Channel Mask: 0x07fff800
+Ext PAN ID: 42af793f623aab54
+Mesh Local Prefix: fd6e:c358:7078:5a8d::/64
+Network Key: f824658f79d8ca033fbb85ecc3ca91cc
+Network Name: OpenThread-b870
+PAN ID: 0xb870
+PSKc: f438a194a5e968cc43cc4b3a6f560ca4
+Security Policy: 672 onrc 0
+Done
+> otcli dataset panid 0xabcd
+Done
+> otcli dataset channel 25
+Done
+> otcli dataset commit active
+Done
+> otcli ifconfig up
+Done
+> otcli thread start
+Done
+> otcli state
+leader
+Done
+```
+
## OTA Software Update
diff --git a/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h b/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h
index 9fe84849fd753f..2653e97705fe39 100644
--- a/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h
+++ b/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h
@@ -50,8 +50,13 @@
#if !CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA
// Use a default pairing code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/.gn b/examples/contact-sensor-app/nxp/k32w/k32w0/.gn
index 3d48789e30ab3d..363727423ce903 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/.gn
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/.gn
@@ -25,4 +25,7 @@ default_args = {
target_os = "freertos"
import("//args.gni")
+
+ # Import default platform configs
+ import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni")
}
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn b/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
index c9b50a84ceb770..4b9f501690d732 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
@@ -13,11 +13,13 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w0_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
-import("${k32w0_sdk_build_root}/k32w0_executable.gni")
-import("${k32w0_sdk_build_root}/k32w0_sdk.gni")
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")
import("${chip_root}/src/app/icd/icd.gni")
import("${chip_root}/src/crypto/crypto.gni")
@@ -27,6 +29,9 @@ import("${chip_root}/src/platform/device.gni")
declare_args() {
chip_software_version = 0
chip_simple_hash_verification = 0
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
}
if (chip_pw_tokenizer_logging) {
@@ -71,6 +76,10 @@ k32w0_sdk("sdk") {
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
]
}
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
}
k32w0_executable("contact_sensor_app") {
@@ -140,6 +149,7 @@ k32w0_executable("contact_sensor_app") {
ldflags = [
"-T" + rebase_path(ldscript, root_build_dir),
+ "-Wl,--defsym=__stack_size__=0x480",
"-Wl,-print-memory-usage",
]
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/README.md b/examples/contact-sensor-app/nxp/k32w/k32w0/README.md
index c325895886a093..b7ec329d7650d1 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/README.md
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/README.md
@@ -40,9 +40,7 @@ network.
- [OTA Testing](#ota-testing)
- [Known issues ota](#known-issues-ota)
- [Low power](#low-power)
-
- - [Known issues power](#known-issues-low-power)
-
+ - [Known issues low power](#known-issues-low-power)
- [Removing SSBL Upgrade region](#removing-ssbl-upgrade-region)
@@ -222,7 +220,7 @@ Start building the application:
```bash
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/contact-sensor-app/nxp/k32w/k32w0
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w0$ gn gen out/debug --args="chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"platform\" chip_with_se05x=0 chip_pw_tokenizer_logging=true"
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w0$ gn gen out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w0$ ninja -C out/debug
```
@@ -248,6 +246,16 @@ In case the board doesn't have 32KHz crystal fitted, one can use the 32KHz free
running oscillator as a clock source. In this case one must set the use_fro_32k
argument to 1.
+K32W0x1 supports antenna diversity feature, which is a technique that maximizes
+the performance of an antenna system, allowing the radio signal to be switched
+between two antennas that have very low correlation between their received
+signals. Typically, this is achieved by spacing two antennas around 0.25
+wavelengths apart or by using 2 orthogonal types of polarization. This is
+controlled by software. K32W0x1 provides an output (`ADO`) on one of `DIO7`,
+`DIO9` or `DIO19` and optionally its complement (`ADE`) on `DIO6` that can be
+used to control an antenna switch. In order to use this feature, user must set
+`use_antenna_diversity` to 1.
+
In case signing errors are encountered when running the "sign_images.sh" script
(run automatically) install the recommanded packages (python version > 3, pip3,
pycrypto, pycryptodome):
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/args.gni b/examples/contact-sensor-app/nxp/k32w/k32w0/args.gni
index 6e931d00452fcd..e328a6ede9011f 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/args.gni
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/args.gni
@@ -14,12 +14,14 @@
import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
-import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni")
# SDK target. This is overridden to add our SDK app_config.h & defines.
k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_ota_requestor = true
+chip_with_ota_encryption = 1
+chip_with_ota_key = "1234567890ABCDEFA1B2C3D4E5F6F1B4"
+
chip_stack_lock_tracking = "fatal"
chip_enable_ble = true
@@ -28,3 +30,11 @@ chip_enable_icd_lit = false
icd_enforce_sit_slow_poll_limit = true
chip_persist_subscriptions = true
chip_subscription_timeout_resumption = true
+
+is_debug = false
+
+chip_crypto = "platform"
+chip_crypto_flavor = "NXP-Ultrafast-P256"
+chip_with_ot_cli = 0
+chip_with_OM15082 = 1
+chip_pw_tokenizer_logging = true
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
index 72f94878cf328f..301d53824a7e55 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
@@ -92,8 +92,13 @@
#else
// Use a default setup PIN code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
/**
* CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
index 17aea9d5897907..81694523876d7e 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -45,7 +45,7 @@
#include
#endif
-#include "BLEManagerImpl.h"
+#include
#include "Keyboard.h"
#include "LED.h"
@@ -452,6 +452,7 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)
button_event.Handler = ResetActionEventHandler;
}
#endif
+
#if CHIP_ENABLE_LIT
if (button_action == USER_ACTIVE_MODE_TRIGGER_PUSH)
{
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
index e44c1a9c71bd40..400b4003c3d1b9 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
@@ -31,10 +31,15 @@ import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni")
declare_args() {
chip_software_version = 0
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
+ chip_with_diag_logs_demo = true
}
assert(current_os == "freertos")
+common_example_dir = "${chip_root}/examples/platform/nxp/common"
k32w1_platform_dir = "${chip_root}/examples/platform/nxp/k32w/k32w1"
k32w1_sdk_root = getenv("NXP_K32W1_SDK_ROOT")
@@ -70,6 +75,14 @@ k32w1_sdk("sdk") {
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
]
}
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
+
+ if (chip_with_diag_logs_demo) {
+ defines += [ "CONFIG_DIAG_LOGS_DEMO=1" ]
+ }
}
k32w1_executable("contact_sensor_app") {
@@ -89,6 +102,8 @@ k32w1_executable("contact_sensor_app") {
"main/main.cpp",
]
+ include_dirs = [ "${common_example_dir}/diagnostic_logs" ]
+
deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
@@ -99,15 +114,24 @@ k32w1_executable("contact_sensor_app") {
"${k32w1_platform_dir}/app/support:freertos_mbedtls_utils",
]
+ #lit and sit are using different zap files
+ if (chip_enable_icd_lit) {
+ deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-lit/" ]
+
+ defines += [ "CHIP_ENABLE_LIT=1" ]
+ } else {
+ deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-sit/" ]
+ }
+
if (chip_openthread_ftd) {
deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
- "${chip_root}/third_party/openthread/repo:libopenthread-ftd",
+ "${openthread_root}:libopenthread-cli-ftd",
+ "${openthread_root}:libopenthread-ftd",
]
} else {
deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
- "${chip_root}/third_party/openthread/repo:libopenthread-mtd",
+ "${openthread_root}:libopenthread-cli-mtd",
+ "${openthread_root}:libopenthread-mtd",
]
}
@@ -142,6 +166,13 @@ k32w1_executable("contact_sensor_app") {
ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ]
}
+ if (chip_with_diag_logs_demo) {
+ sources += [
+ "${common_example_dir}/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.cpp",
+ "${common_example_dir}/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.h",
+ ]
+ }
+
output_dir = root_out_dir
}
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/README.md b/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
index ff3496d7b862ac..5079e01c6e2400 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
@@ -32,7 +32,7 @@ into an existing Matter network and can be controlled by this network.
- [Known issues](#known-issues)
- [Low power](#low-power)
-
+
## Introduction
@@ -93,7 +93,7 @@ states are depicted:
service connectivity.
NOTE: LED2 will be disabled when CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR is
-enabled. On K32W1 EVK board, `PTB0` is wired to LED2 also is wired to CS (Chip
+enabled. On K32W1 EVK board, `PTB0` is wired to `LED2` also is wired to CS (Chip
Select) External Flash Memory. OTA image is stored in external memory because of
it's size. If LED2 is enabled then it will affect External Memory CS and OTA
will not work.
@@ -131,8 +131,9 @@ In order to build the Matter example, we recommend using a Linux distribution
```
user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W1_SDK_ROOT=/home/user/Desktop/SDK_K32W1/
user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh
+user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/contact-sensor-app/nxp/k32w/k32w1
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w1$ gn gen out/debug --args="chip_with_ot_cli=0 is_debug=false chip_openthread_ftd=false chip_crypto=\"platform\""
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w1$ gn gen out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/contact-sensor-app/nxp/k32w/k32w1$ ninja -C out/debug
```
@@ -140,8 +141,6 @@ In case that Openthread CLI is needed, chip_with_ot_cli build argument must be
set to 1.
After a successful build, the `elf` and `srec` files are found in `out/debug/` -
-`see the files prefixed with chip-k32w1-contact-example`. After a successful
-build, the `elf` and `srec` files are found in `out/debug/` -
`see the files prefixed with chip-k32w1-contact-example`.
## Long Idle Time ICD Support
@@ -205,7 +204,7 @@ path -
[K32W148 board quick start guide](https://www.nxp.com/document/guide/getting-started-with-the-k32w148-development-platform:GS-K32W148EVK)
can be used for updating the `NBU/radio` core:
-- Section 2.4 – Get Software – install `SPSDK` (Secure Provisioning Command
+- Section 2.5 – Get Software – install `SPSDK` (Secure Provisioning Command
Line Tool)
- Section 3.3 – Updating `NBU` for Wireless examples - use the corresponding
`.sb3` file found in the SDK package at path
@@ -308,7 +307,7 @@ In `OTAP` application
the image only for the CM33 core
- keep other settings at default values
-### Convert sb3 into ota file
+### Convert `sb3` into `ota` file
In order to build an OTA image, use NXP wrapper over the standard tool
`src/app/ota_image_tool.py`:
@@ -325,7 +324,7 @@ Please see more in the
[OTA image tool guide](../../../../../scripts/tools/nxp/ota/README.md).
Here is an example that generates an OTA image with application update TLV from
-a sb3 file:
+a `sb3` file:
```
./scripts/tools/nxp/ota/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 43033 -vs "1.0" -da sha256 --app-input-file ~/binaries/chip-k32w1-43033.sb3 ~/binaries/chip-k32w1-43033.ota
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni b/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
index b25f000cd85d1c..23e6730b79045c 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
@@ -28,3 +28,11 @@ chip_enable_icd_lit = false
icd_enforce_sit_slow_poll_limit = true
chip_persist_subscriptions = true
chip_subscription_timeout_resumption = true
+
+is_debug = false
+
+chip_crypto = "platform"
+chip_openthread_ftd = false
+chip_with_ot_cli = 0
+
+chip_with_diag_logs_demo = true
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
index 808b70aad0cab7..0d9a4e3b503bee 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
@@ -94,8 +94,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006
// Use a default setup PIN code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"
@@ -186,8 +191,6 @@
#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics
#define CHIP_DEVICE_CONFIG_ENABLE_SED 1
-#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 1000_ms32
-#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL 100_ms32
/**
* @def CHIP_IM_MAX_NUM_COMMAND_HANDLER
@@ -217,3 +220,8 @@
#endif // BUILD_RELEASE
#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1
+
+#if CONFIG_DIAG_LOGS_DEMO
+#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1
+#define CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE 1024
+#endif
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
index 3e9380254bd428..6f0459178cd173 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -30,6 +30,9 @@
#include
#include
#include
+#if CONFIG_DIAG_LOGS_DEMO
+#include "DiagnosticLogsProviderDelegateImpl.h"
+#endif
#include
#include
@@ -95,6 +98,9 @@ using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;
using namespace chip;
using namespace chip::app;
+#if CONFIG_DIAG_LOGS_DEMO
+using namespace chip::app::Clusters::DiagnosticLogs;
+#endif
AppTask AppTask::sAppTask;
#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
@@ -114,6 +120,11 @@ static BDXDownloader gDownloader __attribute__((section(".data")));
constexpr uint16_t requestedOtaBlockSize = 1024;
#endif
+static pm_notify_element_t appNotifyElement = {
+ .notifyCallback = AppTask::LowPowerCallback,
+ .data = NULL,
+};
+
static void app_gap_callback(gapGenericEvent_t * event)
{
/* This callback is called in the context of BLE task, so event processing
@@ -148,7 +159,15 @@ CHIP_ERROR AppTask::Init()
if (ContactSensorMgr().Init() != 0)
{
K32W_LOG("ContactSensorMgr().Init() failed");
- assert(status == 0);
+ assert(0);
+ }
+
+ // Register enter/exit low power application callback.
+ status_t status = PM_RegisterNotify(kPM_NotifyGroup2, &appNotifyElement);
+ if (status != kStatus_Success)
+ {
+ K32W_LOG("Failed to register low power app callback.")
+ return APP_ERROR_PM_REGISTER_LP_CALLBACK_FAILED;
}
PlatformMgr().AddEventHandler(MatterEventHandler, 0);
@@ -250,6 +269,24 @@ void AppTask::InitServer(intptr_t arg)
nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance();
initParams.endpointNativeParams = static_cast(&nativeParams);
VerifyOrDie((chip::Server::GetInstance().Init(initParams)) == CHIP_NO_ERROR);
+
+#if CONFIG_DIAG_LOGS_DEMO
+ char diagLog[CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE];
+ uint16_t diagLogSize = CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE;
+
+ StorageKeyName keyUser = LogProvider::GetKeyDiagUserSupport();
+ StorageKeyName keyNwk = LogProvider::GetKeyDiagNetwork();
+ StorageKeyName keyCrash = LogProvider::GetKeyDiagCrashLog();
+
+ memset(diagLog, 0, diagLogSize);
+ Server::GetInstance().GetPersistentStorage().SyncSetKeyValue(keyUser.KeyName(), diagLog, diagLogSize);
+
+ memset(diagLog, 1, diagLogSize);
+ Server::GetInstance().GetPersistentStorage().SyncSetKeyValue(keyNwk.KeyName(), diagLog, diagLogSize);
+
+ memset(diagLog, 2, diagLogSize);
+ Server::GetInstance().GetPersistentStorage().SyncSetKeyValue(keyCrash.KeyName(), diagLog, diagLogSize);
+#endif
}
void AppTask::PrintOnboardingInfo()
@@ -768,6 +805,11 @@ void AppTask::OnIdentifyStop(Identify * identify)
}
}
+status_t AppTask::LowPowerCallback(pm_event_type_t eventType, uint8_t powerState, void * data)
+{
+ return kStatus_Success;
+}
+
void AppTask::PostContactActionRequest(ContactSensorManager::Action aAction)
{
AppEvent event;
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp b/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
index e1e35b4cb4ec7e..5937d134194c30 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
@@ -30,10 +30,18 @@
#include
#include
+#if CONFIG_DIAG_LOGS_DEMO
+#include "DiagnosticLogsProviderDelegateImpl.h"
+#include
+#endif
+
using namespace ::chip;
using namespace ::chip::app;
using namespace ::chip::app::Clusters;
using namespace ::chip::app::Clusters::BooleanState;
+#if CONFIG_DIAG_LOGS_DEMO
+using namespace ::chip::app::Clusters::DiagnosticLogs;
+#endif
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value)
{
@@ -96,3 +104,11 @@ void logBooleanStateEvent(bool state)
ChipLogProgress(Zcl, "booleanstate: failed to reacord state-change event");
}
}
+
+#if CONFIG_DIAG_LOGS_DEMO
+void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint)
+{
+ auto & logProvider = LogProvider::GetInstance();
+ DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider);
+}
+#endif
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
index 2338131f06c4b0..64842e310561b2 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
@@ -36,6 +36,7 @@
#include "FreeRTOS.h"
#include "fsl_component_button.h"
+#include "fsl_pm_core.h"
#include "timers.h"
// Application-defined error codes in the CHIP_ERROR space.
@@ -45,6 +46,7 @@
#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04)
#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05)
#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06)
+#define APP_ERROR_PM_REGISTER_LP_CALLBACK_FAILED CHIP_APPLICATION_ERROR(0x07)
class AppTask
{
@@ -67,6 +69,8 @@ class AppTask
static void OnIdentifyStart(Identify * identify);
static void OnIdentifyStop(Identify * identify);
+ static status_t LowPowerCallback(pm_event_type_t eventType, uint8_t powerState, void * data);
+
private:
friend AppTask & GetAppTask(void);
@@ -96,6 +100,7 @@ class AppTask
static void TimerEventHandler(TimerHandle_t xTimer);
static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
+
void StartTimer(uint32_t aTimeoutInMs);
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter
index fcec6408acfcb8..b3c6233dc7a8e9 100644
--- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter
+++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter
@@ -659,6 +659,53 @@ cluster NetworkCommissioning = 49 {
command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9;
}
+/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */
+cluster DiagnosticLogs = 50 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum IntentEnum : enum8 {
+ kEndUserSupport = 0;
+ kNetworkDiag = 1;
+ kCrashLogs = 2;
+ }
+
+ enum StatusEnum : enum8 {
+ kSuccess = 0;
+ kExhausted = 1;
+ kNoLogs = 2;
+ kBusy = 3;
+ kDenied = 4;
+ }
+
+ enum TransferProtocolEnum : enum8 {
+ kResponsePayload = 0;
+ kBDX = 1;
+ }
+
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct RetrieveLogsRequestRequest {
+ IntentEnum intent = 0;
+ TransferProtocolEnum requestedProtocol = 1;
+ optional char_string<32> transferFileDesignator = 2;
+ }
+
+ response struct RetrieveLogsResponse = 1 {
+ StatusEnum status = 0;
+ long_octet_string logContent = 1;
+ optional epoch_us UTCTimeStamp = 2;
+ optional systime_us timeSinceBoot = 3;
+ }
+
+ /** Retrieving diagnostic logs from a Node */
+ command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0;
+}
+
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster GeneralDiagnostics = 51 {
revision 2;
@@ -1371,6 +1418,7 @@ endpoint 0 {
emits event AccessControlEntryChanged;
emits event AccessControlExtensionChanged;
callback attribute acl;
+ callback attribute extension;
callback attribute subjectsPerAccessControlEntry;
callback attribute targetsPerAccessControlEntry;
callback attribute accessControlEntriesPerFabric;
@@ -1471,6 +1519,18 @@ endpoint 0 {
handle command ReorderNetwork;
}
+ server cluster DiagnosticLogs {
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command RetrieveLogsRequest;
+ handle command RetrieveLogsResponse;
+ }
+
server cluster GeneralDiagnostics {
emits event BootReason;
callback attribute networkInterfaces;
diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap
index 1e9f3e8bee2875..68b94ef250a67a 100644
--- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap
+++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap
@@ -190,6 +190,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
+ {
+ "name": "Extension",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "SubjectsPerAccessControlEntry",
"code": 2,
@@ -248,7 +264,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -264,7 +280,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -280,7 +296,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -1480,6 +1496,130 @@
}
]
},
+ {
+ "name": "Diagnostic Logs",
+ "code": 50,
+ "mfgCode": null,
+ "define": "DIAGNOSTIC_LOGS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "RetrieveLogsRequest",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RetrieveLogsResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
{
"name": "General Diagnostics",
"code": 51,
@@ -2805,7 +2945,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -2821,7 +2961,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -2837,7 +2977,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -2853,7 +2993,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": null,
+ "defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter
index 3cd88fd42fb0c7..fd15a473ac447b 100644
--- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter
+++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter
@@ -659,6 +659,53 @@ cluster NetworkCommissioning = 49 {
command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9;
}
+/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */
+cluster DiagnosticLogs = 50 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum IntentEnum : enum8 {
+ kEndUserSupport = 0;
+ kNetworkDiag = 1;
+ kCrashLogs = 2;
+ }
+
+ enum StatusEnum : enum8 {
+ kSuccess = 0;
+ kExhausted = 1;
+ kNoLogs = 2;
+ kBusy = 3;
+ kDenied = 4;
+ }
+
+ enum TransferProtocolEnum : enum8 {
+ kResponsePayload = 0;
+ kBDX = 1;
+ }
+
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct RetrieveLogsRequestRequest {
+ IntentEnum intent = 0;
+ TransferProtocolEnum requestedProtocol = 1;
+ optional char_string<32> transferFileDesignator = 2;
+ }
+
+ response struct RetrieveLogsResponse = 1 {
+ StatusEnum status = 0;
+ long_octet_string logContent = 1;
+ optional epoch_us UTCTimeStamp = 2;
+ optional systime_us timeSinceBoot = 3;
+ }
+
+ /** Retrieving diagnostic logs from a Node */
+ command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0;
+}
+
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster GeneralDiagnostics = 51 {
revision 2;
@@ -1371,6 +1418,7 @@ endpoint 0 {
emits event AccessControlEntryChanged;
emits event AccessControlExtensionChanged;
callback attribute acl;
+ callback attribute extension;
callback attribute subjectsPerAccessControlEntry;
callback attribute targetsPerAccessControlEntry;
callback attribute accessControlEntriesPerFabric;
@@ -1471,6 +1519,18 @@ endpoint 0 {
handle command ReorderNetwork;
}
+ server cluster DiagnosticLogs {
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command RetrieveLogsRequest;
+ handle command RetrieveLogsResponse;
+ }
+
server cluster GeneralDiagnostics {
emits event BootReason;
callback attribute networkInterfaces;
diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap
index e0b5e7995d96fe..a433e8e7bd9c9a 100644
--- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap
+++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap
@@ -1,6 +1,6 @@
{
"fileFormat": 2,
- "featureLevel": 100,
+ "featureLevel": 99,
"creator": "zap",
"keyValuePairs": [
{
@@ -190,6 +190,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
+ {
+ "name": "Extension",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "SubjectsPerAccessControlEntry",
"code": 2,
@@ -1480,6 +1496,130 @@
}
]
},
+ {
+ "name": "Diagnostic Logs",
+ "code": 50,
+ "mfgCode": null,
+ "define": "DIAGNOSTIC_LOGS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "RetrieveLogsRequest",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RetrieveLogsResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
{
"name": "General Diagnostics",
"code": 51,
@@ -4010,16 +4150,14 @@
"endpointTypeIndex": 0,
"profileId": 259,
"endpointId": 0,
- "networkId": 0,
- "parentEndpointIdentifier": null
+ "networkId": 0
},
{
"endpointTypeName": "MA-dimmablelight",
"endpointTypeIndex": 1,
"profileId": 259,
"endpointId": 1,
- "networkId": 0,
- "parentEndpointIdentifier": null
+ "networkId": 0
}
]
}
\ No newline at end of file
diff --git a/examples/laundry-washer-app/nxp/common/main/AppTask.cpp b/examples/laundry-washer-app/nxp/common/main/AppTask.cpp
new file mode 100644
index 00000000000000..1137db82338b6f
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/AppTask.cpp
@@ -0,0 +1,140 @@
+/*
+ *
+ * Copyright (c) 2021-2023 Project CHIP Authors
+ * Copyright (c) 2021 Google LLC.
+ * Copyright 2023-2024 NXP
+ * 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 "AppTask.h"
+#include "CHIPDeviceManager.h"
+#include "ICDUtil.h"
+#include
+#include
+
+#include "static-supported-temperature-levels.h"
+#include
+
+#ifdef ENABLE_CHIP_SHELL
+#include
+
+using namespace chip::Shell;
+#endif /* ENABLE_CHIP_SHELL */
+
+using namespace chip;
+using namespace chip::app::Clusters;
+
+app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate;
+
+CHIP_ERROR cliOpState(int argc, char * argv[])
+{
+ if ((argc != 1) && (argc != 2))
+ {
+ ChipLogError(Shell, "Target State is missing");
+ return CHIP_ERROR_INVALID_ARGUMENT;
+ }
+ if (!strcmp(argv[0], "stop"))
+ {
+ ChipLogDetail(Shell, "OpSState : Set to %s state", argv[0]);
+ OperationalState::GetOperationalStateInstance()->SetOperationalState(
+ to_underlying(OperationalState::OperationalStateEnum::kStopped));
+ }
+ else if (!strcmp(argv[0], "run"))
+ {
+ ChipLogDetail(Shell, "OpSState : Set to %s state", argv[0]);
+ OperationalState::GetOperationalStateInstance()->SetOperationalState(
+ to_underlying(OperationalState::OperationalStateEnum::kRunning));
+ }
+ else if (!strcmp(argv[0], "pause"))
+ {
+ ChipLogDetail(Shell, "OpSState : Set to %s state", argv[0]);
+ OperationalState::GetOperationalStateInstance()->SetOperationalState(
+ to_underlying(OperationalState::OperationalStateEnum::kPaused));
+ }
+ else if (!strcmp(argv[0], "error"))
+ {
+ OperationalState::Structs::ErrorStateStruct::Type err;
+ ChipLogDetail(Shell, "OpSState : Set to %s state", argv[0]);
+ if (!strcmp(argv[1], "no_error"))
+ {
+ ChipLogDetail(Shell, "OpSState_error : Error: %s state", argv[1]);
+ err.errorStateID = (uint8_t) OperationalState::ErrorStateEnum::kNoError;
+ }
+ else if (!strcmp(argv[1], "unable_to_start_or_resume"))
+ {
+ ChipLogDetail(Shell, "OpSState_error : Error: %s state", argv[1]);
+ err.errorStateID = (uint8_t) OperationalState::ErrorStateEnum::kUnableToStartOrResume;
+ }
+ else if (!strcmp(argv[1], "unable_to_complete_operation"))
+ {
+ ChipLogDetail(Shell, "OpSState_error : Error: %s state", argv[1]);
+ err.errorStateID = (uint8_t) OperationalState::ErrorStateEnum::kUnableToCompleteOperation;
+ }
+ else if (!strcmp(argv[1], "command_invalid_in_state"))
+ {
+ ChipLogDetail(Shell, "OpSState_error : Error: %s state", argv[1]);
+ err.errorStateID = (uint8_t) OperationalState::ErrorStateEnum::kCommandInvalidInState;
+ }
+ else
+ {
+ ChipLogError(Shell, "Invalid Error State to set");
+ return CHIP_ERROR_INVALID_ARGUMENT;
+ }
+ OperationalState::GetOperationalStateInstance()->OnOperationalErrorDetected(err);
+ OperationalState::GetOperationalStateInstance()->SetOperationalState(
+ to_underlying(OperationalState::OperationalStateEnum::kError));
+ }
+ else
+ {
+ ChipLogError(Shell, "Invalid State to set");
+ return CHIP_ERROR_INVALID_ARGUMENT;
+ }
+ return CHIP_NO_ERROR;
+}
+
+void LaundryWasherApp::AppTask::PreInitMatterStack()
+{
+ ChipLogProgress(DeviceLayer, "Welcome to NXP laundry washer Demo App");
+}
+
+void LaundryWasherApp::AppTask::PostInitMatterStack()
+{
+ chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&chip::NXP::App::GetICDUtil());
+
+ app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate);
+}
+
+void LaundryWasherApp::AppTask::AppMatter_RegisterCustomCliCommands()
+{
+#ifdef ENABLE_CHIP_SHELL
+ /* Register application commands */
+ static const shell_command_t kCommands[] = {
+ { .cmd_func = cliOpState, .cmd_name = "opstate", .cmd_help = "Set the Operational State" },
+ };
+ Engine::Root().RegisterCommands(kCommands, sizeof(kCommands) / sizeof(kCommands[0]));
+#endif
+}
+
+// This returns an instance of this class.
+LaundryWasherApp::AppTask & LaundryWasherApp::AppTask::GetDefaultInstance()
+{
+ static LaundryWasherApp::AppTask sAppTask;
+ return sAppTask;
+}
+
+chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask()
+{
+ return LaundryWasherApp::AppTask::GetDefaultInstance();
+}
diff --git a/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp b/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp
new file mode 100644
index 00000000000000..0d20cf015a7954
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp
@@ -0,0 +1,135 @@
+/*
+ *
+ * Copyright (c) 2020-2023 Project CHIP Authors
+ * Copyright 2024 NXP
+ * 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 DeviceCallbacks.cpp
+ *
+ * Implements all the callbacks to the application from the CHIP Stack
+ *
+ **/
+#include "DeviceCallbacks.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+using namespace chip::app;
+void OnTriggerEffect(::Identify * identify)
+{
+ switch (identify->mCurrentEffectIdentifier)
+ {
+ case Clusters::Identify::EffectIdentifierEnum::kBlink:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBlink");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kBreathe:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBreathe");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kOkay:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kOkay");
+ break;
+ case Clusters::Identify::EffectIdentifierEnum::kChannelChange:
+ ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kChannelChange");
+ break;
+ default:
+ ChipLogProgress(Zcl, "No identifier effect");
+ return;
+ }
+}
+
+Identify gIdentify0 = {
+ chip::EndpointId{ 1 },
+ [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); },
+ [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); },
+ chip::app::Clusters::Identify::IdentifyTypeEnum::kNone,
+ OnTriggerEffect,
+};
+
+Identify gIdentify1 = {
+ chip::EndpointId{ 1 },
+ [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); },
+ [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); },
+ chip::app::Clusters::Identify::IdentifyTypeEnum::kNone,
+ OnTriggerEffect,
+};
+
+using namespace ::chip;
+using namespace ::chip::Inet;
+using namespace ::chip::System;
+using namespace ::chip::DeviceLayer;
+using namespace chip::app::Clusters;
+
+void LaundryWasherApp::DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId,
+ AttributeId attributeId, uint8_t type, uint16_t size,
+ uint8_t * value)
+{
+ ChipLogProgress(DeviceLayer,
+ "endpointId " ChipLogFormatMEI " clusterId " ChipLogFormatMEI " attribute ID: " ChipLogFormatMEI
+ " Type: %u Value: %u, length %u",
+ ChipLogValueMEI(endpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId), type, *value, size);
+ switch (clusterId)
+ {
+ case Clusters::OnOff::Id:
+ OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
+ break;
+ }
+}
+
+void LaundryWasherApp::DeviceCallbacks::OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId,
+ chip::AttributeId attributeId, uint8_t * value)
+{
+ switch (attributeId)
+ {
+ case Clusters::OnOff::Attributes::OnOff::Id:
+ if ((value != nullptr) && (*value == true))
+ {
+ // Update the current mode to OnMode after device is on
+ ModeBase::Instance * modeInstance = LaundryWasherMode::Instance();
+
+ if (modeInstance != nullptr)
+ {
+ DataModel::Nullable mode = modeInstance->GetOnMode();
+ if (mode.IsNull() == false)
+ {
+ modeInstance->UpdateCurrentMode(mode.Value());
+ }
+ }
+ }
+ break;
+
+ default:;
+ }
+}
+
+// This returns an instance of this class.
+LaundryWasherApp::DeviceCallbacks & LaundryWasherApp::DeviceCallbacks::GetDefaultInstance()
+{
+ static LaundryWasherApp::DeviceCallbacks sDeviceCallbacks;
+ return sDeviceCallbacks;
+}
+
+chip::DeviceManager::CHIPDeviceManagerCallbacks & chip::NXP::App::GetDeviceCallbacks()
+{
+ return LaundryWasherApp::DeviceCallbacks::GetDefaultInstance();
+}
diff --git a/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp b/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp
new file mode 100644
index 00000000000000..0a26df6424b771
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 2021-2023 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 "AppTask.h"
+#include "CHIPDeviceManager.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include "laundry-washer-controls-delegate-impl.h"
+
+using namespace ::chip;
+
+void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value)
+{
+ chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
+ chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
+ if (cb != nullptr)
+ {
+ // propagate event to device manager
+ cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, type, size, value);
+ }
+}
+
+using namespace chip::app::Clusters::LaundryWasherControls;
+void emberAfLaundryWasherControlsClusterInitCallback(EndpointId endpoint)
+{
+ LaundryWasherControlsServer::SetDefaultDelegate(endpoint, &LaundryWasherControlDelegate::getLaundryWasherControlDelegate());
+}
diff --git a/examples/shell/nxp/k32w/k32w0/include/AppEvent.h b/examples/laundry-washer-app/nxp/common/main/include/AppEvent.h
similarity index 80%
rename from examples/shell/nxp/k32w/k32w0/include/AppEvent.h
rename to examples/laundry-washer-app/nxp/common/main/include/AppEvent.h
index 0e49456b8addd7..a0dad141a27055 100644
--- a/examples/shell/nxp/k32w/k32w0/include/AppEvent.h
+++ b/examples/laundry-washer-app/nxp/common/main/include/AppEvent.h
@@ -1,5 +1,5 @@
/*
- *
+ * Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2021 Nest Labs, Inc.
* All rights reserved.
*
@@ -19,27 +19,21 @@
#pragma once
struct AppEvent;
-typedef void (*EventHandler)(AppEvent *);
+using EventHandler = void (*)(const AppEvent &);
struct AppEvent
{
enum AppEventTypes
{
- kEventType_Button = 0,
- kEventType_Timer,
+ kEventType_Timer = 0,
kEventType_TurnOn,
kEventType_Install,
};
- AppEventTypes Type;
+ uint16_t Type;
union
{
- struct
- {
- uint8_t PinNo;
- uint8_t Action;
- } ButtonEvent;
struct
{
void * Context;
@@ -48,7 +42,7 @@ struct AppEvent
{
uint8_t Action;
int32_t Actor;
- } LightEvent;
+ } ClusterEvent;
};
EventHandler Handler;
diff --git a/examples/laundry-washer-app/nxp/common/main/include/AppTask.h b/examples/laundry-washer-app/nxp/common/main/include/AppTask.h
new file mode 100644
index 00000000000000..239328f8a1c7ba
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/include/AppTask.h
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2021-2023 Google LLC.
+ * Copyright 2024 NXP
+ * 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
+
+#if CONFIG_APP_FREERTOS_OS
+#include "AppTaskFreeRTOS.h"
+#else
+#include "AppTaskZephyr.h"
+#endif
+
+namespace LaundryWasherApp {
+#if CONFIG_APP_FREERTOS_OS
+class AppTask : public chip::NXP::App::AppTaskFreeRTOS
+#else
+class AppTask : public chip::NXP::App::AppTaskZephyr
+#endif
+{
+public:
+ ~AppTask() override{};
+ void PreInitMatterStack(void) override;
+ void PostInitMatterStack(void) override;
+ void AppMatter_RegisterCustomCliCommands(void) override;
+ // This returns an instance of this class.
+ static AppTask & GetDefaultInstance();
+
+private:
+ static AppTask sAppTask;
+};
+
+} // namespace LaundryWasherApp
+
+/**
+ * Returns the application-specific implementation of the AppTaskBase object.
+ *
+ * Applications can use this to gain access to features of the AppTaskBase
+ * that are specific to the selected application.
+ */
+chip::NXP::App::AppTaskBase & GetAppTask();
diff --git a/examples/laundry-washer-app/nxp/common/main/include/DeviceCallbacks.h b/examples/laundry-washer-app/nxp/common/main/include/DeviceCallbacks.h
new file mode 100644
index 00000000000000..0b16761b2f6f18
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/include/DeviceCallbacks.h
@@ -0,0 +1,53 @@
+/*
+ *
+ * Copyright (c) 2020-2023 Project CHIP Authors
+ * Copyright 2024 NXP
+ * 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 DeviceCallbacks.h
+ *
+ * Implementations for the DeviceManager callbacks for this application
+ *
+ **/
+
+#pragma once
+
+#include "CHIPDeviceManager.h"
+#include "CommonDeviceCallbacks.h"
+
+namespace LaundryWasherApp {
+class DeviceCallbacks : public chip::NXP::App::CommonDeviceCallbacks
+{
+public:
+ // This returns an instance of this class.
+ static DeviceCallbacks & GetDefaultInstance();
+ void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
+ uint8_t type, uint16_t size, uint8_t * value);
+
+private:
+ void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
+ void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
+};
+} // namespace LaundryWasherApp
+
+/**
+ * Returns the application-specific implementation of the CommonDeviceCallbacks object.
+ *
+ * Applications can use this to gain access to features of the CommonDeviceCallbacks
+ * that are specific to the selected application.
+ */
+chip::DeviceManager::CHIPDeviceManagerCallbacks & GetDeviceCallbacks();
diff --git a/examples/laundry-washer-app/nxp/common/main/include/operational-state-delegate-impl.h b/examples/laundry-washer-app/nxp/common/main/include/operational-state-delegate-impl.h
new file mode 100644
index 00000000000000..79f2695eb0a628
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/include/operational-state-delegate-impl.h
@@ -0,0 +1,120 @@
+/*
+ *
+ * Copyright (c) 2023 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
+
+#include
+#include
+#include
+
+namespace chip {
+namespace app {
+namespace Clusters {
+
+namespace OperationalState {
+
+// This is an application level delegate to handle operational state commands according to the specific business logic.
+class GenericOperationalStateDelegateImpl : public Delegate
+{
+public:
+ /**
+ * Get the countdown time. This attribute is not used in this application.
+ * @return The current countdown time.
+ */
+ app::DataModel::Nullable GetCountdownTime() override { return {}; };
+
+ /**
+ * Fills in the provided GenericOperationalState with the state at index `index` if there is one,
+ * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states.
+ * Note: This is used by the SDK to populate the operational state list attribute. If the contents of this list changes,
+ * the device SHALL call the Instance's ReportOperationalStateListChange method to report that this attribute has changed.
+ * @param index The index of the state, with 0 representing the first state.
+ * @param operationalState The GenericOperationalState is filled.
+ */
+ CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) override;
+
+ /**
+ * Fills in the provided MutableCharSpan with the phase at index `index` if there is one,
+ * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases.
+ *
+ * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null
+ * (there are no phases defined at all).
+ *
+ * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the
+ * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed.
+ * @param index The index of the phase, with 0 representing the first phase.
+ * @param operationalPhase The MutableCharSpan is filled.
+ */
+ CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override;
+
+ // command callback
+ /**
+ * Handle Command Callback in application: Pause
+ * @param[out] get operational error after callback.
+ */
+ void HandlePauseStateCallback(GenericOperationalError & err) override;
+
+ /**
+ * Handle Command Callback in application: Resume
+ * @param[out] get operational error after callback.
+ */
+ void HandleResumeStateCallback(GenericOperationalError & err) override;
+
+ /**
+ * Handle Command Callback in application: Start
+ * @param[out] get operational error after callback.
+ */
+ void HandleStartStateCallback(GenericOperationalError & err) override;
+
+ /**
+ * Handle Command Callback in application: Stop
+ * @param[out] get operational error after callback.
+ */
+ void HandleStopStateCallback(GenericOperationalError & err) override;
+
+protected:
+ Span mOperationalStateList;
+ Span mOperationalPhaseList;
+};
+
+// This is an application level delegate to handle operational state commands according to the specific business logic.
+class OperationalStateDelegate : public GenericOperationalStateDelegateImpl
+{
+private:
+ const GenericOperationalState opStateList[4] = {
+ GenericOperationalState(to_underlying(OperationalStateEnum::kStopped)),
+ GenericOperationalState(to_underlying(OperationalStateEnum::kRunning)),
+ GenericOperationalState(to_underlying(OperationalStateEnum::kPaused)),
+ GenericOperationalState(to_underlying(OperationalStateEnum::kError)),
+ };
+
+public:
+ OperationalStateDelegate()
+ {
+ GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList);
+ }
+};
+
+Instance * GetOperationalStateInstance();
+
+void Shutdown();
+
+} // namespace OperationalState
+} // namespace Clusters
+} // namespace app
+} // namespace chip
diff --git a/examples/laundry-washer-app/nxp/common/main/main.cpp b/examples/laundry-washer-app/nxp/common/main/main.cpp
new file mode 100644
index 00000000000000..b2aadab98ceb8b
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/main.cpp
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2021-2023 Google LLC.
+ * 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.
+ */
+
+// ================================================================================
+// Main Code
+// ================================================================================
+
+#include "FreeRTOS.h"
+#include
+#include
+#include
+
+#if configAPPLICATION_ALLOCATED_HEAP
+uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE];
+#endif
+
+using namespace ::chip::DeviceLayer;
+
+extern "C" int main(int argc, char * argv[])
+{
+ TaskHandle_t taskHandle;
+
+ PlatformMgrImpl().HardwareInit();
+ chip::NXP::App::GetAppTask().Start();
+ vTaskStartScheduler();
+}
+
+#if (defined(configCHECK_FOR_STACK_OVERFLOW) && (configCHECK_FOR_STACK_OVERFLOW > 0))
+void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName)
+{
+ assert(0);
+}
+#endif
diff --git a/examples/laundry-washer-app/nxp/common/main/operational-state-delegate-impl.cpp b/examples/laundry-washer-app/nxp/common/main/operational-state-delegate-impl.cpp
new file mode 100644
index 00000000000000..4a6608842c174d
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/common/main/operational-state-delegate-impl.cpp
@@ -0,0 +1,143 @@
+/*
+ *
+ * Copyright (c) 2023 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
+
+using namespace chip;
+using namespace chip::app;
+using namespace chip::app::Clusters;
+using namespace chip::app::Clusters::OperationalState;
+using namespace chip::app::Clusters::RvcOperationalState;
+
+CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState)
+{
+ if (index >= mOperationalStateList.size())
+ {
+ return CHIP_ERROR_NOT_FOUND;
+ }
+ operationalState = mOperationalStateList[index];
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase)
+{
+ if (index >= mOperationalPhaseList.size())
+ {
+ return CHIP_ERROR_NOT_FOUND;
+ }
+ return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase);
+}
+
+void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err)
+{
+ // placeholder implementation
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err)
+{
+ // placeholder implementation
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperationalError & err)
+{
+ uint8_t opState = GetInstance()->GetCurrentOperationalState();
+ if (opState == to_underlying(OperationalStateEnum::kError))
+ {
+ err.Set(to_underlying(ErrorStateEnum::kUnableToStartOrResume));
+ return;
+ }
+ // placeholder implementation
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperationalError & err)
+{
+ // placeholder implementation
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+// Init Operational State cluster
+
+static OperationalState::Instance * gOperationalStateInstance = nullptr;
+static OperationalStateDelegate * gOperationalStateDelegate = nullptr;
+
+OperationalState::Instance * OperationalState::GetOperationalStateInstance()
+{
+ return gOperationalStateInstance;
+}
+
+void OperationalState::Shutdown()
+{
+ if (gOperationalStateInstance != nullptr)
+ {
+ delete gOperationalStateInstance;
+ gOperationalStateInstance = nullptr;
+ }
+ if (gOperationalStateDelegate != nullptr)
+ {
+ delete gOperationalStateDelegate;
+ gOperationalStateDelegate = nullptr;
+ }
+}
+
+void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId)
+{
+ VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
+ VerifyOrDie(gOperationalStateInstance == nullptr && gOperationalStateDelegate == nullptr);
+
+ gOperationalStateDelegate = new OperationalStateDelegate;
+ EndpointId operationalStateEndpoint = 0x01;
+ gOperationalStateInstance = new OperationalState::Instance(gOperationalStateDelegate, operationalStateEndpoint);
+
+ gOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));
+
+ gOperationalStateInstance->Init();
+}
diff --git a/examples/lock-app/nxp/k32w/k32w0/.gn b/examples/laundry-washer-app/nxp/rt/rw61x/.gn
similarity index 85%
rename from examples/lock-app/nxp/k32w/k32w0/.gn
rename to examples/laundry-washer-app/nxp/rt/rw61x/.gn
index 3d48789e30ab3d..c0a26c2dc77832 100644
--- a/examples/lock-app/nxp/k32w/k32w0/.gn
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/.gn
@@ -1,4 +1,5 @@
# Copyright (c) 2020 Project CHIP Authors
+# Copyright 2023 NXP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,6 +14,7 @@
# limitations under the License.
import("//build_overrides/build.gni")
+import("//build_overrides/chip.gni")
# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
@@ -25,4 +27,7 @@ default_args = {
target_os = "freertos"
import("//args.gni")
+
+ # Import default platform configs
+ import("${chip_root}/src/platform/nxp/rt/rw61x/args.gni")
}
diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn
new file mode 100644
index 00000000000000..1a0e8f39d9c9a3
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn
@@ -0,0 +1,288 @@
+# Copyright (c) 2021 Project CHIP Authors
+# Copyright 2023 NXP
+#
+# 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("//build_overrides/nxp_sdk.gni")
+import("//build_overrides/openthread.gni")
+import("${chip_root}/src/platform/device.gni")
+
+#allows to get common NXP SDK gn options
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
+
+# Allows to get various RT gn options
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/rt_sdk.gni")
+
+import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni")
+import(
+ "${nxp_sdk_build_root}/${nxp_sdk_name}/${rt_platform}/${rt_platform}.gni")
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")
+
+assert(current_os == "freertos")
+assert(target_os == "freertos")
+assert(nxp_platform == "rt/rw61x")
+
+declare_args() {
+ # Allows to start the tcp download test app
+ tcp_download = false
+
+ # Allows to start the wifi connect test app
+ wifi_connect = false
+
+ # The 2 params below are used only if tcp_download or wifi_connect are true, otherwise they're unused.
+ wifi_ssid = ""
+ wifi_password = ""
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
+}
+
+example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}"
+common_example_dir = "${chip_root}/examples/platform/nxp/common"
+
+if (tcp_download == true && wifi_connect == true) {
+ assert("Cannot enable tcp_download and wifi_connect at the same time!")
+}
+
+# Use NXP custom zap files for laundry-washer device-type
+app_common_folder = "laundry-washer-app/nxp/zap"
+
+# Create here the SDK instance.
+# Particular sources/defines/includes could be added/changed depending on the target application.
+rt_sdk("sdk") {
+ defines = []
+
+ # To be moved, temporary mbedtls config fix to build app with factory data
+ if (chip_enable_secure_dac_private_key_storage == 1) {
+ defines += [
+ "MBEDTLS_NIST_KW_C",
+ "MBEDTLS_PSA_CRYPTO_CLIENT",
+ ]
+ }
+
+ cflags = []
+ public_deps = []
+ public_configs = []
+ sources = []
+ include_dirs = []
+
+ # Indicate paths to default board files
+ include_dirs += [ "${example_platform_dir}/board/" ]
+ sources += [ "${example_platform_dir}/board/pin_mux.c" ]
+ sources += [ "${example_platform_dir}/board/hardware_init.c" ]
+ sources += [ "${example_platform_dir}/board/clock_config.c" ]
+ sources += [ "${example_platform_dir}/board/board.c" ]
+ sources += [ "${example_platform_dir}/board/peripherals.c" ]
+
+ # Indicate the path to CHIPProjectConfig.h
+ include_dirs += [ "include/config" ]
+
+ # Indicate the default path to FreeRTOSConfig.h
+ include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ]
+
+ # Indicate the default path to OpenThreadConfig.h
+ include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ]
+
+ # For matter with BR feature, increase FreeRTOS heap size
+ if (chip_enable_wifi && chip_enable_openthread) {
+ defines += [ "configTOTAL_HEAP_SIZE=(size_t)(160 * 1024)" ]
+ }
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
+}
+
+# Create the SDK driver instance.
+# Particular sources/defines/includes could be added to add other drivers not available in the default sdk driver template
+rw61x_sdk_drivers("sdk_driver") {
+}
+
+rt_executable("laundry-washer") {
+ output_name = "chip-rw61x-laundry-washer-example"
+
+ defines = [
+ "CONFIG_RENDEZVOUS_MODE=7",
+ "CONFIG_APP_FREERTOS_OS=1",
+ ]
+
+ if (chip_enable_openthread) {
+ defines += [ "CONFIG_NET_L2_OPENTHREAD=1" ]
+ }
+
+ include_dirs = [
+ "../../common/main/include",
+ "../../common/main",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/include",
+ "${chip_root}/examples/providers/",
+ ]
+
+ sources = [
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
+ "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
+ "../../common/main/AppTask.cpp",
+ "../../common/main/DeviceCallbacks.cpp",
+ "../../common/main/ZclCallbacks.cpp",
+ "../../common/main/include/AppEvent.h",
+ "../../common/main/include/AppTask.h",
+ "../../common/main/include/DeviceCallbacks.h",
+ "../../common/main/main.cpp",
+ ]
+
+ if (chip_enable_secure_dac_private_key_storage == 1) {
+ sources += [
+ "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp",
+ ]
+ } else {
+ sources += [
+ "${common_example_dir}/factory_data/source/AppFactoryDataDefaultImpl.cpp",
+ ]
+ }
+
+ # App common files
+ include_dirs += [
+ "${common_example_dir}/icd/include",
+ "${common_example_dir}/matter_button/include",
+ "${common_example_dir}/matter_cli/include",
+ "${common_example_dir}/device_manager/include",
+ "${common_example_dir}/device_callbacks/include",
+ "${common_example_dir}/app_task/include",
+ "${common_example_dir}/factory_data/include",
+ ]
+
+ sources += [
+ "${common_example_dir}/app_task/source/AppTaskBase.cpp",
+ "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp",
+ "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp",
+ "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp",
+ "${common_example_dir}/icd/source/ICDUtil.cpp",
+ "${common_example_dir}/matter_button/source/AppMatterButtonEmpty.cpp",
+ "${common_example_dir}/matter_cli/source/AppMatterCli.cpp",
+ ]
+
+ deps = [ "${chip_root}/examples/${app_common_folder}" ]
+
+ sources += [
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
+ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
+ "../../common/main/operational-state-delegate-impl.cpp",
+ ]
+
+ if (chip_enable_matter_cli) {
+ defines += [ "ENABLE_CHIP_SHELL" ]
+ deps += [
+ "${chip_root}/examples/shell/shell_common:shell_common",
+ "${chip_root}/src/lib/shell:shell",
+ ]
+ }
+
+ if (chip_enable_ota_requestor) {
+ include_dirs += [ "${common_example_dir}/ota_requestor/include" ]
+ sources += [
+ "${common_example_dir}/ota_requestor/source/OTARequestorInitiator.cpp",
+ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorCommon.cpp",
+ ]
+ }
+
+ if (wifi_connect) {
+ defines += [
+ "WIFI_CONNECT_TASK=1",
+ "WIFI_CONNECT=1",
+ ]
+
+ if (!chip_enable_matter_cli) {
+ assert(wifi_ssid != "" && wifi_password != "",
+ "WiFi SSID and password must be specified at build time!")
+ }
+
+ if (wifi_ssid != "") {
+ defines += [ "WIFI_SSID=\"${wifi_ssid}\"" ]
+ }
+
+ if (wifi_password != "") {
+ defines += [ "WIFI_PASSWORD=\"${wifi_password}\"" ]
+ }
+
+ include_dirs += [ "${common_example_dir}/wifi_connect/include" ]
+ sources += [ "${common_example_dir}/wifi_connect/source/WifiConnect.cpp" ]
+ }
+
+ if (tcp_download) {
+ defines += [ "CONFIG_CHIP_TCP_DOWNLOAD=1" ]
+ defines += [
+ "WIFI_CONNECT=1",
+ "WIFI_SSID=\"${wifi_ssid}\"",
+ "WIFI_PASSWORD=\"${wifi_password}\"",
+ ]
+
+ include_dirs += [ "${common_example_dir}/tcp_download_test/include" ]
+ sources +=
+ [ "${common_example_dir}/tcp_download_test/source/TcpDownload.cpp" ]
+ }
+
+ # In case a dedicated assert function needs to be supported the flag sdk_fsl_assert_support should be set to false
+ # The would add to the build a dedicated application assert implementation.
+ if (!sdk_fsl_assert_support) {
+ sources += [ "${common_example_dir}/app_assert/source/AppAssert.cpp" ]
+ }
+
+ cflags = [ "-Wconversion" ]
+
+ ldscript = "${example_platform_dir}/app/ldscripts/RW610_flash.ld"
+
+ inputs = [ ldscript ]
+
+ ldflags = [
+ "-T" + rebase_path(ldscript, root_build_dir),
+ "-fno-common",
+ "-Wl,--defsym=__stack_size__=2048",
+ "-ffreestanding",
+ "-fno-builtin",
+ "-mapcs",
+ "-u qspiflash_config",
+ "-u image_vector_table",
+ "-u boot_data",
+ "-u dcd_data",
+ "-Wl,-print-memory-usage",
+ "-Wl,--no-warn-rwx-segments",
+ ]
+
+ if (chip_enable_ota_requestor) {
+ if (no_mcuboot) {
+ # If "no_mcuboot" is set to true, the application will be linked at the base of the flash.
+ print(
+ "Warning : The OTA Requestor is enabled without MCUBoot. This will prevent the application from applying software updates.")
+ } else {
+ # we need to reserve enough space for the bootloader (MCUBoot)
+ # MCUBoot requires 0x20000 Bytes to be reserved at the base of the flash
+ # Consequently, some sections will need to be shifted
+ ldflags += [ "-Wl,--defsym=__m_mcuboot_size__=0x20000" ]
+ }
+ }
+
+ output_dir = root_out_dir
+}
+
+group("rw61x") {
+ deps = [ ":laundry-washer" ]
+}
+
+group("default") {
+ deps = [ ":rw61x" ]
+}
diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/README.md b/examples/laundry-washer-app/nxp/rt/rw61x/README.md
new file mode 100644
index 00000000000000..e6165a33292b1e
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/README.md
@@ -0,0 +1,5 @@
+# CHIP RW61x Laundry washer Application
+
+All instructions describing how to use a Matter application on NXP RW61x can be
+found in [README.md](../../../../all-clusters-app/nxp/rt/rw61x/README.md) root
+readme
diff --git a/examples/build_overrides/k32w0_sdk.gni b/examples/laundry-washer-app/nxp/rt/rw61x/args.gni
similarity index 69%
rename from examples/build_overrides/k32w0_sdk.gni
rename to examples/laundry-washer-app/nxp/rt/rw61x/args.gni
index e77b63d1e02fa9..c2d91a5db7bae7 100644
--- a/examples/build_overrides/k32w0_sdk.gni
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/args.gni
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Project CHIP Authors
+# 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.
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-declare_args() {
- # Root directory for k32w SDK.
- k32w0_sdk_build_root =
- "//third_party/connectedhomeip/third_party/nxp/k32w0_sdk"
-}
+import("//build_overrides/chip.gni")
+
+# SDK target definitions
+nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain")
+nxp_sdk_driver_target = get_label_info(":sdk_driver", "label_no_toolchain")
diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/build_overrides b/examples/laundry-washer-app/nxp/rt/rw61x/build_overrides
new file mode 120000
index 00000000000000..f10867042f4d19
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/build_overrides
@@ -0,0 +1 @@
+../../../../build_overrides
\ No newline at end of file
diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h b/examples/laundry-washer-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h
new file mode 100644
index 00000000000000..2653e97705fe39
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2020 Google LLC.
+ * Copyright 2023 NXP
+ * 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
+
+/*
+ * Tells to the platform Factory Data Provider whether to use the example configuration or real/provisioned data.
+ */
+#ifndef CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA
+#define CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA 0
+#endif
+
+/**
+ * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
+ *
+ * 0xFFF1: Test vendor.
+ */
+#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1
+
+/**
+ * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
+ *
+ */
+#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005
+
+#if !CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA
+// Use a default pairing code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
+#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
+#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
+
+// Use a default pairing code if one hasn't been provisioned in flash.
+#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"
+
+/**
+ * CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER
+ *
+ * Enables the use of a hard-coded default serial number if none
+ * is found in CHIP NV storage.
+ */
+#define CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER "DUMMY_SN"
+
+#endif /* !CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA */
+
+/**
+ * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
+ *
+ * The hardware version number assigned to device or product by the device vendor. This
+ * number is scoped to the device product id, and typically corresponds to a revision of the
+ * physical device, a change to its packaging, and/or a change to its marketing presentation.
+ * This value is generally *not* incremented for device software versions.
+ */
+#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100
+
+#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING
+#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0"
+#endif
+
+/**
+ * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
+ *
+ * A string identifying the software version running on the device.
+ * CHIP currently expects the software version to be in the format
+ * {MAJOR_VERSION}.0d{MINOR_VERSION}
+ */
+#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
+#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
+#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME
+#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors"
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME
+#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App"
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION
+//-> format_version = 1
+//-> vendor_id = 0xFFF1
+//-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B,
+// 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A,
+// 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029,
+// 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038,
+// 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047,
+// 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056,
+// 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ]
+//-> device_type_id = 0x0016
+//-> certificate_id = "ZIG20142ZB330003-24"
+//-> security_level = 0
+//-> security_information = 0
+//-> version_number = 0x2694
+//-> certification_type = 0
+//-> dac_origin_vendor_id is not present
+//-> dac_origin_product_id is not present
+#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
+ { \
+ 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, \
+ 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, \
+ 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, \
+ 0x01, 0x62, 0x04, 0x82, 0x01, 0x5e, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, \
+ 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, \
+ 0x07, 0x80, 0x05, 0x08, 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, \
+ 0x80, 0x05, 0x0e, 0x80, 0x05, 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, \
+ 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, \
+ 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, \
+ 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, \
+ 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, \
+ 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, \
+ 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, \
+ 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, \
+ 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, \
+ 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, 0x4b, 0x80, 0x05, 0x4c, 0x80, \
+ 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, 0x05, 0x52, 0x80, 0x05, \
+ 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, 0x80, 0x05, 0x59, \
+ 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, 0x5f, 0x80, \
+ 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, 0x13, \
+ 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, \
+ 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, \
+ 0x01, 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, \
+ 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \
+ 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x24, 0xe5, \
+ 0xd1, 0xf4, 0x7a, 0x7d, 0x7b, 0x0d, 0x20, 0x6a, 0x26, 0xef, 0x69, 0x9b, 0x7c, 0x97, 0x57, 0xb7, 0x2d, 0x46, 0x90, \
+ 0x89, 0xde, 0x31, 0x92, 0xe6, 0x78, 0xc7, 0x45, 0xe7, 0xf6, 0x0c, 0x02, 0x21, 0x00, 0xf8, 0xaa, 0x2f, 0xa7, 0x11, \
+ 0xfc, 0xb7, 0x9b, 0x97, 0xe3, 0x97, 0xce, 0xda, 0x66, 0x7b, 0xae, 0x46, 0x4e, 0x2b, 0xd3, 0xff, 0xdf, 0xc3, 0xcc, \
+ 0xed, 0x7a, 0xa8, 0xca, 0x5f, 0x4c, 0x1a, 0x7c \
+ }
+#endif
+
+/**
+ * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC
+ *
+ * Enables synchronizing the device's real time clock with a remote CHIP Time service
+ * using the CHIP Time Sync protocol.
+ */
+// #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1
+
+/**
+ * CHIP_CONFIG_MAX_BINDINGS
+ *
+ * Maximum number of simultaneously active bindings per ChipExchangeManager
+ * 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
+ * in the worst case. Keeping another 4 as buffer.
+ */
+#define CHIP_CONFIG_MAX_BINDINGS 6
+
+/**
+ * CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
+ *
+ * Select the ability to offload event logs to any interested subscribers using WDM.
+ */
+#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1
+
+/**
+ * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
+ *
+ * Enable recording UTC timestamps.
+ */
+#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1
+
+/**
+ * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
+ *
+ * A size, in bytes, of the individual debug event logging buffer.
+ */
+#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)
+
+/**
+ * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE
+ *
+ * For a development build, set the default importance of events to be logged as Debug.
+ * Since debug is the lowest importance level, this means all standard, critical, info and
+ * debug importance level vi events get logged.
+ */
+#if BUILD_RELEASE
+#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production
+#else
+#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug
+#endif // BUILD_RELEASE
+
+/* Increasing the retransmission interval of the MRP messages after subsequent failures */
+#ifndef CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
+#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32)
+#endif
diff --git a/examples/lock-app/nxp/k32w/k32w0/third_party/connectedhomeip b/examples/laundry-washer-app/nxp/rt/rw61x/third_party/connectedhomeip
similarity index 100%
rename from examples/lock-app/nxp/k32w/k32w0/third_party/connectedhomeip
rename to examples/laundry-washer-app/nxp/rt/rw61x/third_party/connectedhomeip
diff --git a/build_overrides/k32w0_sdk.gni b/examples/laundry-washer-app/nxp/zap/BUILD.gn
similarity index 70%
rename from build_overrides/k32w0_sdk.gni
rename to examples/laundry-washer-app/nxp/zap/BUILD.gn
index fa487e9e7fb254..d0a891b637617a 100644
--- a/build_overrides/k32w0_sdk.gni
+++ b/examples/laundry-washer-app/nxp/zap/BUILD.gn
@@ -1,4 +1,5 @@
# Copyright (c) 2020 Project CHIP Authors
+# Copyright 2023 NXP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-declare_args() {
- # Root directory for K32W SDK build files.
- k32w0_sdk_build_root = "//third_party/nxp/k32w0_sdk"
+import("//build_overrides/chip.gni")
+
+import("${chip_root}/src/app/chip_data_model.gni")
+
+import("${chip_root}/src/platform/device.gni")
+
+chip_data_model("zap") {
+ zap_file = "laundry-washer-app.zap"
+ is_server = true
}
diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter
new file mode 100644
index 00000000000000..da2c45a674c038
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter
@@ -0,0 +1,2342 @@
+// This IDL was generated automatically by ZAP.
+// It is for view/code review purposes only.
+
+/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
+cluster Identify = 3 {
+ revision 4;
+
+ enum EffectIdentifierEnum : enum8 {
+ kBlink = 0;
+ kBreathe = 1;
+ kOkay = 2;
+ kChannelChange = 11;
+ kFinishEffect = 254;
+ kStopEffect = 255;
+ }
+
+ enum EffectVariantEnum : enum8 {
+ kDefault = 0;
+ }
+
+ enum IdentifyTypeEnum : enum8 {
+ kNone = 0;
+ kLightOutput = 1;
+ kVisibleIndicator = 2;
+ kAudibleBeep = 3;
+ kDisplay = 4;
+ kActuator = 5;
+ }
+
+ attribute int16u identifyTime = 0;
+ readonly attribute IdentifyTypeEnum identifyType = 1;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct IdentifyRequest {
+ int16u identifyTime = 0;
+ }
+
+ request struct TriggerEffectRequest {
+ EffectIdentifierEnum effectIdentifier = 0;
+ EffectVariantEnum effectVariant = 1;
+ }
+
+ /** Command description for Identify */
+ command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0;
+ /** Command description for TriggerEffect */
+ command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
+}
+
+/** Attributes and commands for group configuration and manipulation. */
+cluster Groups = 4 {
+ revision 4;
+
+ bitmap Feature : bitmap32 {
+ kGroupNames = 0x1;
+ }
+
+ bitmap NameSupportBitmap : bitmap8 {
+ kGroupNames = 0x80;
+ }
+
+ readonly attribute NameSupportBitmap nameSupport = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct AddGroupRequest {
+ group_id groupID = 0;
+ char_string<16> groupName = 1;
+ }
+
+ response struct AddGroupResponse = 0 {
+ enum8 status = 0;
+ group_id groupID = 1;
+ }
+
+ request struct ViewGroupRequest {
+ group_id groupID = 0;
+ }
+
+ response struct ViewGroupResponse = 1 {
+ enum8 status = 0;
+ group_id groupID = 1;
+ char_string<16> groupName = 2;
+ }
+
+ request struct GetGroupMembershipRequest {
+ group_id groupList[] = 0;
+ }
+
+ response struct GetGroupMembershipResponse = 2 {
+ nullable int8u capacity = 0;
+ group_id groupList[] = 1;
+ }
+
+ request struct RemoveGroupRequest {
+ group_id groupID = 0;
+ }
+
+ response struct RemoveGroupResponse = 3 {
+ enum8 status = 0;
+ group_id groupID = 1;
+ }
+
+ request struct AddGroupIfIdentifyingRequest {
+ group_id groupID = 0;
+ char_string<16> groupName = 1;
+ }
+
+ /** Command description for AddGroup */
+ fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0;
+ /** Command description for ViewGroup */
+ fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1;
+ /** Command description for GetGroupMembership */
+ fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2;
+ /** Command description for RemoveGroup */
+ fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3;
+ /** Command description for RemoveAllGroups */
+ fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4;
+ /** Command description for AddGroupIfIdentifying */
+ fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5;
+}
+
+/** Attributes and commands for switching devices between 'On' and 'Off' states. */
+cluster OnOff = 6 {
+ revision 6;
+
+ enum DelayedAllOffEffectVariantEnum : enum8 {
+ kDelayedOffFastFade = 0;
+ kNoFade = 1;
+ kDelayedOffSlowFade = 2;
+ }
+
+ enum DyingLightEffectVariantEnum : enum8 {
+ kDyingLightFadeOff = 0;
+ }
+
+ enum EffectIdentifierEnum : enum8 {
+ kDelayedAllOff = 0;
+ kDyingLight = 1;
+ }
+
+ enum StartUpOnOffEnum : enum8 {
+ kOff = 0;
+ kOn = 1;
+ kToggle = 2;
+ }
+
+ bitmap Feature : bitmap32 {
+ kLighting = 0x1;
+ kDeadFrontBehavior = 0x2;
+ kOffOnly = 0x4;
+ }
+
+ bitmap OnOffControlBitmap : bitmap8 {
+ kAcceptOnlyWhenOn = 0x1;
+ }
+
+ readonly attribute boolean onOff = 0;
+ readonly attribute optional boolean globalSceneControl = 16384;
+ attribute optional int16u onTime = 16385;
+ attribute optional int16u offWaitTime = 16386;
+ attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct OffWithEffectRequest {
+ EffectIdentifierEnum effectIdentifier = 0;
+ enum8 effectVariant = 1;
+ }
+
+ request struct OnWithTimedOffRequest {
+ OnOffControlBitmap onOffControl = 0;
+ int16u onTime = 1;
+ int16u offWaitTime = 2;
+ }
+
+ /** On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime attribute SHALL be set to 0. */
+ command Off(): DefaultSuccess = 0;
+ /** On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is recommended that it is used for power on or similar functions. On receipt of the On command, if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. */
+ command On(): DefaultSuccess = 1;
+ /** On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise, if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime attribute SHALL be set to 0. */
+ command Toggle(): DefaultSuccess = 2;
+ /** The OffWithEffect command allows devices to be turned off using enhanced ways of fading. */
+ command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64;
+ /** The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off. */
+ command OnWithRecallGlobalScene(): DefaultSuccess = 65;
+ /** The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received during this time, are prevented from turning the devices back on. */
+ command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66;
+}
+
+/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
+cluster Descriptor = 29 {
+ revision 2;
+
+ bitmap Feature : bitmap32 {
+ kTagList = 0x1;
+ }
+
+ struct DeviceTypeStruct {
+ devtype_id deviceType = 0;
+ int16u revision = 1;
+ }
+
+ struct SemanticTagStruct {
+ nullable vendor_id mfgCode = 0;
+ enum8 namespaceID = 1;
+ enum8 tag = 2;
+ optional nullable char_string label = 3;
+ }
+
+ readonly attribute DeviceTypeStruct deviceTypeList[] = 0;
+ readonly attribute cluster_id serverList[] = 1;
+ readonly attribute cluster_id clientList[] = 2;
+ readonly attribute endpoint_no partsList[] = 3;
+ readonly attribute optional SemanticTagStruct tagList[] = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */
+cluster Binding = 30 {
+ revision 1; // NOTE: Default/not specifically set
+
+ fabric_scoped struct TargetStruct {
+ optional node_id node = 1;
+ optional group_id group = 2;
+ optional endpoint_no endpoint = 3;
+ optional cluster_id cluster = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ attribute access(write: manage) TargetStruct binding[] = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** The Access Control Cluster exposes a data model view of a
+ Node's Access Control List (ACL), which codifies the rules used to manage
+ and enforce Access Control for the Node's endpoints and their associated
+ cluster instances. */
+cluster AccessControl = 31 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum AccessControlEntryAuthModeEnum : enum8 {
+ kPASE = 1;
+ kCASE = 2;
+ kGroup = 3;
+ }
+
+ enum AccessControlEntryPrivilegeEnum : enum8 {
+ kView = 1;
+ kProxyView = 2;
+ kOperate = 3;
+ kManage = 4;
+ kAdminister = 5;
+ }
+
+ enum ChangeTypeEnum : enum8 {
+ kChanged = 0;
+ kAdded = 1;
+ kRemoved = 2;
+ }
+
+ struct AccessControlTargetStruct {
+ nullable cluster_id cluster = 0;
+ nullable endpoint_no endpoint = 1;
+ nullable devtype_id deviceType = 2;
+ }
+
+ fabric_scoped struct AccessControlEntryStruct {
+ fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
+ fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
+ nullable fabric_sensitive int64u subjects[] = 3;
+ nullable fabric_sensitive AccessControlTargetStruct targets[] = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct AccessControlExtensionStruct {
+ fabric_sensitive octet_string<128> data = 1;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
+ nullable node_id adminNodeID = 1;
+ nullable int16u adminPasscodeID = 2;
+ ChangeTypeEnum changeType = 3;
+ nullable AccessControlEntryStruct latestValue = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
+ nullable node_id adminNodeID = 1;
+ nullable int16u adminPasscodeID = 2;
+ ChangeTypeEnum changeType = 3;
+ nullable AccessControlExtensionStruct latestValue = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
+ attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1;
+ readonly attribute int16u subjectsPerAccessControlEntry = 2;
+ readonly attribute int16u targetsPerAccessControlEntry = 3;
+ readonly attribute int16u accessControlEntriesPerFabric = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** This cluster provides attributes and events for determining basic information about Nodes, which supports both
+ Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number,
+ which apply to the whole Node. Also allows setting user device information such as location. */
+cluster BasicInformation = 40 {
+ revision 3;
+
+ enum ColorEnum : enum8 {
+ kBlack = 0;
+ kNavy = 1;
+ kGreen = 2;
+ kTeal = 3;
+ kMaroon = 4;
+ kPurple = 5;
+ kOlive = 6;
+ kGray = 7;
+ kBlue = 8;
+ kLime = 9;
+ kAqua = 10;
+ kRed = 11;
+ kFuchsia = 12;
+ kYellow = 13;
+ kWhite = 14;
+ kNickel = 15;
+ kChrome = 16;
+ kBrass = 17;
+ kCopper = 18;
+ kSilver = 19;
+ kGold = 20;
+ }
+
+ enum ProductFinishEnum : enum8 {
+ kOther = 0;
+ kMatte = 1;
+ kSatin = 2;
+ kPolished = 3;
+ kRugged = 4;
+ kFabric = 5;
+ }
+
+ struct CapabilityMinimaStruct {
+ int16u caseSessionsPerFabric = 0;
+ int16u subscriptionsPerFabric = 1;
+ }
+
+ struct ProductAppearanceStruct {
+ ProductFinishEnum finish = 0;
+ nullable ColorEnum primaryColor = 1;
+ }
+
+ critical event StartUp = 0 {
+ int32u softwareVersion = 0;
+ }
+
+ critical event ShutDown = 1 {
+ }
+
+ info event Leave = 2 {
+ fabric_idx fabricIndex = 0;
+ }
+
+ info event ReachableChanged = 3 {
+ boolean reachableNewValue = 0;
+ }
+
+ readonly attribute int16u dataModelRevision = 0;
+ readonly attribute char_string<32> vendorName = 1;
+ readonly attribute vendor_id vendorID = 2;
+ readonly attribute char_string<32> productName = 3;
+ readonly attribute int16u productID = 4;
+ attribute access(write: manage) char_string<32> nodeLabel = 5;
+ attribute access(write: administer) char_string<2> location = 6;
+ readonly attribute int16u hardwareVersion = 7;
+ readonly attribute char_string<64> hardwareVersionString = 8;
+ readonly attribute int32u softwareVersion = 9;
+ readonly attribute char_string<64> softwareVersionString = 10;
+ readonly attribute optional char_string<16> manufacturingDate = 11;
+ readonly attribute optional char_string<32> partNumber = 12;
+ readonly attribute optional long_char_string<256> productURL = 13;
+ readonly attribute optional char_string<64> productLabel = 14;
+ readonly attribute optional char_string<32> serialNumber = 15;
+ attribute access(write: manage) optional boolean localConfigDisabled = 16;
+ readonly attribute optional boolean reachable = 17;
+ readonly attribute optional char_string<32> uniqueID = 18;
+ readonly attribute CapabilityMinimaStruct capabilityMinima = 19;
+ readonly attribute optional ProductAppearanceStruct productAppearance = 20;
+ readonly attribute int32u specificationVersion = 21;
+ readonly attribute int16u maxPathsPerInvoke = 22;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ command MfgSpecificPing(): DefaultSuccess = 0;
+}
+
+/** Provides an interface for providing OTA software updates */
+cluster OtaSoftwareUpdateProvider = 41 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum ApplyUpdateActionEnum : enum8 {
+ kProceed = 0;
+ kAwaitNextAction = 1;
+ kDiscontinue = 2;
+ }
+
+ enum DownloadProtocolEnum : enum8 {
+ kBDXSynchronous = 0;
+ kBDXAsynchronous = 1;
+ kHTTPS = 2;
+ kVendorSpecific = 3;
+ }
+
+ enum StatusEnum : enum8 {
+ kUpdateAvailable = 0;
+ kBusy = 1;
+ kNotAvailable = 2;
+ kDownloadProtocolNotSupported = 3;
+ }
+
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct QueryImageRequest {
+ vendor_id vendorID = 0;
+ int16u productID = 1;
+ int32u softwareVersion = 2;
+ DownloadProtocolEnum protocolsSupported[] = 3;
+ optional int16u hardwareVersion = 4;
+ optional char_string<2> location = 5;
+ optional boolean requestorCanConsent = 6;
+ optional octet_string<512> metadataForProvider = 7;
+ }
+
+ response struct QueryImageResponse = 1 {
+ StatusEnum status = 0;
+ optional int32u delayedActionTime = 1;
+ optional char_string<256> imageURI = 2;
+ optional int32u softwareVersion = 3;
+ optional char_string<64> softwareVersionString = 4;
+ optional octet_string<32> updateToken = 5;
+ optional boolean userConsentNeeded = 6;
+ optional octet_string<512> metadataForRequestor = 7;
+ }
+
+ request struct ApplyUpdateRequestRequest {
+ octet_string<32> updateToken = 0;
+ int32u newVersion = 1;
+ }
+
+ response struct ApplyUpdateResponse = 3 {
+ ApplyUpdateActionEnum action = 0;
+ int32u delayedActionTime = 1;
+ }
+
+ request struct NotifyUpdateAppliedRequest {
+ octet_string<32> updateToken = 0;
+ int32u softwareVersion = 1;
+ }
+
+ /** Determine availability of a new Software Image */
+ command QueryImage(QueryImageRequest): QueryImageResponse = 0;
+ /** Determine next action to take for a downloaded Software Image */
+ command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2;
+ /** Notify OTA Provider that an update was applied */
+ command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4;
+}
+
+/** Provides an interface for downloading and applying OTA software updates */
+cluster OtaSoftwareUpdateRequestor = 42 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum AnnouncementReasonEnum : enum8 {
+ kSimpleAnnouncement = 0;
+ kUpdateAvailable = 1;
+ kUrgentUpdateAvailable = 2;
+ }
+
+ enum ChangeReasonEnum : enum8 {
+ kUnknown = 0;
+ kSuccess = 1;
+ kFailure = 2;
+ kTimeOut = 3;
+ kDelayByProvider = 4;
+ }
+
+ enum UpdateStateEnum : enum8 {
+ kUnknown = 0;
+ kIdle = 1;
+ kQuerying = 2;
+ kDelayedOnQuery = 3;
+ kDownloading = 4;
+ kApplying = 5;
+ kDelayedOnApply = 6;
+ kRollingBack = 7;
+ kDelayedOnUserConsent = 8;
+ }
+
+ fabric_scoped struct ProviderLocation {
+ node_id providerNodeID = 1;
+ endpoint_no endpoint = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ info event StateTransition = 0 {
+ UpdateStateEnum previousState = 0;
+ UpdateStateEnum newState = 1;
+ ChangeReasonEnum reason = 2;
+ nullable int32u targetSoftwareVersion = 3;
+ }
+
+ critical event VersionApplied = 1 {
+ int32u softwareVersion = 0;
+ int16u productID = 1;
+ }
+
+ info event DownloadError = 2 {
+ int32u softwareVersion = 0;
+ int64u bytesDownloaded = 1;
+ nullable int8u progressPercent = 2;
+ nullable int64s platformCode = 3;
+ }
+
+ attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0;
+ readonly attribute boolean updatePossible = 1;
+ readonly attribute UpdateStateEnum updateState = 2;
+ readonly attribute nullable int8u updateStateProgress = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct AnnounceOTAProviderRequest {
+ node_id providerNodeID = 0;
+ vendor_id vendorID = 1;
+ AnnouncementReasonEnum announcementReason = 2;
+ optional octet_string<512> metadataForNode = 3;
+ endpoint_no endpoint = 4;
+ }
+
+ /** Announce the presence of an OTA Provider */
+ command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0;
+}
+
+/** Nodes should be expected to be deployed to any and all regions of the world. These global regions
+ may have differing common languages, units of measurements, and numerical formatting
+ standards. As such, Nodes that visually or audibly convey information need a mechanism by which
+ they can be configured to use a user’s preferred language, units, etc */
+cluster LocalizationConfiguration = 43 {
+ revision 1; // NOTE: Default/not specifically set
+
+ attribute access(write: manage) char_string<35> activeLocale = 0;
+ readonly attribute char_string supportedLocales[] = 1;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** Nodes should be expected to be deployed to any and all regions of the world. These global regions
+ may have differing preferences for how dates and times are conveyed. As such, Nodes that visually
+ or audibly convey time information need a mechanism by which they can be configured to use a
+ user’s preferred format. */
+cluster TimeFormatLocalization = 44 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CalendarTypeEnum : enum8 {
+ kBuddhist = 0;
+ kChinese = 1;
+ kCoptic = 2;
+ kEthiopian = 3;
+ kGregorian = 4;
+ kHebrew = 5;
+ kIndian = 6;
+ kIslamic = 7;
+ kJapanese = 8;
+ kKorean = 9;
+ kPersian = 10;
+ kTaiwanese = 11;
+ kUseActiveLocale = 255;
+ }
+
+ enum HourFormatEnum : enum8 {
+ k12hr = 0;
+ k24hr = 1;
+ kUseActiveLocale = 255;
+ }
+
+ bitmap Feature : bitmap32 {
+ kCalendarFormat = 0x1;
+ }
+
+ attribute access(write: manage) HourFormatEnum hourFormat = 0;
+ attribute access(write: manage) optional CalendarTypeEnum activeCalendarType = 1;
+ readonly attribute optional CalendarTypeEnum supportedCalendarTypes[] = 2;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** Nodes should be expected to be deployed to any and all regions of the world. These global regions
+ may have differing preferences for the units in which values are conveyed in communication to a
+ user. As such, Nodes that visually or audibly convey measurable values to the user need a
+ mechanism by which they can be configured to use a user’s preferred unit. */
+cluster UnitLocalization = 45 {
+ revision 1;
+
+ enum TempUnitEnum : enum8 {
+ kFahrenheit = 0;
+ kCelsius = 1;
+ kKelvin = 2;
+ }
+
+ bitmap Feature : bitmap32 {
+ kTemperatureUnit = 0x1;
+ }
+
+ attribute access(write: manage) optional TempUnitEnum temperatureUnit = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
+cluster PowerSource = 47 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum BatApprovedChemistryEnum : enum16 {
+ kUnspecified = 0;
+ kAlkaline = 1;
+ kLithiumCarbonFluoride = 2;
+ kLithiumChromiumOxide = 3;
+ kLithiumCopperOxide = 4;
+ kLithiumIronDisulfide = 5;
+ kLithiumManganeseDioxide = 6;
+ kLithiumThionylChloride = 7;
+ kMagnesium = 8;
+ kMercuryOxide = 9;
+ kNickelOxyhydride = 10;
+ kSilverOxide = 11;
+ kZincAir = 12;
+ kZincCarbon = 13;
+ kZincChloride = 14;
+ kZincManganeseDioxide = 15;
+ kLeadAcid = 16;
+ kLithiumCobaltOxide = 17;
+ kLithiumIon = 18;
+ kLithiumIonPolymer = 19;
+ kLithiumIronPhosphate = 20;
+ kLithiumSulfur = 21;
+ kLithiumTitanate = 22;
+ kNickelCadmium = 23;
+ kNickelHydrogen = 24;
+ kNickelIron = 25;
+ kNickelMetalHydride = 26;
+ kNickelZinc = 27;
+ kSilverZinc = 28;
+ kSodiumIon = 29;
+ kSodiumSulfur = 30;
+ kZincBromide = 31;
+ kZincCerium = 32;
+ }
+
+ enum BatChargeFaultEnum : enum8 {
+ kUnspecified = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevelEnum : enum8 {
+ kOK = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeStateEnum : enum8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatCommonDesignationEnum : enum16 {
+ kUnspecified = 0;
+ kAAA = 1;
+ kAA = 2;
+ kC = 3;
+ kD = 4;
+ k4v5 = 5;
+ k6v0 = 6;
+ k9v0 = 7;
+ k12AA = 8;
+ kAAAA = 9;
+ kA = 10;
+ kB = 11;
+ kF = 12;
+ kN = 13;
+ kNo6 = 14;
+ kSubC = 15;
+ kA23 = 16;
+ kA27 = 17;
+ kBA5800 = 18;
+ kDuplex = 19;
+ k4SR44 = 20;
+ k523 = 21;
+ k531 = 22;
+ k15v0 = 23;
+ k22v5 = 24;
+ k30v0 = 25;
+ k45v0 = 26;
+ k67v5 = 27;
+ kJ = 28;
+ kCR123A = 29;
+ kCR2 = 30;
+ k2CR5 = 31;
+ kCRP2 = 32;
+ kCRV3 = 33;
+ kSR41 = 34;
+ kSR43 = 35;
+ kSR44 = 36;
+ kSR45 = 37;
+ kSR48 = 38;
+ kSR54 = 39;
+ kSR55 = 40;
+ kSR57 = 41;
+ kSR58 = 42;
+ kSR59 = 43;
+ kSR60 = 44;
+ kSR63 = 45;
+ kSR64 = 46;
+ kSR65 = 47;
+ kSR66 = 48;
+ kSR67 = 49;
+ kSR68 = 50;
+ kSR69 = 51;
+ kSR516 = 52;
+ kSR731 = 53;
+ kSR712 = 54;
+ kLR932 = 55;
+ kA5 = 56;
+ kA10 = 57;
+ kA13 = 58;
+ kA312 = 59;
+ kA675 = 60;
+ kAC41E = 61;
+ k10180 = 62;
+ k10280 = 63;
+ k10440 = 64;
+ k14250 = 65;
+ k14430 = 66;
+ k14500 = 67;
+ k14650 = 68;
+ k15270 = 69;
+ k16340 = 70;
+ kRCR123A = 71;
+ k17500 = 72;
+ k17670 = 73;
+ k18350 = 74;
+ k18500 = 75;
+ k18650 = 76;
+ k19670 = 77;
+ k25500 = 78;
+ k26650 = 79;
+ k32600 = 80;
+ }
+
+ enum BatFaultEnum : enum8 {
+ kUnspecified = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceabilityEnum : enum8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatusEnum : enum8 {
+ kUnspecified = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentTypeEnum : enum8 {
+ kAC = 0;
+ kDC = 1;
+ }
+
+ enum WiredFaultEnum : enum8 {
+ kUnspecified = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
+ bitmap Feature : bitmap32 {
+ kWired = 0x1;
+ kBattery = 0x2;
+ kRechargeable = 0x4;
+ kReplaceable = 0x8;
+ }
+
+ struct BatChargeFaultChangeType {
+ BatChargeFaultEnum current[] = 0;
+ BatChargeFaultEnum previous[] = 1;
+ }
+
+ struct BatFaultChangeType {
+ BatFaultEnum current[] = 0;
+ BatFaultEnum previous[] = 1;
+ }
+
+ struct WiredFaultChangeType {
+ WiredFaultEnum current[] = 0;
+ WiredFaultEnum previous[] = 1;
+ }
+
+ info event WiredFaultChange = 0 {
+ WiredFaultEnum current[] = 0;
+ WiredFaultEnum previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFaultEnum current[] = 0;
+ BatFaultEnum previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFaultEnum current[] = 0;
+ BatChargeFaultEnum previous[] = 1;
+ }
+
+ readonly attribute PowerSourceStatusEnum status = 0;
+ readonly attribute int8u order = 1;
+ readonly attribute char_string<60> description = 2;
+ readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3;
+ readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4;
+ readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5;
+ readonly attribute optional nullable int32u wiredAssessedCurrent = 6;
+ readonly attribute optional int32u wiredNominalVoltage = 7;
+ readonly attribute optional int32u wiredMaximumCurrent = 8;
+ readonly attribute optional boolean wiredPresent = 9;
+ readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10;
+ readonly attribute optional nullable int32u batVoltage = 11;
+ readonly attribute optional nullable int8u batPercentRemaining = 12;
+ readonly attribute optional nullable int32u batTimeRemaining = 13;
+ readonly attribute optional BatChargeLevelEnum batChargeLevel = 14;
+ readonly attribute optional boolean batReplacementNeeded = 15;
+ readonly attribute optional BatReplaceabilityEnum batReplaceability = 16;
+ readonly attribute optional boolean batPresent = 17;
+ readonly attribute optional BatFaultEnum activeBatFaults[] = 18;
+ readonly attribute optional char_string<60> batReplacementDescription = 19;
+ readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20;
+ readonly attribute optional char_string<20> batANSIDesignation = 21;
+ readonly attribute optional char_string<20> batIECDesignation = 22;
+ readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23;
+ readonly attribute optional int32u batCapacity = 24;
+ readonly attribute optional int8u batQuantity = 25;
+ readonly attribute optional BatChargeStateEnum batChargeState = 26;
+ readonly attribute optional nullable int32u batTimeToFullCharge = 27;
+ readonly attribute optional boolean batFunctionalWhileCharging = 28;
+ readonly attribute optional nullable int32u batChargingCurrent = 29;
+ readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30;
+ readonly attribute endpoint_no endpointList[] = 31;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** This cluster is used to manage global aspects of the Commissioning flow. */
+cluster GeneralCommissioning = 48 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CommissioningErrorEnum : enum8 {
+ kOK = 0;
+ kValueOutsideRange = 1;
+ kInvalidAuthentication = 2;
+ kNoFailSafe = 3;
+ kBusyWithOtherAdmin = 4;
+ }
+
+ enum RegulatoryLocationTypeEnum : enum8 {
+ kIndoor = 0;
+ kOutdoor = 1;
+ kIndoorOutdoor = 2;
+ }
+
+ struct BasicCommissioningInfo {
+ int16u failSafeExpiryLengthSeconds = 0;
+ int16u maxCumulativeFailsafeSeconds = 1;
+ }
+
+ attribute access(write: administer) int64u breadcrumb = 0;
+ readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1;
+ readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2;
+ readonly attribute RegulatoryLocationTypeEnum locationCapability = 3;
+ readonly attribute boolean supportsConcurrentConnection = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ArmFailSafeRequest {
+ int16u expiryLengthSeconds = 0;
+ int64u breadcrumb = 1;
+ }
+
+ response struct ArmFailSafeResponse = 1 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string<128> debugText = 1;
+ }
+
+ request struct SetRegulatoryConfigRequest {
+ RegulatoryLocationTypeEnum newRegulatoryConfig = 0;
+ char_string<2> countryCode = 1;
+ int64u breadcrumb = 2;
+ }
+
+ response struct SetRegulatoryConfigResponse = 3 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string debugText = 1;
+ }
+
+ response struct CommissioningCompleteResponse = 5 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string debugText = 1;
+ }
+
+ /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */
+ command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0;
+ /** Set the regulatory configuration to be used during commissioning */
+ command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2;
+ /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */
+ fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4;
+}
+
+/** Functionality to configure, enable, disable network credentials and access on a Matter device. */
+cluster NetworkCommissioning = 49 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum NetworkCommissioningStatusEnum : enum8 {
+ kSuccess = 0;
+ kOutOfRange = 1;
+ kBoundsExceeded = 2;
+ kNetworkIDNotFound = 3;
+ kDuplicateNetworkID = 4;
+ kNetworkNotFound = 5;
+ kRegulatoryError = 6;
+ kAuthFailure = 7;
+ kUnsupportedSecurity = 8;
+ kOtherConnectionFailure = 9;
+ kIPV6Failed = 10;
+ kIPBindFailed = 11;
+ kUnknownError = 12;
+ }
+
+ enum WiFiBandEnum : enum8 {
+ k2G4 = 0;
+ k3G65 = 1;
+ k5G = 2;
+ k6G = 3;
+ k60G = 4;
+ k1G = 5;
+ }
+
+ bitmap Feature : bitmap32 {
+ kWiFiNetworkInterface = 0x1;
+ kThreadNetworkInterface = 0x2;
+ kEthernetNetworkInterface = 0x4;
+ kPerDeviceCredentials = 0x8;
+ }
+
+ bitmap ThreadCapabilitiesBitmap : bitmap16 {
+ kIsBorderRouterCapable = 0x1;
+ kIsRouterCapable = 0x2;
+ kIsSleepyEndDeviceCapable = 0x4;
+ kIsFullThreadDevice = 0x8;
+ kIsSynchronizedSleepyEndDeviceCapable = 0x10;
+ }
+
+ bitmap WiFiSecurityBitmap : bitmap8 {
+ kUnencrypted = 0x1;
+ kWEP = 0x2;
+ kWPAPersonal = 0x4;
+ kWPA2Personal = 0x8;
+ kWPA3Personal = 0x10;
+ kWPA3MatterPDC = 0x20;
+ }
+
+ struct NetworkInfoStruct {
+ octet_string<32> networkID = 0;
+ boolean connected = 1;
+ optional nullable octet_string<20> networkIdentifier = 2;
+ optional nullable octet_string<20> clientIdentifier = 3;
+ }
+
+ struct ThreadInterfaceScanResultStruct {
+ int16u panId = 0;
+ int64u extendedPanId = 1;
+ char_string<16> networkName = 2;
+ int16u channel = 3;
+ int8u version = 4;
+ octet_string<8> extendedAddress = 5;
+ int8s rssi = 6;
+ int8u lqi = 7;
+ }
+
+ struct WiFiInterfaceScanResultStruct {
+ WiFiSecurityBitmap security = 0;
+ octet_string<32> ssid = 1;
+ octet_string<6> bssid = 2;
+ int16u channel = 3;
+ WiFiBandEnum wiFiBand = 4;
+ int8s rssi = 5;
+ }
+
+ readonly attribute access(read: administer) int8u maxNetworks = 0;
+ readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1;
+ readonly attribute optional int8u scanMaxTimeSeconds = 2;
+ readonly attribute optional int8u connectMaxTimeSeconds = 3;
+ attribute access(write: administer) boolean interfaceEnabled = 4;
+ readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5;
+ readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6;
+ readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7;
+ readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8;
+ readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9;
+ readonly attribute optional int16u threadVersion = 10;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ScanNetworksRequest {
+ optional nullable octet_string<32> ssid = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct ScanNetworksResponse = 1 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string debugText = 1;
+ optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2;
+ optional ThreadInterfaceScanResultStruct threadScanResults[] = 3;
+ }
+
+ request struct AddOrUpdateWiFiNetworkRequest {
+ octet_string<32> ssid = 0;
+ octet_string<64> credentials = 1;
+ optional int64u breadcrumb = 2;
+ optional octet_string<140> networkIdentity = 3;
+ optional octet_string<20> clientIdentifier = 4;
+ optional octet_string<32> possessionNonce = 5;
+ }
+
+ request struct AddOrUpdateThreadNetworkRequest {
+ octet_string<254> operationalDataset = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ request struct RemoveNetworkRequest {
+ octet_string<32> networkID = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct NetworkConfigResponse = 5 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string<512> debugText = 1;
+ optional int8u networkIndex = 2;
+ optional octet_string<140> clientIdentity = 3;
+ optional octet_string<64> possessionSignature = 4;
+ }
+
+ request struct ConnectNetworkRequest {
+ octet_string<32> networkID = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct ConnectNetworkResponse = 7 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string debugText = 1;
+ nullable int32s errorValue = 2;
+ }
+
+ request struct ReorderNetworkRequest {
+ octet_string<32> networkID = 0;
+ int8u networkIndex = 1;
+ optional int64u breadcrumb = 2;
+ }
+
+ request struct QueryIdentityRequest {
+ octet_string<20> keyIdentifier = 0;
+ optional octet_string<32> possessionNonce = 1;
+ }
+
+ response struct QueryIdentityResponse = 10 {
+ octet_string<140> identity = 0;
+ optional octet_string<64> possessionSignature = 1;
+ }
+
+ /** Detemine the set of networks the device sees as available. */
+ command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0;
+ /** Add or update the credentials for a given Wi-Fi network. */
+ command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2;
+ /** Add or update the credentials for a given Thread network. */
+ command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3;
+ /** Remove the definition of a given network (including its credentials). */
+ command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4;
+ /** Connect to the specified network, using previously-defined credentials. */
+ command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6;
+ /** Modify the order in which networks will be presented in the Networks attribute. */
+ command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8;
+ /** Retrieve details about and optionally proof of possession of a network client identity. */
+ command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9;
+}
+
+/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
+cluster GeneralDiagnostics = 51 {
+ revision 2;
+
+ enum BootReasonEnum : enum8 {
+ kUnspecified = 0;
+ kPowerOnReboot = 1;
+ kBrownOutReset = 2;
+ kSoftwareWatchdogReset = 3;
+ kHardwareWatchdogReset = 4;
+ kSoftwareUpdateCompleted = 5;
+ kSoftwareReset = 6;
+ }
+
+ enum HardwareFaultEnum : enum8 {
+ kUnspecified = 0;
+ kRadio = 1;
+ kSensor = 2;
+ kResettableOverTemp = 3;
+ kNonResettableOverTemp = 4;
+ kPowerSource = 5;
+ kVisualDisplayFault = 6;
+ kAudioOutputFault = 7;
+ kUserInterfaceFault = 8;
+ kNonVolatileMemoryError = 9;
+ kTamperDetected = 10;
+ }
+
+ enum InterfaceTypeEnum : enum8 {
+ kUnspecified = 0;
+ kWiFi = 1;
+ kEthernet = 2;
+ kCellular = 3;
+ kThread = 4;
+ }
+
+ enum NetworkFaultEnum : enum8 {
+ kUnspecified = 0;
+ kHardwareFailure = 1;
+ kNetworkJammed = 2;
+ kConnectionFailed = 3;
+ }
+
+ enum RadioFaultEnum : enum8 {
+ kUnspecified = 0;
+ kWiFiFault = 1;
+ kCellularFault = 2;
+ kThreadFault = 3;
+ kNFCFault = 4;
+ kBLEFault = 5;
+ kEthernetFault = 6;
+ }
+
+ bitmap Feature : bitmap32 {
+ kDataModelTest = 0x1;
+ }
+
+ struct NetworkInterface {
+ char_string<32> name = 0;
+ boolean isOperational = 1;
+ nullable boolean offPremiseServicesReachableIPv4 = 2;
+ nullable boolean offPremiseServicesReachableIPv6 = 3;
+ octet_string<8> hardwareAddress = 4;
+ octet_string IPv4Addresses[] = 5;
+ octet_string IPv6Addresses[] = 6;
+ InterfaceTypeEnum type = 7;
+ }
+
+ critical event HardwareFaultChange = 0 {
+ HardwareFaultEnum current[] = 0;
+ HardwareFaultEnum previous[] = 1;
+ }
+
+ critical event RadioFaultChange = 1 {
+ RadioFaultEnum current[] = 0;
+ RadioFaultEnum previous[] = 1;
+ }
+
+ critical event NetworkFaultChange = 2 {
+ NetworkFaultEnum current[] = 0;
+ NetworkFaultEnum previous[] = 1;
+ }
+
+ critical event BootReason = 3 {
+ BootReasonEnum bootReason = 0;
+ }
+
+ readonly attribute NetworkInterface networkInterfaces[] = 0;
+ readonly attribute int16u rebootCount = 1;
+ readonly attribute optional int64u upTime = 2;
+ readonly attribute optional int32u totalOperationalHours = 3;
+ readonly attribute optional BootReasonEnum bootReason = 4;
+ readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5;
+ readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
+ readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
+ readonly attribute boolean testEventTriggersEnabled = 8;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct TestEventTriggerRequest {
+ octet_string<16> enableKey = 0;
+ int64u eventTrigger = 1;
+ }
+
+ response struct TimeSnapshotResponse = 2 {
+ systime_ms systemTimeMs = 0;
+ nullable posix_ms posixTimeMs = 1;
+ }
+
+ request struct PayloadTestRequestRequest {
+ octet_string<16> enableKey = 0;
+ int8u value = 1;
+ int16u count = 2;
+ }
+
+ response struct PayloadTestResponse = 4 {
+ octet_string payload = 0;
+ }
+
+ /** Provide a means for certification tests to trigger some test-plan-specific events */
+ command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
+ /** Take a snapshot of system time and epoch time. */
+ command TimeSnapshot(): TimeSnapshotResponse = 1;
+ /** Request a variable length payload response. */
+ command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
+}
+
+/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
+cluster WiFiNetworkDiagnostics = 54 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum AssociationFailureCauseEnum : enum8 {
+ kUnknown = 0;
+ kAssociationFailed = 1;
+ kAuthenticationFailed = 2;
+ kSsidNotFound = 3;
+ }
+
+ enum ConnectionStatusEnum : enum8 {
+ kConnected = 0;
+ kNotConnected = 1;
+ }
+
+ enum SecurityTypeEnum : enum8 {
+ kUnspecified = 0;
+ kNone = 1;
+ kWEP = 2;
+ kWPA = 3;
+ kWPA2 = 4;
+ kWPA3 = 5;
+ }
+
+ enum WiFiVersionEnum : enum8 {
+ kA = 0;
+ kB = 1;
+ kG = 2;
+ kN = 3;
+ kAc = 4;
+ kAx = 5;
+ kAh = 6;
+ }
+
+ bitmap Feature : bitmap32 {
+ kPacketCounts = 0x1;
+ kErrorCounts = 0x2;
+ }
+
+ info event Disconnection = 0 {
+ int16u reasonCode = 0;
+ }
+
+ info event AssociationFailure = 1 {
+ AssociationFailureCauseEnum associationFailureCause = 0;
+ int16u status = 1;
+ }
+
+ info event ConnectionStatus = 2 {
+ ConnectionStatusEnum connectionStatus = 0;
+ }
+
+ readonly attribute nullable octet_string<6> bssid = 0;
+ readonly attribute nullable SecurityTypeEnum securityType = 1;
+ readonly attribute nullable WiFiVersionEnum wiFiVersion = 2;
+ readonly attribute nullable int16u channelNumber = 3;
+ readonly attribute nullable int8s rssi = 4;
+ readonly attribute optional nullable int32u beaconLostCount = 5;
+ readonly attribute optional nullable int32u beaconRxCount = 6;
+ readonly attribute optional nullable int32u packetMulticastRxCount = 7;
+ readonly attribute optional nullable int32u packetMulticastTxCount = 8;
+ readonly attribute optional nullable int32u packetUnicastRxCount = 9;
+ readonly attribute optional nullable int32u packetUnicastTxCount = 10;
+ readonly attribute optional nullable int64u currentMaxRate = 11;
+ readonly attribute optional nullable int64u overrunCount = 12;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ /** Reception of this command SHALL reset the Breacon and Packet related count attributes to 0 */
+ command ResetCounts(): DefaultSuccess = 0;
+}
+
+/** Commands to trigger a Node to allow a new Administrator to commission it. */
+cluster AdministratorCommissioning = 60 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CommissioningWindowStatusEnum : enum8 {
+ kWindowNotOpen = 0;
+ kEnhancedWindowOpen = 1;
+ kBasicWindowOpen = 2;
+ }
+
+ enum StatusCode : enum8 {
+ kBusy = 2;
+ kPAKEParameterError = 3;
+ kWindowNotOpen = 4;
+ }
+
+ bitmap Feature : bitmap32 {
+ kBasic = 0x1;
+ }
+
+ readonly attribute CommissioningWindowStatusEnum windowStatus = 0;
+ readonly attribute nullable fabric_idx adminFabricIndex = 1;
+ readonly attribute nullable vendor_id adminVendorId = 2;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct OpenCommissioningWindowRequest {
+ int16u commissioningTimeout = 0;
+ octet_string PAKEPasscodeVerifier = 1;
+ int16u discriminator = 2;
+ int32u iterations = 3;
+ octet_string<32> salt = 4;
+ }
+
+ request struct OpenBasicCommissioningWindowRequest {
+ int16u commissioningTimeout = 0;
+ }
+
+ /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */
+ timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
+ /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */
+ timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
+ /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */
+ timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2;
+}
+
+/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */
+cluster OperationalCredentials = 62 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CertificateChainTypeEnum : enum8 {
+ kDACCertificate = 1;
+ kPAICertificate = 2;
+ }
+
+ enum NodeOperationalCertStatusEnum : enum8 {
+ kOK = 0;
+ kInvalidPublicKey = 1;
+ kInvalidNodeOpId = 2;
+ kInvalidNOC = 3;
+ kMissingCsr = 4;
+ kTableFull = 5;
+ kInvalidAdminSubject = 6;
+ kFabricConflict = 9;
+ kLabelConflict = 10;
+ kInvalidFabricIndex = 11;
+ }
+
+ fabric_scoped struct FabricDescriptorStruct {
+ octet_string<65> rootPublicKey = 1;
+ vendor_id vendorID = 2;
+ fabric_id fabricID = 3;
+ node_id nodeID = 4;
+ char_string<32> label = 5;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct NOCStruct {
+ fabric_sensitive octet_string noc = 1;
+ nullable fabric_sensitive octet_string icac = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ readonly attribute access(read: administer) NOCStruct NOCs[] = 0;
+ readonly attribute FabricDescriptorStruct fabrics[] = 1;
+ readonly attribute int8u supportedFabrics = 2;
+ readonly attribute int8u commissionedFabrics = 3;
+ readonly attribute octet_string trustedRootCertificates[] = 4;
+ readonly attribute int8u currentFabricIndex = 5;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct AttestationRequestRequest {
+ octet_string<32> attestationNonce = 0;
+ }
+
+ response struct AttestationResponse = 1 {
+ octet_string<900> attestationElements = 0;
+ octet_string<64> attestationSignature = 1;
+ }
+
+ request struct CertificateChainRequestRequest {
+ CertificateChainTypeEnum certificateType = 0;
+ }
+
+ response struct CertificateChainResponse = 3 {
+ octet_string<600> certificate = 0;
+ }
+
+ request struct CSRRequestRequest {
+ octet_string<32> CSRNonce = 0;
+ optional boolean isForUpdateNOC = 1;
+ }
+
+ response struct CSRResponse = 5 {
+ octet_string NOCSRElements = 0;
+ octet_string attestationSignature = 1;
+ }
+
+ request struct AddNOCRequest {
+ octet_string<400> NOCValue = 0;
+ optional octet_string<400> ICACValue = 1;
+ octet_string<16> IPKValue = 2;
+ int64u caseAdminSubject = 3;
+ vendor_id adminVendorId = 4;
+ }
+
+ request struct UpdateNOCRequest {
+ octet_string NOCValue = 0;
+ optional octet_string ICACValue = 1;
+ }
+
+ response struct NOCResponse = 8 {
+ NodeOperationalCertStatusEnum statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional char_string<128> debugText = 2;
+ }
+
+ request struct UpdateFabricLabelRequest {
+ char_string<32> label = 0;
+ }
+
+ request struct RemoveFabricRequest {
+ fabric_idx fabricIndex = 0;
+ }
+
+ request struct AddTrustedRootCertificateRequest {
+ octet_string rootCACertificate = 0;
+ }
+
+ /** Sender is requesting attestation information from the receiver. */
+ command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0;
+ /** Sender is requesting a device attestation certificate from the receiver. */
+ command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2;
+ /** Sender is requesting a certificate signing request (CSR) from the receiver. */
+ command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4;
+ /** Sender is requesting to add the new node operational certificates. */
+ command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6;
+ /** Sender is requesting to update the node operational certificates. */
+ fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7;
+ /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */
+ fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9;
+ /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */
+ command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
+ /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */
+ command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
+}
+
+/** The Group Key Management Cluster is the mechanism by which group keys are managed. */
+cluster GroupKeyManagement = 63 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum GroupKeySecurityPolicyEnum : enum8 {
+ kTrustFirst = 0;
+ kCacheAndSync = 1;
+ }
+
+ bitmap Feature : bitmap32 {
+ kCacheAndSync = 0x1;
+ }
+
+ fabric_scoped struct GroupInfoMapStruct {
+ group_id groupId = 1;
+ endpoint_no endpoints[] = 2;
+ optional char_string<16> groupName = 3;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct GroupKeyMapStruct {
+ group_id groupId = 1;
+ int16u groupKeySetID = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ struct GroupKeySetStruct {
+ int16u groupKeySetID = 0;
+ GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1;
+ nullable octet_string<16> epochKey0 = 2;
+ nullable epoch_us epochStartTime0 = 3;
+ nullable octet_string<16> epochKey1 = 4;
+ nullable epoch_us epochStartTime1 = 5;
+ nullable octet_string<16> epochKey2 = 6;
+ nullable epoch_us epochStartTime2 = 7;
+ }
+
+ attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0;
+ readonly attribute GroupInfoMapStruct groupTable[] = 1;
+ readonly attribute int16u maxGroupsPerFabric = 2;
+ readonly attribute int16u maxGroupKeysPerFabric = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct KeySetWriteRequest {
+ GroupKeySetStruct groupKeySet = 0;
+ }
+
+ request struct KeySetReadRequest {
+ int16u groupKeySetID = 0;
+ }
+
+ response struct KeySetReadResponse = 2 {
+ GroupKeySetStruct groupKeySet = 0;
+ }
+
+ request struct KeySetRemoveRequest {
+ int16u groupKeySetID = 0;
+ }
+
+ response struct KeySetReadAllIndicesResponse = 5 {
+ int16u groupKeySetIDs[] = 0;
+ }
+
+ /** Write a new set of keys for the given key set id. */
+ fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0;
+ /** Read the keys for a given key set id. */
+ fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1;
+ /** Revoke a Root Key from a Group */
+ fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3;
+ /** Return the list of Group Key Sets associated with the accessing fabric */
+ fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4;
+}
+
+/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only
+labels. */
+cluster FixedLabel = 64 {
+ revision 1; // NOTE: Default/not specifically set
+
+ struct LabelStruct {
+ char_string<16> label = 0;
+ char_string<16> value = 1;
+ }
+
+ readonly attribute LabelStruct labelList[] = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */
+cluster UserLabel = 65 {
+ revision 1; // NOTE: Default/not specifically set
+
+ struct LabelStruct {
+ char_string<16> label = 0;
+ char_string<16> value = 1;
+ }
+
+ attribute access(write: manage) LabelStruct labelList[] = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** Attributes and commands for selecting a mode from a list of supported options. */
+cluster ModeSelect = 80 {
+ revision 2;
+
+ bitmap Feature : bitmap32 {
+ kOnOff = 0x1;
+ }
+
+ struct SemanticTagStruct {
+ vendor_id mfgCode = 0;
+ enum16 value = 1;
+ }
+
+ struct ModeOptionStruct {
+ char_string<64> label = 0;
+ int8u mode = 1;
+ SemanticTagStruct semanticTags[] = 2;
+ }
+
+ readonly attribute char_string<64> description = 0;
+ readonly attribute nullable enum16 standardNamespace = 1;
+ readonly attribute ModeOptionStruct supportedModes[] = 2;
+ readonly attribute int8u currentMode = 3;
+ attribute optional nullable int8u startUpMode = 4;
+ attribute optional nullable int8u onMode = 5;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ChangeToModeRequest {
+ int8u newMode = 0;
+ }
+
+ /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */
+ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0;
+}
+
+/** Attributes and commands for selecting a mode from a list of supported options. */
+cluster LaundryWasherMode = 81 {
+ revision 2;
+
+ enum ModeTag : enum16 {
+ kNormal = 16384;
+ kDelicate = 16385;
+ kHeavy = 16386;
+ kWhites = 16387;
+ }
+
+ bitmap Feature : bitmap32 {
+ kOnOff = 0x1;
+ }
+
+ struct ModeTagStruct {
+ optional vendor_id mfgCode = 0;
+ enum16 value = 1;
+ }
+
+ struct ModeOptionStruct {
+ char_string<64> label = 0;
+ int8u mode = 1;
+ ModeTagStruct modeTags[] = 2;
+ }
+
+ readonly attribute ModeOptionStruct supportedModes[] = 0;
+ readonly attribute int8u currentMode = 1;
+ attribute optional nullable int8u startUpMode = 2;
+ attribute optional nullable int8u onMode = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ChangeToModeRequest {
+ int8u newMode = 0;
+ }
+
+ response struct ChangeToModeResponse = 1 {
+ enum8 status = 0;
+ optional char_string statusText = 1;
+ }
+
+ /** This command is used to change device modes.
+ On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */
+ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
+}
+
+/** This cluster supports remotely monitoring and controlling the different types of functionality available to a washing device, such as a washing machine. */
+cluster LaundryWasherControls = 83 {
+ revision 1;
+
+ enum NumberOfRinsesEnum : enum8 {
+ kNone = 0;
+ kNormal = 1;
+ kExtra = 2;
+ kMax = 3;
+ }
+
+ bitmap Feature : bitmap32 {
+ kSpin = 0x1;
+ kRinse = 0x2;
+ }
+
+ readonly attribute optional char_string spinSpeeds[] = 0;
+ attribute optional nullable int8u spinSpeedCurrent = 1;
+ attribute optional NumberOfRinsesEnum numberOfRinses = 2;
+ readonly attribute optional NumberOfRinsesEnum supportedRinses[] = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** Attributes and commands for configuring the temperature control, and reporting temperature. */
+cluster TemperatureControl = 86 {
+ revision 1; // NOTE: Default/not specifically set
+
+ bitmap Feature : bitmap32 {
+ kTemperatureNumber = 0x1;
+ kTemperatureLevel = 0x2;
+ kTemperatureStep = 0x4;
+ }
+
+ readonly attribute optional temperature temperatureSetpoint = 0;
+ readonly attribute optional temperature minTemperature = 1;
+ readonly attribute optional temperature maxTemperature = 2;
+ readonly attribute optional temperature step = 3;
+ readonly attribute optional int8u selectedTemperatureLevel = 4;
+ readonly attribute optional char_string supportedTemperatureLevels[] = 5;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct SetTemperatureRequest {
+ optional temperature targetTemperature = 0;
+ optional int8u targetTemperatureLevel = 1;
+ }
+
+ /** Set Temperature */
+ command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0;
+}
+
+/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */
+cluster OperationalState = 96 {
+ revision 1;
+
+ enum ErrorStateEnum : enum8 {
+ kNoError = 0;
+ kUnableToStartOrResume = 1;
+ kUnableToCompleteOperation = 2;
+ kCommandInvalidInState = 3;
+ }
+
+ enum OperationalStateEnum : enum8 {
+ kStopped = 0;
+ kRunning = 1;
+ kPaused = 2;
+ kError = 3;
+ }
+
+ struct ErrorStateStruct {
+ enum8 errorStateID = 0;
+ optional char_string<64> errorStateLabel = 1;
+ optional char_string<64> errorStateDetails = 2;
+ }
+
+ struct OperationalStateStruct {
+ enum8 operationalStateID = 0;
+ optional char_string<64> operationalStateLabel = 1;
+ }
+
+ critical event OperationalError = 0 {
+ ErrorStateStruct errorState = 0;
+ }
+
+ info event OperationCompletion = 1 {
+ enum8 completionErrorCode = 0;
+ optional nullable elapsed_s totalOperationalTime = 1;
+ optional nullable elapsed_s pausedTime = 2;
+ }
+
+ readonly attribute nullable char_string phaseList[] = 0;
+ readonly attribute nullable int8u currentPhase = 1;
+ readonly attribute optional nullable elapsed_s countdownTime = 2;
+ readonly attribute OperationalStateStruct operationalStateList[] = 3;
+ readonly attribute OperationalStateEnum operationalState = 4;
+ readonly attribute ErrorStateStruct operationalError = 5;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ response struct OperationalCommandResponse = 4 {
+ ErrorStateStruct commandResponseState = 0;
+ }
+
+ /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */
+ command Pause(): OperationalCommandResponse = 0;
+ /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */
+ command Stop(): OperationalCommandResponse = 1;
+ /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */
+ command Start(): OperationalCommandResponse = 2;
+ /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
+ command Resume(): OperationalCommandResponse = 3;
+}
+
+endpoint 0 {
+ device type ma_rootdevice = 22, version 1;
+
+ binding cluster OtaSoftwareUpdateProvider;
+
+ server cluster Identify {
+ ram attribute identifyTime default = 0x0000;
+ ram attribute identifyType default = 0x00;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 4;
+
+ handle command Identify;
+ }
+
+ server cluster Descriptor {
+ callback attribute deviceTypeList;
+ callback attribute serverList;
+ callback attribute clientList;
+ callback attribute partsList;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+ }
+
+ server cluster AccessControl {
+ emits event AccessControlEntryChanged;
+ emits event AccessControlExtensionChanged;
+ callback attribute acl;
+ callback attribute extension;
+ callback attribute subjectsPerAccessControlEntry;
+ callback attribute targetsPerAccessControlEntry;
+ callback attribute accessControlEntriesPerFabric;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ callback attribute clusterRevision;
+ }
+
+ server cluster BasicInformation {
+ emits event StartUp;
+ emits event ShutDown;
+ emits event Leave;
+ callback attribute dataModelRevision;
+ callback attribute vendorName;
+ callback attribute vendorID;
+ callback attribute productName;
+ callback attribute productID;
+ persist attribute nodeLabel;
+ callback attribute location;
+ callback attribute hardwareVersion;
+ callback attribute hardwareVersionString;
+ callback attribute softwareVersion;
+ callback attribute softwareVersionString;
+ callback attribute manufacturingDate;
+ callback attribute partNumber;
+ callback attribute productURL;
+ callback attribute productLabel;
+ callback attribute serialNumber;
+ persist attribute localConfigDisabled default = 0;
+ callback attribute uniqueID;
+ callback attribute capabilityMinima;
+ callback attribute productAppearance;
+ callback attribute specificationVersion;
+ callback attribute maxPathsPerInvoke;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 2;
+ }
+
+ server cluster OtaSoftwareUpdateRequestor {
+ emits event StateTransition;
+ emits event VersionApplied;
+ emits event DownloadError;
+ callback attribute defaultOTAProviders;
+ ram attribute updatePossible default = 1;
+ ram attribute updateState default = 0;
+ ram attribute updateStateProgress default = 0;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command AnnounceOTAProvider;
+ }
+
+ server cluster LocalizationConfiguration {
+ persist attribute activeLocale default = "en-US";
+ callback attribute supportedLocales;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster TimeFormatLocalization {
+ ram attribute hourFormat;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster UnitLocalization {
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster GeneralCommissioning {
+ ram attribute breadcrumb default = 0x0000000000000000;
+ callback attribute basicCommissioningInfo;
+ callback attribute regulatoryConfig;
+ callback attribute locationCapability;
+ callback attribute supportsConcurrentConnection;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command ArmFailSafe;
+ handle command ArmFailSafeResponse;
+ handle command SetRegulatoryConfig;
+ handle command SetRegulatoryConfigResponse;
+ handle command CommissioningComplete;
+ handle command CommissioningCompleteResponse;
+ }
+
+ server cluster NetworkCommissioning {
+ ram attribute maxNetworks;
+ callback attribute networks;
+ ram attribute scanMaxTimeSeconds;
+ ram attribute connectMaxTimeSeconds;
+ ram attribute interfaceEnabled;
+ ram attribute lastNetworkingStatus;
+ ram attribute lastNetworkID;
+ ram attribute lastConnectErrorValue;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 2;
+ ram attribute clusterRevision default = 1;
+
+ handle command ScanNetworks;
+ handle command ScanNetworksResponse;
+ handle command AddOrUpdateWiFiNetwork;
+ handle command AddOrUpdateThreadNetwork;
+ handle command RemoveNetwork;
+ handle command NetworkConfigResponse;
+ handle command ConnectNetwork;
+ handle command ConnectNetworkResponse;
+ handle command ReorderNetwork;
+ }
+
+ server cluster GeneralDiagnostics {
+ emits event BootReason;
+ callback attribute networkInterfaces;
+ callback attribute rebootCount;
+ callback attribute upTime;
+ callback attribute totalOperationalHours;
+ callback attribute bootReason;
+ callback attribute testEventTriggersEnabled default = false;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+
+ handle command TestEventTrigger;
+ handle command TimeSnapshot;
+ handle command TimeSnapshotResponse;
+ }
+
+ server cluster WiFiNetworkDiagnostics {
+ callback attribute bssid;
+ callback attribute securityType;
+ callback attribute wiFiVersion;
+ callback attribute channelNumber;
+ callback attribute rssi;
+ callback attribute currentMaxRate;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster AdministratorCommissioning {
+ callback attribute windowStatus;
+ callback attribute adminFabricIndex;
+ callback attribute adminVendorId;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command OpenCommissioningWindow;
+ handle command RevokeCommissioning;
+ }
+
+ server cluster OperationalCredentials {
+ callback attribute NOCs;
+ callback attribute fabrics;
+ callback attribute supportedFabrics;
+ callback attribute commissionedFabrics;
+ callback attribute trustedRootCertificates;
+ callback attribute currentFabricIndex;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command AttestationRequest;
+ handle command AttestationResponse;
+ handle command CertificateChainRequest;
+ handle command CertificateChainResponse;
+ handle command CSRRequest;
+ handle command CSRResponse;
+ handle command AddNOC;
+ handle command UpdateNOC;
+ handle command NOCResponse;
+ handle command UpdateFabricLabel;
+ handle command RemoveFabric;
+ handle command AddTrustedRootCertificate;
+ }
+
+ server cluster GroupKeyManagement {
+ callback attribute groupKeyMap;
+ callback attribute groupTable;
+ callback attribute maxGroupsPerFabric;
+ callback attribute maxGroupKeysPerFabric;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+
+ handle command KeySetWrite;
+ handle command KeySetRead;
+ handle command KeySetReadResponse;
+ handle command KeySetRemove;
+ handle command KeySetReadAllIndices;
+ handle command KeySetReadAllIndicesResponse;
+ }
+}
+endpoint 1 {
+ device type ma_laundry_washer = 115, version 1;
+
+
+ server cluster Identify {
+ ram attribute identifyTime default = 0x0;
+ ram attribute identifyType default = 0x00;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 4;
+
+ handle command Identify;
+ handle command TriggerEffect;
+ }
+
+ server cluster Groups {
+ ram attribute nameSupport;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 4;
+
+ handle command AddGroup;
+ handle command AddGroupResponse;
+ handle command ViewGroup;
+ handle command ViewGroupResponse;
+ handle command GetGroupMembership;
+ handle command GetGroupMembershipResponse;
+ handle command RemoveGroup;
+ handle command RemoveGroupResponse;
+ handle command RemoveAllGroups;
+ handle command AddGroupIfIdentifying;
+ }
+
+ server cluster OnOff {
+ persist attribute onOff default = 0;
+ ram attribute globalSceneControl default = 1;
+ ram attribute onTime default = 0;
+ ram attribute offWaitTime default = 0;
+ persist attribute startUpOnOff default = 0xFF;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 1;
+ ram attribute clusterRevision default = 5;
+
+ handle command Off;
+ handle command On;
+ handle command Toggle;
+ handle command OffWithEffect;
+ handle command OnWithRecallGlobalScene;
+ handle command OnWithTimedOff;
+ }
+
+ server cluster Descriptor {
+ callback attribute deviceTypeList;
+ callback attribute serverList;
+ callback attribute clientList;
+ callback attribute partsList;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+ }
+
+ server cluster Binding {
+ callback attribute binding;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster PowerSource {
+ ram attribute status;
+ ram attribute order;
+ ram attribute description;
+ ram attribute wiredCurrentType;
+ callback attribute endpointList;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 1;
+ ram attribute clusterRevision default = 2;
+ }
+
+ server cluster FixedLabel {
+ callback attribute labelList;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster UserLabel {
+ callback attribute labelList;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster ModeSelect {
+ ram attribute description;
+ ram attribute standardNamespace;
+ callback attribute supportedModes;
+ ram attribute currentMode;
+ ram attribute startUpMode;
+ ram attribute onMode;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command ChangeToMode;
+ }
+
+ server cluster LaundryWasherMode {
+ callback attribute supportedModes;
+ callback attribute currentMode;
+ callback attribute startUpMode;
+ callback attribute onMode;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ callback attribute featureMap;
+ ram attribute clusterRevision default = 1;
+
+ handle command ChangeToMode;
+ handle command ChangeToModeResponse;
+ }
+
+ server cluster LaundryWasherControls {
+ callback attribute spinSpeeds;
+ ram attribute spinSpeedCurrent;
+ ram attribute numberOfRinses;
+ callback attribute supportedRinses;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 3;
+ ram attribute clusterRevision default = 1;
+ }
+
+ server cluster TemperatureControl {
+ ram attribute selectedTemperatureLevel;
+ callback attribute supportedTemperatureLevels;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 2;
+ ram attribute clusterRevision default = 1;
+
+ handle command SetTemperature;
+ }
+
+ server cluster OperationalState {
+ emits event OperationalError;
+ emits event OperationCompletion;
+ callback attribute phaseList;
+ callback attribute currentPhase;
+ callback attribute countdownTime;
+ callback attribute operationalStateList;
+ callback attribute operationalState;
+ callback attribute operationalError;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command Pause;
+ handle command Stop;
+ handle command Start;
+ handle command Resume;
+ handle command OperationalCommandResponse;
+ }
+}
+
+
diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap
new file mode 100644
index 00000000000000..d5c7ee215e1976
--- /dev/null
+++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap
@@ -0,0 +1,5288 @@
+{
+ "fileFormat": 2,
+ "featureLevel": 99,
+ "creator": "zap",
+ "keyValuePairs": [
+ {
+ "key": "commandDiscovery",
+ "value": "1"
+ },
+ {
+ "key": "defaultResponsePolicy",
+ "value": "always"
+ },
+ {
+ "key": "manufacturerCodes",
+ "value": "0x1002"
+ }
+ ],
+ "package": [
+ {
+ "pathRelativity": "relativeToZap",
+ "path": "../../../../src/app/zap-templates/zcl/zcl.json",
+ "type": "zcl-properties",
+ "category": "matter",
+ "version": 1,
+ "description": "Matter SDK ZCL data"
+ },
+ {
+ "pathRelativity": "relativeToZap",
+ "path": "../../../../src/app/zap-templates/app-templates.json",
+ "type": "gen-templates-json",
+ "version": "chip-v1"
+ }
+ ],
+ "endpointTypes": [
+ {
+ "id": 1,
+ "name": "MA-rootdevice",
+ "deviceTypeRef": {
+ "code": 22,
+ "profileId": 259,
+ "label": "MA-rootdevice",
+ "name": "MA-rootdevice"
+ },
+ "deviceTypes": [
+ {
+ "code": 22,
+ "profileId": 259,
+ "label": "MA-rootdevice",
+ "name": "MA-rootdevice"
+ }
+ ],
+ "deviceVersions": [
+ 1
+ ],
+ "deviceIdentifiers": [
+ 22
+ ],
+ "deviceTypeName": "MA-rootdevice",
+ "deviceTypeCode": 22,
+ "deviceTypeProfileId": 259,
+ "clusters": [
+ {
+ "name": "Identify",
+ "code": 3,
+ "mfgCode": null,
+ "define": "IDENTIFY_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "Identify",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "IdentifyTime",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0000",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "IdentifyType",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "IdentifyTypeEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "4",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Descriptor",
+ "code": 29,
+ "mfgCode": null,
+ "define": "DESCRIPTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DeviceTypeList",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ServerList",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClientList",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "PartsList",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Access Control",
+ "code": 31,
+ "mfgCode": null,
+ "define": "ACCESS_CONTROL_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "ACL",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Extension",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SubjectsPerAccessControlEntry",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "TargetsPerAccessControlEntry",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AccessControlEntriesPerFabric",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "AccessControlEntryChanged",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "AccessControlExtensionChanged",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "Basic Information",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_INFORMATION_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DataModelRevision",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorName",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorID",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "vendor_id",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductName",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductID",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "NodeLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ManufacturingDate",
+ "code": 11,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "PartNumber",
+ "code": 12,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductURL",
+ "code": 13,
+ "mfgCode": null,
+ "side": "server",
+ "type": "long_char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductLabel",
+ "code": 14,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SerialNumber",
+ "code": 15,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "LocalConfigDisabled",
+ "code": 16,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UniqueID",
+ "code": 18,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CapabilityMinima",
+ "code": 19,
+ "mfgCode": null,
+ "side": "server",
+ "type": "CapabilityMinimaStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductAppearance",
+ "code": 20,
+ "mfgCode": null,
+ "side": "server",
+ "type": "ProductAppearanceStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SpecificationVersion",
+ "code": 21,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "MaxPathsPerInvoke",
+ "code": 22,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "StartUp",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "ShutDown",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "Leave",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "OTA Software Update Provider",
+ "code": 41,
+ "mfgCode": null,
+ "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER",
+ "side": "client",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "QueryImage",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "QueryImageResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ApplyUpdateRequest",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ApplyUpdateResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NotifyUpdateApplied",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "OTA Software Update Requestor",
+ "code": 42,
+ "mfgCode": null,
+ "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "AnnounceOTAProvider",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "DefaultOTAProviders",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpdatePossible",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpdateState",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "UpdateStateEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpdateStateProgress",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "StateTransition",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "VersionApplied",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "DownloadError",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "Localization Configuration",
+ "code": 43,
+ "mfgCode": null,
+ "define": "LOCALIZATION_CONFIGURATION_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "ActiveLocale",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "en-US",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedLocales",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Time Format Localization",
+ "code": 44,
+ "mfgCode": null,
+ "define": "TIME_FORMAT_LOCALIZATION_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "HourFormat",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "HourFormatEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Unit Localization",
+ "code": 45,
+ "mfgCode": null,
+ "define": "UNIT_LOCALIZATION_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "General Commissioning",
+ "code": 48,
+ "mfgCode": null,
+ "define": "GENERAL_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ArmFailSafe",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ArmFailSafeResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "SetRegulatoryConfig",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "SetRegulatoryConfigResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CommissioningComplete",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CommissioningCompleteResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "Breadcrumb",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0000000000000000",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "BasicCommissioningInfo",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "BasicCommissioningInfo",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RegulatoryConfig",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "RegulatoryLocationTypeEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LocationCapability",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "RegulatoryLocationTypeEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportsConcurrentConnection",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Network Commissioning",
+ "code": 49,
+ "mfgCode": null,
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ScanNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ScanNetworksResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddOrUpdateWiFiNetwork",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddOrUpdateThreadNetwork",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveNetwork",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NetworkConfigResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ConnectNetwork",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ConnectNetworkResponse",
+ "code": 7,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ReorderNetwork",
+ "code": 8,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "MaxNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Networks",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ScanMaxTimeSeconds",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ConnectMaxTimeSeconds",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "InterfaceEnabled",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastNetworkingStatus",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "NetworkCommissioningStatusEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastNetworkID",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "octet_string",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastConnectErrorValue",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32s",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "General Diagnostics",
+ "code": 51,
+ "mfgCode": null,
+ "define": "GENERAL_DIAGNOSTICS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "TestEventTrigger",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "TimeSnapshot",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "TimeSnapshotResponse",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "NetworkInterfaces",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RebootCount",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpTime",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "TotalOperationalHours",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "BootReason",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "BootReasonEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "TestEventTriggersEnabled",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "false",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "BootReason",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "WiFi Network Diagnostics",
+ "code": 54,
+ "mfgCode": null,
+ "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "BSSID",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "octet_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SecurityType",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "SecurityTypeEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "WiFiVersion",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "WiFiVersionEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ChannelNumber",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RSSI",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8s",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentMaxRate",
+ "code": 11,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Administrator Commissioning",
+ "code": 60,
+ "mfgCode": null,
+ "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "OpenCommissioningWindow",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RevokeCommissioning",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "WindowStatus",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "CommissioningWindowStatusEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AdminFabricIndex",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "fabric_idx",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AdminVendorId",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "vendor_id",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "AttestationRequest",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AttestationResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CertificateChainRequest",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CertificateChainResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CSRRequest",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CSRResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddNOC",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "UpdateNOC",
+ "code": 7,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NOCResponse",
+ "code": 8,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddTrustedRootCertificate",
+ "code": 11,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "NOCs",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Fabrics",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedFabrics",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CommissionedFabrics",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TrustedRootCertificates",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentFabricIndex",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Group Key Management",
+ "code": 63,
+ "mfgCode": null,
+ "define": "GROUP_KEY_MANAGEMENT_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "KeySetWrite",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetRead",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadResponse",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetRemove",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadAllIndices",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadAllIndicesResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "GroupKeyMap",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "GroupTable",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "MaxGroupsPerFabric",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "MaxGroupKeysPerFabric",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "Anonymous Endpoint Type",
+ "deviceTypeRef": {
+ "code": 115,
+ "profileId": 259,
+ "label": "MA-laundry-washer",
+ "name": "MA-laundry-washer"
+ },
+ "deviceTypes": [
+ {
+ "code": 115,
+ "profileId": 259,
+ "label": "MA-laundry-washer",
+ "name": "MA-laundry-washer"
+ }
+ ],
+ "deviceVersions": [
+ 1
+ ],
+ "deviceIdentifiers": [
+ 115
+ ],
+ "deviceTypeName": "MA-laundry-washer",
+ "deviceTypeCode": 115,
+ "deviceTypeProfileId": 259,
+ "clusters": [
+ {
+ "name": "Identify",
+ "code": 3,
+ "mfgCode": null,
+ "define": "IDENTIFY_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "Identify",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "TriggerEffect",
+ "code": 64,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "IdentifyTime",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "IdentifyType",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "IdentifyTypeEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "4",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Groups",
+ "code": 4,
+ "mfgCode": null,
+ "define": "GROUPS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "AddGroup",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddGroupResponse",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ViewGroup",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ViewGroupResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "GetGroupMembership",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "GetGroupMembershipResponse",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveGroup",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveGroupResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveAllGroups",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddGroupIfIdentifying",
+ "code": 5,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "NameSupport",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "NameSupportBitmap",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "4",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "On/Off",
+ "code": 6,
+ "mfgCode": null,
+ "define": "ON_OFF_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "Off",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "On",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Toggle",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "OffWithEffect",
+ "code": 64,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "OnWithRecallGlobalScene",
+ "code": 65,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "OnWithTimedOff",
+ "code": 66,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "OnOff",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GlobalSceneControl",
+ "code": 16384,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OnTime",
+ "code": 16385,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OffWaitTime",
+ "code": 16386,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "StartUpOnOff",
+ "code": 16387,
+ "mfgCode": null,
+ "side": "server",
+ "type": "StartUpOnOffEnum",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0xFF",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "5",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Descriptor",
+ "code": 29,
+ "mfgCode": null,
+ "define": "DESCRIPTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DeviceTypeList",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ServerList",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClientList",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "PartsList",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Binding",
+ "code": 30,
+ "mfgCode": null,
+ "define": "BINDING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "Binding",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Power Source",
+ "code": 47,
+ "mfgCode": null,
+ "define": "POWER_SOURCE_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "Status",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "PowerSourceStatusEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Order",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Description",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "WiredCurrentType",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "WiredCurrentTypeEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EndpointList",
+ "code": 31,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Fixed Label",
+ "code": 64,
+ "mfgCode": null,
+ "define": "FIXED_LABEL_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "LabelList",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "User Label",
+ "code": 65,
+ "mfgCode": null,
+ "define": "USER_LABEL_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "LabelList",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Mode Select",
+ "code": 80,
+ "mfgCode": null,
+ "define": "MODE_SELECT_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ChangeToMode",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "Description",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "StandardNamespace",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "enum16",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedModes",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentMode",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "StartUpMode",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OnMode",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Laundry Washer Mode",
+ "code": 81,
+ "mfgCode": null,
+ "define": "LAUNDRY_WASHER_MODE_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ChangeToMode",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ChangeToModeResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "SupportedModes",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentMode",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "StartUpMode",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OnMode",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Laundry Washer Controls",
+ "code": 83,
+ "mfgCode": null,
+ "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "SpinSpeeds",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SpinSpeedCurrent",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "NumberOfRinses",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "NumberOfRinsesEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedRinses",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Temperature Control",
+ "code": 86,
+ "mfgCode": null,
+ "define": "TEMPERATURE_CONTROL_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "SetTemperature",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "SelectedTemperatureLevel",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedTemperatureLevels",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational State",
+ "code": 96,
+ "mfgCode": null,
+ "define": "OPERATIONAL_STATE_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "Pause",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Stop",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Start",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Resume",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "OperationalCommandResponse",
+ "code": 4,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "PhaseList",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentPhase",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CountdownTime",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "elapsed_s",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OperationalStateList",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OperationalState",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "OperationalStateEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "OperationalError",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "ErrorStateStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "OperationalError",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "OperationCompletion",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "endpoints": [
+ {
+ "endpointTypeName": "MA-rootdevice",
+ "endpointTypeIndex": 0,
+ "profileId": 259,
+ "endpointId": 0,
+ "networkId": 0
+ },
+ {
+ "endpointTypeName": "Anonymous Endpoint Type",
+ "endpointTypeIndex": 1,
+ "profileId": 259,
+ "endpointId": 1,
+ "networkId": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/examples/lighting-app/nxp/k32w/k32w0/.gn b/examples/lighting-app/nxp/k32w/k32w0/.gn
index 3d48789e30ab3d..363727423ce903 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/.gn
+++ b/examples/lighting-app/nxp/k32w/k32w0/.gn
@@ -25,4 +25,7 @@ default_args = {
target_os = "freertos"
import("//args.gni")
+
+ # Import default platform configs
+ import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni")
}
diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn
index 93bf1dc363f9dd..43a9860b5da48a 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn
+++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn
@@ -13,11 +13,13 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w0_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
-import("${k32w0_sdk_build_root}/k32w0_executable.gni")
-import("${k32w0_sdk_build_root}/k32w0_sdk.gni")
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
@@ -26,6 +28,9 @@ import("${chip_root}/src/platform/device.gni")
declare_args() {
chip_software_version = 0
chip_simple_hash_verification = 0
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
}
if (chip_pw_tokenizer_logging) {
@@ -70,6 +75,10 @@ k32w0_sdk("sdk") {
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
]
}
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
}
k32w0_executable("light_app") {
diff --git a/examples/lighting-app/nxp/k32w/k32w0/README.md b/examples/lighting-app/nxp/k32w/k32w0/README.md
index 3194d71b39b889..af43002f21c65a 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/README.md
+++ b/examples/lighting-app/nxp/k32w/k32w0/README.md
@@ -231,7 +231,7 @@ Start building the application:
```bash
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lighting-app/nxp/k32w/k32w0
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ gn gen out/debug --args="chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"platform\" chip_with_se05x=0 chip_pw_tokenizer_logging=true"
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ gn gen out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ ninja -C out/debug
```
@@ -257,6 +257,16 @@ In case the board doesn't have 32KHz crystal fitted, one can use the 32KHz free
running oscillator as a clock source. In this case one must set the use_fro_32k
argument to 1.
+K32W0x1 supports antenna diversity feature, which is a technique that maximizes
+the performance of an antenna system, allowing the radio signal to be switched
+between two antennas that have very low correlation between their received
+signals. Typically, this is achieved by spacing two antennas around 0.25
+wavelengths apart or by using 2 orthogonal types of polarization. This is
+controlled by software. K32W0x1 provides an output (`ADO`) on one of `DIO7`,
+`DIO9` or `DIO19` and optionally its complement (`ADE`) on `DIO6` that can be
+used to control an antenna switch. In order to use this feature, user must set
+`use_antenna_diversity` to 1.
+
In case signing errors are encountered when running the "sign_images.sh" script
(run automatically) install the recommanded packages (python version > 3, pip3,
pycrypto, pycryptodome):
@@ -624,14 +634,14 @@ The concept for OTA is the next one:
informed of the node id of the OTA Provider Application.
_Computer #1_ can be any system running an Ubuntu distribution. We recommand
-using TE 7.5 instructions from
-[here](https://groups.csa-iot.org/wg/matter-csg/document/24839), where RPi 4 are
-proposed. Also, TE 7.5 instructions document point to the OS/Docker images that
-should be used on the RPis. For compatibility reasons, we recommand compiling
-chip-tool and OTA Provider applications with the same commit id that was used
-for compiling the Lighting Application. Also, please note that there is a single
-controller (chip-tool) running on Computer #1 which is used for commissioning
-both the device and the OTA Provider Application. If needed,
+using CSA official instructions from
+[here](https://groups.csa-iot.org/wg/matter-csg/document/28566), where RPi 4 are
+proposed. Also, CSA official instructions document point to the OS/Docker images
+that should be used on the RPis. For compatibility reasons, we recommand
+compiling chip-tool and OTA Provider applications with the same commit id that
+was used for compiling the Lighting Application. Also, please note that there is
+a single controller (chip-tool) running on Computer #1 which is used for
+commissioning both the device and the OTA Provider Application. If needed,
[these instructions](https://itsfoss.com/connect-wifi-terminal-ubuntu/) could be
used for connecting the RPis to WiFi.
diff --git a/examples/lighting-app/nxp/k32w/k32w0/args.gni b/examples/lighting-app/nxp/k32w/k32w0/args.gni
index 4f4bba4b47cf07..f5fd7a83cd9005 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/args.gni
+++ b/examples/lighting-app/nxp/k32w/k32w0/args.gni
@@ -13,8 +13,6 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("${chip_root}/config/standalone/args.gni")
-import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni")
# SDK target. This is overridden to add our SDK app_config.h & defines.
k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain")
@@ -22,3 +20,11 @@ k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_ota_requestor = true
chip_stack_lock_tracking = "fatal"
chip_enable_ble = true
+
+is_debug = false
+
+chip_crypto = "platform"
+chip_crypto_flavor = "NXP-Ultrafast-P256"
+chip_with_ot_cli = 0
+chip_with_OM15082 = 1
+chip_pw_tokenizer_logging = true
diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
index 946d457622e467..e32575e55ff5c4 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
+++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
@@ -106,8 +106,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005
// Use a default setup PIN code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
/**
* CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
index 39c9584c883480..7b9ecccdec3068 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -52,6 +52,9 @@
#include "LEDWidget.h"
#include "app_config.h"
+#if CHIP_CRYPTO_HSM
+#include
+#endif
#ifdef ENABLE_HSM_DEVICE_ATTESTATION
#include "DeviceAttestationSe05xCredsExample.h"
#endif
@@ -643,7 +646,6 @@ void AppTask::BleStartAdvertising(intptr_t arg)
else
{
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
-
if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR)
{
K32W_LOG("Started BLE Advertising!");
diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/include/AppTask.h b/examples/lighting-app/nxp/k32w/k32w0/main/include/AppTask.h
index 9590734521d5e1..0c455f431a8cf4 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/main/include/AppTask.h
+++ b/examples/lighting-app/nxp/k32w/k32w0/main/include/AppTask.h
@@ -112,7 +112,6 @@ class AppTask
kFunctionTurnOnTurnOff,
kFunction_Identify,
kFunction_TriggerEffect,
-
kFunction_Invalid
} Function;
diff --git a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
index 2f327213533e94..7785720c28c3ec 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
+++ b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
@@ -36,6 +36,9 @@ if (chip_enable_pw_rpc) {
declare_args() {
chip_software_version = 0
+
+ # Setup discriminator as argument
+ setup_discriminator = 3840
}
assert(current_os == "freertos")
@@ -85,6 +88,10 @@ k32w1_sdk("sdk") {
"BOARD_APP_UART_CLK_FREQ=96000000",
]
}
+
+ defines += [
+ "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}",
+ ]
}
k32w1_executable("light_app") {
@@ -92,6 +99,13 @@ k32w1_executable("light_app") {
sources = []
deps = []
+ defines = []
+
+ if (chip_config_dimmable_led) {
+ defines += [ "CHIP_CONFIG_ENABLE_DIMMABLE_LED = 1" ]
+ } else {
+ defines += [ "CHIP_CONFIG_ENABLE_DIMMABLE_LED = 0" ]
+ }
if (chip_enable_pw_rpc) {
forward_variables_from(pw_rpc_server, "*")
@@ -111,12 +125,19 @@ k32w1_executable("light_app") {
"main/main.cpp",
]
- public = [ "${chip_root}/src/platform/nxp/k32w/k32w1/DefaultTestEventTriggerDelegate.h" ]
+ if (chip_config_dimmable_led) {
+ sources += [
+ "${k32w1_platform_dir}/util/LED_Dimmer.cpp",
+ "${k32w1_platform_dir}/util/include/LED_Dimmer.h",
+ ]
+ deps += [ "${chip_root}/examples/lighting-app/lighting-common/" ]
+ } else {
+ deps += [ "${chip_root}/examples/lighting-app/nxp/zap/" ]
+ }
deps += [
":sdk",
"${chip_root}/examples/common/QRCode",
- "${chip_root}/examples/lighting-app/nxp/zap/",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
@@ -126,13 +147,13 @@ k32w1_executable("light_app") {
if (chip_openthread_ftd) {
deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
- "${chip_root}/third_party/openthread/repo:libopenthread-ftd",
+ "${openthread_root}:libopenthread-cli-ftd",
+ "${openthread_root}:libopenthread-ftd",
]
} else {
deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
- "${chip_root}/third_party/openthread/repo:libopenthread-mtd",
+ "${openthread_root}:libopenthread-cli-mtd",
+ "${openthread_root}:libopenthread-mtd",
]
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/README.md b/examples/lighting-app/nxp/k32w/k32w1/README.md
index 253c21e04eafbb..c44c73a1ecc946 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/README.md
+++ b/examples/lighting-app/nxp/k32w/k32w1/README.md
@@ -22,18 +22,17 @@ into an existing Matter network and can be controlled by this network.
- [Device UI](#device-ui)
- [Building](#building)
- [SMU2](#smu2-memory)
+ - [LED PWM](#led-pwm)
- [Manufacturing data](#manufacturing-data)
- [Flashing](#flashing)
- [Flashing the NBU image](#flashing-the-nbu-image)
- [Flashing the host image](#flashing-the-host-image)
- [Debugging](#debugging)
- [OTA](#ota)
-
- [Convert srec into sb3 file](#convert-srec-into-sb3-file)
- [Convert sb3 into ota file](#convert-sb3-into-ota-file)
- [Running OTA](#running-ota)
- [Known issues](#known-issues)
-
- [Running RPC console](#running-rpc-console)
@@ -136,8 +135,9 @@ In order to build the Matter example, we recommend using a Linux distribution
```
user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W1_SDK_ROOT=/home/user/Desktop/SDK_K32W1/
user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh
+user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lighting-app/nxp/k32w/k32w1
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w1$ gn gen out/debug --args="chip_with_ot_cli=0 is_debug=false chip_openthread_ftd=true chip_crypto=\"platform\""
+user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w1$ gn gen out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w1$ ninja -C out/debug
```
@@ -154,10 +154,10 @@ memory. When compiling with OpenThread FTD support (`chip_openthread_ftd=true`)
and with `use_smu2_static=true`, the following components are placed in `SMU2`
memory:
-- `gImageProcessor` from `OTAImageProcessorImpl.cpp`.
-- `gApplicationProcessor` from `OTAHooks.cpp`.
-- `Server::sServer` from `Server.cpp`.
-- `ThreadStackManagerImpl::sInstance` from `ThreadStackManagerImpl.cpp`.
+- `gImageProcessor` from OTAImageProcessorImpl.cpp.
+- `gApplicationProcessor` from OTAHooks.cpp.
+- `Server::sServer` from Server.cpp.
+- `ThreadStackManagerImpl::sInstance` from ThreadStackManagerImpl.cpp.
These instances and global variables are placed in `SMU2` memory through name
matching in the application linker script. They should not be changed or, if
@@ -171,6 +171,17 @@ the OpenThread buffers will be dynamically allocated instead of statically,
freeing some `SRAM`. To enable this feature compile with OpenThread FTD support
(`chip_openthread_ftd=true`) and with `use_smu2_dynamic=true`.
+### LED PWM
+
+In the default configuration, the onboard RGB LED pins are configured as GPIO
+pins. In order to enable the dimming feature, the pins need to be configured in
+PWM mode and synced with channels of the `TPM` (Timer PWM Module). To enable
+this feature, compile the application with: `chip_config_dimmable_led=true`
+
+If the feature is enabled, the LED brightness can be controlled using **Level
+control** cluster
+[commands](../../../../../docs/guides/chip_tool_guide.md#step-7-control-application-data-model-clusters).
+
## Manufacturing data
Use `chip_with_factory_data=1` in the gn build command to enable factory data.
@@ -195,7 +206,7 @@ path -
[K32W148 board quick start guide](https://www.nxp.com/document/guide/getting-started-with-the-k32w148-development-platform:GS-K32W148EVK)
can be used for updating the `NBU/radio` core:
-- Section 2.4 – Get Software – install `SPSDK` (Secure Provisioning Command
+- Section 2.5 – Get Software – install `SPSDK` (Secure Provisioning Command
Line Tool)
- Section 3.3 – Updating `NBU` for Wireless examples - use the corresponding
.sb3 file found in the SDK package at path
@@ -298,7 +309,7 @@ In `OTAP` application
the image only for the CM33 core
- keep other settings at default values
-### Convert sb3 into ota file
+### Convert `sb3` into `ota` file
In order to build an OTA image, use NXP wrapper over the standard tool
`src/app/ota_image_tool.py`:
diff --git a/examples/lighting-app/nxp/k32w/k32w1/args.gni b/examples/lighting-app/nxp/k32w/k32w1/args.gni
index a06e5828acdc45..d0c28a1e048545 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/args.gni
+++ b/examples/lighting-app/nxp/k32w/k32w1/args.gni
@@ -17,6 +17,13 @@ import("//build_overrides/chip.gni")
# SDK target. This is overridden to add our SDK app_config.h & defines.
k32w1_sdk_target = get_label_info(":sdk", "label_no_toolchain")
+chip_config_dimmable_led = false
chip_enable_ota_requestor = true
chip_stack_lock_tracking = "fatal"
chip_enable_ble = true
+
+is_debug = false
+
+chip_crypto = "platform"
+chip_openthread_ftd = true
+chip_with_ot_cli = 0
diff --git a/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
index 05f8042ed28138..ad5d876dc650ab 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
@@ -101,8 +101,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005
// Use a default setup PIN code if one hasn't been provisioned in flash.
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
+#endif
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
index 2eb2f8e095b8b1..96f5a5b96b3248 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -57,6 +57,10 @@
#include "fsl_component_button.h"
#include "fwk_platform.h"
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+#include "LED_Dimmer.h"
+#endif
+
#define FACTORY_RESET_TRIGGER_TIMEOUT 6000
#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000
#define APP_TASK_PRIORITY 2
@@ -165,7 +169,13 @@ CHIP_ERROR AppTask::Init()
#ifndef CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
sStatusLED.Init(SYSTEM_STATE_LED, false);
#endif
+
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ init_dimmable();
+#else
sLightLED.Init(LIGHT_STATE_LED, false);
+#endif
+
UpdateDeviceState();
/* intialize the Keyboard and button press callback */
@@ -487,7 +497,12 @@ void AppTask::ResetActionEventHandler(AppEvent * aEvent)
#ifndef CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
sStatusLED.Set(false);
#endif
+
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ sLightLED.SetLevel(0);
+#else
sLightLED.Set(false);
+#endif
#ifndef CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
sStatusLED.Blink(500);
@@ -537,7 +552,7 @@ void AppTask::LightActionEventHandler(AppEvent * aEvent)
if (err == CHIP_NO_ERROR)
{
- initiated = LightingMgr().InitiateAction(actor, action);
+ initiated = LightingMgr().InitiateAction(actor, action, LightingMgr().IsTurnedOff() ? 0 : 1);
if (!initiated)
{
@@ -644,6 +659,10 @@ void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor)
{
K32W_LOG("Turn off Action has been initiated")
}
+ else if (aAction == LightingManager::DIM_ACTION)
+ {
+ K32W_LOG("Dim Action has been initiated");
+ }
if (aActor == AppEvent::kEventType_Button)
{
@@ -653,20 +672,33 @@ void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor)
sAppTask.mFunction = kFunctionTurnOnTurnOff;
}
-void AppTask::ActionCompleted(LightingManager::Action_t aAction)
+void AppTask::ActionCompleted(LightingManager::Action_t aAction, uint8_t level)
{
// Turn on the light LED if in a TURNON state OR
// Turn off the light LED if in a TURNOFF state.
if (aAction == LightingManager::TURNON_ACTION)
{
K32W_LOG("Turn on action has been completed")
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+#else
sLightLED.Set(true);
+#endif
}
else if (aAction == LightingManager::TURNOFF_ACTION)
{
K32W_LOG("Turn off action has been completed")
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+#else
sLightLED.Set(false);
+#endif
+ }
+ else if (aAction == LightingManager::DIM_ACTION)
+ {
+ K32W_LOG("Move to level %d completed", level);
}
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ sLightLED.SetLevel(LightingMgr().IsTurnedOff() ? 1 : LightingMgr().GetDimLevel());
+#endif
if (sAppTask.mSyncClusterToButtonAction)
{
@@ -679,6 +711,9 @@ void AppTask::ActionCompleted(LightingManager::Action_t aAction)
void AppTask::RestoreLightingState(void)
{
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ LightingMgr().SetState(!LightingMgr().IsTurnedOff());
+#else
/* restore initial state for the LED indicating Lighting state */
if (LightingMgr().IsTurnedOff())
{
@@ -688,6 +723,7 @@ void AppTask::RestoreLightingState(void)
{
sLightLED.Set(true);
}
+#endif
}
void AppTask::OnIdentifyStart(Identify * identify)
@@ -706,7 +742,11 @@ void AppTask::OnIdentifyStart(Identify * identify)
ChipLogProgress(Zcl, "Identify process has started. Status LED should blink with a period of 0.5 seconds.");
sAppTask.mFunction = kFunction_Identify;
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ sLightLED.SetLevel(0);
+#else
sLightLED.Set(false);
+#endif
sLightLED.Blink(250);
}
@@ -790,7 +830,11 @@ void AppTask::OnTriggerEffect(Identify * identify)
if (timerDelay)
{
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+ sLightLED.SetLevel(0);
+#else
sLightLED.Set(false);
+#endif
sLightLED.Blink(500);
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(timerDelay), OnTriggerEffectComplete, identify);
@@ -873,7 +917,10 @@ void AppTask::UpdateDeviceStateInternal(intptr_t arg)
(void) app::Clusters::OnOff::Attributes::OnOff::Get(1, &onoffAttrValue);
/* set the device state */
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+#else
sLightLED.Set(onoffAttrValue);
+#endif
LightingMgr().SetState(onoffAttrValue);
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/LightingManager.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/LightingManager.cpp
index 7a5cefc9b668fc..2627138043bbe4 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/LightingManager.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/LightingManager.cpp
@@ -19,6 +19,10 @@
#include "LightingManager.h"
+#if CHIP_CONFIG_ENABLE_DIMMABLE_LED
+#include "LED_Dimmer.h"
+#endif
+
#include "AppTask.h"
#include "FreeRTOS.h"
@@ -30,6 +34,8 @@ int LightingManager::Init()
{
mState = kState_On;
+ mLevel = kLevel_Max;
+
return 0;
}
@@ -44,24 +50,48 @@ void LightingManager::SetState(bool state)
mState = state ? kState_On : kState_Off;
}
+void LightingManager::SetDimLevel(uint8_t level)
+{
+ mLevel = level;
+}
+
bool LightingManager::IsTurnedOff()
{
return (mState == kState_Off) ? true : false;
}
-bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction)
+uint8_t LightingManager::GetDimLevel()
+{
+ return mLevel;
+}
+
+bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t kValue)
{
bool action_initiated = false;
+ State_t current_state;
if (mState == kState_On && aAction == TURNOFF_ACTION)
{
action_initiated = true;
- mState = kState_Off;
+ current_state = kState_Off;
}
else if (mState == kState_Off && aAction == TURNON_ACTION)
{
action_initiated = true;
- mState = kState_On;
+ current_state = kState_On;
+ }
+
+ else if (aAction == DIM_ACTION && kValue != mLevel)
+ {
+ action_initiated = true;
+ if (kValue == 1)
+ {
+ current_state = kState_Off;
+ }
+ else
+ {
+ current_state = kState_On;
+ }
}
if (action_initiated)
@@ -70,9 +100,20 @@ bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction)
{
mActionInitiated_CB(aAction, aActor);
}
+
+ if (aAction == TURNON_ACTION || aAction == TURNOFF_ACTION)
+ {
+ SetState(current_state == kState_On);
+ }
+ else if (aAction == DIM_ACTION)
+ {
+ mState = current_state;
+ SetDimLevel(kValue);
+ }
+
if (mActionCompleted_CB)
{
- mActionCompleted_CB(aAction);
+ mActionCompleted_CB(aAction, kValue);
}
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
index 5a4eee6e2c09e4..a9c6aee8798c49 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
@@ -40,14 +40,21 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
return;
}
- LightingMgr().InitiateAction(0, *value ? LightingManager::TURNON_ACTION : LightingManager::TURNOFF_ACTION);
+ LightingMgr().InitiateAction(0, *value ? LightingManager::TURNON_ACTION : LightingManager::TURNOFF_ACTION, *value);
}
else if (path.mClusterId == LevelControl::Id)
{
- ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
- ChipLogValueMEI(path.mAttributeId), type, *value, size);
+ if (path.mAttributeId != LevelControl::Attributes::CurrentLevel::Id)
+ {
+ ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mAttributeId));
+ return;
+ }
- // WIP Apply attribute change to Light
+ if (*value > 1 && *value < 254)
+ {
+ ChipLogProgress(Zcl, "Setting value: %d", *value);
+ LightingMgr().InitiateAction(0, LightingManager::DIM_ACTION, *value);
+ }
}
else if (path.mClusterId == ColorControl::Id)
{
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h b/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
index b5201da2477862..096690c680b1d2 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
@@ -71,7 +71,7 @@ class AppTask
CHIP_ERROR Init();
static void ActionInitiated(LightingManager::Action_t aAction, int32_t aActor);
- static void ActionCompleted(LightingManager::Action_t aAction);
+ static void ActionCompleted(LightingManager::Action_t aAction, uint8_t level);
void CancelTimer(void);
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/include/LightingManager.h b/examples/lighting-app/nxp/k32w/k32w1/main/include/LightingManager.h
index 327bf3bdf02763..f96d6c7ecae40c 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/include/LightingManager.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/include/LightingManager.h
@@ -33,7 +33,7 @@ class LightingManager
{
TURNON_ACTION = 0,
TURNOFF_ACTION,
-
+ DIM_ACTION,
INVALID_ACTION
} Action;
@@ -43,18 +43,24 @@ class LightingManager
kState_Off,
} State;
+ static const uint8_t kLevel_Max = 254;
+ static const uint8_t kLevel_Min = 0;
+
int Init();
bool IsTurnedOff();
- bool InitiateAction(int32_t aActor, Action_t aAction);
+ uint8_t GetDimLevel();
+ bool InitiateAction(int32_t aActor, Action_t aAction, uint8_t kValue);
typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor);
- typedef void (*Callback_fn_completed)(Action_t);
+ typedef void (*Callback_fn_completed)(Action_t, uint8_t level);
void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB);
void SetState(bool state);
+ void SetDimLevel(uint8_t level);
private:
friend LightingManager & LightingMgr(void);
State_t mState;
+ uint8_t mLevel;
Callback_fn_initiated mActionInitiated_CB;
Callback_fn_completed mActionCompleted_CB;
diff --git a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn
deleted file mode 100644
index c755514d66a175..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn
+++ /dev/null
@@ -1,163 +0,0 @@
-# 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/k32w0_sdk.gni")
-import("//build_overrides/openthread.gni")
-import("${chip_root}/src/platform/device.gni")
-import("${chip_root}/third_party/simw-top-mini/simw_config.gni")
-
-import("${k32w0_sdk_build_root}/k32w0_executable.gni")
-import("${k32w0_sdk_build_root}/k32w0_sdk.gni")
-
-import("${chip_root}/src/crypto/crypto.gni")
-import("${chip_root}/src/lib/core/core.gni")
-
-declare_args() {
- chip_software_version = 0
-}
-
-if (chip_pw_tokenizer_logging) {
- import("//build_overrides/pigweed.gni")
- import("$dir_pw_tokenizer/database.gni")
-}
-
-assert(current_os == "freertos")
-
-k32w0_platform_dir = "${chip_root}/examples/platform/nxp/k32w/k32w0"
-
-k32w0_sdk("sdk") {
- sources = [
- "${k32w0_platform_dir}/app/project_include/OpenThreadConfig.h",
- "include/CHIPProjectConfig.h",
- "include/FreeRTOSConfig.h",
- "main/include/app_config.h",
- ]
-
- public_deps =
- [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform" ]
-
- include_dirs = [
- "main/include",
- "main",
- "include",
- "${k32w0_platform_dir}/app/support",
- "${k32w0_platform_dir}/util/include",
- "${k32w0_platform_dir}/common",
- ]
-
- defines = []
- if (is_debug) {
- defines += [ "BUILD_RELEASE=0" ]
- } else {
- defines += [ "BUILD_RELEASE=1" ]
- }
-
- if (chip_software_version != 0) {
- defines += [
- "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
- ]
- }
-}
-
-k32w0_executable("lock_app") {
- output_name = "chip-k32w0x-lock-example"
-
- sources = [
- "${k32w0_platform_dir}/util/LEDWidget.cpp",
- "${k32w0_platform_dir}/util/include/LEDWidget.h",
- "main/AppTask.cpp",
- "main/BoltLockManager.cpp",
- "main/ZclCallbacks.cpp",
- "main/include/AppEvent.h",
- "main/include/AppTask.h",
- "main/include/BoltLockManager.h",
- "main/main.cpp",
- ]
-
- if (chip_with_factory_data == 1 && use_custom_factory_provider == 1) {
- sources += [
- "${k32w0_platform_dir}/common/CustomFactoryDataProvider.cpp",
- "${k32w0_platform_dir}/common/CustomFactoryDataProvider.h",
- ]
-
- defines = [ "CHIP_DEVICE_CONFIG_USE_CUSTOM_PROVIDER=1" ]
- }
-
- deps = [
- ":sdk",
- "${chip_root}/examples/common/QRCode",
- "${chip_root}/examples/lock-app/nxp/zap/",
- "${chip_root}/examples/providers:device_info_provider",
- "${chip_root}/src/crypto",
- "${chip_root}/src/lib",
- "${chip_root}/src/platform:syscalls_stub",
- "${chip_root}/third_party/mbedtls:mbedtls",
- "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
- ]
-
- if (chip_openthread_ftd) {
- deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
- "${chip_root}/third_party/openthread/repo:libopenthread-ftd",
- ]
- } else {
- deps += [
- "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
- "${chip_root}/third_party/openthread/repo:libopenthread-mtd",
- ]
- }
-
- cflags = [ "-Wconversion" ]
-
- output_dir = root_out_dir
-
- ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w0x-linker.ld"
-
- inputs = [ ldscript ]
-
- ldflags = [
- "-T" + rebase_path(ldscript, root_build_dir),
- "-Wl,-print-memory-usage",
- ]
-}
-
-if (chip_pw_tokenizer_logging) {
- pw_tokenizer_database("lock_app.database") {
- database = "$root_build_dir/chip-k32w0x-lock-example-database.bin"
- create = "binary"
- deps = [ ":lock_app" ]
- optional_paths = [ "$root_build_dir/chip-k32w0x-lock-example" ]
- }
-}
-group("k32w0") {
- deps = [
- ":binsign",
- ":lock_app",
- ]
- if (chip_pw_tokenizer_logging) {
- deps += [ ":lock_app.database" ]
- }
-}
-
-action("binsign") {
- deps = [ ":lock_app" ]
- script = "${k32w0_platform_dir}/scripts/sign-outdir.py"
- output_name = "bignsign.log"
- outputs = [ "${root_build_dir}/${output_name}" ]
-}
-
-group("default") {
- deps = [ ":k32w0" ]
-}
diff --git a/examples/lock-app/nxp/k32w/k32w0/README.md b/examples/lock-app/nxp/k32w/k32w0/README.md
deleted file mode 100644
index 49920906819b0f..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/README.md
+++ /dev/null
@@ -1,452 +0,0 @@
-# CHIP K32W061 Lock Example Application
-
-The Project CHIP K32W061 Lock Example demonstrates how to remotely control a
-door lock device with one basic bolt. It uses buttons to test changing the lock
-and device states and LEDs to show the state of these changes. You can use this
-example as a reference for creating your own application.
-
-The example is based on
-[Project CHIP](https://github.com/project-chip/connectedhomeip) and the NXP K32W
-SDK, and supports remote access and control of a simulated door lock over a
-low-power, 802.15.4 Thread network.
-
-The example behaves as a Project CHIP accessory, that is a device that can be
-paired into an existing Project CHIP network and can be controlled by this
-network.
-
-
-
-- [CHIP K32W0 Lock Example Application](#chip-k32w061-lock-example-application)
-- [Introduction](#introduction)
- - [Bluetooth LE Advertising](#bluetooth-le-advertising)
- - [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous)
-- [Device UI](#device-ui)
-- [Building](#building)
- - [Overwrite board config files](#overwrite-board-config-files)
- - [Known issues building](#known-issues-building)
-- [Manufacturing data](#manufacturing-data)
-- [Flashing and debugging](#flashing-and-debugging)
-- [Pigweed Tokenizer](#pigweed-tokenizer)
- - [Detokenizer script](#detokenizer-script)
- - [Notes](#notes)
- - [Known issues](#known-issues-tokenizer)
-- [NXP Ultrafast P256 ECC Library](#nxp-ultrafast-p256-ecc-library)
- - [Building steps](#building-steps)
-- [Tinycrypt ECC library](#tinycrypt-ecc-library)
- - [Building steps](#building-steps-1)
-- [Low power](#low-power)
-
- - [Known issues low power](#known-issues-low-power)
-
-
-
-## Introduction
-
-![K32W061 DK6](../../../../platform/nxp/k32w/k32w0/doc/images/k32w-dk6.jpg)
-
-The K32W061 lock example application provides a working demonstration of a
-connected door lock device, built using the Project CHIP codebase and the NXP
-K32W061 SDK. The example supports remote access (e.g.: using CHIP Tool from a
-mobile phone) and control of a simulated door lock over a low-power, 802.15.4
-Thread network. It is capable of being paired into an existing Project CHIP
-network along with other Project CHIP-enabled devices.
-
-The example targets the
-[NXP K32W061 DK6](https://www.nxp.com/products/wireless/thread/k32w061-41-high-performance-secure-and-ultra-low-power-mcu-for-zigbeethread-and-bluetooth-le-5-0-with-built-in-nfc-option:K32W061_41)
-development kit, but is readily adaptable to other K32W-based hardware.
-
-The CHIP device that runs the lock application is controlled by the CHIP
-controller device over the Thread protocol. By default, the CHIP device has
-Thread disabled, and it should be paired over Bluetooth LE with the CHIP
-controller and obtain configuration from it. The actions required before
-establishing full communication are described below.
-
-The example also comes with a test mode, which allows to start Thread with the
-default settings by pressing a button. However, this mode does not guarantee
-that the device will be able to communicate with the CHIP controller and other
-devices.
-
-### SE051H Secure Element
-
-Deployment of this firmware configuration requires the K32W061 board setups
-using the K32W061 module board, SE051 Expansion board and Generic Expansion
-board as shown below:
-
-![SE051H + K32W061 DK6](../../../../platform/nxp/k32w/k32w0/doc/images/k32w-se.jpg)
-
-The SE051H Secure Element extension may be used for best in class security and
-offloading some of the Project CHIP cryptographic operations. Depending on your
-hardware configuration, choose one of the options below (building with or
-without Secure Element). NOTE: the SE051H is a derivative of the SE051 product
-family (see http://www.nxp.com/SE051) including dedicated CHIP support in
-addition to the SE051 feature set. See the material provided separately by NXP
-for more details on SE051H.
-
-### Bluetooth LE Advertising
-
-In this example, to commission the device onto a Project CHIP network, it must
-be discoverable over Bluetooth LE. For security reasons, you must start
-Bluetooth LE advertising manually after powering up the device by pressing
-Button USERINTERFACE.
-
-### Bluetooth LE Rendezvous
-
-In this example, the commissioning procedure (called rendezvous) is done over
-Bluetooth LE between a CHIP device and the CHIP controller, where the controller
-has the commissioner role.
-
-To start the rendezvous, the controller must get the commissioning information
-from the CHIP device. The data payload is encoded within a QR code, printed to
-the UART console and shared using an NFC tag. For security reasons, you must
-start NFC tag emulation manually after powering up the device by pressing
-Button 4.
-
-### Thread Provisioning
-
-Last part of the rendezvous procedure, the provisioning operation involves
-sending the Thread network credentials from the CHIP controller to the CHIP
-device. As a result, device is able to join the Thread network and communicate
-with other Thread devices in the network.
-
-## Device UI
-
-The example application provides a simple UI that depicts the state of the
-device and offers basic user control. This UI is implemented via the
-general-purpose LEDs and buttons built in to the OM15082 Expansion board
-attached to the DK6 board.
-
-**LED D2** shows the overall state of the device and its connectivity. Four
-states are depicted:
-
-- _Short Flash On (50ms on/950ms off)_ — The device is in an
- unprovisioned (unpaired) state and is waiting for a commissioning
- application to connect.
-
-* _Rapid Even Flashing (100ms on/100ms off)_ — The device is in an
- unprovisioned state and a commissioning application is connected via BLE.
-
-- _Short Flash Off (950ms on/50ms off)_ — The device is full
- provisioned, but does not yet have full network (Thread) or service
- connectivity.
-
-* _Solid On_ — The device is fully provisioned and has full network and
- service connectivity.
-
-**LED D3** shows the state of the simulated lock bolt. When the LED is lit the
-bolt is extended (i.e. door locked); when not lit, the bolt is retracted (door
-unlocked). The LED will flash whenever the simulated bolt is in motion from one
-position to another.
-
-**Button SW2** can be used to reset the device to a default state. A short Press
-Button SW2 initiates a factory reset. After an initial period of 3 seconds, LED2
-D2 and D3 will flash in unison to signal the pending reset. After 6 seconds will
-cause the device to reset its persistent configuration and initiate a reboot.
-The reset action can be cancelled by press SW2 button at any point before the 6
-second limit.
-
-**Button SW3** can be used to change the state of the simulated bolt. This can
-be used to mimic a user manually operating the lock. The button behaves as a
-toggle, swapping the state every time it is pressed.
-
-**Button SW4** can be used for joining a predefined Thread network advertised by
-a Border Router. Default parameters for a Thread network are hard-coded and are
-being used if this button is pressed.
-
-The remaining two LEDs (D1/D4) and button (SW1) are unused.
-
-Directly on the development board, **Button USERINTERFACE** can be used for
-enabling Bluetooth LE advertising for a predefined period of time. Also, pushing
-this button starts the NFC emulation by writing the onboarding information in
-the NTAG.
-
-### No expansion board
-
-In case the **OM15082** Expansion board is not attached to the DK6 board, the
-functionality of LED D2 and LED D3 is taken over by LED DS2, respectively LED
-DS3, which can be found on the DK6 board.
-
-Also, by long pressing the **USERINTERFACE** button, the factory reset action
-will be initiated.
-
-## Building
-
-In order to build the Project CHIP example, we recommend using a Linux
-distribution (the demo-application was compiled on Ubuntu 20.04).
-
-Activate the Matter environment:
-
-```bash
-user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh
-```
-
-To bring the SDK in the environment, the user can:
-
-- download it with west tool, in which case it will be handled automatically
- by gn:
-
- ```bash
- user@ubuntu:~/Desktop/git/connectedhomeip$ cd third_party/nxp/k32w0_sdk/repo
- user@ubuntu:~/Desktop/git/connectedhomeip/third_party/nxp/k32w0_sdk/repo$ west init -l manifest --mf west.yml
- user@ubuntu:~/Desktop/git/connectedhomeip/third_party/nxp/k32w0_sdk/repo$ west update
- ```
-
- In case there are local modification to the already installed github NXP
- SDK, use the below `west forall` command instead of the `west init` command
- to reset the west workspace. Warning: all local changes will be lost after
- running this command.
-
- ```bash
- user@ubuntu:~/Desktop/git/connectedhomeip$ cd third_party/nxp/k32w0_sdk/repo
- user@ubuntu:~/Desktop/git/connectedhomeip/third_party/nxp/k32w0_sdk/repo$ west forall -c "git reset --hard && git clean -xdf" -a
- ```
-
-- set up a custom path to the SDK, in which case
- `k32w0_sdk_root=\"${NXP_K32W0_SDK_ROOT}\"` must be added to the `gn gen`
- command:
-
- ```
- user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W0_SDK_ROOT=/custom/path/to/SDK
- ```
-
-Start building the application:
-
-```bash
-user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lock-app/nxp/k32w/k32w0
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ gn gen out/debug --args="chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"platform\" chip_with_se05x=0 chip_pw_tokenizer_logging=true"
-user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ ninja -C out/debug
-```
-
-To build with Secure Element, follow the same steps as above but set
-`chip_with_se05x=1` in the `gn gen` command.
-
-- K32W041AM flavor
-
- Exactly the same steps as above but set argument `build_for_k32w041am=1` in
- the gn command.
-
-Also, in case the OM15082 Expansion Board is not attached to the DK6 board, the
-build argument (`chip_with_OM15082`) inside the gn build instruction should be
-set to zero. The argument `chip_with_OM15082` is set to zero by default.
-
-In case that Openthread CLI is needed, `chip_with_ot_cli` build argument must be
-set to 1.
-
-In case the board doesn't have 32KHz crystal fitted, one can use the 32KHz free
-running oscillator as a clock source. In this case one must set the
-`use_fro_32k` argument to 1.
-
-In case signing errors are encountered when running the "sign_images.sh" script
-(run automatically) install the recommanded packages (python version > 3, pip3,
-pycrypto, pycryptodome):
-
-```
-user@ubuntu:~$ python3 --version
-Python 3.8.2
-user@ubuntu:~$ pip3 --version
-pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
-user@ubuntu:~$ pip3 list | grep -i pycrypto
-pycrypto 2.6.1
-pycryptodome 3.9.8
-```
-
-The resulting output file can be found in out/debug/chip-k32w0x-lock-example.
-
-### Overwrite board config files
-
-The example uses template/reference board configuration files.
-
-To overwrite the board configuration files, set `override_is_DK6=false` in the
-`k32w0_sdk` target from the app `BUILD.gn`:
-
-```
-k32w0_sdk("sdk") {
- override_is_DK6 = false
- ...
-}
-```
-
-This variable will be used by `k32w0_sdk.gni` to overwrite `chip_with_DK6`
-option, thus the reference board configuration files will no longer be used.
-
-## Known issues building
-
-- When using Secure element and cross-compiling on Linux, log messages from
- the Plug&Trust middleware stack may not echo to the console.
-
-## Rotating device id
-
-This is an optional feature and can be used in multiple ways (please see section
-5.4.2.4.5 from Matter specification). One use case is Amazon Frustration Free
-Setup, which leverages the C3 Characteristic (Additional commissioning-related
-data) to offer an easier way to set up the device. The rotating device id will
-be encoded in this additional data and is programmed to rotate at pre-defined
-moments. The algorithm uses a unique per-device identifier that must be
-programmed during factory provisioning.
-
-Please use the following build args:
-
-- `chip_enable_rotating_device_id=1` - to enable rotating device id.
-- `chip_enable_additional_data_advertising=1` - to enable C3 characteristic.
-
-## Manufacturing data
-
-See
-[Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp_manufacturing_flow.md).
-
-There are factory data generated binaries available in
-examples/platform/nxp/k32w/k32w0/scripts/demo_generated_factory_data folder.
-These are based on the DAC, PAI and PAA certificates found in
-scripts/tools/nxp/demo_generated_certs folder. The demo_factory_data_dut1.bin
-uses the DAC certificate and private key found in
-examples/platform/nxp/k32w/k32w0/scripts/demo_generated_factory_data/dac/dut1
-folder. The demo_factory_data_dut2.bin uses the DAC certificate and private key
-found in
-examples/platform/nxp/k32w/k32w0/scripts/demo_generated_factory_data/dac/dut2
-folder. These two factory data binaries can be used for testing topologies with
-2 DUTS. They contain the corresponding DACs/PAIs generated using
-generate_nxp_chip_factory_bin.py script. The discriminator is 14014 and the
-passcode is 1000. These demo certificates are working with the CDs installed in
-CHIPProjectConfig.h.
-
-Regarding factory data provider, there are two options:
-
-- use the default factory data provider: `FactoryDataProviderImpl` by setting
- `chip_with_factory_data=1` in the gn build command.
-- use a custom factory data provider: please see
- [Guide for implementing a custom factory data provider](../../../../platform/nxp/k32w/k32w0/common/README.md).
- This can be enabled when `chip_with_factory_data=1` by setting
- `use_custom_factory_provider=1` in the gn build command.
-
-## Flashing and debugging
-
-Program the firmware using the official
-[OpenThread Flash Instructions](https://github.com/openthread/ot-nxp/tree/main/src/k32w0/k32w061#flash-binaries).
-
-All you have to do is to replace the Openthread binaries from the above
-documentation with _out/debug/chip-k32w0x-lock-example.bin_ if DK6Programmer is
-used or with _out/debug/chip-k32w0x-lock-example_ if MCUXpresso is used.
-
-## Pigweed tokenizer
-
-The tokenizer is a pigweed module that allows hashing the strings. This greatly
-reduces the flash needed for logs. The module can be enabled by building with
-the gn argument _chip_pw_tokenizer_logging=true_. The detokenizer script is
-needed for parsing the hashed scripts.
-
-### Detokenizer script
-
-The python3 script detokenizer.py is a script that decodes the tokenized logs
-either from a file or from a serial port. It is located in the following path
-`examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py`.
-
-The script can be used in the following ways:
-
-```
-usage: detokenizer.py serial [-h] -i INPUT -d DATABASE [-o OUTPUT]
-usage: detokenizer.py file [-h] -i INPUT -d DATABASE -o OUTPUT
-```
-
-The first parameter is either _serial_ or _file_ and it selects between decoding
-from a file or from a serial port.
-
-The second parameter is _-i INPUT_ and it must se set to the path of the file or
-the serial to decode from.
-
-The third parameter is _-d DATABASE_ and represents the path to the token
-database to be used for decoding. The default path is
-_out/debug/chip-k32w0x-lock-example-database.bin_ after a successful build.
-
-The forth parameter is _-o OUTPUT_ and it represents the path to the output file
-where the decoded logs will be stored. This parameter is required for file usage
-and optional for serial usage. If not provided when used with serial port, it
-will show the decoded log only at the stdout and not save it to file.
-
-### Notes
-
-The token database is created automatically after building the binary if the
-argument _chip_pw_tokenizer_logging=true_ was used.
-
-The detokenizer script must be run inside the example's folder after a
-successful run of the _scripts/activate.sh_ script. The pw_tokenizer module used
-by the script is loaded by the environment. An example of running the
-detokenizer script to see logs of a lock app:
-
-```
-python3 ../../../../../examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py serial -i /dev/ttyACM0 -d out/debug/chip-k32w0x-lock-example-database.bin -o device.txt
-```
-
-### Known issues tokenizer
-
-The building process will not update the token database if it already exists. In
-case that new strings are added and the database already exists in the output
-folder, it must be deleted so that it will be recreated at the next build.
-
-Not all tokens will be decoded. This is due to a gcc/pw_tokenizer issue. The
-pw_tokenizer creates special elf sections using attributes where the tokens and
-strings will be stored. This sections will be used by the database creation
-script. For template C++ functions, gcc ignores these attributes and places all
-the strings by default in the .rodata section. As a result the database creation
-script won't find them in the special-created sections.
-
-If run, closed and rerun with the serial option on the same serial port, the
-detokenization script will get stuck and not show any logs. The solution is to
-unplug and plug the board and then rerun the script.
-
-## NXP Ultrafast P256 ECC Library
-
-### Building steps
-
-By default, the application builds with NXP Ultrafast P256 ECC Library. To build
-with this library, use the following arguments:
-
-- Build without Secure element (_chip_with_se05x=0_) and with crypto platform
- (_chip_crypto=\"platform\"_).
-
-To stop using Ultrafast P256 ECC Library, simply build with
-_chip_crypto=\"mbedtls\"_ or with Tinycrypt.
-
-## Tinycrypt ECC library
-
-### Building steps
-
-In order to use the Tinycrypt ECC library, use the following build arguments:
-
-- Build without Secure element (_chip_with_se05x=0_), with crypto platform
- (_chip_crypto=\"platform\"_) and with tinycrypt selected
- (_chip_crypto_flavor=\"tinycrypt\"_).
-
-## Low power
-
-The example also offers the possibility to run in low power mode. This means
-that the board will go in a deep power down mode most of the time and the power
-consumption will be very low.
-
-In order to build with low power support, the _chip_with_low_power=1_ must be
-provided to the build system. In this case, please note that the GN build
-arguments _chip_with_OM15082_ and _chip_with_ot_cli_ must be set to 0 and
-_chip_logging_ must be set to false to disable logging.
-
-In order to maintain a low power consumption, the LEDs showing the state of the
-elock and the internal state are disabled. Console logs can be used instead.
-Also, please note that once the board is flashed with MCUXpresso the debugger
-disconnects because the board enters low power.
-
-Power Measurement Tool can be used inside MCUXpresso for checking the power
-consumption pattern: Window -> Show View -> Other -> Power Measurement Tool. The
-configuration for this tool is the next one:
-
-![POWER_CONF](../../../../platform/nxp/k32w/k32w0/doc/images/power_conf.JPG)
-
-Also, please make sure that the J14 jumper is set to the _ENABLED_ position and
-no expansion board is attached to the DK6. A view from this tool is illustrated
-below:
-
-![POWER_VIEW](../../../../platform/nxp/k32w/k32w0/doc/images/power_view.JPG)
-
-Please note that that the Power Measurement Tool is not very accurate and
-professional tools must be used if exact power consumption needs to be known.
-
-## Known issues low power
-
-- Power Measurement Tool may not work correctly in MCUXpresso versions greater
- that 11.0.1.
diff --git a/examples/lock-app/nxp/k32w/k32w0/args.gni b/examples/lock-app/nxp/k32w/k32w0/args.gni
deleted file mode 100644
index a733921b547e38..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/args.gni
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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")
-import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni")
-
-# SDK target. This is overridden to add our SDK app_config.h & defines.
-k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain")
-
-chip_stack_lock_tracking = "fatal"
-chip_enable_ble = true
-
-chip_enable_icd_server = true
-chip_persist_subscriptions = true
-chip_subscription_timeout_resumption = true
diff --git a/examples/lock-app/nxp/k32w/k32w0/build_overrides b/examples/lock-app/nxp/k32w/k32w0/build_overrides
deleted file mode 120000
index ad07557834803a..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/build_overrides
+++ /dev/null
@@ -1 +0,0 @@
-../../../../build_overrides/
\ No newline at end of file
diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
deleted file mode 100644
index 43598870fb7533..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2020 Project CHIP Authors
- * Copyright (c) 2020 Google LLC.
- * 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
-
-// Security and Authentication disabled for development build.
-// For convenience, enable CHIP Security Test Mode and disable the requirement for
-// authentication in various protocols.
-// WARNING: These options make it possible to circumvent basic CHIP security functionality,
-// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
-#define CHIP_CONFIG_SECURITY_TEST_MODE 0
-
-// Use hard-coded test certificates already embedded in generic chip code => set it to 0
-// Use real/development certificates => set it to 1 + file the provisioning section from
-// the internal flash
-#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
-#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0
-#endif
-
-#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
-
-// Enable usage of custom factory data provider
-#ifndef CHIP_DEVICE_CONFIG_USE_CUSTOM_PROVIDER
-#define CHIP_DEVICE_CONFIG_USE_CUSTOM_PROVIDER 0
-#endif
-
-// VID/PID for product => will be used by Basic Information Cluster
-#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037
-#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA220
-
-// Set the following define to use the Certification Declaration from below and not use it stored in factory data section
-#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION
-#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0
-#endif
-
-#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION
-//-> format_version = 1
-//-> vendor_id = 0x1037
-//-> product_id_array = [ 0xA220 ]
-//-> device_type_id = 0x0015
-//-> certificate_id = "ZIG20142ZB330003-24"
-//-> security_level = 0
-//-> security_information = 0
-//-> version_number = 0x2694
-//-> certification_type = 0
-//-> dac_origin_vendor_id is not present
-//-> dac_origin_product_id is not present
-#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
- { \
- 0x30, 0x81, 0xe8, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xda, 0x30, 0x81, 0xd7, \
- 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \
- 0x44, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x37, 0x04, 0x35, 0x15, 0x24, 0x00, \
- 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x20, 0xa2, 0x18, 0x24, 0x03, 0x15, 0x2c, 0x04, 0x13, 0x5a, 0x49, \
- 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, \
- 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, 0x03, \
- 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, \
- 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, \
- 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x29, 0x7f, 0xf6, 0x0e, \
- 0x4c, 0x72, 0x38, 0x77, 0x19, 0xfc, 0xb9, 0x7c, 0x08, 0x71, 0x8a, 0x88, 0x61, 0xf7, 0x0a, 0xf7, 0xf0, 0x63, 0x43, \
- 0x09, 0x69, 0xb0, 0x40, 0xf2, 0xce, 0xfd, 0x69, 0x15, 0x02, 0x21, 0x00, 0xa8, 0xd1, 0x6e, 0xae, 0xd5, 0x7f, 0x28, \
- 0x34, 0x0d, 0x21, 0x65, 0xa3, 0x3f, 0xc4, 0x4c, 0x8b, 0x26, 0x26, 0x3f, 0xb2, 0xac, 0x8f, 0x22, 0xe4, 0xff, 0xbd, \
- 0x9b, 0x48, 0x2d, 0x7e, 0xc9, 0x17, \
- }
-
-// All remaining data will be pulled from the provisioning region of flash.
-#endif
-
-#else
-
-// Use a default setup PIN code if one hasn't been provisioned in flash.
-#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
-#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
-
-/**
- * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
- *
- * Enables the use of a hard-coded default serial number if none
- * is found in CHIP NV storage.
- */
-#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
-
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
- *
- * 0xFFF1: Test vendor.
- */
-#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1
-
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
- *
- * 0x8006: example lock-app
- */
-#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006
-
-#endif
-
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
- *
- * The hardware version number assigned to device or product by the device vendor. This
- * number is scoped to the device product id, and typically corresponds to a revision of the
- * physical device, a change to its packaging, and/or a change to its marketing presentation.
- * This value is generally *not* incremented for device software versions.
- */
-#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100
-
-#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING
-#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0"
-#endif
-
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
- *
- * A string identifying the software version running on the device.
- * CHIP currently expects the software version to be in the format
- * {MAJOR_VERSION}.0d{MINOR_VERSION}
- */
-#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
-#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "03-2022-te8"
-#endif
-
-#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
-#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 42020
-#endif
-
-#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME
-#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors"
-#endif
-
-#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME
-#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App"
-#endif
-
-/**
- * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
- *
- * The amount of time in miliseconds after which BLE should change his advertisements
- * from fast interval to slow interval.
- *
- * 30000 (30 secondes).
- */
-#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000)
-
-/**
- * @def CHIP_CONFIG_MAX_FABRICS
- *
- * @brief
- * Maximum number of fabrics the device can participate in. Each fabric can
- * provision the device with its unique operational credentials and manage
- * its own access control lists.
- */
-#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics
-
-#define CHIP_DEVICE_CONFIG_ENABLE_SED 1
-
-/**
- * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE
- *
- * For a development build, set the default importance of events to be logged as Debug.
- * Since debug is the lowest importance level, this means all standard, critical, info and
- * debug importance level vi events get logged.
- */
-#if BUILD_RELEASE
-#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production
-#else
-#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug
-#endif // BUILD_RELEASE
-
-#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1
-
-/**
- * CHIP_DEVICE_CONFIG_BLE_SET_PHY_2M_REQ
- *
- * This define enables/disables the Gap_LeSetPhy request to switch to 2M.
- * It is disabled here for interoperability reasons just to be extra cautious.
- * Both devices may send a Link Layer control procedure in parallel resulting in a
- * LPM Error Transaction Collision.
- * If the peer device doesn't accept our reject command, this can result in a BLE
- * connection timeout.
- */
-#define CHIP_DEVICE_CONFIG_BLE_SET_PHY_2M_REQ 0
-
-/**
- * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER
- *
- * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server.
- */
-#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 1
-
-/**
- * @def CHIP_IM_MAX_NUM_WRITE_HANDLER
- *
- * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server.
- */
-#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2
diff --git a/examples/lock-app/nxp/k32w/k32w0/include/FreeRTOSConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/FreeRTOSConfig.h
deleted file mode 100644
index c0e0a81a8fbf42..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/include/FreeRTOSConfig.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * FreeRTOS Kernel V10.2.0
- * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * http://www.FreeRTOS.org
- * http://aws.amazon.com/freertos
- *
- * 1 tab == 4 spaces!
- */
-
-#pragma once
-
-/*-----------------------------------------------------------
- * Application specific definitions.
- *
- * These definitions should be adjusted for your particular hardware and
- * application requirements.
- *
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
- *
- * See http://www.freertos.org/a00110.html.
- *----------------------------------------------------------*/
-
-#define configUSE_PREEMPTION 1
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
-#define configUSE_TICKLESS_IDLE 1
-#else
-#define configUSE_TICKLESS_IDLE 0
-#endif
-
-#define configCPU_CLOCK_HZ (SystemCoreClock)
-#define configTICK_RATE_HZ ((TickType_t) 100)
-#define configMAX_PRIORITIES (8)
-
-#if defined(configUSE_TICKLESS_IDLE) && (configUSE_TICKLESS_IDLE == 1)
-#define configMINIMAL_STACK_SIZE ((unsigned short) 250)
-#else
-#define configMINIMAL_STACK_SIZE ((unsigned short) 450)
-#endif
-
-#define configMAX_TASK_NAME_LEN 20
-#define configUSE_16_BIT_TICKS 0
-#define configIDLE_SHOULD_YIELD 1
-#define configUSE_TASK_NOTIFICATIONS 1
-#define configUSE_MUTEXES 1
-#define configUSE_RECURSIVE_MUTEXES 1
-#define configUSE_COUNTING_SEMAPHORES 1
-#define configUSE_ALTERNATIVE_API 0 /* Deprecated! */
-#define configQUEUE_REGISTRY_SIZE 8
-#define configUSE_QUEUE_SETS 0
-/* make sure that Thread task can interrupt lengthy Matter
- * processing in case priority inversion occurs
- */
-#define configUSE_TIME_SLICING 1
-#define configUSE_NEWLIB_REENTRANT 0
-#define configENABLE_BACKWARD_COMPATIBILITY 1
-#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5
-
-/* Tasks.c additions (e.g. Thread Aware Debug capability) */
-#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
-
-/* Used memory allocation (heap_x.c) */
-#define configFRTOS_MEMORY_SCHEME 4
-
-/* Memory allocation related definitions. */
-#define configSUPPORT_STATIC_ALLOCATION 0
-#define configSUPPORT_DYNAMIC_ALLOCATION 1
-#define configTOTAL_HEAP_SIZE ((size_t) (gTotalHeapSize_c))
-#define configAPPLICATION_ALLOCATED_HEAP 1
-
-#define configUSE_IDLE_HOOK 1
-#define configUSE_TICK_HOOK 0
-#define configCHECK_FOR_STACK_OVERFLOW 0
-#ifndef configUSE_MALLOC_FAILED_HOOK
-#define configUSE_MALLOC_FAILED_HOOK 0
-#endif
-#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
-
-/* Run time and task stats gathering related definitions. */
-#define configGENERATE_RUN_TIME_STATS 0
-#define configUSE_TRACE_FACILITY 1
-#define configUSE_STATS_FORMATTING_FUNCTIONS 0
-
-/* Task aware debugging. */
-#define configRECORD_STACK_HIGH_ADDRESS 1
-
-/* Co-routine related definitions. */
-#define configUSE_CO_ROUTINES 0
-#define configMAX_CO_ROUTINE_PRIORITIES 2
-
-/* Software timer related definitions. */
-#define configUSE_TIMERS 1
-#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1)
-#define configTIMER_QUEUE_LENGTH 10
-#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 4)
-
-/* Define to trap errors during development. */
-#if defined gLoggingActive_d && (gLoggingActive_d != 0)
-#include "dbg_logging.h"
-#define configASSERT(x) \
- if ((x) == 0) \
- { \
- taskDISABLE_INTERRUPTS(); \
- DbgLogDump(1); \
- }
-#else
-#define configASSERT(x) \
- if ((x) == 0) \
- { \
- taskDISABLE_INTERRUPTS(); \
- for (;;) \
- ; \
- }
-#endif
-
-/* Optional functions - most linkers will remove unused functions anyway. */
-#define INCLUDE_vTaskPrioritySet 1
-#define INCLUDE_uxTaskPriorityGet 1
-#define INCLUDE_vTaskDelete 1
-#define INCLUDE_vTaskSuspend 1
-#define INCLUDE_xResumeFromISR 1
-#define INCLUDE_vTaskDelayUntil 1
-#define INCLUDE_vTaskDelay 1
-#define INCLUDE_xTaskGetSchedulerState 1
-#define INCLUDE_xTaskGetCurrentTaskHandle 1
-#define INCLUDE_uxTaskGetStackHighWaterMark 1
-#define INCLUDE_xTaskGetIdleTaskHandle 0
-#define INCLUDE_eTaskGetState 0
-#define INCLUDE_xEventGroupSetBitFromISR 1
-#define INCLUDE_xTimerPendFunctionCall 1
-#define INCLUDE_xTaskAbortDelay 0
-#define INCLUDE_xTaskGetHandle 0
-#define INCLUDE_xTaskResumeFromISR 1
-#define INCLUDE_xQueueGetMutexHolder 1
-
-/* Interrupt nesting behaviour configuration. Cortex-M specific. */
-#ifdef __NVIC_PRIO_BITS
-/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
-#define configPRIO_BITS __NVIC_PRIO_BITS
-#else
-#define configPRIO_BITS 3
-#endif
-
-/* The lowest interrupt priority that can be used in a call to a "set priority"
-function. */
-#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
-
-/* The highest interrupt priority that can be used by any interrupt service
-routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
-INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
-PRIORITY THAN THIS! (higher priorities are lower numeric values. */
-#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 1
-
-/* Interrupt priorities used by the kernel port layer itself. These are generic
-to all Cortex-M ports, and do not rely on any particular library functions. */
-#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
-/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
-See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
-
-/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
-standard names. */
-#define vPortSVCHandler SVC_Handler
-#define xPortPendSVHandler PendSV_Handler
-#define xPortSysTickHandler SysTick_Handler
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
index 7c6cffaf968c02..5880a6e07c784b 100644
--- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -33,6 +33,7 @@
#include
#include
+#include
#include
#include "Keyboard.h"
@@ -41,6 +42,9 @@
#include "PWR_Interface.h"
#include "app_config.h"
+#if CHIP_CRYPTO_HSM
+#include
+#endif
#ifdef ENABLE_HSM_DEVICE_ATTESTATION
#include "DeviceAttestationSe05xCredsExample.h"
#endif
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/BoltLockManager.cpp b/examples/lock-app/nxp/k32w/k32w0/main/BoltLockManager.cpp
deleted file mode 100644
index 6a18ef8214e727..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/BoltLockManager.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- *
- * Copyright (c) 2020 Project CHIP Authors
- * Copyright (c) 2019 Google LLC.
- * 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 "BoltLockManager.h"
-
-#include "AppTask.h"
-#include "FreeRTOS.h"
-
-#include "app_config.h"
-
-BoltLockManager BoltLockManager::sLock;
-
-TimerHandle_t sLockTimer; // FreeRTOS app sw timer.
-
-int BoltLockManager::Init()
-{
- int err = 0;
-
- // Create FreeRTOS sw timer for Lock timer.
-
- sLockTimer = xTimerCreate("LockTmr", // Just a text name, not used by the RTOS kernel
- 1, // == default timer period (mS)
- false, // no timer reload (==one-shot)
- (void *) this, // init timer id = lock obj context
- TimerEventHandler // timer callback handler
- );
-
- if (sLockTimer == NULL)
- {
- K32W_LOG("lock timer create failed");
- assert(0);
- }
-
- mState = kState_LockingCompleted;
- mAutoLockTimerArmed = false;
- mAutoRelock = false;
- mAutoLockDuration = 0;
-
- return err;
-}
-
-void BoltLockManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB)
-{
- mActionInitiated_CB = aActionInitiated_CB;
- mActionCompleted_CB = aActionCompleted_CB;
-}
-
-bool BoltLockManager::IsActionInProgress()
-{
- return (mState == kState_LockingInitiated || mState == kState_UnlockingInitiated) ? true : false;
-}
-
-bool BoltLockManager::IsUnlocked()
-{
- return (mState == kState_UnlockingCompleted) ? true : false;
-}
-
-void BoltLockManager::EnableAutoRelock(bool aOn)
-{
- mAutoRelock = aOn;
-}
-
-void BoltLockManager::SetAutoLockDuration(uint32_t aDurationInSecs)
-{
- mAutoLockDuration = aDurationInSecs;
-}
-
-bool BoltLockManager::InitiateAction(int32_t aActor, Action_t aAction)
-{
- bool action_initiated = false;
- State_t new_state;
-
- // Initiate Lock/Unlock Action only when the previous one is complete.
- if (mState == kState_LockingCompleted && aAction == UNLOCK_ACTION)
- {
- action_initiated = true;
-
- new_state = kState_UnlockingInitiated;
- }
- else if (mState == kState_UnlockingCompleted && aAction == LOCK_ACTION)
- {
- action_initiated = true;
-
- new_state = kState_LockingInitiated;
- }
-
- if (action_initiated)
- {
- if (mAutoLockTimerArmed && new_state == kState_LockingInitiated)
- {
- // If auto lock timer has been armed and someone initiates locking,
- // cancel the timer and continue as normal.
- mAutoLockTimerArmed = false;
-
- CancelTimer();
- }
-
- StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS);
-
- // Since the timer started successfully, update the state and trigger callback
- mState = new_state;
-
- if (mActionInitiated_CB)
- {
- mActionInitiated_CB(aAction, aActor);
- }
- }
-
- return action_initiated;
-}
-
-void BoltLockManager::StartTimer(uint32_t aTimeoutMs)
-{
- if (xTimerIsTimerActive(sLockTimer))
- {
- K32W_LOG("lock timer already started!");
- // appError(err);
- CancelTimer();
- }
-
- // timer is not active, change its period to required value.
- // This also causes the timer to start. FreeRTOS- Block for a maximum of
- // 100 ticks if the change period command cannot immediately be sent to the
- // timer command queue.
- if (xTimerChangePeriod(sLockTimer, aTimeoutMs / portTICK_PERIOD_MS, 100) != pdPASS)
- {
- K32W_LOG("lock timer start() failed");
- // appError(err);
- }
-}
-
-void BoltLockManager::CancelTimer(void)
-{
- if (xTimerStop(sLockTimer, 0) == pdFAIL)
- {
- K32W_LOG("lock timer stop() failed");
- // appError(err);
- }
-}
-
-void BoltLockManager::TimerEventHandler(TimerHandle_t xTimer)
-{
- // Get lock obj context from timer id.
- BoltLockManager * lock = static_cast(pvTimerGetTimerID(xTimer));
-
- // The timer event handler will be called in the context of the timer task
- // once sLockTimer expires. Post an event to apptask queue with the actual handler
- // so that the event can be handled in the context of the apptask.
- AppEvent event;
- event.Type = AppEvent::kEventType_Timer;
- event.TimerEvent.Context = lock;
-
- if (lock->mAutoLockTimerArmed)
- {
- event.Handler = AutoReLockTimerEventHandler;
- GetAppTask().PostEvent(&event);
- }
- else
- {
- event.Handler = ActuatorMovementTimerEventHandler;
- GetAppTask().PostEvent(&event);
- }
-}
-
-void BoltLockManager::AutoReLockTimerEventHandler(void * aGenericEvent)
-{
- AppEvent * aEvent = (AppEvent *) aGenericEvent;
- BoltLockManager * lock = static_cast(aEvent->TimerEvent.Context);
- int32_t actor = 0;
-
- // Make sure auto lock timer is still armed.
- if (!lock->mAutoLockTimerArmed)
- {
- return;
- }
-
- lock->mAutoLockTimerArmed = false;
-
- K32W_LOG("Auto Re-Lock has been triggered!");
-
- lock->InitiateAction(actor, LOCK_ACTION);
-}
-
-void BoltLockManager::ActuatorMovementTimerEventHandler(void * aGenericEvent)
-{
- AppEvent * aEvent = (AppEvent *) aGenericEvent;
- Action_t actionCompleted = INVALID_ACTION;
-
- BoltLockManager * lock = static_cast(aEvent->TimerEvent.Context);
-
- if (lock->mState == kState_LockingInitiated)
- {
- lock->mState = kState_LockingCompleted;
- actionCompleted = LOCK_ACTION;
- }
- else if (lock->mState == kState_UnlockingInitiated)
- {
- lock->mState = kState_UnlockingCompleted;
- actionCompleted = UNLOCK_ACTION;
- }
-
- if (actionCompleted != INVALID_ACTION)
- {
- if (lock->mActionCompleted_CB)
- {
- lock->mActionCompleted_CB(actionCompleted);
- }
-
- if (lock->mAutoRelock && actionCompleted == UNLOCK_ACTION)
- {
- // Start the timer for auto relock
- lock->StartTimer(lock->mAutoLockDuration * 1000);
-
- lock->mAutoLockTimerArmed = true;
-
- K32W_LOG("Auto Re-lock enabled. Will be triggered in %u seconds", lock->mAutoLockDuration);
- }
- }
-}
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp b/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
deleted file mode 100644
index b888db03861c7f..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * 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 "AppTask.h"
-#include "BoltLockManager.h"
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace ::chip;
-using namespace ::chip::app::Clusters;
-using namespace ::chip::app::Clusters::DoorLock;
-using ::chip::app::DataModel::Nullable;
-
-bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx,
- const Nullable & nodeId, const Optional & pinCode,
- OperationErrorEnum & err)
-{
- return BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION);
-}
-
-bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx,
- const Nullable & nodeId, const Optional & pinCode,
- OperationErrorEnum & err)
-{
- return BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION);
-}
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/include/AppTask.h b/examples/lock-app/nxp/k32w/k32w0/main/include/AppTask.h
deleted file mode 100644
index 1addd9236c4bcf..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/include/AppTask.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright (c) 2020 Google LLC.
- * 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
-
-#include
-#include
-
-#include "AppEvent.h"
-#include "BoltLockManager.h"
-
-#include "CHIPProjectConfig.h"
-
-#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
-#include
-#if CHIP_DEVICE_CONFIG_USE_CUSTOM_PROVIDER
-#include "CustomFactoryDataProvider.h"
-#endif
-#endif
-
-#include
-
-#include "FreeRTOS.h"
-#include "timers.h"
-
-class AppTask
-{
-public:
- CHIP_ERROR StartAppTask();
- static void AppTaskMain(void * pvParameter);
-
- void PostLockActionRequest(int32_t aActor, BoltLockManager::Action_t aAction);
- void PostEvent(const AppEvent * event);
-
- void UpdateClusterState(void);
-
-private:
- friend AppTask & GetAppTask(void);
-
- CHIP_ERROR Init();
-
- static void ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor);
- static void ActionCompleted(BoltLockManager::Action_t aAction);
-
- void CancelTimer(void);
-
- void DispatchEvent(AppEvent * event);
-
- static void FunctionTimerEventHandler(void * aGenericEvent);
- static void KBD_Callback(uint8_t events);
- static void HandleKeyboard(void);
- static void JoinHandler(void * aGenericEvent);
- static void BleHandler(void * aGenericEvent);
- static void BleStartAdvertising(intptr_t arg);
- static void LockActionEventHandler(void * aGenericEvent);
- static void ResetActionEventHandler(void * aGenericEvent);
- static void InstallEventHandler(void * aGenericEvent);
-
- static void ButtonEventHandler(uint8_t pin_no, uint8_t button_action);
- static void TimerEventHandler(TimerHandle_t xTimer);
-
- static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
- static void UpdateClusterStateInternal(intptr_t arg);
- static void ThreadStart();
- static void InitServer(intptr_t arg);
- static void PrintOnboardingInfo();
- void StartTimer(uint32_t aTimeoutInMs);
-
- enum Function_t
- {
- kFunction_NoneSelected = 0,
- kFunction_SoftwareUpdate = 0,
- kFunction_FactoryReset,
- kFunctionLockUnlock,
-
- kFunction_Invalid
- } Function;
-
- Function_t mFunction = kFunction_NoneSelected;
- bool mResetTimerActive = false;
- bool mSyncClusterToButtonAction = false;
-
- static AppTask sAppTask;
-};
-
-inline AppTask & GetAppTask(void)
-{
- return AppTask::sAppTask;
-}
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/include/BoltLockManager.h b/examples/lock-app/nxp/k32w/k32w0/main/include/BoltLockManager.h
deleted file mode 100644
index cd33fada37b4fb..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/include/BoltLockManager.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright (c) 2020 Google LLC.
- * 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
-
-#include
-#include
-
-#include "AppEvent.h"
-
-#include "FreeRTOS.h"
-#include "timers.h" // provides FreeRTOS timer support
-
-class BoltLockManager
-{
-public:
- enum Action_t
- {
- LOCK_ACTION = 0,
- UNLOCK_ACTION,
-
- INVALID_ACTION
- } Action;
-
- enum State_t
- {
- kState_LockingInitiated = 0,
- kState_LockingCompleted,
- kState_UnlockingInitiated,
- kState_UnlockingCompleted,
- } State;
-
- int Init();
- bool IsUnlocked();
- void EnableAutoRelock(bool aOn);
- void SetAutoLockDuration(uint32_t aDurationInSecs);
- bool IsActionInProgress();
- bool InitiateAction(int32_t aActor, Action_t aAction);
-
- typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor);
- typedef void (*Callback_fn_completed)(Action_t);
- void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB);
-
-private:
- friend BoltLockManager & BoltLockMgr(void);
- State_t mState;
-
- Callback_fn_initiated mActionInitiated_CB;
- Callback_fn_completed mActionCompleted_CB;
-
- bool mAutoRelock;
- uint32_t mAutoLockDuration;
- bool mAutoLockTimerArmed;
-
- void CancelTimer(void);
- void StartTimer(uint32_t aTimeoutMs);
-
- static void TimerEventHandler(TimerHandle_t xTimer);
- static void AutoReLockTimerEventHandler(void * aGenericEvent);
- static void ActuatorMovementTimerEventHandler(void * aGenericEvent);
-
- static BoltLockManager sLock;
-};
-
-inline BoltLockManager & BoltLockMgr(void)
-{
- return BoltLockManager::sLock;
-}
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/include/app_config.h b/examples/lock-app/nxp/k32w/k32w0/main/include/app_config.h
deleted file mode 100644
index cfed43e850c4bc..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/include/app_config.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright (c) 2020 Google LLC.
- * 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 "LED.h"
-
-#pragma once
-
-// ---- Lock Example App Config ----
-
-#define RESET_BUTTON 1
-#define LOCK_BUTTON 2
-#define JOIN_BUTTON 3
-#define BLE_BUTTON 4
-
-#define RESET_BUTTON_PUSH 1
-#define LOCK_BUTTON_PUSH 2
-#define JOIN_BUTTON_PUSH 3
-#define BLE_BUTTON_PUSH 4
-
-#define APP_BUTTON_PUSH 1
-
-#define LOCK_STATE_LED LED2
-#define SYSTEM_STATE_LED LED1
-
-// Time it takes in ms for the simulated actuator to move from one
-// state to another.
-#define ACTUATOR_MOVEMENT_PERIOS_MS 2000
-
-// ---- Lock Example SWU Config ----
-#define SWU_INTERVAl_WINDOW_MIN_MS (23 * 60 * 60 * 1000) // 23 hours
-#define SWU_INTERVAl_WINDOW_MAX_MS (24 * 60 * 60 * 1000) // 24 hours
-
-// ---- Thread Polling Config ----
-#define THREAD_ACTIVE_POLLING_INTERVAL_MS 100
-#define THREAD_INACTIVE_POLLING_INTERVAL_MS 1000
-
-#if K32W_LOG_ENABLED
-#define K32W_LOG(...) otPlatLog(OT_LOG_LEVEL_NONE, OT_LOG_REGION_API, ##__VA_ARGS__);
-#else
-#define K32W_LOG(...)
-#endif
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/main.cpp b/examples/lock-app/nxp/k32w/k32w0/main/main.cpp
deleted file mode 100644
index 7cb5057175b37b..00000000000000
--- a/examples/lock-app/nxp/k32w/k32w0/main/main.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- *
- * Copyright (c) 2020 Google LLC.
- * 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.
- */
-
-// ================================================================================
-// Main Code
-// ================================================================================
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include "FreeRtosHooks.h"
-#include "app_config.h"
-
-#if PDM_SAVE_IDLE
-#include
-#endif
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
-#include "fsl_gpio.h"
-#include "fsl_iocon.h"
-#include "gpio_pins.h"
-#endif
-
-using namespace ::chip;
-using namespace ::chip::Inet;
-using namespace ::chip::DeviceLayer;
-using namespace ::chip::Logging;
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
-#include "Keyboard.h"
-#include "OtaSupport.h"
-#include "PWR_Configuration.h"
-#include "PWR_Interface.h"
-#include "RNG_Interface.h"
-#include "app_dual_mode_low_power.h"
-#include "app_dual_mode_switch.h"
-#include "radio.h"
-#endif
-
-#include "MacSched.h"
-
-typedef void (*InitFunc)(void);
-
-extern InitFunc __init_array_start;
-extern InitFunc __init_array_end;
-
-extern "C" void sched_enable();
-
-/* low power requirements */
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
-extern "C" void setThreadInitialized(bool isInitialized);
-extern "C" bool isThreadInitialized();
-#endif
-
-/* needed for FreeRtos Heap 4 */
-uint8_t __attribute__((section(".heap"))) ucHeap[HEAP_SIZE];
-
-extern "C" void main_task(void const * argument)
-{
- CHIP_ERROR err = CHIP_NO_ERROR;
-
- /* Call C++ constructors */
- InitFunc * pFunc = &__init_array_start;
- for (; pFunc < &__init_array_end; ++pFunc)
- {
- (*pFunc)();
- }
-
- mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree);
- err = PlatformMgrImpl().InitBoardFwk();
- if (err != CHIP_NO_ERROR)
- {
- return;
- }
-
- K32W_LOG("Welcome to NXP ELock Demo App");
-
- /* Mbedtls Threading support is needed because both
- * Thread and Matter tasks are using it */
- freertos_mbedtls_mutex_init();
-
- // Init Chip memory management before the stack
- chip::Platform::MemoryInit();
-
-#if PDM_SAVE_IDLE
- /* OT Settings needs to be initialized
- * early as XCVR is making use of it */
- otPlatSettingsInit(NULL, NULL, 0);
-#endif
-
- CHIP_ERROR ret = PlatformMgr().InitChipStack();
- if (ret != CHIP_NO_ERROR)
- {
- K32W_LOG("Error during PlatformMgr().InitMatterStack()");
- goto exit;
- }
-
- ret = ThreadStackMgr().InitThreadStack();
- if (ret != CHIP_NO_ERROR)
- {
- K32W_LOG("Error during ThreadStackMgr().InitThreadStack()");
- goto exit;
- }
-
- /* Enable the MAC scheduler after BLEManagerImpl::_Init() and V2MMAC_Enable().
- * This is needed to register properly the active protocols.
- */
- sched_enable();
-
- ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
- if (ret != CHIP_NO_ERROR)
- {
- goto exit;
- }
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
- setThreadInitialized(TRUE);
-#endif
-
- // Start OpenThread task
- ret = ThreadStackMgrImpl().StartThreadTask();
- if (ret != CHIP_NO_ERROR)
- {
- K32W_LOG("Error during ThreadStackMgrImpl().StartThreadTask()");
- goto exit;
- }
-
- ret = GetAppTask().StartAppTask();
- if (ret != CHIP_NO_ERROR)
- {
- K32W_LOG("Error during GetAppTask().StartAppTask()");
- goto exit;
- }
-
- ret = PlatformMgr().StartEventLoopTask();
- if (ret != CHIP_NO_ERROR)
- {
- K32W_LOG("Error during PlatformMgr().StartEventLoopTask();");
- goto exit;
- }
-
- GetAppTask().AppTaskMain(NULL);
-
-exit:
- return;
-}
-
-/**
- * Glue function called directly by the OpenThread stack
- * when system event processing work is pending.
- */
-extern "C" void otSysEventSignalPending(void)
-{
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
- /* make sure that 15.4 radio is initialized before waking up the Thread task */
- if (isThreadInitialized())
-#endif
- {
- BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR();
- portYIELD_FROM_ISR(yieldRequired);
- }
-}
-
-#if defined(chip_with_low_power) && (chip_with_low_power == 1)
-extern "C" void vOptimizeConsumption(void)
-{
- /* BUTTON2 change contact, BUTTON4 start adv/factoryreset */
- uint32_t u32SkipIO = (1 << IOCON_USER_BUTTON1_PIN) | (1 << IOCON_USER_BUTTON2_PIN);
-
- /* Pins are set to GPIO mode (IOCON FUNC0), pulldown and analog mode */
- uint32_t u32PIOvalue = (IOCON_FUNC0 | IOCON_MODE_PULLDOWN | IOCON_ANALOG_EN);
-
- const gpio_pin_config_t pin_config = { .pinDirection = kGPIO_DigitalInput, .outputLogic = 1U };
-
- if (u32PIOvalue != 0)
- {
- for (int i = 0; i < 22; i++)
- {
- if (((u32SkipIO >> i) & 0x1) != 1)
- {
- /* configure GPIOs to Input mode */
- GPIO_PinInit(GPIO, 0, i, &pin_config);
- IOCON_PinMuxSet(IOCON, 0, i, u32PIOvalue);
- }
- }
- }
-}
-#endif
diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap
index aeb737f5ac6bb6..de2ffe615ee4e5 100644
--- a/examples/lock-app/nxp/zap/lock-app.zap
+++ b/examples/lock-app/nxp/zap/lock-app.zap
@@ -3460,4 +3460,4 @@
"parentEndpointIdentifier": null
}
]
-}
\ No newline at end of file
+}
diff --git a/examples/all-clusters-app/nxp/common/main/AppAssert.cpp b/examples/platform/nxp/common/app_assert/source/AppAssert.cpp
similarity index 100%
rename from examples/all-clusters-app/nxp/common/main/AppAssert.cpp
rename to examples/platform/nxp/common/app_assert/source/AppAssert.cpp
diff --git a/examples/platform/nxp/common/app_task/include/AppTaskBase.h b/examples/platform/nxp/common/app_task/include/AppTaskBase.h
new file mode 100644
index 00000000000000..02fdf513eb6679
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/include/AppTaskBase.h
@@ -0,0 +1,151 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2021 Google LLC.
+ * Copyright 2024 NXP
+ * 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
+
+#include
+#include
+
+#include "AppEvent.h"
+#include
+#include
+
+namespace chip {
+namespace NXP {
+namespace App {
+class AppTaskBase
+{
+public:
+ virtual ~AppTaskBase() = default;
+
+ /**
+ * \brief Entry point of AppTaskBase. This function should be overridden.
+ *
+ * This function should be called by the main function in order to initialize the matter stack and all other components
+ * required.
+ * Should be overriden depending on the OS, for example FreeRTOS start the AppTaskMain task, but Zephyr didn't need to start any
+ * task.
+ *
+ */
+ virtual CHIP_ERROR Start() = 0;
+
+ /**
+ * \brief This function could be overridden in order to execute code at the beginning of the InitServer function.
+ *
+ * This function is called at the begging of the InitServer function.
+ *
+ */
+ virtual void PreInitMatterServerInstance(void){};
+
+ /**
+ * \brief This function could be overridden in order to execute code at the end of the InitServer function.
+ *
+ * Example of usage: all-cluster-apps example disable last fixed endpoint after InitServer function execution.
+ *
+ */
+ virtual void PostInitMatterServerInstance(void){};
+
+ /**
+ * \brief This function could be overridden in order to execute code before matter stack init function.
+ *
+ * Example of usage: if some initialization has to be done before the matter stack initialization.
+ *
+ */
+ virtual void PreInitMatterStack(void){};
+
+ /**
+ * \brief This function could be overridden in order to execute code after matter stack init function.
+ *
+ * Example of usage: The laundry whasher example requires the TemperatureControl cluster initialization, this initialization is
+ * done after matter stack init. Developper can override this function to add cluster initialization/customization.
+ *
+ */
+ virtual void PostInitMatterStack(void){};
+
+ /**
+ * \brief This function could be overridden in order to register features.
+ *
+ * Example of usage: Could be overridden in order to register matter CLI or button features.
+ *
+ * \return CHIP_ERROR
+ *
+ */
+ virtual CHIP_ERROR AppMatter_Register(void) { return CHIP_NO_ERROR; };
+
+ /**
+ * \brief This function could be overridden in order to register custom CLI commands.
+ *
+ * Example of usage: Laundry washer application used additionnal CLI commands.
+ *
+ */
+ virtual void AppMatter_RegisterCustomCliCommands(void){};
+
+ /**
+ * \brief This function could be overridden in order to dispatch event.
+ *
+ * Example of usage: FreeRtos dispatch event using the event handler.
+ *
+ */
+ virtual void DispatchEvent(const AppEvent & event){};
+
+ /**
+ * \brief Return a pointer to the NXP Wifi Driver instance.
+ *
+ * \return NXP Wifi Driver instance pointeur
+ */
+#if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA
+ virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) = 0;
+#endif
+
+ /**
+ * \brief Stack initializations.
+ *
+ * Init matter stack and all other components (openthread, wifi, cli ...).
+ *
+ */
+ CHIP_ERROR Init();
+
+ /**
+ * \brief Initialize the ZCL Data Model and start server.
+ *
+ * Call by Init function to initialize the ZCL Data Model and start server.
+ *
+ */
+ static void InitServer(intptr_t arg);
+
+ /* Commissioning handlers */
+ virtual void StartCommissioningHandler(void){};
+ virtual void StopCommissioningHandler(void){};
+ virtual void SwitchCommissioningStateHandler(void){};
+ virtual void FactoryResetHandler(void){};
+
+private:
+ inline static chip::CommonCaseDeviceServerInitParams initParams;
+};
+
+/**
+ * Returns the application-specific implementation of the AppTaskBase object.
+ *
+ * Applications can use this to gain access to features of the AppTaskBase.
+ */
+extern AppTaskBase & GetAppTask();
+} // namespace App
+} // namespace NXP
+} // namespace chip
diff --git a/examples/platform/nxp/common/app_task/include/AppTaskFreeRTOS.h b/examples/platform/nxp/common/app_task/include/AppTaskFreeRTOS.h
new file mode 100644
index 00000000000000..9fbaf8063df8b7
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/include/AppTaskFreeRTOS.h
@@ -0,0 +1,93 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright 2024 NXP
+ * 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
+
+#include "AppTaskBase.h"
+
+namespace chip {
+namespace NXP {
+namespace App {
+class AppTaskFreeRTOS : public AppTaskBase
+{
+public:
+ virtual ~AppTaskFreeRTOS() = default;
+
+ /**
+ * \brief Entry point of AppTaskBase.
+ *
+ * This function:
+ * - Create application message queue
+ * - Create the dedicated application task
+ *
+ */
+ virtual CHIP_ERROR Start() override;
+
+ /**
+ * \brief Application task.
+ *
+ * This function:
+ * - Init matter stack and other needed components
+ * - Dispatch event comming from the app event queue
+ *
+ */
+ static void AppTaskMain(void * pvParameter);
+
+ /**
+ * \brief Send event to the event queue.
+ *
+ */
+ void PostEvent(const AppEvent & event);
+
+ /**
+ * \brief Return a pointer to the NXP Wifi Driver instance.
+ *
+ * \return NXP Wifi Driver instance pointeur
+ */
+#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+ virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) override;
+#endif
+
+ /**
+ * \brief This function register matter CLI and button features.
+ *
+ * \return CHIP_ERROR
+ *
+ */
+ virtual CHIP_ERROR AppMatter_Register(void) override;
+
+ /* Functions that would be called in the Matter task context */
+ static void StartCommissioning(intptr_t arg);
+ static void StopCommissioning(intptr_t arg);
+ static void SwitchCommissioningState(intptr_t arg);
+
+ /* Commissioning handlers */
+ virtual void StartCommissioningHandler(void) override;
+ virtual void StopCommissioningHandler(void) override;
+ virtual void SwitchCommissioningStateHandler(void) override;
+
+ /* FactoryResetHandler */
+ virtual void FactoryResetHandler(void) override;
+
+private:
+ void DispatchEvent(const AppEvent & event);
+};
+} // namespace App
+} // namespace NXP
+} // namespace chip
diff --git a/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h b/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h
new file mode 100644
index 00000000000000..163e3e76a9d87c
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright 2024 NXP
+ * 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
+
+#include "AppTaskBase.h"
+
+namespace chip {
+namespace NXP {
+namespace App {
+class AppTaskZephyr : public AppTaskBase
+{
+public:
+ virtual ~AppTaskZephyr() = default;
+
+ /**
+ * \brief Entry point of AppTaskBase.
+ *
+ * This function:
+ * - Init matter stack and other needed components
+ * - Dispatch event comming from the app event queue
+ *
+ */
+ virtual CHIP_ERROR Start() override;
+
+ /**
+ * \brief Send event to the event queue.
+ *
+ */
+ void PostEvent(const AppEvent & event);
+
+ /**
+ * \brief Return a pointer to the NXP Wifi Driver instance.
+ *
+ * \return NXP Wifi Driver instance pointeur
+ */
+#if defined(CONFIG_CHIP_WIFI)
+ virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) override;
+#endif
+
+private:
+ void DispatchEvent(const AppEvent & event);
+};
+} // namespace App
+} // namespace NXP
+} // namespace chip
diff --git a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp
new file mode 100644
index 00000000000000..e03634e9807aa5
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp
@@ -0,0 +1,252 @@
+/*
+ *
+ * Copyright (c) 2021 Project CHIP Authors
+ * Copyright (c) 2021 Google LLC.
+ * Copyright 2024 NXP
+ * 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 "AppTaskBase.h"
+#include "AppEvent.h"
+#include "AppFactoryData.h"
+#include "CHIPDeviceManager.h"
+#include "CommonDeviceCallbacks.h"
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include "lib/core/ErrorStr.h"
+
+#include
+
+#ifdef EMBER_AF_PLUGIN_BINDING
+#include "binding-handler.h"
+#endif
+
+#if CONFIG_NET_L2_OPENTHREAD
+#include
+#include
+#endif
+
+#if CONFIG_CHIP_TCP_DOWNLOAD
+#include "TcpDownload.h"
+#endif
+
+#if CONFIG_CHIP_OTA_PROVIDER
+#include
+#endif
+
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+#include "OTARequestorInitiator.h"
+#endif
+
+#if CONFIG_CHIP_TEST_EVENT && CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+#include
+#endif
+
+using namespace chip;
+using namespace chip::TLV;
+using namespace ::chip::Credentials;
+using namespace ::chip::DeviceLayer;
+using namespace ::chip::DeviceManager;
+using namespace ::chip::app::Clusters;
+
+chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
+
+#if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA
+app::Clusters::NetworkCommissioning::Instance sNetworkCommissioningInstance(0,
+ chip::NXP::App::GetAppTask().GetWifiDriverInstance());
+#endif
+
+#if CONFIG_CHIP_TEST_EVENT && CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+static uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
+ 0xcc, 0xdd, 0xee, 0xff };
+#endif
+
+#if CONFIG_NET_L2_OPENTHREAD
+void LockOpenThreadTask(void)
+{
+ chip::DeviceLayer::ThreadStackMgr().LockThreadStack();
+}
+
+void UnlockOpenThreadTask(void)
+{
+ chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack();
+}
+#endif
+
+void chip::NXP::App::AppTaskBase::InitServer(intptr_t arg)
+{
+ GetAppTask().PreInitMatterServerInstance();
+
+#if CONFIG_CHIP_TEST_EVENT && CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+ static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) };
+ initParams.testEventTriggerDelegate = &testEventTriggerDelegate;
+#endif
+ (void) initParams.InitializeStaticResourcesBeforeServerInit();
+#if CONFIG_NET_L2_OPENTHREAD
+ // Init ZCL Data Model and start server
+ chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams;
+ nativeParams.lockCb = LockOpenThreadTask;
+ nativeParams.unlockCb = UnlockOpenThreadTask;
+ nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance();
+ initParams.endpointNativeParams = static_cast(&nativeParams);
+#endif
+
+ VerifyOrDie((chip::Server::GetInstance().Init(initParams)) == CHIP_NO_ERROR);
+
+ gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
+ chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
+
+ GetAppTask().PostInitMatterServerInstance();
+
+#if CONFIG_CHIP_OTA_PROVIDER
+ InitOTAServer();
+#endif
+}
+
+CHIP_ERROR chip::NXP::App::AppTaskBase::Init()
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+
+ /* Init Chip memory management before the stack */
+ chip::Platform::MemoryInit();
+
+ /* Initialize Matter factory data before initializing the Matter stack */
+ err = AppFactoryData_PreMatterStackInit();
+
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Pre Factory Data Provider init failed");
+ goto exit;
+ }
+
+ /*
+ * Initialize the CHIP stack.
+ * Would also initialize all required platform modules
+ */
+ err = PlatformMgr().InitChipStack();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "PlatformMgr().InitChipStack() failed: %s", ErrorStr(err));
+ goto exit;
+ }
+
+ /* Initialize Matter factory data after initializing the Matter stack */
+ err = AppFactoryData_PostMatterStackInit();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Post Factory Data Provider init failed");
+ goto exit;
+ }
+
+ /*
+ * Register all application callbacks allowing to be informed of stack events
+ */
+ err = CHIPDeviceManager::GetInstance().Init(&GetDeviceCallbacks());
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "CHIPDeviceManager.Init() failed: %s", ErrorStr(err));
+ goto exit;
+ }
+
+#if CONFIG_NET_L2_OPENTHREAD
+ err = ThreadStackMgr().InitThreadStack();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Error during ThreadStackMgr().InitThreadStack()");
+ return err;
+ }
+
+ err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
+ if (err != CHIP_NO_ERROR)
+ {
+ return err;
+ }
+#endif
+
+ /*
+ * Schedule an event to the Matter stack to initialize
+ * the ZCL Data Model and start server
+ */
+ PlatformMgr().ScheduleWork(InitServer, 0);
+
+#ifdef EMBER_AF_PLUGIN_BINDING
+ /* Init binding handlers */
+ err = InitBindingHandlers();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "InitBindingHandlers failed: %s", ErrorStr(err));
+ goto exit;
+ }
+#endif
+
+#if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA
+ sNetworkCommissioningInstance.Init();
+#endif
+#if CONFIG_CHIP_OTA_REQUESTOR
+ if (err == CHIP_NO_ERROR)
+ {
+ /* If an update is under test make it permanent */
+ OTARequestorInitiator::Instance().HandleSelfTest();
+ }
+#endif
+
+ err = AppMatter_Register();
+ if (err != CHIP_NO_ERROR)
+ {
+ goto exit;
+ }
+
+ ConfigurationMgr().LogDeviceConfig();
+
+ // QR code will be used with CHIP Tool
+#if CONFIG_NETWORK_LAYER_BLE
+ PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE));
+#else
+ PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork));
+#endif /* CONFIG_NETWORK_LAYER_BLE */
+
+ /* Start a task to run the CHIP Device event loop. */
+ err = PlatformMgr().StartEventLoopTask();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Error during PlatformMgr().StartEventLoopTask()");
+ goto exit;
+ }
+
+#if CONFIG_NET_L2_OPENTHREAD
+ // Start OpenThread task
+ err = ThreadStackMgrImpl().StartThreadTask();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Error during ThreadStackMgrImpl().StartThreadTask()");
+ }
+#endif
+
+#if CONFIG_CHIP_TCP_DOWNLOAD
+ EnableTcpDownloadComponent();
+#endif
+
+exit:
+ return err;
+}
diff --git a/examples/platform/nxp/common/app_task/source/AppTaskFreeRTOS.cpp b/examples/platform/nxp/common/app_task/source/AppTaskFreeRTOS.cpp
new file mode 100644
index 00000000000000..8508884b672b23
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/source/AppTaskFreeRTOS.cpp
@@ -0,0 +1,240 @@
+/*
+ *
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2021 Google LLC.
+ * Copyright 2024 NXP
+ * 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 "AppTaskFreeRTOS.h"
+#include
+#include
+
+#include "AppMatterButton.h"
+#include "AppMatterCli.h"
+
+#include "CHIPDeviceManager.h"
+#include
+
+#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+#include
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
+
+#include
+
+#include
+
+#if WIFI_CONNECT_TASK
+#include "WifiConnect.h"
+#endif
+
+#ifndef APP_TASK_STACK_SIZE
+#define APP_TASK_STACK_SIZE ((configSTACK_DEPTH_TYPE) 6144 / sizeof(portSTACK_TYPE))
+#endif
+#ifndef APP_TASK_PRIORITY
+#define APP_TASK_PRIORITY 2
+#endif
+#define APP_EVENT_QUEUE_SIZE 10
+
+static QueueHandle_t sAppEventQueue;
+
+using namespace chip;
+using namespace chip::TLV;
+using namespace ::chip::Credentials;
+using namespace ::chip::DeviceLayer;
+using namespace ::chip::DeviceManager;
+using namespace ::chip::app::Clusters;
+
+#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+
+chip::DeviceLayer::NetworkCommissioning::WiFiDriver * chip::NXP::App::AppTaskFreeRTOS::GetWifiDriverInstance()
+{
+ return static_cast(
+ &(::chip::DeviceLayer::NetworkCommissioning::NXPWiFiDriver::GetInstance()));
+}
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
+
+CHIP_ERROR chip::NXP::App::AppTaskFreeRTOS::AppMatter_Register()
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ /* Register Matter CLI cmds */
+ err = AppMatterCli_RegisterCommands();
+ AppMatter_RegisterCustomCliCommands();
+ AppMatterCli_StartTask();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Error during AppMatterCli_RegisterCommands");
+ return err;
+ }
+ /* Register Matter buttons */
+ err = AppMatterButton_registerButtons();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "Error during AppMatterButton_registerButtons");
+ return err;
+ }
+ return err;
+}
+
+CHIP_ERROR chip::NXP::App::AppTaskFreeRTOS::Start()
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ TaskHandle_t taskHandle;
+
+ sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent));
+ if (sAppEventQueue == NULL)
+ {
+ err = CHIP_ERROR_NO_MEMORY;
+ ChipLogError(DeviceLayer, "Failed to allocate app event queue");
+ assert(err == CHIP_NO_ERROR);
+ }
+
+ /* AppTaskMain function will loss actual object instance, give it as parameter */
+ if (xTaskCreate(&AppTaskFreeRTOS::AppTaskMain, "AppTaskMain", APP_TASK_STACK_SIZE, this, APP_TASK_PRIORITY, &taskHandle) !=
+ pdPASS)
+ {
+ err = CHIP_ERROR_NO_MEMORY;
+ ChipLogError(DeviceLayer, "Failed to start app task");
+ assert(err == CHIP_NO_ERROR);
+ }
+
+ return err;
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::AppTaskMain(void * pvParameter)
+{
+ CHIP_ERROR err;
+ AppEvent event;
+
+ /* AppTaskMain function will loss AppTask object instance (FreeRTOS task context), AppTask instance is given as parameter */
+ AppTaskFreeRTOS * sAppTask = static_cast(pvParameter);
+
+ sAppTask->PreInitMatterStack();
+ err = sAppTask->Init();
+ sAppTask->PostInitMatterStack();
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(DeviceLayer, "AppTask.Init() failed");
+ assert(err == CHIP_NO_ERROR);
+ }
+
+ while (true)
+ {
+ BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY);
+ while (eventReceived == pdTRUE)
+ {
+ sAppTask->DispatchEvent(event);
+ eventReceived = xQueueReceive(sAppEventQueue, &event, 0);
+ }
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::PostEvent(const AppEvent & event)
+{
+ if (sAppEventQueue != NULL)
+ {
+ if (!xQueueSend(sAppEventQueue, &event, 0))
+ {
+ ChipLogError(DeviceLayer, "Failed to post event to app task event queue");
+ }
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::DispatchEvent(const AppEvent & event)
+{
+ if (event.Handler)
+ {
+ event.Handler(event);
+ }
+ else
+ {
+ ChipLogProgress(DeviceLayer, "Event received with no handler. Dropping event.");
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::StartCommissioning(intptr_t arg)
+{
+ /* Check the status of the commissioning */
+ if (ConfigurationMgr().IsFullyProvisioned())
+ {
+ ChipLogProgress(DeviceLayer, "Device already commissioned");
+ }
+ else if (chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
+ {
+ ChipLogProgress(DeviceLayer, "Commissioning window already opened");
+ }
+ else
+ {
+ chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::StopCommissioning(intptr_t arg)
+{
+ /* Check the status of the commissioning */
+ if (ConfigurationMgr().IsFullyProvisioned())
+ {
+ ChipLogProgress(DeviceLayer, "Device already commissioned");
+ }
+ else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
+ {
+ ChipLogProgress(DeviceLayer, "Commissioning window not opened");
+ }
+ else
+ {
+ chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow();
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::SwitchCommissioningState(intptr_t arg)
+{
+ /* Check the status of the commissioning */
+ if (ConfigurationMgr().IsFullyProvisioned())
+ {
+ ChipLogProgress(DeviceLayer, "Device already commissioned");
+ }
+ else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
+ {
+ chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
+ }
+ else
+ {
+ chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow();
+ }
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::StartCommissioningHandler(void)
+{
+ /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
+ PlatformMgr().ScheduleWork(StartCommissioning, 0);
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::StopCommissioningHandler(void)
+{
+ /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
+ PlatformMgr().ScheduleWork(StopCommissioning, 0);
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::SwitchCommissioningStateHandler(void)
+{
+ /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */
+ PlatformMgr().ScheduleWork(SwitchCommissioningState, 0);
+}
+
+void chip::NXP::App::AppTaskFreeRTOS::FactoryResetHandler(void)
+{
+ /* Emit the ShutDown event before factory reset */
+ chip::Server::GetInstance().GenerateShutDownEvent();
+ chip::Server::GetInstance().ScheduleFactoryReset();
+}
diff --git a/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp b/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp
new file mode 100644
index 00000000000000..03a86a572a82c2
--- /dev/null
+++ b/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2020 Project CHIP Authors
+ * Copyright 2024 NXP
+ * 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.
+ */
+
+/* -------------------------------------------------------------------------- */
+/* Includes */
+/* -------------------------------------------------------------------------- */
+#include "AppTaskZephyr.h"
+
+#include "CHIPDeviceManager.h"
+#include
+#include
+#include
+#include
+#include
+
+#ifdef CONFIG_CHIP_WIFI
+#include
+#endif
+
+#if CONFIG_CHIP_FACTORY_DATA
+#include
+#else
+#include
+#endif
+
+#include "AppFactoryData.h"
+
+LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
+
+using namespace ::chip;
+using namespace ::chip::app;
+using namespace ::chip::Credentials;
+using namespace ::chip::DeviceLayer;
+using namespace ::chip::DeviceManager;
+
+/* -------------------------------------------------------------------------- */
+/* Private memory */
+/* -------------------------------------------------------------------------- */
+
+constexpr size_t kAppEventQueueSize = 10;
+K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), kAppEventQueueSize, alignof(AppEvent));
+
+/* -------------------------------------------------------------------------- */
+/* Class implementation */
+/* -------------------------------------------------------------------------- */
+
+#if defined(CONFIG_CHIP_WIFI)
+chip::DeviceLayer::NetworkCommissioning::WiFiDriver * chip::NXP::App::AppTaskZephyr::GetWifiDriverInstance()
+{
+ return static_cast(&(NetworkCommissioning::NxpWifiDriver::Instance()));
+}
+#endif // CONFIG_CHIP_WIFI
+
+CHIP_ERROR chip::NXP::App::AppTaskZephyr::Start()
+{
+
+ ReturnErrorOnFailure(Init());
+
+ AppEvent event{};
+
+ while (true)
+ {
+ k_msgq_get(&sAppEventQueue, &event, K_FOREVER);
+ DispatchEvent(event);
+ }
+
+ return CHIP_NO_ERROR;
+}
+
+void chip::NXP::App::AppTaskZephyr::PostEvent(const AppEvent & event)
+{
+ if (k_msgq_put(&sAppEventQueue, &event, K_NO_WAIT) != 0)
+ {
+ LOG_INF("Failed to post event to app task event queue");
+ }
+}
+
+void chip::NXP::App::AppTaskZephyr::DispatchEvent(const AppEvent & event)
+{
+ if (event.Handler)
+ {
+ event.Handler(event);
+ }
+ else
+ {
+ LOG_INF("Event received with no handler. Dropping event.");
+ }
+}
diff --git a/examples/platform/nxp/common/device_callbacks/include/CommonDeviceCallbacks.h b/examples/platform/nxp/common/device_callbacks/include/CommonDeviceCallbacks.h
new file mode 100644
index 00000000000000..4cbd5028ce58b3
--- /dev/null
+++ b/examples/platform/nxp/common/device_callbacks/include/CommonDeviceCallbacks.h
@@ -0,0 +1,69 @@
+/*
+ *
+ * Copyright (c) 2020-2023 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 CommonDeviceCallbacks.h
+ *
+ * Common Implementations for the DeviceManager callbacks for all applications
+ *
+ **/
+
+#pragma once
+
+#include "CHIPDeviceManager.h"
+#include
+#include
+
+namespace chip {
+namespace NXP {
+namespace App {
+class CommonDeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
+{
+public:
+ virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
+ virtual void OnWiFiConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
+ virtual void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
+ virtual void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event);
+ virtual void OnInterfaceIpAddressChanged(const chip::DeviceLayer::ChipDeviceEvent * event);
+#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
+ virtual void OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event);
+#endif
+};
+
+class DeviceCallbacksDelegate
+{
+public:
+ static DeviceCallbacksDelegate & Instance()
+ {
+ static DeviceCallbacksDelegate instance;
+ return instance;
+ }
+ DeviceCallbacksDelegate * mDelegate = nullptr;
+ void SetAppDelegate(DeviceCallbacksDelegate * delegate) { mDelegate = delegate; }
+ DeviceCallbacksDelegate * GetAppDelegate() { return mDelegate; }
+};
+
+/**
+ * Returns the application-specific implementation of the CommonDeviceCallbacks object.
+ *
+ * Applications can use this to gain access to features of the CommonDeviceCallbacks.
+ */
+extern chip::DeviceManager::CHIPDeviceManagerCallbacks & GetDeviceCallbacks();
+} // namespace App
+} // namespace NXP
+} // namespace chip
diff --git a/examples/platform/nxp/common/device_callbacks/source/CommonDeviceCallbacks.cpp b/examples/platform/nxp/common/device_callbacks/source/CommonDeviceCallbacks.cpp
new file mode 100644
index 00000000000000..d38d6f59f8c572
--- /dev/null
+++ b/examples/platform/nxp/common/device_callbacks/source/CommonDeviceCallbacks.cpp
@@ -0,0 +1,177 @@
+/*
+ *
+ * Copyright (c) 2020-2023 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 CommonDeviceCallbacks.cpp
+ *
+ * Implements all the callbacks to the application from the CHIP Stack
+ *
+ **/
+#include "CommonDeviceCallbacks.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
+#include "openthread-system.h"
+#include "ot_platform_common.h"
+#endif /* CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED */
+
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+#include "OTARequestorInitiator.h"
+#endif
+
+using namespace chip::app;
+using namespace ::chip;
+using namespace ::chip::Inet;
+using namespace ::chip::System;
+using namespace ::chip::DeviceLayer;
+
+void chip::NXP::App::CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
+{
+ ChipLogDetail(DeviceLayer, "DeviceEventCallback: 0x%04x", event->Type);
+ switch (event->Type)
+ {
+ case DeviceEventType::kWiFiConnectivityChange:
+ OnWiFiConnectivityChange(event);
+ break;
+
+ case DeviceEventType::kInternetConnectivityChange:
+ OnInternetConnectivityChange(event);
+ break;
+
+ case DeviceEventType::kInterfaceIpAddressChanged:
+#if !CHIP_ENABLE_OPENTHREAD // No need to do this for OT mDNS server
+ if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
+ (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
+ {
+ // MDNS server restart on any ip assignment: if link local ipv6 is configured, that
+ // will not trigger a 'internet connectivity change' as there is no internet
+ // connectivity. MDNS still wants to refresh its listening interfaces to include the
+ // newly selected address.
+ chip::app::DnssdServer::Instance().StartServer();
+ }
+#endif
+ OnInterfaceIpAddressChanged(event);
+ break;
+
+#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
+ case DeviceEventType::kCommissioningComplete:
+ CommonDeviceCallbacks::OnComissioningComplete(event);
+ break;
+#endif
+ case DeviceLayer::DeviceEventType::kDnssdInitialized:
+ ChipLogProgress(DeviceLayer, "kDnssdInitialized");
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+ /* Initialize OTA Requestor */
+ OTARequestorInitiator::Instance().InitOTA(reinterpret_cast(&OTARequestorInitiator::Instance()));
+#endif
+ break;
+ }
+}
+
+void chip::NXP::App::CommonDeviceCallbacks::OnWiFiConnectivityChange(const ChipDeviceEvent * event)
+{
+ if (event->WiFiConnectivityChange.Result == kConnectivity_Established)
+ {
+ ChipLogProgress(DeviceLayer, "WiFi connection established");
+ }
+ else if (event->WiFiConnectivityChange.Result == kConnectivity_Lost)
+ {
+ ChipLogProgress(DeviceLayer, "WiFi connection lost");
+ }
+}
+
+void chip::NXP::App::CommonDeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event)
+{
+ if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established)
+ {
+ char ip_addr[Inet::IPAddress::kMaxStringLength];
+ event->InternetConnectivityChange.ipAddress.ToString(ip_addr);
+ ChipLogProgress(DeviceLayer, "Server ready at: %s:%d", ip_addr, CHIP_PORT);
+#if !CHIP_ENABLE_OPENTHREAD // No need to do this for OT mDNS server
+ chip::app::DnssdServer::Instance().StartServer();
+#endif
+ }
+ else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost)
+ {
+ ChipLogProgress(DeviceLayer, "Lost IPv4 connectivity...");
+ }
+ if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)
+ {
+ char ip_addr[Inet::IPAddress::kMaxStringLength];
+ event->InternetConnectivityChange.ipAddress.ToString(ip_addr);
+ ChipLogProgress(DeviceLayer, "IPv6 Server ready at: [%s]:%d", ip_addr, CHIP_PORT);
+#if !CHIP_ENABLE_OPENTHREAD // No need to do this for OT mDNS server
+ chip::app::DnssdServer::Instance().StartServer();
+#endif
+ }
+ else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost)
+ {
+ ChipLogProgress(DeviceLayer, "Lost IPv6 connectivity...");
+ }
+}
+
+void chip::NXP::App::CommonDeviceCallbacks::OnInterfaceIpAddressChanged(const ChipDeviceEvent * event)
+{
+ switch (event->InterfaceIpAddressChanged.Type)
+ {
+ case InterfaceIpChangeType::kIpV4_Assigned:
+ ChipLogProgress(DeviceLayer, "Interface IPv4 address assigned");
+ break;
+ case InterfaceIpChangeType::kIpV4_Lost:
+ ChipLogProgress(DeviceLayer, "Interface IPv4 address lost");
+ break;
+ case InterfaceIpChangeType::kIpV6_Assigned:
+ ChipLogProgress(DeviceLayer, "Interface IPv6 address assigned");
+ break;
+ case InterfaceIpChangeType::kIpV6_Lost:
+ ChipLogProgress(DeviceLayer, "Interface IPv6 address lost");
+ break;
+ }
+}
+
+void chip::NXP::App::CommonDeviceCallbacks::OnSessionEstablished(chip::DeviceLayer::ChipDeviceEvent const *)
+{
+ /* Empty */
+}
+
+#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
+void chip::NXP::App::CommonDeviceCallbacks::OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event)
+{
+ /*
+ * If a transceiver supporting a multiprotocol scenario is used, a check of the provisioning state is required,
+ * so that we can inform the transceiver to stop BLE to give the priority to another protocol.
+ * For example it is the case when a K32W0 transceiver supporting OT+BLE+Zigbee is used. When the device is already provisioned,
+ * BLE is no more required and the transceiver needs to be informed so that Zigbee can be switched on and BLE switched off.
+ *
+ * If a transceiver does not support such vendor property the cmd would be ignored.
+ */
+ if (ConfigurationMgr().IsFullyProvisioned())
+ {
+ ChipLogDetail(DeviceLayer, "Provisioning complete, stopping BLE\n");
+ ThreadStackMgrImpl().LockThreadStack();
+ PlatformMgrImpl().StopBLEConnectivity();
+ ThreadStackMgrImpl().UnlockThreadStack();
+ }
+}
+#endif
diff --git a/examples/all-clusters-app/nxp/common/main/include/CHIPDeviceManager.h b/examples/platform/nxp/common/device_manager/include/CHIPDeviceManager.h
similarity index 100%
rename from examples/all-clusters-app/nxp/common/main/include/CHIPDeviceManager.h
rename to examples/platform/nxp/common/device_manager/include/CHIPDeviceManager.h
diff --git a/examples/all-clusters-app/nxp/common/main/CHIPDeviceManager.cpp b/examples/platform/nxp/common/device_manager/source/CHIPDeviceManager.cpp
similarity index 100%
rename from examples/all-clusters-app/nxp/common/main/CHIPDeviceManager.cpp
rename to examples/platform/nxp/common/device_manager/source/CHIPDeviceManager.cpp
diff --git a/examples/shell/nxp/k32w/k32w0/args.gni b/examples/platform/nxp/common/diagnostic_logs/BUILD.gn
similarity index 62%
rename from examples/shell/nxp/k32w/k32w0/args.gni
rename to examples/platform/nxp/common/diagnostic_logs/BUILD.gn
index e9f2a25ea6f722..04d864753a6633 100644
--- a/examples/shell/nxp/k32w/k32w0/args.gni
+++ b/examples/platform/nxp/common/diagnostic_logs/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Project CHIP Authors
+# 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.
@@ -13,11 +13,12 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/pigweed.gni")
-import("${chip_root}/config/standalone/args.gni")
-import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni")
-import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni")
-k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain")
+source_set("nxp_diagnostic_logs") {
+ sources = [
+ "DiagnosticLogsProviderDelegateImpl.cpp",
+ "DiagnosticLogsProviderDelegateImpl.h",
+ ]
-chip_enable_ble = false
+ include_dirs = [ "${chip_root}/src" ]
+}
diff --git a/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.cpp b/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.cpp
new file mode 100644
index 00000000000000..359edc3dedc9a6
--- /dev/null
+++ b/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.cpp
@@ -0,0 +1,168 @@
+/*
+ *
+ * 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 "DiagnosticLogsProviderDelegateImpl.h"
+
+#include
+#include
+
+using namespace chip;
+using namespace chip::app::Clusters::DiagnosticLogs;
+
+namespace {
+bool IsValidIntent(IntentEnum intent)
+{
+ return intent != IntentEnum::kUnknownEnumValue;
+}
+} // namespace
+
+LogProvider LogProvider::sInstance;
+
+LogProvider::~LogProvider() {}
+
+CHIP_ERROR LogProvider::GetLogForIntent(IntentEnum intent, MutableByteSpan & outBuffer, Optional & outTimeStamp,
+ Optional & outTimeSinceBoot)
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ LogSessionHandle sessionHandle = kInvalidLogSessionHandle;
+
+ err = StartLogCollection(intent, sessionHandle, outTimeStamp, outTimeSinceBoot);
+ VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0));
+
+ bool unusedOutIsEndOfLog;
+ err = CollectLog(sessionHandle, outBuffer, unusedOutIsEndOfLog);
+ VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0));
+
+ err = EndLogCollection(sessionHandle);
+ VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0));
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR LogProvider::StartLogCollection(IntentEnum intent, LogSessionHandle & outHandle, Optional & outTimeStamp,
+ Optional & outTimeSinceBoot)
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+
+ VerifyOrReturnValue(IsValidIntent(intent), CHIP_ERROR_INVALID_ARGUMENT);
+
+ auto key = GetKeyForIntent(intent);
+ VerifyOrReturnValue(key.IsInitialized(), CHIP_ERROR_NOT_FOUND);
+
+ uint16_t diagSize = GetSizeForIntent(intent);
+ VerifyOrReturnError(diagSize, CHIP_ERROR_NOT_FOUND);
+
+ uint8_t * diagData = (uint8_t *) calloc(1, diagSize);
+ VerifyOrReturnError(diagData, CHIP_ERROR_NO_MEMORY);
+
+ err = chip::Server::GetInstance().GetPersistentStorage().SyncGetKeyValue(key.KeyName(), diagData, diagSize);
+ VerifyOrReturnValue(err == CHIP_NO_ERROR, err);
+
+ MutableByteSpan * mutableSpan = reinterpret_cast(calloc(1, sizeof(MutableByteSpan)));
+ VerifyOrReturnValue(mutableSpan, CHIP_ERROR_NO_MEMORY, free(diagData));
+
+ *mutableSpan = MutableByteSpan(diagData, diagSize);
+
+ mLogSessionHandle++;
+ // If the session handle rolls over to UINT16_MAX which is invalid, reset to 0.
+ VerifyOrDo(mLogSessionHandle != kInvalidLogSessionHandle, mLogSessionHandle = 0);
+
+ outHandle = mLogSessionHandle;
+ mSessionSpanMap[mLogSessionHandle] = mutableSpan;
+ mSessionDiagMap[mLogSessionHandle] = diagData;
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR LogProvider::EndLogCollection(LogSessionHandle sessionHandle)
+{
+ VerifyOrReturnValue(sessionHandle != kInvalidLogSessionHandle, CHIP_ERROR_INVALID_ARGUMENT);
+ VerifyOrReturnValue(mSessionSpanMap.count(sessionHandle), CHIP_ERROR_INVALID_ARGUMENT);
+
+ free(mSessionDiagMap[sessionHandle]);
+ free(mSessionSpanMap[sessionHandle]);
+
+ mSessionSpanMap.erase(sessionHandle);
+ mSessionDiagMap.erase(sessionHandle);
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR LogProvider::CollectLog(LogSessionHandle sessionHandle, MutableByteSpan & outBuffer, bool & outIsEndOfLog)
+{
+ VerifyOrReturnValue(sessionHandle != kInvalidLogSessionHandle, CHIP_ERROR_INVALID_ARGUMENT);
+ VerifyOrReturnValue(mSessionSpanMap.count(sessionHandle), CHIP_ERROR_INVALID_ARGUMENT);
+
+ MutableByteSpan * mutableSpan = mSessionSpanMap[sessionHandle];
+ auto diagSize = mutableSpan->size();
+ auto count = std::min(diagSize, outBuffer.size());
+
+ VerifyOrReturnError(CanCastTo(count), CHIP_ERROR_INVALID_ARGUMENT, outBuffer.reduce_size(0));
+
+ ReturnErrorOnFailure(CopySpanToMutableSpan(ByteSpan(mutableSpan->data(), count), outBuffer));
+
+ outIsEndOfLog = diagSize == count;
+
+ if (!outIsEndOfLog)
+ {
+ // reduce the span after reading count bytes
+ *mutableSpan = mutableSpan->SubSpan(count);
+ }
+
+ return CHIP_NO_ERROR;
+}
+
+size_t LogProvider::GetSizeForIntent(IntentEnum intent)
+{
+ uint16_t sizeForIntent = 0;
+ CHIP_ERROR err = CHIP_NO_ERROR;
+
+ auto key = GetKeyForIntent(intent);
+ VerifyOrReturnValue(key.IsInitialized(), 0);
+
+ uint16_t bufferLen = CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE;
+ Platform::ScopedMemoryBuffer buffer;
+
+ buffer.Calloc(bufferLen);
+ VerifyOrReturnValue(buffer.Get() != nullptr, 0);
+
+ err = Server::GetInstance().GetPersistentStorage().SyncGetKeyValue(key.KeyName(), buffer.Get(), sizeForIntent);
+ VerifyOrReturnValue(err == CHIP_NO_ERROR, 0);
+
+ return sizeForIntent;
+}
+
+StorageKeyName LogProvider::GetKeyForIntent(IntentEnum intent) const
+{
+ StorageKeyName key = StorageKeyName::Uninitialized();
+
+ switch (intent)
+ {
+ case IntentEnum::kEndUserSupport:
+ return GetKeyDiagUserSupport();
+ case IntentEnum::kNetworkDiag:
+ return GetKeyDiagNetwork();
+ case IntentEnum::kCrashLogs:
+ return GetKeyDiagCrashLog();
+ case IntentEnum::kUnknownEnumValue:
+ // It should never happen.
+ chipDie();
+ }
+
+ return key;
+}
diff --git a/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.h b/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.h
new file mode 100644
index 00000000000000..73d60f542aacdc
--- /dev/null
+++ b/examples/platform/nxp/common/diagnostic_logs/DiagnosticLogsProviderDelegateImpl.h
@@ -0,0 +1,75 @@
+/*
+ *
+ * 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
+
+#include
+#include
+#include