diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 57337d553128b5..b0b4fef50e15df 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -41,7 +41,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:81 + image: ghcr.io/project-chip/chip-build-efr32:85 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 7000082f03e32e..78a1c8dea80809 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -70,6 +70,7 @@ jobs: --target linux-arm64-lit-icd-no-ble-clang \ --target linux-arm64-fabric-admin-clang-rpc \ --target linux-arm64-fabric-bridge-no-ble-clang-rpc \ + --target linux-arm64-fabric-sync-no-ble-clang \ build \ " - name: Bloat report - chip-tool diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 83b82369ba4878..2bed5acd82f040 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -219,6 +219,16 @@ jobs: linux debug fabric-bridge-app \ out/linux-x64-fabric-bridge-no-ble-rpc/fabric-bridge-app \ /tmp/bloat_reports/ + - name: Build example Fabric Sync + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-fabric-sync-no-ble \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug fabric-sync \ + out/linux-x64-fabric-sync-no-ble/fabric-sync \ + /tmp/bloat_reports/ - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 22cf6b335eaa12..54997b6efa9b39 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:81 + image: ghcr.io/project-chip/chip-build-efr32:85 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.gitmodules b/.gitmodules index ed472c937c5e0d..c2b9a95a5e0345 100644 --- a/.gitmodules +++ b/.gitmodules @@ -213,17 +213,17 @@ [submodule "third_party/silabs/simplicity_sdk"] path = third_party/silabs/simplicity_sdk url = https://github.com/SiliconLabs/simplicity_sdk.git - branch = v2024.6.1-0 + branch = v2024.6.2 platforms = silabs [submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"] path = third_party/silabs/wiseconnect-wifi-bt-sdk url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git - branch = 2.10.0 + branch = 2.10.3 platforms = silabs [submodule "third_party/silabs/wifi_sdk"] path = third_party/silabs/wifi_sdk url = https://github.com/SiliconLabs/wiseconnect.git - branch = v3.3.2 + branch = v3.3.3 platforms = silabs [submodule "editline"] path = third_party/editline/repo diff --git a/.vscode/launch.json b/.vscode/launch.json index 898defc9c60fe1..fc821c76eb802c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -419,6 +419,14 @@ "cwd": "${workspaceFolder}" }, + { + "name": "Fabric Sync (Linux)", + "type": "lldb", + "request": "launch", + "program": "${workspaceFolder}/out/debug/standalone/fabric-sync", + "cwd": "${workspaceFolder}" + }, + { "name": "OTA Requestor App (Linux)", "type": "lldb", diff --git a/docs/development_controllers/chip-tool/chip_tool_guide.md b/docs/development_controllers/chip-tool/chip_tool_guide.md index 8aac8daa121812..81000368a47f0c 100644 --- a/docs/development_controllers/chip-tool/chip_tool_guide.md +++ b/docs/development_controllers/chip-tool/chip_tool_guide.md @@ -9,33 +9,29 @@ the setup payload or performing discovery actions.
-## Source files +## Installation -You can find source files of the CHIP Tool in the `examples/chip-tool` -directory. - -> **Note:** The CHIP Tool caches the configuration state in the -> `/tmp/chip_tool_config.ini` file. Deleting this and other `.ini` files in the -> `/tmp` directory can sometimes resolve issues related to stale configuration. +On Linux distributions +[running snapd](https://snapcraft.io/docs/installing-snapd), such as Ubuntu, the +CHIP Tool can be installed using the +[chip-tool snap](https://snapcraft.io/chip-tool). To do this, run: -> **Note:** To make the configuration persistent (since `/tmp` directory might -> be flushed at each reboot) you can change the directory where CHIP Tool caches -> its configuration by using the option `--storage-directory` +``` +sudo snap install chip-tool +``` -
+## Building from source -## Building and running the CHIP Tool +The source files of the CHIP Tool are available in the `examples/chip-tool` +directory. -Before you can use the CHIP Tool, you must compile it from source on Linux -(amd64/aarch64) or macOS. If you want to run it on Raspberry Pi, it must use a -64-bit OS. +The source can be compiled on Linux (amd64/aarch64) or macOS. If you want to run +it on Raspberry Pi, you must use a 64-bit OS. > **Note:** To ensure compatibility, always build the CHIP Tool and the Matter > device from the same revision of the `connectedhomeip` repository. -### Building the CHIP Tool - -To build and run the CHIP Tool: +To build the CHIP Tool: 1. Install all required packages for Matter and prepare the source code and the build system. Read the [Building Matter](../../guides/BUILDING.md) guide for @@ -50,10 +46,16 @@ To build and run the CHIP Tool: In this command, `BUILD_PATH` specifies where the target binaries are to be placed. -### Running the CHIP Tool +## Running the CHIP Tool + +If you installed the CHIP Tool as a snap, the command to run it would be: + +``` +$ chip-tool +``` -To check if the CHIP Tool runs correctly, execute the following command from the -`BUILD_PATH` directory: +If you compiled the CHIP Tool from source, it can be executed with the following +command from the `BUILD_PATH` directory: ``` $ ./chip-tool @@ -68,6 +70,13 @@ more complex command by appending it with sub-commands. Examples of specific commands and their use cases are described in the [Supported commands and options](#supported-commands-and-options) section. +> **Note:** The CHIP Tool caches the configuration state in the +> `/tmp/chip_tool_config.ini` file. Deleting this and other `.ini` files in the +> `/tmp` directory can sometimes resolve issues related to stale configuration. +> To make the configuration persistent you can change the directory where CHIP +> Tool caches its configuration by using the command line option +> `--storage-directory` +
## CHIP Tool modes diff --git a/examples/all-clusters-app/nxp/common/main/main.cpp b/examples/all-clusters-app/nxp/common/main/main.cpp index b2aadab98ceb8b..26772e9e600659 100644 --- a/examples/all-clusters-app/nxp/common/main/main.cpp +++ b/examples/all-clusters-app/nxp/common/main/main.cpp @@ -32,7 +32,7 @@ uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE]; using namespace ::chip::DeviceLayer; -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { TaskHandle_t taskHandle; diff --git a/examples/contact-sensor-app/nxp/common/main.cpp b/examples/contact-sensor-app/nxp/common/main.cpp index d9672b5402c867..ee193927912eeb 100644 --- a/examples/contact-sensor-app/nxp/common/main.cpp +++ b/examples/contact-sensor-app/nxp/common/main.cpp @@ -30,7 +30,7 @@ extern "C" void main_task(void const * argument) chip::NXP::App::GetAppTask().Start(); } #else -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { chip::DeviceLayer::PlatformMgrImpl().HardwareInit(); chip::NXP::App::GetAppTask().Start(); diff --git a/examples/laundry-washer-app/nxp/common/main/main.cpp b/examples/laundry-washer-app/nxp/common/main/main.cpp index b2aadab98ceb8b..26772e9e600659 100644 --- a/examples/laundry-washer-app/nxp/common/main/main.cpp +++ b/examples/laundry-washer-app/nxp/common/main/main.cpp @@ -32,7 +32,7 @@ uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE]; using namespace ::chip::DeviceLayer; -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { TaskHandle_t taskHandle; diff --git a/examples/light-switch-app/genio/src/main.cpp b/examples/light-switch-app/genio/src/main.cpp index d545409c706913..564233716d1d9a 100644 --- a/examples/light-switch-app/genio/src/main.cpp +++ b/examples/light-switch-app/genio/src/main.cpp @@ -251,7 +251,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/light-switch-app/nrfconnect/README.md b/examples/light-switch-app/nrfconnect/README.md index 11e53793463570..02f7b500aa6270 100644 --- a/examples/light-switch-app/nrfconnect/README.md +++ b/examples/light-switch-app/nrfconnect/README.md @@ -638,7 +638,7 @@ same Matter network. To perform the unicast binding process, complete the following steps: 1. Build the CHIP Tool according to the steps from the - [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-and-running-the-chip-tool). + [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-from-source). 2. Go to the CHIP Tool build directory. 3. Add an ACL to the development kit that is programmed with the [Lighting Application Example](../../lighting-app/nrfconnect/README.md) by @@ -690,7 +690,7 @@ same Matter network. To perform the unicast binding process, complete the following steps: 1. Build the CHIP Tool according to the steps from the - [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-and-running-the-chip-tool). + [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-from-source). 2. Go to the CHIP Tool build directory. 3. Add the light switch device to the multicast group by running the following diff --git a/examples/lighting-app-data-mode-no-unique-id/linux/main.cpp b/examples/lighting-app-data-mode-no-unique-id/linux/main.cpp index 8e586b5cf56d54..56cafc2e527509 100644 --- a/examples/lighting-app-data-mode-no-unique-id/linux/main.cpp +++ b/examples/lighting-app-data-mode-no-unique-id/linux/main.cpp @@ -95,7 +95,7 @@ void ApplicationShutdown() } } -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { if (ChipLinuxAppInit(argc, argv) != 0) { diff --git a/examples/lighting-app/genio/src/main.cpp b/examples/lighting-app/genio/src/main.cpp index 22f654eb5f2f50..2db77457d2e7b1 100644 --- a/examples/lighting-app/genio/src/main.cpp +++ b/examples/lighting-app/genio/src/main.cpp @@ -251,7 +251,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/lighting-app/linux/main.cpp b/examples/lighting-app/linux/main.cpp index 8e586b5cf56d54..46dea03cdebccb 100644 --- a/examples/lighting-app/linux/main.cpp +++ b/examples/lighting-app/linux/main.cpp @@ -95,7 +95,14 @@ void ApplicationShutdown() } } -extern "C" int main(int argc, char * argv[]) +#ifdef __NuttX__ +// NuttX requires the main function to be defined with C-linkage. However, marking +// the main as extern "C" is not strictly conformant with the C++ standard. Since +// clang >= 20 such code triggers -Wmain warning. +extern "C" { +#endif + +int main(int argc, char * argv[]) { if (ChipLinuxAppInit(argc, argv) != 0) { @@ -124,3 +131,7 @@ extern "C" int main(int argc, char * argv[]) return 0; } + +#ifdef __NuttX__ +} +#endif diff --git a/examples/lighting-app/nxp/common/main.cpp b/examples/lighting-app/nxp/common/main.cpp index d9672b5402c867..ee193927912eeb 100644 --- a/examples/lighting-app/nxp/common/main.cpp +++ b/examples/lighting-app/nxp/common/main.cpp @@ -30,7 +30,7 @@ extern "C" void main_task(void const * argument) chip::NXP::App::GetAppTask().Start(); } #else -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { chip::DeviceLayer::PlatformMgrImpl().HardwareInit(); chip::NXP::App::GetAppTask().Start(); diff --git a/examples/lock-app/genio/src/main.cpp b/examples/lock-app/genio/src/main.cpp index 92b16a39663ee4..36564e13330f93 100644 --- a/examples/lock-app/genio/src/main.cpp +++ b/examples/lock-app/genio/src/main.cpp @@ -251,7 +251,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/lock-app/nxp/common/main/main.cpp b/examples/lock-app/nxp/common/main/main.cpp index 09de048127518b..8565ca01af32e9 100644 --- a/examples/lock-app/nxp/common/main/main.cpp +++ b/examples/lock-app/nxp/common/main/main.cpp @@ -39,7 +39,7 @@ extern "C" void main_task(void const * argument) chip::NXP::App::GetAppTask().Start(); } #else -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { chip::DeviceLayer::PlatformMgrImpl().HardwareInit(); chip::NXP::App::GetAppTask().Start(); diff --git a/examples/ota-requestor-app/genio/src/main.cpp b/examples/ota-requestor-app/genio/src/main.cpp index e3676c5c9eacbd..6c9f4f16c274f4 100644 --- a/examples/ota-requestor-app/genio/src/main.cpp +++ b/examples/ota-requestor-app/genio/src/main.cpp @@ -281,7 +281,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/platform/openiotsdk/app/openiotsdk_startup_gcc.cpp b/examples/platform/openiotsdk/app/openiotsdk_startup_gcc.cpp index 9add2ca4e53777..88488ff64763da 100644 --- a/examples/platform/openiotsdk/app/openiotsdk_startup_gcc.cpp +++ b/examples/platform/openiotsdk/app/openiotsdk_startup_gcc.cpp @@ -57,7 +57,7 @@ alignas(8) static uint8_t malloc_mutex_obj[80]; // C runtime import: constructor initialization and main extern "C" void __libc_init_array(void); -extern "C" int main(void); +int main(void); // IOT SDK serial declarations #define STDIN_FILENO 0 diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h index cd605b0f0a5152..57622a61ff65f4 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h @@ -29,6 +29,14 @@ //! Disable feature #define RSI_DISABLE 0 +// Temmporary work-around for wifi-init failure in ACX modules with WiseConnect v3.3.3. This can be removed after integrating with +// WiseConnect v3.4.0 +#if (SL_SI91X_ACX_MODULE == 1) +#define REGION_CODE IGNORE_REGION +#else +#define REGION_CODE US +#endif + static const sl_wifi_device_configuration_t config = { .boot_option = LOAD_NWP_FW, .mac_address = NULL, diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp index 4e9c40974c40e1..78d13498efa5ab 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp @@ -506,6 +506,9 @@ static void wfx_rsi_save_ap_info(void) // translation case SME_WPA2_ENTERPRISE: wfx_rsi.sec.security = WFX_SEC_WPA2; break; + case SME_WPA_WPA2_MIXED_MODE: + wfx_rsi.sec.security = WFX_SEC_WPA_WPA2_MIXED; + break; case SME_WEP: wfx_rsi.sec.security = WFX_SEC_WEP; break; @@ -551,6 +554,7 @@ static void wfx_rsi_do_join(void) break; case WFX_SEC_WPA: case WFX_SEC_WPA2: + case WFX_SEC_WPA_WPA2_MIXED: connect_security_mode = RSI_WPA_WPA2_MIXED; break; #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION diff --git a/examples/platform/silabs/uart.cpp b/examples/platform/silabs/uart.cpp index 1af3cb75d9f507..390e151cb7fbbf 100644 --- a/examples/platform/silabs/uart.cpp +++ b/examples/platform/silabs/uart.cpp @@ -38,7 +38,6 @@ extern "C" { #include "rsi_board.h" #include "rsi_debug.h" #include "rsi_rom_egpio.h" -#include "sl_si91x_usart.h" #else // For EFR32 #if (_SILICON_LABS_32B_SERIES < 3) #include "em_core.h" diff --git a/examples/shell/genio/src/main.cpp b/examples/shell/genio/src/main.cpp index 7190fd232a0969..fb4b3e068a0d0c 100644 --- a/examples/shell/genio/src/main.cpp +++ b/examples/shell/genio/src/main.cpp @@ -161,7 +161,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/thermostat/genio/src/main.cpp b/examples/thermostat/genio/src/main.cpp index d545409c706913..564233716d1d9a 100644 --- a/examples/thermostat/genio/src/main.cpp +++ b/examples/thermostat/genio/src/main.cpp @@ -251,7 +251,7 @@ void vStartTask(void * pvParameters) * Main Function ****************************************************************************/ -extern "C" int main(void) +int main(void) { mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); diff --git a/examples/thermostat/nxp/common/main/main.cpp b/examples/thermostat/nxp/common/main/main.cpp index b2aadab98ceb8b..26772e9e600659 100644 --- a/examples/thermostat/nxp/common/main/main.cpp +++ b/examples/thermostat/nxp/common/main/main.cpp @@ -32,7 +32,7 @@ uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE]; using namespace ::chip::DeviceLayer; -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { TaskHandle_t taskHandle; diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 99bc5042ed9939..824b79d6ce1a22 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" python scripts/checkout_submodules.py --shallow --recursive --platform esp32 nrfconnect silabs linux android id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" # NOTE: silabs boostrap is NOT done with the rest as it requests a conflicting # jinja2 version (asks for 3.1.3 when constraints.txt asks for 3.0.3) env: @@ -24,7 +24,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -45,7 +45,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -66,7 +66,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -88,7 +88,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -141,7 +141,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:85" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/scripts/BUILD.gn b/scripts/BUILD.gn index 0ebcab979112ca..ea1d49662fcb11 100644 --- a/scripts/BUILD.gn +++ b/scripts/BUILD.gn @@ -20,8 +20,8 @@ import("$dir_pw_build/python_dist.gni") # This target creates a single Python package and wheel for yamltests. It will # merge all Python dependencies Matter. The output is located in: -# out/obj/matter_yamltests_distribution/ <- source files here -# out/obj/matter_yamltests_distribution._build_wheel/matter_yamltests-0.0.1-py3-none-any.whl +# out/obj/scripts/matter_yamltests_distribution/ <- source files here +# out/obj/scripts/matter_yamltests_distribution._build_wheel/matter_yamltests-0.0.1-py3-none-any.whl pw_python_distribution("matter_yamltests_distribution") { packages = [ "${chip_root}/scripts/py_matter_yamltests:matter_yamltests" ] generate_setup_cfg = { diff --git a/scripts/build_python.sh b/scripts/build_python.sh index da3fe0cbedf733..7f03815f3fe7e3 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -175,22 +175,6 @@ tracing_options="matter_log_json_payload_hex=true matter_log_json_payload_decode gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="$tracing_options chip_detail_logging=$chip_detail_logging chip_project_config_include_dirs=[\"//config/python\"] $chip_mdns_arg $chip_case_retry_arg $pregen_dir_arg chip_config_network_layer_ble=$enable_ble chip_enable_ble=$enable_ble chip_crypto=\"boringssl\"" -function ninja_target() { - # Print the ninja target required to build a gn label. - local GN_LABEL="$1" - local NINJA_TARGET="$(gn ls "$OUTPUT_ROOT" --as=output "$GN_LABEL")" - echo "$NINJA_TARGET" -} - -function wheel_output_dir() { - # Print the wheel output directory for a pw_python_package or - # pw_python_distribution. The label must end in "._build_wheel". - local GN_LABEL="$1" - local NINJA_TARGET="$(ninja_target "$GN_LABEL")" - local WHEEL_DIR="$OUTPUT_ROOT"/"$(dirname "$NINJA_TARGET")/$(basename -s .stamp "$NINJA_TARGET")" - echo "$WHEEL_DIR" -} - # Compile Python wheels ninja -C "$OUTPUT_ROOT" python_wheels @@ -200,6 +184,11 @@ WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl) # Add the matter_testing_infrastructure wheel WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/chip-testing._build_wheel/chip_testing-*.whl) +if [ "$install_pytest_requirements" = "yes" ]; then + # Add the matter_yamltests_distribution wheel + WHEEL+=("$OUTPUT_ROOT"/obj/scripts/matter_yamltests_distribution._build_wheel/matter_yamltests-*.whl) +fi + if [ -n "$extra_packages" ]; then WHEEL+=("$extra_packages") fi @@ -221,14 +210,7 @@ if [ -n "$install_virtual_env" ]; then "$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade "${WHEEL[@]}" if [ "$install_pytest_requirements" = "yes" ]; then - YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel" - # Add wheels from pw_python_package or pw_python_distribution templates. - YAMLTEST_WHEEL=( - "$(ls -tr "$(wheel_output_dir "$YAMLTESTS_GN_LABEL")"/*.whl | head -n 1)" - ) - echo_blue "Installing python test dependencies ..." - "$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${YAMLTEST_WHEEL[@]}" "$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/scripts/tests/requirements.txt" "$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/src/python_testing/requirements.txt" fi diff --git a/scripts/py_matter_yamltests/matter_yamltests/hooks.py b/scripts/py_matter_yamltests/matter_yamltests/hooks.py index d14e90a7aabe90..ca739b8ea27633 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/hooks.py +++ b/scripts/py_matter_yamltests/matter_yamltests/hooks.py @@ -152,7 +152,7 @@ def step_skipped(self, name: str, expression: str): """ pass - def step_start(self, request: TestStep, endpoint: Optional[int] = None): + def step_start(self, request: TestStep): """ This method is called when the runner starts running a step from the test. @@ -160,8 +160,6 @@ def step_start(self, request: TestStep, endpoint: Optional[int] = None): ---------- request: TestStep The original request as defined by the test step. - endpoint: int - An optional device endpoint the step will target. """ pass diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 08215244b039aa..ec8cbd60457450 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -606,84 +606,82 @@ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ - { (uint16_t) 0x32, (uint16_t) 0x1, (uint16_t) 0xFF }, /* DefaultMoveRate */ \ - \ - /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1F }, /* SpinSpeedCurrent */ \ - \ - /* Endpoint: 1, Cluster: Smoke CO Alarm (server) */ \ - { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x2 }, /* SmokeSensitivityLevel */ \ - \ - /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */ \ - { (uint16_t) 0x64, (uint16_t) 0x1, (uint16_t) 0x64 }, /* DefaultOpenLevel */ \ - \ - /* Endpoint: 1, Cluster: Energy EVSE (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFFFE }, /* ApproximateEVEfficiency */ \ - \ - /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xF }, /* Mode */ \ - \ - /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* OperationMode */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x7 }, /* ControlMode */ \ - \ - /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { (uint16_t) 0xA28, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedCoolingSetpoint */ \ - { (uint16_t) 0x7D0, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedHeatingSetpoint */ \ - { (uint16_t) 0x2BC, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinHeatSetpointLimit */ \ - { (uint16_t) 0xBB8, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \ - { (uint16_t) 0x640, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \ - { (uint16_t) 0xC80, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \ - { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x7F }, /* MinSetpointDeadBand */ \ - { (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \ - { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \ - \ - /* Endpoint: 1, Cluster: Fan Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x6 }, /* FanMode */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* PercentSetting */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* SpeedSetting */ \ - \ - /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* TemperatureDisplayMode */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x5 }, /* KeypadLockout */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* ScheduleProgrammingVisibility */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointX */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointY */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRX */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRY */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGX */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGY */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBX */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBY */ \ - { (uint16_t) 0xFA, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* StartUpColorTemperatureMireds */ \ - \ - /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ - { (uint16_t) 0x1, (uint16_t) 0x1, (uint16_t) 0xFE }, /* MinLevel */ \ - { (uint16_t) 0xFE, (uint16_t) 0x1, (uint16_t) 0xFE }, /* MaxLevel */ \ - { (uint16_t) 0xFF, (uint16_t) 0x64, (uint16_t) 0xFFFF }, /* BallastFactorAdjustment */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* LampAlarmMode */ \ - \ - /* Endpoint: 1, Cluster: Unit Testing (server) */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ - { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ - { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ - { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ - { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* nullable_range_restricted_int16s */ \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ + \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ + { (uint16_t) 0x32, (uint16_t) 0x1, (uint16_t) 0xFF }, /* DefaultMoveRate */ \ + \ + /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1F }, /* SpinSpeedCurrent */ \ + \ + /* Endpoint: 1, Cluster: Smoke CO Alarm (server) */ \ + { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x2 }, /* SmokeSensitivityLevel */ \ + \ + /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */ \ + { (uint16_t) 0x64, (uint16_t) 0x1, (uint16_t) 0x64 }, /* DefaultOpenLevel */ \ + \ + /* Endpoint: 1, Cluster: Energy EVSE (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFFFE }, /* ApproximateEVEfficiency */ \ + \ + /* Endpoint: 1, Cluster: Window Covering (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xF }, /* Mode */ \ + \ + /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* OperationMode */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x7 }, /* ControlMode */ \ + \ + /* Endpoint: 1, Cluster: Thermostat (server) */ \ + { (uint16_t) 0xA28, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedCoolingSetpoint */ \ + { (uint16_t) 0x7D0, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedHeatingSetpoint */ \ + { (uint16_t) 0x2BC, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinHeatSetpointLimit */ \ + { (uint16_t) 0xBB8, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \ + { (uint16_t) 0x640, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \ + { (uint16_t) 0xC80, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \ + { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x7F }, /* MinSetpointDeadBand */ \ + { (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \ + { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \ + \ + /* Endpoint: 1, Cluster: Fan Control (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x6 }, /* FanMode */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* PercentSetting */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* SpeedSetting */ \ + \ + /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* TemperatureDisplayMode */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x5 }, /* KeypadLockout */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* ScheduleProgrammingVisibility */ \ + \ + /* Endpoint: 1, Cluster: Color Control (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointX */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointY */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRX */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRY */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGX */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGY */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBX */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBY */ \ + { (uint16_t) 0xFA, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* StartUpColorTemperatureMireds */ \ + \ + /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ + { (uint16_t) 0x1, (uint16_t) 0x1, (uint16_t) 0xFE }, /* MinLevel */ \ + { (uint16_t) 0xFE, (uint16_t) 0x1, (uint16_t) 0xFE }, /* MaxLevel */ \ + { (uint16_t) 0xFF, (uint16_t) 0x64, (uint16_t) 0xFFFF }, /* BallastFactorAdjustment */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* LampAlarmMode */ \ + \ + /* Endpoint: 1, Cluster: Unit Testing (server) */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ + { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ + { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ + { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ + { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* nullable_range_restricted_int16s */ \ \ /* Endpoint: 2, Cluster: On/Off (server) */ \ - { \ - (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 \ - } /* StartUpOnOff */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 } /* StartUpOnOff */ \ } // This is an array of EmberAfAttributeMetadata structures. @@ -4394,12 +4392,8 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, // Array of device types #define FIXED_DEVICE_TYPES \ - { \ - { 0x00000011, 1 }, { 0x00000016, 1 }, { 0x00000100, 1 }, { 0x00000011, 1 }, { 0x00000100, 1 }, { 0x00000011, 1 }, \ - { \ - 0x00000019, 1 \ - } \ - } + { { 0x00000011, 1 }, { 0x00000016, 1 }, { 0x00000100, 1 }, { 0x00000011, 1 }, \ + { 0x00000100, 1 }, { 0x00000011, 1 }, { 0x00000019, 1 } } // Array of device type offsets #define FIXED_DEVICE_TYPE_OFFSETS { 0, 2, 4, 6 } diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index fa214e1686690b..6395681cf33469 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -118,14 +118,12 @@ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ - { (uint16_t) 0x32, (uint16_t) 0x1, (uint16_t) 0xFF }, /* DefaultMoveRate */ \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ + { (uint16_t) 0x32, (uint16_t) 0x1, (uint16_t) 0xFF }, /* DefaultMoveRate */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ - { \ - (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF \ - } /* StartUpColorTemperatureMireds */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF } /* StartUpColorTemperatureMireds */ \ } // This is an array of EmberAfAttributeMetadata structures. @@ -1233,13 +1231,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define FIXED_PROFILE_IDS { 0x0103, 0x0103 } // Array of device types -#define FIXED_DEVICE_TYPES \ - { \ - { 0x00000016, 1 }, \ - { \ - 0x00000101, 1 \ - } \ - } +#define FIXED_DEVICE_TYPES { { 0x00000016, 1 }, { 0x00000101, 1 } } // Array of device type offsets #define FIXED_DEVICE_TYPE_OFFSETS { 0, 1 } diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index e4db190c507608..9a32401bc7a47d 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -343,9 +343,9 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) if (GetFabricTable().FabricCount() != 0) { +#if CONFIG_NETWORK_LAYER_BLE // The device is already commissioned, proactively disable BLE advertisement. ChipLogProgress(AppServer, "Fabric already commissioned. Disabling BLE advertisement"); -#if CONFIG_NETWORK_LAYER_BLE chip::DeviceLayer::ConnectivityMgr().SetBLEAdvertisingEnabled(false); #endif } diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml deleted file mode 100644 index 5b3cbf40b3b5d5..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_1.yaml +++ /dev/null @@ -1,219 +0,0 @@ -# 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 263.4.1. [TC-DISHM-3.1] On Mode functionality with DUT as Server - -PICS: - - DISHM.S.A0003 - - MOD.S.F00 - - OO.S.C00.Rsp - - OO.S.C01.Rsp - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Precondition" - verification: | - 1 Dishwasher Mode and OnOff clusters are available on the same endpoint - - 2 The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - - Read the SupportedModes attribute, select a value from SupportedModes and save the value as OnMode_value - - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify the list of SupportedModes and below is the sample log provided for the raspi platform: - - [1692170674.471882][3058:3061] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 2502960191 - [1692170674.472010][3058:3061] CHIP:TOO: SupportedModes: 3 entries - [1692170674.472081][3058:3061] CHIP:TOO: [1]: { - [1692170674.472110][3058:3061] CHIP:TOO: Label: Normal - [1692170674.472135][3058:3061] CHIP:TOO: Mode: 0 - [1692170674.472163][3058:3061] CHIP:TOO: ModeTags: 1 entries - [1692170674.472223][3058:3061] CHIP:TOO: [1]: { - [1692170674.472252][3058:3061] CHIP:TOO: Value: 16384 - [1692170674.472288][3058:3061] CHIP:TOO: } - [1692170674.472314][3058:3061] CHIP:TOO: } - [1692170674.472385][3058:3061] CHIP:TOO: [2]: { - [1692170674.472411][3058:3061] CHIP:TOO: Label: Heavy - [1692170674.472435][3058:3061] CHIP:TOO: Mode: 1 - [1692170674.472475][3058:3061] CHIP:TOO: ModeTags: 2 entries - [1692170674.472506][3058:3061] CHIP:TOO: [1]: { - [1692170674.472542][3058:3061] CHIP:TOO: Value: 7 - [1692170674.472567][3058:3061] CHIP:TOO: } - [1692170674.472595][3058:3061] CHIP:TOO: [2]: { - [1692170674.472632][3058:3061] CHIP:TOO: Value: 16385 - [1692170674.472658][3058:3061] CHIP:TOO: } - [1692170674.472683][3058:3061] CHIP:TOO: } - [1692170674.472730][3058:3061] CHIP:TOO: [3]: { - [1692170674.472755][3058:3061] CHIP:TOO: Label: Light - [1692170674.472778][3058:3061] CHIP:TOO: Mode: 2 - [1692170674.472820][3058:3061] CHIP:TOO: ModeTags: 3 entries - [1692170674.472851][3058:3061] CHIP:TOO: [1]: { - [1692170674.472886][3058:3061] CHIP:TOO: Value: 16386 - [1692170674.472910][3058:3061] CHIP:TOO: } - [1692170674.472938][3058:3061] CHIP:TOO: [2]: { - [1692170674.472973][3058:3061] CHIP:TOO: Value: 8 - [1692170674.472996][3058:3061] CHIP:TOO: } - [1692170674.473024][3058:3061] CHIP:TOO: [3]: { - [1692170674.473048][3058:3061] CHIP:TOO: Value: 2 - [1692170674.473071][3058:3061] CHIP:TOO: } - [1692170674.473095][3058:3061] CHIP:TOO: } - - Set the OnMode attribute value to OnMode_value - - ./chip-tool dishwashermode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1692170913.264454][3071:3073] CHIP:DMG: StatusIB = - [1692170913.264489][3071:3073] CHIP:DMG: { - [1692170913.264522][3071:3073] CHIP:DMG: status = 0x00 (SUCCESS), - [1692170913.264557][3071:3073] CHIP:DMG: }, - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the OnMode attribute." - PICS: DISHM.S.A0003 && MOD.S.F00 - verification: | - ./chip-tool dishwashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an Integer - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - [1690188734.934221][15978:15980] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0003 DataVersion: 74242734 - [1690188734.934259][15978:15980] CHIP:TOO: OnMode: 0 - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: DISHM.S.A0001 && MOD.S.F00 - verification: | - ./chip-tool dishwashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. - - [1690188747.957507][15982:15984] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 74242734 - [1690188747.957564][15982:15984] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 4: TH reads from the DUT the SupportedModes attribute." - PICS: DISHM.S.A0000 && MOD.S.F00 - verification: | - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690188771.532158][15986:15988] CHIP:DMG: } - [1690188771.532258][15986:15988] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 74242734 - [1690188771.532287][15986:15988] CHIP:TOO: SupportedModes: 3 entries - [1690188771.532305][15986:15988] CHIP:TOO: [1]: { - [1690188771.532309][15986:15988] CHIP:TOO: Label: Normal - [1690188771.532316][15986:15988] CHIP:TOO: Mode: 0 - [1690188771.532321][15986:15988] CHIP:TOO: ModeTags: 1 entries - [1690188771.532327][15986:15988] CHIP:TOO: [1]: { - [1690188771.532331][15986:15988] CHIP:TOO: Value: 16384 - [1690188771.532334][15986:15988] CHIP:TOO: } - [1690188771.532338][15986:15988] CHIP:TOO: } - [1690188771.532345][15986:15988] CHIP:TOO: [2]: { - [1690188771.532348][15986:15988] CHIP:TOO: Label: Heavy - [1690188771.532352][15986:15988] CHIP:TOO: Mode: 1 - [1690188771.532358][15986:15988] CHIP:TOO: ModeTags: 2 entries - [1690188771.532363][15986:15988] CHIP:TOO: [1]: { - [1690188771.532366][15986:15988] CHIP:TOO: Value: 7 - [1690188771.532368][15986:15988] CHIP:TOO: } - [1690188771.532372][15986:15988] CHIP:TOO: [2]: { - [1690188771.532374][15986:15988] CHIP:TOO: Value: 16385 - [1690188771.532376][15986:15988] CHIP:TOO: } - [1690188771.532379][15986:15988] CHIP:TOO: } - [1690188771.532386][15986:15988] CHIP:TOO: [3]: { - [1690188771.532388][15986:15988] CHIP:TOO: Label: Light - [1690188771.532390][15986:15988] CHIP:TOO: Mode: 2 - [1690188771.532395][15986:15988] CHIP:TOO: ModeTags: 3 entries - [1690188771.532398][15986:15988] CHIP:TOO: [1]: { - [1690188771.532401][15986:15988] CHIP:TOO: Value: 16386 - [1690188771.532403][15986:15988] CHIP:TOO: } - [1690188771.532406][15986:15988] CHIP:TOO: [2]: { - [1690188771.532409][15986:15988] CHIP:TOO: Value: 8 - [1690188771.532411][15986:15988] CHIP:TOO: } - [1690188771.532414][15986:15988] CHIP:TOO: [3]: { - [1690188771.532417][15986:15988] CHIP:TOO: Value: 2 - [1690188771.532419][15986:15988] CHIP:TOO: } - [1690188771.532421][15986:15988] CHIP:TOO: } - disabled: true - - - label: - "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: DISHM.S.C00.Rsp && MOD.S.F00 - verification: | - ./chip-tool dishwashermode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690198333.074192][17405:17407] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Command 0x0000_0001 - [1690198333.074208][17405:17407] CHIP:TOO: ChangeToModeResponse: { - [1690198333.074213][17405:17407] CHIP:TOO: status: 0 - [1690198333.074216][17405:17407] CHIP:TOO: } - disabled: true - - - label: "Step 6: TH sends a Off command to the DUT" - PICS: OO.S.C00.Rsp && MOD.S.F00 - verification: | - ./chip-tool onoff off 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true - - - label: "Step 7: TH sends a On command to the DUT" - PICS: OO.S.C01.Rsp && MOD.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: DISHM.S.A0001 && MOD.S.F00 - verification: | - ./chip-tool dishwashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 - - [1690188859.713934][16004:16006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 74242736 - [1690188859.713980][16004:16006] CHIP:TOO: CurrentMode: 0 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml deleted file mode 100644 index c53124e903fb7a..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_2.yaml +++ /dev/null @@ -1,237 +0,0 @@ -# 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 263.4.2. [TC-DISHM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - DISHM.S.A0002 - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Preconditions" - verification: | - !DISHM.S.F00 | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL - disabled: true - - - label: "Note" - verification: | - To Execute the TC-DISHM-3.2 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer or null - - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null - - NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - - [1690188941.380388][16015:16017] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 74242738 - [1690188941.380430][16015:16017] CHIP:TOO: StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - PICS: DISHM.S.A0000 - verification: | - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690188996.754102][16022:16024] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 74242738 - [1690188996.754208][16022:16024] CHIP:TOO: SupportedModes: 3 entries - [1690188996.754248][16022:16024] CHIP:TOO: [1]: { - [1690188996.754258][16022:16024] CHIP:TOO: Label: Normal - [1690188996.754270][16022:16024] CHIP:TOO: Mode: 0 - [1690188996.754285][16022:16024] CHIP:TOO: ModeTags: 1 entries - [1690188996.754302][16022:16024] CHIP:TOO: [1]: { - [1690188996.754314][16022:16024] CHIP:TOO: Value: 16384 - [1690188996.754325][16022:16024] CHIP:TOO: } - [1690188996.754336][16022:16024] CHIP:TOO: } - [1690188996.754360][16022:16024] CHIP:TOO: [2]: { - [1690188996.754369][16022:16024] CHIP:TOO: Label: Heavy - [1690188996.754378][16022:16024] CHIP:TOO: Mode: 1 - [1690188996.754393][16022:16024] CHIP:TOO: ModeTags: 2 entries - [1690188996.754407][16022:16024] CHIP:TOO: [1]: { - [1690188996.754416][16022:16024] CHIP:TOO: Value: 7 - [1690188996.754425][16022:16024] CHIP:TOO: } - [1690188996.754439][16022:16024] CHIP:TOO: [2]: { - [1690188996.754450][16022:16024] CHIP:TOO: Value: 16385 - [1690188996.754459][16022:16024] CHIP:TOO: } - [1690188996.754469][16022:16024] CHIP:TOO: } - [1690188996.754493][16022:16024] CHIP:TOO: [3]: { - [1690188996.754501][16022:16024] CHIP:TOO: Label: Light - [1690188996.754511][16022:16024] CHIP:TOO: Mode: 2 - [1690188996.754548][16022:16024] CHIP:TOO: ModeTags: 3 entries - [1690188996.754564][16022:16024] CHIP:TOO: [1]: { - [1690188996.754574][16022:16024] CHIP:TOO: Value: 16386 - [1690188996.754583][16022:16024] CHIP:TOO: } - [1690188996.754597][16022:16024] CHIP:TOO: [2]: { - [1690188996.754606][16022:16024] CHIP:TOO: Value: 8 - [1690188996.754615][16022:16024] CHIP:TOO: } - [1690188996.754629][16022:16024] CHIP:TOO: [3]: { - [1690188996.754638][16022:16024] CHIP:TOO: Value: 2 - [1690188996.754646][16022:16024] CHIP:TOO: } - [1690188996.754654][16022:16024] CHIP:TOO: } - disabled: true - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode write start-up-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690188912.259778][16011:16013] CHIP:DMG: { - [1690188912.259790][16011:16013] CHIP:DMG: status = 0x00 (SUCCESS), - [1690188912.259800][16011:16013] CHIP:DMG: }, - [1690188912.259813][16011:16013] CHIP:DMG: - - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform . - - [1692171314.157274][3112:3114] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 2502960195 - [1692171314.157331][3112:3114] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: DISHM.S.A0001 - verification: | - ./chip-tool dishwashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. - - [1690189040.789208][16040:16042] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 1012425326 - [1690189040.789223][16040:16042] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: DISHM.S.A0000 - verification: | - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690188996.754102][16022:16024] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 74242738 - [1690188996.754208][16022:16024] CHIP:TOO: SupportedModes: 3 entries - [1690188996.754248][16022:16024] CHIP:TOO: [1]: { - [1690188996.754258][16022:16024] CHIP:TOO: Label: Normal - [1690188996.754270][16022:16024] CHIP:TOO: Mode: 0 - [1690188996.754285][16022:16024] CHIP:TOO: ModeTags: 1 entries - [1690188996.754302][16022:16024] CHIP:TOO: [1]: { - [1690188996.754314][16022:16024] CHIP:TOO: Value: 16384 - [1690188996.754325][16022:16024] CHIP:TOO: } - [1690188996.754336][16022:16024] CHIP:TOO: } - [1690188996.754360][16022:16024] CHIP:TOO: [2]: { - [1690188996.754369][16022:16024] CHIP:TOO: Label: Heavy - [1690188996.754378][16022:16024] CHIP:TOO: Mode: 1 - [1690188996.754393][16022:16024] CHIP:TOO: ModeTags: 2 entries - [1690188996.754407][16022:16024] CHIP:TOO: [1]: { - [1690188996.754416][16022:16024] CHIP:TOO: Value: 7 - [1690188996.754425][16022:16024] CHIP:TOO: } - [1690188996.754439][16022:16024] CHIP:TOO: [2]: { - [1690188996.754450][16022:16024] CHIP:TOO: Value: 16385 - [1690188996.754459][16022:16024] CHIP:TOO: } - [1690188996.754469][16022:16024] CHIP:TOO: } - [1690188996.754493][16022:16024] CHIP:TOO: [3]: { - [1690188996.754501][16022:16024] CHIP:TOO: Label: Light - [1690188996.754511][16022:16024] CHIP:TOO: Mode: 2 - [1690188996.754548][16022:16024] CHIP:TOO: ModeTags: 3 entries - [1690188996.754564][16022:16024] CHIP:TOO: [1]: { - [1690188996.754574][16022:16024] CHIP:TOO: Value: 16386 - [1690188996.754583][16022:16024] CHIP:TOO: } - [1690188996.754597][16022:16024] CHIP:TOO: [2]: { - [1690188996.754606][16022:16024] CHIP:TOO: Value: 8 - [1690188996.754615][16022:16024] CHIP:TOO: } - [1690188996.754629][16022:16024] CHIP:TOO: [3]: { - [1690188996.754638][16022:16024] CHIP:TOO: Value: 2 - [1690188996.754646][16022:16024] CHIP:TOO: } - [1690188996.754654][16022:16024] CHIP:TOO: } - disabled: true - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: DISHM.S.C00.Rsp - verification: | - ./chip-tool dishwashermode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690265961.529808][30174:30176] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Command 0x0000_0001 - [1690265961.529857][30174:30176] CHIP:TOO: ChangeToModeResponse: { - [1690265961.529880][30174:30176] CHIP:TOO: status: 0 - [1690265961.529891][30174:30176] CHIP:TOO: } - disabled: true - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - disabled: true - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer. - - Save the value as new_start_up_mode_dut and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform, Here StartUpMode value is 0 - - [1690188941.380388][16015:16017] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 74242738 - [1690188941.380430][16015:16017] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: DISHM.S.A0001 - verification: | - ./chip-tool dishwashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690189040.789208][16040:16042] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 1012425326 - [1690189040.789223][16040:16042] CHIP:TOO: CurrentMode: 0 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml deleted file mode 100644 index c9e788d45a6eef..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DISHM_3_3.yaml +++ /dev/null @@ -1,274 +0,0 @@ -# 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 189.3.3.[TC-DISHM-3.3] On Mode and Startup Mode functionality with DUT as - Server - -PICS: - - DISHM.S.A0002 - - DISHM.S.A0003 - - MOD.S.F00 - - OO.S.A4003 - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Note" - verification: | - To Execute the TC-DISH-3.3 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer or Null - - Save the value as startup_mode_dut, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is null - - NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - - [1651099663211] [82177:7560652] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0004 DataVersion: 2609052118 - [1651099663212] [82177:7560652] CHIP: [TOO] StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - PICS: DISHM.S.A0000 - verification: | - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690189296.612007][16077:16079] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 1012425327 - [1690189296.612104][16077:16079] CHIP:TOO: SupportedModes: 3 entries - [1690189296.612139][16077:16079] CHIP:TOO: [1]: { - [1690189296.612149][16077:16079] CHIP:TOO: Label: Normal - [1690189296.612168][16077:16079] CHIP:TOO: Mode: 0 - [1690189296.612189][16077:16079] CHIP:TOO: ModeTags: 1 entries - [1690189296.612214][16077:16079] CHIP:TOO: [1]: { - [1690189296.612224][16077:16079] CHIP:TOO: Value: 16384 - [1690189296.612234][16077:16079] CHIP:TOO: } - [1690189296.612243][16077:16079] CHIP:TOO: } - [1690189296.612264][16077:16079] CHIP:TOO: [2]: { - [1690189296.612273][16077:16079] CHIP:TOO: Label: Heavy - [1690189296.612282][16077:16079] CHIP:TOO: Mode: 1 - [1690189296.612296][16077:16079] CHIP:TOO: ModeTags: 2 entries - [1690189296.612309][16077:16079] CHIP:TOO: [1]: { - [1690189296.612318][16077:16079] CHIP:TOO: Value: 7 - [1690189296.612327][16077:16079] CHIP:TOO: } - [1690189296.612339][16077:16079] CHIP:TOO: [2]: { - [1690189296.612348][16077:16079] CHIP:TOO: Value: 16385 - [1690189296.612356][16077:16079] CHIP:TOO: } - [1690189296.612365][16077:16079] CHIP:TOO: } - [1690189296.612384][16077:16079] CHIP:TOO: [3]: { - [1690189296.612392][16077:16079] CHIP:TOO: Label: Light - [1690189296.612398][16077:16079] CHIP:TOO: Mode: 2 - [1690189296.612413][16077:16079] CHIP:TOO: ModeTags: 3 entries - [1690189296.612425][16077:16079] CHIP:TOO: [1]: { - [1690189296.612433][16077:16079] CHIP:TOO: Value: 16386 - [1690189296.612443][16077:16079] CHIP:TOO: } - [1690189296.612456][16077:16079] CHIP:TOO: [2]: { - [1690189296.612465][16077:16079] CHIP:TOO: Value: 8 - [1690189296.612473][16077:16079] CHIP:TOO: } - [1690189296.612485][16077:16079] CHIP:TOO: [3]: { - [1690189296.612494][16077:16079] CHIP:TOO: Value: 2 - [1690189296.612502][16077:16079] CHIP:TOO: } - [1690189296.612511][16077:16079] CHIP:TOO: } - disabled: true - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode write start-up-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690188912.259766][16011:16013] CHIP:DMG: StatusIB = - [1690188912.259778][16011:16013] CHIP:DMG: { - [1690188912.259790][16011:16013] CHIP:DMG: status = 0x00 (SUCCESS), - [1690188912.259800][16011:16013] CHIP:DMG: }, - [1690188912.259813][16011:16013] CHIP:DMG: - - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform . - - [1692171314.157274][3112:3114] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0002 DataVersion: 2502960195 - [1692171314.157331][3112:3114] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: DISHM.S.A0003 && DISHM.S.A0002 - verification: | - As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. - - ./chip-tool dishwashermode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690189187.414225][16062:16064] CHIP:DMG: StatusIB = - [1690189187.414237][16062:16064] CHIP:DMG: { - [1690189187.414249][16062:16064] CHIP:DMG: status = 0x00 (SUCCESS), - [1690189187.414260][16062:16064] CHIP:DMG: }, - - - ./chip-tool dishwashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer value - - Save the value as old_on_mode_dut, below is the sample log provided for the raspi platform, here OnMode attribute value is 0 - - NOTE: If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. Else proceed to step 8. - - [1690189501.554415][16104:16106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0003 DataVersion: 1012425329 - [1690189501.554429][16104:16106] CHIP:TOO: OnMode: 0 - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: DISHM.S.A0000 && DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690189296.612007][16077:16079] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 1012425327 - [1690189296.612104][16077:16079] CHIP:TOO: SupportedModes: 3 entries - [1690189296.612139][16077:16079] CHIP:TOO: [1]: { - [1690189296.612149][16077:16079] CHIP:TOO: Label: Normal - [1690189296.612168][16077:16079] CHIP:TOO: Mode: 0 - [1690189296.612189][16077:16079] CHIP:TOO: ModeTags: 1 entries - [1690189296.612214][16077:16079] CHIP:TOO: [1]: { - [1690189296.612224][16077:16079] CHIP:TOO: Value: 16384 - [1690189296.612234][16077:16079] CHIP:TOO: } - [1690189296.612243][16077:16079] CHIP:TOO: } - [1690189296.612264][16077:16079] CHIP:TOO: [2]: { - [1690189296.612273][16077:16079] CHIP:TOO: Label: Heavy - [1690189296.612282][16077:16079] CHIP:TOO: Mode: 1 - [1690189296.612296][16077:16079] CHIP:TOO: ModeTags: 2 entries - [1690189296.612309][16077:16079] CHIP:TOO: [1]: { - [1690189296.612318][16077:16079] CHIP:TOO: Value: 7 - [1690189296.612327][16077:16079] CHIP:TOO: } - [1690189296.612339][16077:16079] CHIP:TOO: [2]: { - [1690189296.612348][16077:16079] CHIP:TOO: Value: 16385 - [1690189296.612356][16077:16079] CHIP:TOO: } - [1690189296.612365][16077:16079] CHIP:TOO: } - [1690189296.612384][16077:16079] CHIP:TOO: [3]: { - [1690189296.612392][16077:16079] CHIP:TOO: Label: Light - [1690189296.612398][16077:16079] CHIP:TOO: Mode: 2 - [1690189296.612413][16077:16079] CHIP:TOO: ModeTags: 3 entries - [1690189296.612425][16077:16079] CHIP:TOO: [1]: { - [1690189296.612433][16077:16079] CHIP:TOO: Value: 16386 - [1690189296.612443][16077:16079] CHIP:TOO: } - [1690189296.612456][16077:16079] CHIP:TOO: [2]: { - [1690189296.612465][16077:16079] CHIP:TOO: Value: 8 - [1690189296.612473][16077:16079] CHIP:TOO: } - [1690189296.612485][16077:16079] CHIP:TOO: [3]: { - [1690189296.612494][16077:16079] CHIP:TOO: Value: 2 - [1690189296.612502][16077:16079] CHIP:TOO: } - [1690189296.612511][16077:16079] CHIP:TOO: } - disabled: true - - - label: - "Step 7: TH writes to the DUT the OnMode attribute with the - new_mode_th value" - PICS: DISHM.S.A0003 - verification: | - ./chip-tool dishwashermode write on-mode 2 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690189470.746137][16086:16088] CHIP:DMG: { - [1690189470.746140][16086:16088] CHIP:DMG: status = 0x00 (SUCCESS), - [1690189470.746142][16086:16088] CHIP:DMG: }, - disabled: true - - - label: "Step 8: TH reads from the DUT the OnMode attribute." - PICS: DISHM.S.A0003 && MOD.S.F00 - verification: | - ./chip-tool dishwashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer - - Save the value as new_on_mode_dut and is equal to new_mode_th and below is the sample log provided for the raspi platform, here OnMode attribute value is 2 - - [1690189501.554415][16104:16106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0003 DataVersion: 1012425329 - [1690189501.554429][16104:16106] CHIP:TOO: OnMode: 2 - disabled: true - - - label: - "Step 9: TH writes to the DUT the StartUpOnOff attribute with the - value 1." - PICS: OO.S.A4003 - verification: | - ./chip-tool onoff write start-up-on-off 1 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1651101661960] [90832:7598169] CHIP: [DMG] { - [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651101661960] [90832:7598169] CHIP: [DMG] }, - disabled: true - - - label: "Step 10: Physically power cycle the device" - verification: | - Physically power cycle the device. - disabled: true - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: DISHM.S.A0002 - verification: | - ./chip-tool dishwashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is 0 - - [1651099663211] [82177:7560652] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0050 Attribute 0x0000_0004 DataVersion: 2609052118 - [1651099663212] [82177:7560652] CHIP: [TOO] StartUpMode: 0 - disabled: true - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: DISHM.S.A0001 - verification: | - ./chip-tool dishwashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_on_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 2 - - [1690189536.790233][16118:16120] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 4080703118 - [1690189536.790280][16118:16120] CHIP:TOO: CurrentMode: 2 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml index 8e9ee05b33e9ff..aa0fbcfddc83bf 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml @@ -188,6 +188,16 @@ tests: minValue: MinLevelFeatureMapNotSupportedValue maxValue: MaxLevelFeatureMapNotSupportedValue + - label: "Step 9c: TH reads the OnLevel attribute from the DUT" + PICS: LVL.S.A0011 && !LVL.S.F01 && !LVL.S.A0002 && !LVL.S.A0003 + command: "readAttribute" + attribute: "OnLevel" + response: + constraints: + type: int8u + minValue: 0 + maxValue: 254 + - label: "Step 10: TH reads the OnTransitionTime attribute from the DUT" PICS: LVL.S.A0012 command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml deleted file mode 100644 index 2bafddfa303f64..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_1.yaml +++ /dev/null @@ -1,134 +0,0 @@ -# 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: 183.3.1. [TC-LWM-3.1] On Mode functionality with DUT as Server - -PICS: - - LWM.S.A0003 - - MOD.S.F00 - - OO.S.C00.Rsp - - OO.S.C01.Rsp - -config: - nodeId: 0x12344321 - cluster: "Laundry Washer Mode" - endpoint: 1 - - ConfigureOnMode: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 2 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To - execute this test case set onmode to any integer value because as - default it value has null." - PICS: LWM.S.A0003 && MOD.S.F00 - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: ConfigureOnMode - - - label: "Step 2: TH reads from the DUT the OnMode attribute." - PICS: LWM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: on_mode_dut - constraints: - type: int8u - minValue: 0 - maxValue: 254 - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - constraints: - type: int8u - minValue: 0 - maxValue: 254 - - - label: - "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. - Else proceed to step 6." - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: on_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 4: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: LWM.S.A0000 && MOD.S.F00 - command: "readAttribute" - attribute: "SupportedModes" - response: - constraints: - type: list - minLength: 2 - - - label: - "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - runIf: IsExpectedValue - PICS: LWM.S.C00.Rsp && MOD.S.F00 - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 6:TH sends a Off command to the DUT" - PICS: OO.S.C00.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "Off" - - - label: "Step 7:TH sends a On command to the DUT" - PICS: OO.S.C01.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "On" - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml deleted file mode 100644 index fe8ff87e214e18..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml +++ /dev/null @@ -1,172 +0,0 @@ -# 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: 183.3.2. [TC-LWM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - LWM.S.A0002 - -config: - nodeId: 0x12344321 - cluster: "Laundry Washer Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: LWM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: LWM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: LWM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: LWM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed - to step 6. Else proceed to step 8." - PICS: LWM.S.A0001 && LWM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: LWM.S.A0000 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: LWM.S.C00.Rsp - runIf: Step5_IsExpectedValue - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: LWM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: new_start_up_mode_dut - constraints: - anyOf: [startup_mode_dut, new_start_up_mode_th] - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_start_up_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml deleted file mode 100644 index bf97f17f286154..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml +++ /dev/null @@ -1,189 +0,0 @@ -# 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: - 183.3.3. [TC-LWM-3.3] On Mode and Startup Mode functionality with DUT as - Server - -PICS: - - LWM.S.A0002 - - LWM.S.A0003 - - MOD.S.F00 - - OO.S.A4003 - -config: - nodeId: 0x12344321 - cluster: "Laundry Washer Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: LWM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: LWM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: LWM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: LWM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: LWM.S.A0003 && LWM.S.A0002 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: old_on_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to - step 6. Else proceed to step 8." - PICS: LWM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: old_on_mode_dut - - name: "Value2" - value: startup_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: LWM.S.A0000 && LWM.S.A0002 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH writes to the DUT the OnMode attribute with the - new_mode_th value" - PICS: LWM.S.A0003 - runIf: Step5_IsExpectedValue - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: new_mode_th - - - label: "Step 8: TH reads from the DUT the OnMode attribute." - PICS: LWM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: new_on_mode_dut - - - label: - "Step 9: TH writes to the DUT the StartUpOnOff attribute with the - value 1." - PICS: OO.S.A4003 - cluster: "On/Off" - command: "writeAttribute" - attribute: "StartUpOnOff" - arguments: - value: 1 - - - label: "Step 10: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: LWM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - constraints: - anyOf: [new_start_up_mode_th, startup_mode_dut] - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml deleted file mode 100644 index 51f389b6afaffc..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml +++ /dev/null @@ -1,722 +0,0 @@ -# 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 81.1.3. [TC-MOD-1.3] Attributes with client as DUT - -PICS: - - MOD.C - - MOD.C.AM-READ - - MOD.C.AO-READ - - MOD.C.AM-WRITE - - MOD.C.AO-WRITE - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: DUT reads all supported mandatory attributes from TH one at a - time in a manufacturer specific order" - PICS: MOD.C.AM-READ - verification: | - ./chip-tool modeselect read supported-modes 1 1 - - Verify the "SupportedModes response" on the TH (all-cluster-app) log: - - [1666940683.282921][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940683.282923][9718:9718] CHIP:DMG: { - [1666940683.282925][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940683.282928][9718:9718] CHIP:DMG: [ - [1666940683.282929][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.282933][9718:9718] CHIP:DMG: { - [1666940683.282935][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.282937][9718:9718] CHIP:DMG: { - [1666940683.282939][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.282941][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.282944][9718:9718] CHIP:DMG: { - [1666940683.282946][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.282948][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.282950][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.282952][9718:9718] CHIP:DMG: } - [1666940683.282955][9718:9718] CHIP:DMG: - [1666940683.282957][9718:9718] CHIP:DMG: Data = [ - [1666940683.282959][9718:9718] CHIP:DMG: - [1666940683.282962][9718:9718] CHIP:DMG: ], - [1666940683.282964][9718:9718] CHIP:DMG: }, - [1666940683.282966][9718:9718] CHIP:DMG: - [1666940683.282968][9718:9718] CHIP:DMG: }, - [1666940683.282972][9718:9718] CHIP:DMG: - [1666940683.282974][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.282978][9718:9718] CHIP:DMG: { - [1666940683.282980][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.282982][9718:9718] CHIP:DMG: { - [1666940683.282984][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.282986][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.282988][9718:9718] CHIP:DMG: { - [1666940683.282990][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.282992][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.282995][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.282997][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.282999][9718:9718] CHIP:DMG: } - [1666940683.283001][9718:9718] CHIP:DMG: - [1666940683.283003][9718:9718] CHIP:DMG: Data = - [1666940683.283005][9718:9718] CHIP:DMG: { - [1666940683.283008][9718:9718] CHIP:DMG: 0x0 = "Black" (5 chars), - [1666940683.283011][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283013][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283015][9718:9718] CHIP:DMG: - [1666940683.283020][9718:9718] CHIP:DMG: { - [1666940683.283022][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283025][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283027][9718:9718] CHIP:DMG: }, - [1666940683.283030][9718:9718] CHIP:DMG: ], - [1666940683.283032][9718:9718] CHIP:DMG: }, - [1666940683.283034][9718:9718] CHIP:DMG: }, - [1666940683.283037][9718:9718] CHIP:DMG: - [1666940683.283039][9718:9718] CHIP:DMG: }, - [1666940683.283044][9718:9718] CHIP:DMG: - [1666940683.283046][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.283049][9718:9718] CHIP:DMG: { - [1666940683.283051][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.283053][9718:9718] CHIP:DMG: { - [1666940683.283055][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.283057][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.283059][9718:9718] CHIP:DMG: { - [1666940683.283061][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.283064][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.283066][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.283068][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.283070][9718:9718] CHIP:DMG: } - [1666940683.283072][9718:9718] CHIP:DMG: - [1666940683.283074][9718:9718] CHIP:DMG: Data = - [1666940683.283076][9718:9718] CHIP:DMG: { - [1666940683.283079][9718:9718] CHIP:DMG: 0x0 = "Cappuccino" (10 chars), - [1666940683.283081][9718:9718] CHIP:DMG: 0x1 = 4, - [1666940683.283084][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283086][9718:9718] CHIP:DMG: - [1666940683.283088][9718:9718] CHIP:DMG: { - [1666940683.283091][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283093][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283095][9718:9718] CHIP:DMG: }, - [1666940683.283098][9718:9718] CHIP:DMG: ], - [1666940683.283100][9718:9718] CHIP:DMG: }, - [1666940683.283102][9718:9718] CHIP:DMG: }, - [1666940683.283105][9718:9718] CHIP:DMG: - [1666940683.283107][9718:9718] CHIP:DMG: }, - [1666940683.283112][9718:9718] CHIP:DMG: - [1666940683.283114][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.283117][9718:9718] CHIP:DMG: { - [1666940683.283119][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.283121][9718:9718] CHIP:DMG: { - [1666940683.283123][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.283125][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.283128][9718:9718] CHIP:DMG: { - [1666940683.283130][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.283132][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.283134][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.283136][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.283138][9718:9718] CHIP:DMG: } - [1666940683.283141][9718:9718] CHIP:DMG: - [1666940683.283143][9718:9718] CHIP:DMG: Data = - [1666940683.283145][9718:9718] CHIP:DMG: { - [1666940683.283148][9718:9718] CHIP:DMG: 0x0 = "Espresso" (8 chars), - [1666940683.283150][9718:9718] CHIP:DMG: 0x1 = 7, - [1666940683.283152][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283154][9718:9718] CHIP:DMG: - [1666940683.283157][9718:9718] CHIP:DMG: { - [1666940683.283159][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283161][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283164][9718:9718] CHIP:DMG: }, - [1666940683.283167][9718:9718] CHIP:DMG: ], - [1666940683.283169][9718:9718] CHIP:DMG: }, - [1666940683.283171][9718:9718] CHIP:DMG: }, - [1666940683.283174][9718:9718] CHIP:DMG: - [1666940683.283176][9718:9718] CHIP:DMG: }, - [1666940683.283179][9718:9718] CHIP:DMG: - [1666940683.283181][9718:9718] CHIP:DMG: ], - [1666940683.283188][9718:9718] CHIP:DMG: - [1666940683.283190][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940683.283192][9718:9718] CHIP:DMG: InteractionModelRevision = 1 - - - ./chip-tool modeselect read current-mode 1 1 - - Verify the "CurrentMode response" on the TH (all-cluster-app) log: - - [1666940720.150375][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940720.150377][9718:9718] CHIP:DMG: { - [1666940720.150379][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940720.150382][9718:9718] CHIP:DMG: [ - [1666940720.150384][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940720.150387][9718:9718] CHIP:DMG: { - [1666940720.150389][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940720.150391][9718:9718] CHIP:DMG: { - [1666940720.150394][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940720.150396][9718:9718] CHIP:DMG: AttributePathIB = - [1666940720.150399][9718:9718] CHIP:DMG: { - [1666940720.150402][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940720.150404][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940720.150406][9718:9718] CHIP:DMG: Attribute = 0x0000_0003, - [1666940720.150408][9718:9718] CHIP:DMG: } - [1666940720.150411][9718:9718] CHIP:DMG: - [1666940720.150414][9718:9718] CHIP:DMG: Data = 0, - [1666940720.150416][9718:9718] CHIP:DMG: }, - [1666940720.150419][9718:9718] CHIP:DMG: - [1666940720.150421][9718:9718] CHIP:DMG: }, - [1666940720.150424][9718:9718] CHIP:DMG: - [1666940720.150426][9718:9718] CHIP:DMG: ], - [1666940720.150429][9718:9718] CHIP:DMG: - [1666940720.150431][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940720.150433][9718:9718] CHIP:DMG: InteractionModelRevision = 1 - - ./chip-tool modeselect read standard-namespace 1 1 - - Verify the "StandardNamespace response" on the TH (all-cluster-app) log: - - 1668497274.561088][9289:9289] CHIP:DMG: ReportDataMessage = - [1668497274.561091][9289:9289] CHIP:DMG: { - [1668497274.561094][9289:9289] CHIP:DMG: AttributeReportIBs = - [1668497274.561100][9289:9289] CHIP:DMG: [ - [1668497274.561103][9289:9289] CHIP:DMG: AttributeReportIB = - [1668497274.561108][9289:9289] CHIP:DMG: { - [1668497274.561111][9289:9289] CHIP:DMG: AttributeDataIB = - [1668497274.561115][9289:9289] CHIP:DMG: { - [1668497274.561119][9289:9289] CHIP:DMG: DataVersion = 0x6c775d5f, - [1668497274.561123][9289:9289] CHIP:DMG: AttributePathIB = - [1668497274.561126][9289:9289] CHIP:DMG: { - [1668497274.561129][9289:9289] CHIP:DMG: Endpoint = 0x1, - [1668497274.561133][9289:9289] CHIP:DMG: Cluster = 0x50, - [1668497274.561137][9289:9289] CHIP:DMG: Attribute = 0x0000_0001, - [1668497274.561142][9289:9289] CHIP:DMG: } - [1668497274.561147][9289:9289] CHIP:DMG: - [1668497274.561153][9289:9289] CHIP:DMG: Data = 0, - [1668497274.561157][9289:9289] CHIP:DMG: }, - [1668497274.561162][9289:9289] CHIP:DMG: - [1668497274.561165][9289:9289] CHIP:DMG: }, - [1668497274.561169][9289:9289] CHIP:DMG: - [1668497274.561172][9289:9289] CHIP:DMG: ], - [1668497274.561177][9289:9289] CHIP:DMG: - [1668497274.561180][9289:9289] CHIP:DMG: SuppressResponse = true, - [1668497274.561183][9289:9289] CHIP:DMG: InteractionModelRevision = 1 - [1668497274.561185][9289:9289] CHIP:DMG: } - - ./chip-tool modeselect read description 1 1 - - Verify the "Description response" on the TH (all-cluster-app) log: - - [1668497391.858312][9289:9289] CHIP:DMG: ReportDataMessage = - [1668497391.858315][9289:9289] CHIP:DMG: { - [1668497391.858318][9289:9289] CHIP:DMG: AttributeReportIBs = - [1668497391.858324][9289:9289] CHIP:DMG: [ - [1668497391.858327][9289:9289] CHIP:DMG: AttributeReportIB = - [1668497391.858331][9289:9289] CHIP:DMG: { - [1668497391.858334][9289:9289] CHIP:DMG: AttributeDataIB = - [1668497391.858338][9289:9289] CHIP:DMG: { - [1668497391.858342][9289:9289] CHIP:DMG: DataVersion = 0x6c775d5f, - [1668497391.858345][9289:9289] CHIP:DMG: AttributePathIB = - [1668497391.858348][9289:9289] CHIP:DMG: { - [1668497391.858352][9289:9289] CHIP:DMG: Endpoint = 0x1, - [1668497391.858355][9289:9289] CHIP:DMG: Cluster = 0x50, - [1668497391.858359][9289:9289] CHIP:DMG: Attribute = 0x0000_0000, - [1668497391.858363][9289:9289] CHIP:DMG: } - [1668497391.858368][9289:9289] CHIP:DMG: - [1668497391.858372][9289:9289] CHIP:DMG: Data = "Coffee" (6 chars), - [1668497391.858375][9289:9289] CHIP:DMG: }, - [1668497391.858380][9289:9289] CHIP:DMG: - [1668497391.858383][9289:9289] CHIP:DMG: }, - [1668497391.858387][9289:9289] CHIP:DMG: - [1668497391.858390][9289:9289] CHIP:DMG: ], - [1668497391.858395][9289:9289] CHIP:DMG: - [1668497391.858398][9289:9289] CHIP:DMG: SuppressResponse = true, - [1668497391.858403][9289:9289] CHIP:DMG: InteractionModelRevision = 1 - [1668497391.858406][9289:9289] CHIP:DMG: } - disabled: true - - - label: - "Step 2: DUT reads all supported optional attributes from TH one at a - time in a manufacturer specific order" - PICS: MOD.C.AO-READ - verification: | - ./chip-tool modeselect read on-mode 1 1 - - Verify the "OnMode response" on the TH (all-cluster-app) log: - - [1666940828.515256][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940828.515259][9718:9718] CHIP:DMG: { - [1666940828.515261][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940828.515265][9718:9718] CHIP:DMG: [ - [1666940828.515267][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940828.515272][9718:9718] CHIP:DMG: { - [1666940828.515275][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940828.515277][9718:9718] CHIP:DMG: { - [1666940828.515280][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940828.515282][9718:9718] CHIP:DMG: AttributePathIB = - [1666940828.515285][9718:9718] CHIP:DMG: { - [1666940828.515288][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940828.515290][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940828.515293][9718:9718] CHIP:DMG: Attribute = 0x0000_0005, - [1666940828.515295][9718:9718] CHIP:DMG: } - [1666940828.515298][9718:9718] CHIP:DMG: - [1666940828.515301][9718:9718] CHIP:DMG: Data = NULL - [1666940828.515304][9718:9718] CHIP:DMG: }, - [1666940828.515307][9718:9718] CHIP:DMG: - [1666940828.515309][9718:9718] CHIP:DMG: }, - [1666940828.515312][9718:9718] CHIP:DMG: - [1666940828.515314][9718:9718] CHIP:DMG: ], - [1666940828.515317][9718:9718] CHIP:DMG: - [1666940828.515320][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940828.515322][9718:9718] CHIP:DMG: InteractionModelRevision = 1 - - ./chip-tool modeselect read start-up-mode 1 1 - - Verify the "StartUpMode response" on the TH (all-cluster-app) log: - - [1666940848.925393][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940848.925396][9718:9718] CHIP:DMG: { - [1666940848.925397][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940848.925401][9718:9718] CHIP:DMG: [ - [1666940848.925403][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940848.925407][9718:9718] CHIP:DMG: { - [1666940848.925410][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940848.925414][9718:9718] CHIP:DMG: { - [1666940848.925416][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940848.925418][9718:9718] CHIP:DMG: AttributePathIB = - [1666940848.925421][9718:9718] CHIP:DMG: { - [1666940848.925423][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940848.925428][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940848.925431][9718:9718] CHIP:DMG: Attribute = 0x0000_0004, - [1666940848.925433][9718:9718] CHIP:DMG: } - [1666940848.925436][9718:9718] CHIP:DMG: - [1666940848.925438][9718:9718] CHIP:DMG: Data = 0, - [1666940848.925440][9718:9718] CHIP:DMG: }, - [1666940848.925443][9718:9718] CHIP:DMG: - [1666940848.925445][9718:9718] CHIP:DMG: }, - [1666940848.925448][9718:9718] CHIP:DMG: - [1666940848.925450][9718:9718] CHIP:DMG: ], - [1666940848.925454][9718:9718] CHIP:DMG: - [1666940848.925456][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940848.925458][9718:9718] CHIP:DMG: InteractionModelRevision = 1 - disabled: true - - - label: - "Step 3: DUT writes a suitable value to all supported mandatory - attributes on the TH one at a time in a manufacturer specific order" - PICS: MOD.C.AM-WRITE - verification: | - This cluster doesn't have any writable attributes - disabled: true - - - label: - "Step 4: DUT writes a suitable value to all supported optional - attributes on the TH one at a time in a manufacturer specific order" - PICS: MOD.C.AO-WRITE - verification: | - ./chip-tool modeselect write on-mode 0 1 1 - - Verify the "WriteRequestMessage" on TH(all-cluster-app) log: - - WriteRequestMessage = - [1673335946.283857][10561:10561] CHIP:DMG: { - [1673335946.283866][10561:10561] CHIP:DMG: suppressResponse = false, - [1673335946.283878][10561:10561] CHIP:DMG: timedRequest = false, - [1673335946.283887][10561:10561] CHIP:DMG: AttributeDataIBs = - [1673335946.283905][10561:10561] CHIP:DMG: [ - [1673335946.283914][10561:10561] CHIP:DMG: AttributeDataIB = - [1673335946.283926][10561:10561] CHIP:DMG: { - [1673335946.283935][10561:10561] CHIP:DMG: AttributePathIB = - [1673335946.283947][10561:10561] CHIP:DMG: { - [1673335946.283959][10561:10561] CHIP:DMG: Endpoint = 0x1, - [1673335946.283971][10561:10561] CHIP:DMG: Cluster = 0x50, - [1673335946.283983][10561:10561] CHIP:DMG: Attribute = 0x0000_0005, - [1673335946.283994][10561:10561] CHIP:DMG: } - [1673335946.284008][10561:10561] CHIP:DMG: - [1673335946.284022][10561:10561] CHIP:DMG: Data = 0, - [1673335946.284032][10561:10561] CHIP:DMG: }, - [1673335946.284046][10561:10561] CHIP:DMG: - [1673335946.284055][10561:10561] CHIP:DMG: ], - [1673335946.284070][10561:10561] CHIP:DMG: - [1673335946.284081][10561:10561] CHIP:DMG: moreChunkedMessages = false, - [1673335946.284091][10561:10561] CHIP:DMG: InteractionModelRevision = 1 - [1673335946.284099][10561:10561] CHIP:DMG: }, - - ./chip-tool modeselect write start-up-mode 0 1 1 - - Verify the "WriteRequestMessage" on TH(all-cluster-app) log: - - WriteRequestMessage = - [1673336054.600463][10561:10561] CHIP:DMG: { - [1673336054.600470][10561:10561] CHIP:DMG: suppressResponse = false, - [1673336054.600479][10561:10561] CHIP:DMG: timedRequest = false, - [1673336054.600486][10561:10561] CHIP:DMG: AttributeDataIBs = - [1673336054.600501][10561:10561] CHIP:DMG: [ - [1673336054.600509][10561:10561] CHIP:DMG: AttributeDataIB = - [1673336054.600521][10561:10561] CHIP:DMG: { - [1673336054.600531][10561:10561] CHIP:DMG: AttributePathIB = - [1673336054.600544][10561:10561] CHIP:DMG: { - [1673336054.600557][10561:10561] CHIP:DMG: Endpoint = 0x1, - [1673336054.600569][10561:10561] CHIP:DMG: Cluster = 0x50, - [1673336054.600582][10561:10561] CHIP:DMG: Attribute = 0x0000_0004, - [1673336054.600593][10561:10561] CHIP:DMG: } - [1673336054.600608][10561:10561] CHIP:DMG: - [1673336054.600621][10561:10561] CHIP:DMG: Data = 0, - [1673336054.600631][10561:10561] CHIP:DMG: }, - [1673336054.600646][10561:10561] CHIP:DMG: - [1673336054.600656][10561:10561] CHIP:DMG: ], - [1673336054.600673][10561:10561] CHIP:DMG: - [1673336054.600683][10561:10561] CHIP:DMG: moreChunkedMessages = false, - [1673336054.600695][10561:10561] CHIP:DMG: InteractionModelRevision = 1 - [1673336054.600704][10561:10561] CHIP:DMG: }, - disabled: true - - - label: - "Step 5: Configure TH such that it implements mandatory and none of - the optional attributes of the server-side of the cluster, and that it - also reflects this in global attributes such as FeatureMap and - AttributeList. Commission DUT to TH again" - verification: | - ./chip-tool modeselect read attribute-list 1 1 - - Verify the "AttributeList response" on the TH (all-cluster-minimal-app) log: - - [1689750639.773775][3545:3547] CHIP:DMG: ReportDataMessage = - [1689750639.773815][3545:3547] CHIP:DMG: { - [1689750639.773846][3545:3547] CHIP:DMG: AttributeReportIBs = - [1689750639.773896][3545:3547] CHIP:DMG: [ - [1689750639.773928][3545:3547] CHIP:DMG: AttributeReportIB = - [1689750639.773980][3545:3547] CHIP:DMG: { - [1689750639.774014][3545:3547] CHIP:DMG: AttributeDataIB = - [1689750639.774052][3545:3547] CHIP:DMG: { - [1689750639.774093][3545:3547] CHIP:DMG: DataVersion = 0x346e22fd, - [1689750639.774132][3545:3547] CHIP:DMG: AttributePathIB = - [1689750639.774174][3545:3547] CHIP:DMG: { - [1689750639.774217][3545:3547] CHIP:DMG: Endpoint = 0x1, - [1689750639.774261][3545:3547] CHIP:DMG: Cluster = 0x50, - [1689750639.774304][3545:3547] CHIP:DMG: Attribute = 0x0000_FFFB, - [1689750639.774347][3545:3547] CHIP:DMG: } - [1689750639.774390][3545:3547] CHIP:DMG: - [1689750639.774430][3545:3547] CHIP:DMG: Data = [ - [1689750639.774515][3545:3547] CHIP:DMG: 0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533, - [1689750639.774565][3545:3547] CHIP:DMG: ], - [1689750639.774604][3545:3547] CHIP:DMG: }, - [1689750639.774652][3545:3547] CHIP:DMG: - [1689750639.774685][3545:3547] CHIP:DMG: }, - [1689750639.774731][3545:3547] CHIP:DMG: - [1689750639.774761][3545:3547] CHIP:DMG: ], - [1689750639.774804][3545:3547] CHIP:DMG: - [1689750639.774835][3545:3547] CHIP:DMG: SuppressResponse = true, - [1689750639.774867][3545:3547] CHIP:DMG: InteractionModelRevision = 1 - [1689750639.774896][3545:3547] CHIP:DMG: } - - - ./chip-tool modeselect read feature-map 1 1 - - Verify the " FeatureMap " on the TH (all-cluster-minimal-app) log: - - [1666943338.908026][12769:12769] CHIP:DMG: ReportDataMessage = - [1666943338.908028][12769:12769] CHIP:DMG: { - [1666943338.908031][12769:12769] CHIP:DMG: AttributeReportIBs = - [1666943338.908035][12769:12769] CHIP:DMG: [ - [1666943338.908038][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943338.908042][12769:12769] CHIP:DMG: { - [1666943338.908045][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943338.908048][12769:12769] CHIP:DMG: { - [1666943338.908051][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943338.908054][12769:12769] CHIP:DMG: AttributePathIB = - [1666943338.908057][12769:12769] CHIP:DMG: { - [1666943338.908060][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943338.908064][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943338.908067][12769:12769] CHIP:DMG: Attribute = 0x0000_FFFC, - [1666943338.908070][12769:12769] CHIP:DMG: } - [1666943338.908074][12769:12769] CHIP:DMG: - [1666943338.908077][12769:12769] CHIP:DMG: Data = 0, - [1666943338.908080][12769:12769] CHIP:DMG: }, - [1666943338.908084][12769:12769] CHIP:DMG: - [1666943338.908086][12769:12769] CHIP:DMG: }, - [1666943338.908090][12769:12769] CHIP:DMG: - [1666943338.908092][12769:12769] CHIP:DMG: ], - [1666943338.908096][12769:12769] CHIP:DMG: - [1666943338.908099][12769:12769] CHIP:DMG: SuppressResponse = true, - [1666943338.908102][12769:12769] CHIP:DMG: InteractionModelRevision = 1 - [1666943338.908104][12769:12769] CHIP:DMG: } - - - ./chip-tool modeselect read supported-modes 1 1 - - Verify the "SupportedModes response" on the TH (all-cluster-minimal-app) log: - - 1666943362.813636][12769:12769] CHIP:DMG: ReportDataMessage = - [1666943362.813638][12769:12769] CHIP:DMG: { - [1666943362.813640][12769:12769] CHIP:DMG: AttributeReportIBs = - [1666943362.813643][12769:12769] CHIP:DMG: [ - [1666943362.813645][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943362.813650][12769:12769] CHIP:DMG: { - [1666943362.813652][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943362.813655][12769:12769] CHIP:DMG: { - [1666943362.813657][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943362.813659][12769:12769] CHIP:DMG: AttributePathIB = - [1666943362.813662][12769:12769] CHIP:DMG: { - [1666943362.813664][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943362.813666][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943362.813669][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, - [1666943362.813671][12769:12769] CHIP:DMG: } - [1666943362.813674][12769:12769] CHIP:DMG: - [1666943362.813676][12769:12769] CHIP:DMG: Data = [ - [1666943362.813679][12769:12769] CHIP:DMG: - [1666943362.813681][12769:12769] CHIP:DMG: ], - [1666943362.813683][12769:12769] CHIP:DMG: }, - [1666943362.813686][12769:12769] CHIP:DMG: - [1666943362.813688][12769:12769] CHIP:DMG: }, - [1666943362.813692][12769:12769] CHIP:DMG: - [1666943362.813694][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943362.813699][12769:12769] CHIP:DMG: { - [1666943362.813701][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943362.813703][12769:12769] CHIP:DMG: { - [1666943362.813705][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943362.813707][12769:12769] CHIP:DMG: AttributePathIB = - [1666943362.813709][12769:12769] CHIP:DMG: { - [1666943362.813711][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943362.813714][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943362.813716][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, - [1666943362.813719][12769:12769] CHIP:DMG: ListIndex = Null, - [1666943362.813721][12769:12769] CHIP:DMG: } - [1666943362.813725][12769:12769] CHIP:DMG: - [1666943362.813727][12769:12769] CHIP:DMG: Data = - [1666943362.813729][12769:12769] CHIP:DMG: { - [1666943362.813732][12769:12769] CHIP:DMG: 0x0 = "Black" (5 chars), - [1666943362.813735][12769:12769] CHIP:DMG: 0x1 = 0, - [1666943362.813737][12769:12769] CHIP:DMG: 0x2 = [ - [1666943362.813740][12769:12769] CHIP:DMG: - [1666943362.813742][12769:12769] CHIP:DMG: { - [1666943362.813745][12769:12769] CHIP:DMG: 0x0 = 0, - [1666943362.813748][12769:12769] CHIP:DMG: 0x1 = 0, - [1666943362.813750][12769:12769] CHIP:DMG: }, - [1666943362.813752][12769:12769] CHIP:DMG: ], - [1666943362.813755][12769:12769] CHIP:DMG: }, - [1666943362.813756][12769:12769] CHIP:DMG: }, - [1666943362.813760][12769:12769] CHIP:DMG: - [1666943362.813762][12769:12769] CHIP:DMG: }, - [1666943362.813768][12769:12769] CHIP:DMG: - [1666943362.813770][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943362.813775][12769:12769] CHIP:DMG: { - [1666943362.813776][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943362.813779][12769:12769] CHIP:DMG: { - [1666943362.813781][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943362.813783][12769:12769] CHIP:DMG: AttributePathIB = - [1666943362.813786][12769:12769] CHIP:DMG: { - [1666943362.813788][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943362.813790][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943362.813793][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, - [1666943362.813795][12769:12769] CHIP:DMG: ListIndex = Null, - [1666943362.813797][12769:12769] CHIP:DMG: } - [1666943362.813801][12769:12769] CHIP:DMG: - [1666943362.813803][12769:12769] CHIP:DMG: Data = - [1666943362.813805][12769:12769] CHIP:DMG: { - [1666943362.813807][12769:12769] CHIP:DMG: 0x0 = "Cappuccino" (10 chars), - [1666943362.813810][12769:12769] CHIP:DMG: 0x1 = 4, - [1666943362.813812][12769:12769] CHIP:DMG: 0x2 = [ - [1666943362.813814][12769:12769] CHIP:DMG: - [1666943362.813817][12769:12769] CHIP:DMG: { - [1666943362.813820][12769:12769] CHIP:DMG: 0x0 = 0, - [1666943362.813823][12769:12769] CHIP:DMG: 0x1 = 0, - [1666943362.813826][12769:12769] CHIP:DMG: }, - [1666943362.813828][12769:12769] CHIP:DMG: ], - [1666943362.813830][12769:12769] CHIP:DMG: }, - [1666943362.813832][12769:12769] CHIP:DMG: }, - [1666943362.813836][12769:12769] CHIP:DMG: - [1666943362.813838][12769:12769] CHIP:DMG: }, - [1666943362.813844][12769:12769] CHIP:DMG: - [1666943362.813846][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943362.813850][12769:12769] CHIP:DMG: { - [1666943362.813852][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943362.813855][12769:12769] CHIP:DMG: { - [1666943362.813857][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943362.813860][12769:12769] CHIP:DMG: AttributePathIB = - [1666943362.813862][12769:12769] CHIP:DMG: { - [1666943362.813864][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943362.813866][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943362.813869][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, - [1666943362.813871][12769:12769] CHIP:DMG: ListIndex = Null, - [1666943362.813873][12769:12769] CHIP:DMG: } - [1666943362.813876][12769:12769] CHIP:DMG: - [1666943362.813878][12769:12769] CHIP:DMG: Data = - [1666943362.813881][12769:12769] CHIP:DMG: { - [1666943362.813883][12769:12769] CHIP:DMG: 0x0 = "Espresso" (8 chars), - [1666943362.813886][12769:12769] CHIP:DMG: 0x1 = 7, - [1666943362.813888][12769:12769] CHIP:DMG: 0x2 = [ - [1666943362.813890][12769:12769] CHIP:DMG: - [1666943362.813893][12769:12769] CHIP:DMG: { - [1666943362.813895][12769:12769] CHIP:DMG: 0x0 = 0, - [1666943362.813898][12769:12769] CHIP:DMG: 0x1 = 0, - [1666943362.813900][12769:12769] CHIP:DMG: }, - [1666943362.813903][12769:12769] CHIP:DMG: ], - [1666943362.813905][12769:12769] CHIP:DMG: }, - [1666943362.813907][12769:12769] CHIP:DMG: }, - [1666943362.813911][12769:12769] CHIP:DMG: - [1666943362.813913][12769:12769] CHIP:DMG: }, - [1666943362.813917][12769:12769] CHIP:DMG: - [1666943362.813918][12769:12769] CHIP:DMG: ], - [1666943362.813926][12769:12769] CHIP:DMG: - [1666943362.813928][12769:12769] CHIP:DMG: SuppressResponse = true, - [1666943362.813931][12769:12769] CHIP:DMG: InteractionModelRevision = 1 - [1666943362.813934][12769:12769] CHIP:DMG: } - [1666943362.813936][12769:12769] CHIP:DMG: - - - ./chip-tool modeselect read current-mode 1 1 - - Verify the "CurrentMode response" on the TH (all-cluster-minimal-app) log: - - 1666943427.104790][12769:12769] CHIP:DMG: ReportDataMessage = - [1666943427.104798][12769:12769] CHIP:DMG: { - [1666943427.104804][12769:12769] CHIP:DMG: AttributeReportIBs = - [1666943427.104814][12769:12769] CHIP:DMG: [ - [1666943427.104820][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943427.104838][12769:12769] CHIP:DMG: { - [1666943427.104846][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943427.104858][12769:12769] CHIP:DMG: { - [1666943427.104869][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943427.104880][12769:12769] CHIP:DMG: AttributePathIB = - [1666943427.104891][12769:12769] CHIP:DMG: { - [1666943427.104904][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943427.104916][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943427.104931][12769:12769] CHIP:DMG: Attribute = 0x0000_0003, - [1666943427.104939][12769:12769] CHIP:DMG: } - [1666943427.104948][12769:12769] CHIP:DMG: - [1666943427.104956][12769:12769] CHIP:DMG: Data = 0, - [1666943427.104963][12769:12769] CHIP:DMG: }, - [1666943427.104974][12769:12769] CHIP:DMG: - [1666943427.104981][12769:12769] CHIP:DMG: }, - [1666943427.104991][12769:12769] CHIP:DMG: - [1666943427.105001][12769:12769] CHIP:DMG: ], - [1666943427.105017][12769:12769] CHIP:DMG: - [1666943427.105027][12769:12769] CHIP:DMG: SuppressResponse = true, - [1666943427.105037][12769:12769] CHIP:DMG: InteractionModelRevision = 1 - [1666943427.105045][12769:12769] CHIP:DMG: } - - - ./chip-tool modeselect read standard-namespace 1 1 - - Verify the "StandardNamespace response" on the TH (all-cluster-minimal-app) log: - - [1666943453.966995][12769:12769] CHIP:DMG: ReportDataMessage = - [1666943453.966997][12769:12769] CHIP:DMG: { - [1666943453.966999][12769:12769] CHIP:DMG: AttributeReportIBs = - [1666943453.967003][12769:12769] CHIP:DMG: [ - [1666943453.967005][12769:12769] CHIP:DMG: AttributeReportIB = - [1666943453.967008][12769:12769] CHIP:DMG: { - [1666943453.967010][12769:12769] CHIP:DMG: AttributeDataIB = - [1666943453.967014][12769:12769] CHIP:DMG: { - [1666943453.967017][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, - [1666943453.967019][12769:12769] CHIP:DMG: AttributePathIB = - [1666943453.967021][12769:12769] CHIP:DMG: { - [1666943453.967025][12769:12769] CHIP:DMG: Endpoint = 0x1, - [1666943453.967027][12769:12769] CHIP:DMG: Cluster = 0x50, - [1666943453.967029][12769:12769] CHIP:DMG: Attribute = 0x0000_0001, - [1666943453.967033][12769:12769] CHIP:DMG: } - [1666943453.967035][12769:12769] CHIP:DMG: - [1666943453.967038][12769:12769] CHIP:DMG: Data = 0, - [1666943453.967040][12769:12769] CHIP:DMG: }, - [1666943453.967043][12769:12769] CHIP:DMG: - [1666943453.967045][12769:12769] CHIP:DMG: }, - [1666943453.967047][12769:12769] CHIP:DMG: - [1666943453.967050][12769:12769] CHIP:DMG: ], - [1666943453.967053][12769:12769] CHIP:DMG: - [1666943453.967055][12769:12769] CHIP:DMG: SuppressResponse = true, - [1666943453.967057][12769:12769] CHIP:DMG: InteractionModelRevision = 1 - - ./chip-tool modeselect read description 1 1 - - Verify the "Description response" on the TH (all-cluster-minimal-app) log: - - [1666941093.845092][9718:9718] CHIP:DMG: ReportDataMessage = - [1666941093.845094][9718:9718] CHIP:DMG: { - [1666941093.845096][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666941093.845099][9718:9718] CHIP:DMG: [ - [1666941093.845101][9718:9718] CHIP:DMG: AttributeReportIB = - [1666941093.845105][9718:9718] CHIP:DMG: { - [1666941093.845107][9718:9718] CHIP:DMG: AttributeDataIB = - [1666941093.845110][9718:9718] CHIP:DMG: { - [1666941093.845112][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666941093.845115][9718:9718] CHIP:DMG: AttributePathIB = - [1666941093.845117][9718:9718] CHIP:DMG: { - [1666941093.845119][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666941093.845122][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666941093.845124][9718:9718] CHIP:DMG: Attribute = 0x0000_0000, - [1666941093.845126][9718:9718] CHIP:DMG: } - [1666941093.845129][9718:9718] CHIP:DMG: - [1666941093.845132][9718:9718] CHIP:DMG: Data = "Coffee" (6 chars), - [1666941093.845134][9718:9718] CHIP:DMG: }, - [1666941093.845137][9718:9718] CHIP:DMG: - [1666941093.845139][9718:9718] CHIP:DMG: }, - [1666941093.845142][9718:9718] CHIP:DMG: - [1666941093.845144][9718:9718] CHIP:DMG: ], - [1666941093.845147][9718:9718] CHIP:DMG: - [1666941093.845149][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666941093.845152][9718:9718] CHIP:DMG: InteractionModelRevision = 1 - disabled: true - - - label: - "Step 6: DUT reads all supported optional attributes from TH one at a - time in a manufacturer specific order" - PICS: MOD.C.AO-READ - verification: | - ./chip-tool modeselect read on-mode 1 1 - - Verify status response as UNSUPPORTED_ATTRIBUTE on the TH (all-cluster-minimal-app) log: - - [1684929635.593547][20278:20280] CHIP:DMG: StatusIB = - [1684929635.593551][20278:20280] CHIP:DMG: { - [1684929635.593555][20278:20280] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1684929635.593558][20278:20280] CHIP:DMG: }, - - - ./chip-tool modeselect read start-up-mode 1 1 - - Verify status response as UNSUPPORTED_ATTRIBUTE on the TH (all-cluster-minimal-app) log: - - [1684929665.428885][20285:20287] CHIP:DMG: StatusIB = - [1684929665.428891][20285:20287] CHIP:DMG: { - [1684929665.428895][20285:20287] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1684929665.428900][20285:20287] CHIP:DMG: }, - disabled: true - - - label: - "Step 7: DUT writes a suitable value to all supported optional - attributes on the TH one at a time in a manufacturer specific order" - PICS: MOD.C.AO-WRITE - verification: | - ./chip-tool modeselect write on-mode 0 1 1 - - Verify status response as UNSUPPORTED_ATTRIBUTE on the TH (all-cluster-minimal-app) log: - - [1684929889.679386][20348:20350] CHIP:DMG: StatusIB = - [1684929889.679389][20348:20350] CHIP:DMG: { - [1684929889.679392][20348:20350] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1684929889.679395][20348:20350] CHIP:DMG: }, - [1684929889.679398][20348:20350] CHIP:DMG: - - - ./chip-tool modeselect write start-up-mode 0 1 1 - - Verify status response as UNSUPPORTED_ATTRIBUTE on the TH (all-cluster-minimal-app) log: - - [1684929889.679386][20348:20350] CHIP:DMG: StatusIB = - [1684929889.679389][20348:20350] CHIP:DMG: { - [1684929889.679392][20348:20350] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1684929889.679395][20348:20350] CHIP:DMG: }, - [1684929889.679398][20348:20350] CHIP:DMG: - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml deleted file mode 100644 index 3d886d15ab6253..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml +++ /dev/null @@ -1,131 +0,0 @@ -# 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: 3.4 [TC-OTCCM-3.1] On Mode functionality with DUT as Server - -PICS: - - OTCCM.S.A0003 - - MOD.S.F00 - - OO.S.C00.Rsp - - OO.S.C01.Rsp - -config: - nodeId: 0x12344321 - cluster: "Oven Mode" - endpoint: 1 - - ConfigureOnMode: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 2 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To - execute this test case set onmode to any integer value because as - default it value has null." - PICS: OTCCM.S.A0003 && MOD.S.F00 - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: ConfigureOnMode - - - label: "Step 2: TH reads from the DUT the OnMode attribute." - PICS: OTCCM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: on_mode_dut - constraints: - type: int8u - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: OTCCM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - constraints: - type: int8u - - - label: - "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. - Else proceed to step 6." - PICS: OTCCM.S.A0001 && MOD.S.F00 && OTCCM.S.A0003 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: on_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 4: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: OTCCM.S.A0000 && MOD.S.F00 - command: "readAttribute" - attribute: "SupportedModes" - response: - constraints: - type: list - minLength: 2 - - - label: - "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - runIf: IsExpectedValue - PICS: OTCCM.S.C00.Rsp && MOD.S.F00 - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 6:TH sends a Off command to the DUT" - PICS: OO.S.C00.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "Off" - - - label: "Step 7:TH sends a On command to the DUT" - PICS: OO.S.C01.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "On" - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: OTCCM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml deleted file mode 100644 index e1220de758e875..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml +++ /dev/null @@ -1,171 +0,0 @@ -# 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: 3.5 [TC-OTCCM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - OTCCM.S.A0002 - -config: - nodeId: 0x12344321 - cluster: "Oven Mode" - endpoint: 1 - - new_start-up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: OTCCM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: OTCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: OTCCM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: OTCCM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: OTCCM.S.A0001 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed - to step 6. Else proceed to step 8." - PICS: OTCCM.S.A0001 && OTCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: OTCCM.S.A0000 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: OTCCM.S.C00.Rsp - runIf: Step5_IsExpectedValue - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: OTCCM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: new_start_up_mode_dut - value: new_start_up_mode_th - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: OTCCM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_start_up_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml deleted file mode 100644 index 27184569f51b5a..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# 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: - 3.6 [TC-OTCCM-3.3] On Mode and Startup Mode functionality with DUT as Server - -PICS: - - OTCCM.S.A0002 - - OTCCM.S.A0003 - - MOD.S.F00 - - OO.S.A4003 - -config: - nodeId: 0x12344321 - cluster: "Oven Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: OTCCM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: OTCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: OTCCM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: OTCCM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: OTCCM.S.A0003 && OTCCM.S.A0002 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: old_on_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to - step 6. Else proceed to step 8." - PICS: OTCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: old_on_mode_dut - - name: "Value2" - value: startup_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: OTCCM.S.A0000 && OTCCM.S.A0002 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH writes to the DUT the OnMode attribute with the - new_mode_th value" - PICS: OTCCM.S.A0003 - runIf: Step5_IsExpectedValue - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: new_mode_th - - - label: "Step 8: TH reads from the DUT the OnMode attribute." - PICS: OTCCM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: new_on_mode_dut - - - label: - "Step 9: TH writes to the DUT the StartUpOnOff attribute with the - value 1." - PICS: OO.S.A4003 - cluster: "On/Off" - command: "writeAttribute" - attribute: "StartUpOnOff" - arguments: - value: 1 - - - label: "Step 10: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: OTCCM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - value: new_start_up_mode_th - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: OTCCM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_S_2_6.yaml b/src/app/tests/suites/certification/Test_TC_S_2_6.yaml index cff80b796ab11c..40f4fa89d46006 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_6.yaml @@ -118,7 +118,7 @@ tests: Verify the RemoveAllScenesResponse with following fields: Status is SUCCESS - Group ID is 0x0000 on the TH(Chip-tool) log and below is the sample log provided for the raspi platform: + Group ID is 0x0000 on the TH2(Chip-tool) log and below is the sample log provided for the raspi platform: [1700826575.191275][15971:15973] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0003 [1700826575.191321][15971:15973] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0003 @@ -135,7 +135,7 @@ tests: Verify the RemoveAllScenesResponse with following fields: Status is SUCCESS - Group ID is 0x0000 on the TH(Chip-tool) log and below is the sample log provided for the raspi platform: + Group ID is 0x0000 on the TH3(Chip-tool) log and below is the sample log provided for the raspi platform: [1700826595.190538][15975:15977] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0003 [1700826595.190578][15975:15977] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0003 @@ -236,7 +236,7 @@ tests: CHIP:DMG: Refresh LivenessCheckTime for 9224 milliseconds with SubscriptionId = 0xce6a96bc Peer = 01:0000000000000001 disabled: true - - label: "Step 2d: Repeat Step 2b and 2c with TH2 and TH3" + - label: "Step 2d: Repeat Step 2b and 2c with TH2." verification: | TH2: @@ -974,44 +974,40 @@ tests: - label: "Step 7: TH3 sends a StoreScene command to DUT with the GroupID field - set to 0x0000, the SceneID field set to 0x01." + set to 0x0000, the SceneID field set to 0xfe." PICS: S.S.C04.Rsp verification: | - scenesmanagement store-scene 0x0000 0x01 3 1 --commissioner-name gamma + scenesmanagement store-scene 0x0000 0xfe 3 1 --commissioner-name gamma Verify the StoreSceneResponse with following fields: Status is RESOURCE_EXHAUSTED(0x89) on the TH3(Chip-tool) log and below is the sample log provided for the raspi platform: - [1705915551.740537][21417:21419] CHIP:DMG: }, - [1705915551.740557][21417:21419] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0004 - [1705915551.740566][21417:21419] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0004 - [1705915551.740585][21417:21419] CHIP:TOO: StoreSceneResponse: { - [1705915551.740590][21417:21419] CHIP:TOO: status: 137 - [1705915551.740593][21417:21419] CHIP:TOO: groupID: 0 - [1705915551.740596][21417:21419] CHIP:TOO: sceneID: 1 - [1705915551.740598][21417:21419] CHIP:TOO: } + [1718862868.462786][6330:6332] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0004 + [1718862868.462834][6330:6332] CHIP:TOO: StoreSceneResponse: { + [1718862868.462862][6330:6332] CHIP:TOO: status: 137 + [1718862868.462885][6330:6332] CHIP:TOO: groupID: 0 + [1718862868.462908][6330:6332] CHIP:TOO: sceneID: 254 + [1718862868.462930][6330:6332] CHIP:TOO: } disabled: true - label: "Step 8: TH sends a CopyScene command to DUT with the mode field set to 0x00, the group identifier from field set to 0x0000, the scene identifier from field set to 0x01, the group identifier to field set - to 0x0000 and the scene identifier to field set to 0xFE." + to 0x0000 and the scene identifier to field set to 0x02." PICS: S.S.C40.Rsp verification: | - scenesmanagement copy-scene 0x00 0x0000 0x02 0x0000 0x00 3 1 --commissioner-name gamma + scenesmanagement copy-scene 0x00 0x0000 0x01 0x0000 0x02 1 1 Verify the CopySceneResponse with following fields: - Status is RESOURCE_EXHAUSTED(0x89) on the TH(Chip-tool) log and below is the sample log provided for the raspi platform: - - [1705915659.672801][21417:21419] CHIP:DMG: }, - [1705915659.672875][21417:21419] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0040 - [1705915659.672891][21417:21419] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0040 - [1705915659.672923][21417:21419] CHIP:TOO: CopySceneResponse: { - [1705915659.672937][21417:21419] CHIP:TOO: status: 133 - [1705915659.672950][21417:21419] CHIP:TOO: groupIdentifierFrom: 0 - [1705915659.672979][21417:21419] CHIP:TOO: sceneIdentifierFrom: 2 - [1705915659.672991][21417:21419] CHIP:TOO: } + Status is RESOURCE_EXHAUSTED(0x89), the group identifier from field set to 0x0000 and the scene identifier from field set to 1 on the TH(Chip-tool) log and below is the sample log provided for the raspi platform: + + [1708499075.003907][25643:25645] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0040 + [1708499075.004059][25643:25645] CHIP:TOO: CopySceneResponse: { + [1708499075.004128][25643:25645] CHIP:TOO: status: 137 + [1708499075.004185][25643:25645] CHIP:TOO: groupIdentifierFrom: 0 + [1708499075.004240][25643:25645] CHIP:TOO: sceneIdentifierFrom: 1 + [1708499075.004293][25643:25645] CHIP:TOO: } disabled: true - label: @@ -1147,32 +1143,30 @@ tests: "Step 11a: TH1 removes the TH2 fabric by sending the RemoveFabric command to the DUT with the FabricIndex set to th2FabricIndex" verification: | - operationalcredentials remove-fabric th2FabricIndex 1 0 + operationalcredentials remove-fabric 2 1 0 - On TH1(chip-tool) verify the success with the nocresponse with statuscode is success(0) + Verify the DUT sends a response to TH with the Status field set to 0x00 (SUCCESS) and the FabricIndex field set to th2FabricIndex on TH1(Chip-tool) log and below is the sample log provided for the raspi platform: - [1784416866.004187][21433:21435] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 - [1784416866.004214][21433:21435] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 - [1784416866.004236][21433:21435] CHIP:TOO: NOCResponse: { - [1784416866.004250][21433:21435] CHIP:TOO: statusCode: 0 - [1784416866.004255][21433:21435] CHIP:TOO: fabricIndex: th2FabricIndex - [1784416866.004259][21433:21435] CHIP:TOO: } - [1784416866.004270][21433:21435] CHIP:DMG: ICR moving to [AwaitingDe] + [1708332262.744710][18447:18449] CHIP:DMG: }, + [1708332262.744728][18447:18449] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 + [1708332262.744737][18447:18449] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 + [1708332262.744755][18447:18449] CHIP:TOO: NOCResponse: { + [1708332262.744761][18447:18449] CHIP:TOO: statusCode: 0 + [1708332262.744765][18447:18449] CHIP:TOO: fabricIndex: 2 + [1708332262.744768][18447:18449] CHIP:TOO: } disabled: true - label: "Step 11b: TH1 removes the TH3 fabric by sending the RemoveFabric command to the DUT with the FabricIndex set to th3FabricIndex" verification: | - operationalcredentials remove-fabric th3FabricIndex 1 0 + operationalcredentials remove-fabric 3 1 0 - On TH1(chip-tool) verify the success with the nocresponse with statuscode is success(0) + Verify the DUT sends a response to TH with the Status field set to 0x00 (SUCCESS) and the FabricIndex field set to th3FabricIndex on TH1(Chip-tool) log and below is the sample log provided for the raspi platform: - [1784416866.004187][21433:21435] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 - [1784416866.004214][21433:21435] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 - [1784416866.004236][21433:21435] CHIP:TOO: NOCResponse: { - [1784416866.004250][21433:21435] CHIP:TOO: statusCode: 0 - [1784416866.004255][21433:21435] CHIP:TOO: fabricIndex: th3FabricIndex - [1784416866.004259][21433:21435] CHIP:TOO: } - [1784416866.004270][21433:21435] CHIP:DMG: ICR moving to [AwaitingDe] + [1708332339.212544][18440:18442] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 + [1708332339.212553][18440:18442] CHIP:TOO: NOCResponse: { + [1708332339.212557][18440:18442] CHIP:TOO: statusCode: 0 + [1708332339.212560][18440:18442] CHIP:TOO: fabricIndex: 3 + [1708332339.212562][18440:18442] CHIP:TOO: } disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml deleted file mode 100644 index 178357027408c7..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml +++ /dev/null @@ -1,127 +0,0 @@ -# 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: 219.3.1. [TC-TCCM-3.1] On Mode functionality with DUT as Server - -PICS: - - TCCM.S.A0003 - - MOD.S.F00 - - OO.S.C00.Rsp - - OO.S.C01.Rsp - -config: - nodeId: 0x12344321 - cluster: "Refrigerator And Temperature Controlled Cabinet Mode" - endpoint: 1 - #Configure newmode value - new_mode_th: - type: int8u - defaultValue: 2 - nonNull_OnMode_value: - type: int8u - defaultValue: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Preconditions: The OnMode attribute is set to a non-NULL value from - the mode values indicated by the SupportedModes attribute." - PICS: TCCM.S.A0003 && MOD.S.F00 - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: nonNull_OnMode_value - - - label: "Step 2: TH reads from the DUT the OnMode attribute." - PICS: TCCM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: on_mode_dut - - - label: "Step 3a: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - - - label: - "Step 3b: If the OnMode and CurrentMode attributes have the same - value, proceed to step 4, Otherwise proceed to step 6" - PICS: TCCM.S.A0003 && TCCM.S.A0001 && MOD.S.F00 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: on_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 4:TH reads the SupportedModes attribute from the DUT" - runIf: IsExpectedValue - PICS: TCCM.S.A0000 && MOD.S.F00 - command: "readAttribute" - attribute: "SupportedModes" - response: - constraints: - type: list - minLength: 2 - - - label: - "Step 5: Select a value from supported_modes_dut different from - on_mode_dut. Save the value as new_mode_th. TH sends a ChangeToMode - command to the DUT with NewMode set to new_mode_th" - runIf: IsExpectedValue - PICS: TCCM.S.C00.Rsp && MOD.S.F00 - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 6: TH sends an Off command to the DUT" - PICS: OO.S.C00.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "Off" - - - label: "Step 7: TH sends an On command to the DUT" - PICS: OO.S.C01.Rsp && MOD.S.F00 - cluster: "On/Off" - command: "On" - - - label: "Step 8: TH reads the CurrentMode attribute from the DUT" - PICS: TCCM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml deleted file mode 100644 index b89db6a41925c2..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml +++ /dev/null @@ -1,176 +0,0 @@ -# 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: 219.3.2. [TC-TCCM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - TCCM.S.A0002 - -config: - nodeId: 0x12344321 - cluster: "Refrigerator And Temperature Controlled Cabinet Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: TCCM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - constraints: - type: int8u - - - label: - "If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5" - PICS: TCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: TCCM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 4:TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - runIf: IsExpectedValue - PICS: TCCM.S.A0002 - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - constraints: - type: int8u - - - label: - "If startup_mode_dut is equal to old_current_mode_dut proceed to step - 6. Else proceed to step 8" - PICS: TCCM.S.A0002 && TCCM.S.A0001 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - runIf: Step5_IsExpectedValue - PICS: TCCM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - runIf: Step5_IsExpectedValue - PICS: DISHM.S.C00.Rsp - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - - - label: "Step 8: Physically power cycle the device." - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: TCCM.S.A0002 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: new_start_up_mode_dut - constraints: - type: int8u - anyOf: [new_start_up_mode_th, startup_mode_dut] - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_start_up_mode_dut - constraints: - type: int8u diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml deleted file mode 100644 index 64d8b3f7d637e9..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml +++ /dev/null @@ -1,195 +0,0 @@ -# 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: - 219.3.3. [TC-TCCM-3.3] On Mode and Startup Mode functionality with DUT as - Server - -PICS: - - TCCM.S.A0002 - - TCCM.S.A0003 - - MOD.S.F00 - - OO.S.A4003 - -config: - nodeId: 0x12344321 - cluster: "Refrigerator And Temperature Controlled Cabinet Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: TCCM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - constraints: - type: int8u - - - label: - "If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5" - PICS: TCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: TCCM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 4:TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - runIf: IsExpectedValue - PICS: TCCM.S.A0002 - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: TCCM.S.A0003 && TCCM.S.A0002 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: old_on_mode_dut - constraints: - type: int8u - - - label: - "If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. - Else proceed to step 8." - PICS: TCCM.S.A0003 && TCCM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: old_on_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads the SupportedModes attribute from the DUT" - runIf: Step5_IsExpectedValue - PICS: TCCM.S.A0000 && TCCM.S.A0002 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7:TH writes to the DUT the OnMode attribute with the new_mode_th - value" - runIf: Step5_IsExpectedValue - PICS: TCCM.S.A0003 - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: new_mode_th - - - label: "Step 8: TH reads from the DUT the OnMode attribute." - PICS: TCCM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: new_on_mode_dut - constraints: - anyOf: [new_mode_th, old_on_mode_dut] - - - label: - "Step 9:TH writes to the DUT the StartUpOnOff attribute with the value - 1" - PICS: OO.S.A4003 - cluster: "On/Off" - command: "writeAttribute" - attribute: "StartUpOnOff" - arguments: - value: 1 - - - label: "Step 10: Physically power cycle the device." - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: TCCM.S.A0002 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "StartUpMode" - response: - constraints: - anyOf: [new_start_up_mode_th, startup_mode_dut] - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_on_mode_dut diff --git a/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml index 463aa6af03f865..5cbf1d28ec89d3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/CameraAVStreamManagement.adoc Parameters: in-progress -Git: 0.9-fall2024-387-gfd3062545 +Git: 0.9-fall2024-411-g9835b5cd7 --> @@ -127,8 +127,8 @@ Git: 0.9-fall2024-387-gfd3062545 - - + + @@ -143,8 +143,8 @@ Git: 0.9-fall2024-387-gfd3062545 - - + + Camera AV Stream Management 0x0551 CAMERA_AV_STREAM_MANAGEMENT_CLUSTER @@ -172,7 +172,7 @@ Git: 0.9-fall2024-387-gfd3062545 - + @@ -187,7 +187,7 @@ Git: 0.9-fall2024-387-gfd3062545 NightVisionCapable MinViewport RateDistortionTradeOffPoints - MaxPreRollBufferSize + MaxContentBufferSize MicrophoneCapabilities SpeakerCapabilities TwoWayTalkSupport @@ -345,8 +345,8 @@ Git: 0.9-fall2024-387-gfd3062545 - - + + @@ -447,8 +447,8 @@ Git: 0.9-fall2024-387-gfd3062545 - - + + This event SHALL be generated when there is a modification in the corresponding video stream. diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index f7f5699ef8fccf..ff485bbf6bba81 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -2698,4 +2698,47 @@ limitations under the License. + + MA-waterheater + CHIP + Water Heater + 0x0103 + 0x050F + Simple + Endpoint + + + CLIENT_LIST + DEVICE_TYPE_LIST + PARTS_LIST + SERVER_LIST + + + IDENTIFY_TIME + IDENTIFY_TYPE + Identify + + + CONTROL_SEQUENCE_OF_OPERATION + LOCAL_TEMPERATURE + SYSTEM_MODE + SetpointRaiseLower + + + BOOST_STATE + HEATER_TYPES + HEAT_DEMAND + BoostEnded + BoostStarted + Boost + CancelBoost + + + CURRENT_MODE + SUPPORTED_MODES + ChangeToMode + ChangeToModeResponse + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d663a5f018a217..24c7e00c623b53 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9527,7 +9527,7 @@ provisional cluster ZoneManagement = 1360 { } /** The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. */ -cluster CameraAvStreamManagement = 1361 { +provisional cluster CameraAvStreamManagement = 1361 { revision 1; enum AudioCodecEnum : enum8 { @@ -9695,7 +9695,7 @@ cluster CameraAvStreamManagement = 1361 { readonly attribute optional boolean nightVisionCapable = 3; readonly attribute optional VideoResolutionStruct minViewport = 4; readonly attribute optional RateDistortionTradeOffPointsStruct rateDistortionTradeOffPoints[] = 5; - readonly attribute optional int32u maxPreRollBufferSize = 6; + readonly attribute optional int32u maxContentBufferSize = 6; readonly attribute optional AudioCapabilitiesStruct microphoneCapabilities = 7; readonly attribute optional AudioCapabilitiesStruct speakerCapabilities = 8; readonly attribute optional TwoWayTalkSupportTypeEnum twoWayTalkSupport = 9; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index dff134bddd1a18..06b8dd8ff0b54c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59730,7 +59730,7 @@ public static class CameraAvStreamManagementCluster extends BaseChipCluster { private static final long NIGHT_VISION_CAPABLE_ATTRIBUTE_ID = 3L; private static final long MIN_VIEWPORT_ATTRIBUTE_ID = 4L; private static final long RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID = 5L; - private static final long MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID = 6L; + private static final long MAX_CONTENT_BUFFER_SIZE_ATTRIBUTE_ID = 6L; private static final long MICROPHONE_CAPABILITIES_ATTRIBUTE_ID = 7L; private static final long SPEAKER_CAPABILITIES_ATTRIBUTE_ID = 8L; private static final long TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID = 9L; @@ -60418,9 +60418,9 @@ public void onSuccess(byte[] tlv) { }, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMaxPreRollBufferSizeAttribute( + public void readMaxContentBufferSizeAttribute( LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONTENT_BUFFER_SIZE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60428,12 +60428,12 @@ public void onSuccess(byte[] tlv) { Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, true); + }, MAX_CONTENT_BUFFER_SIZE_ATTRIBUTE_ID, true); } - public void subscribeMaxPreRollBufferSizeAttribute( + public void subscribeMaxContentBufferSizeAttribute( LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONTENT_BUFFER_SIZE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60441,7 +60441,7 @@ public void onSuccess(byte[] tlv) { Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, minInterval, maxInterval); + }, MAX_CONTENT_BUFFER_SIZE_ATTRIBUTE_ID, minInterval, maxInterval); } public void readMicrophoneCapabilitiesAttribute( diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index a43df66e40bf0a..354f49ed6caa5d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -17079,7 +17079,7 @@ public enum Attribute { NightVisionCapable(3L), MinViewport(4L), RateDistortionTradeOffPoints(5L), - MaxPreRollBufferSize(6L), + MaxContentBufferSize(6L), MicrophoneCapabilities(7L), SpeakerCapabilities(8L), TwoWayTalkSupport(9L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 9abbcd879c5503..843114b4374f58 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18340,17 +18340,17 @@ private static Map readCameraAvStreamManagementInteract readCameraAvStreamManagementRateDistortionTradeOffPointsCommandParams ); result.put("readRateDistortionTradeOffPointsAttribute", readCameraAvStreamManagementRateDistortionTradeOffPointsAttributeInteractionInfo); - Map readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams = new LinkedHashMap(); - InteractionInfo readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo = new InteractionInfo( + Map readCameraAvStreamManagementMaxContentBufferSizeCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxContentBufferSizeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxPreRollBufferSizeAttribute( + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxContentBufferSizeAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams + readCameraAvStreamManagementMaxContentBufferSizeCommandParams ); - result.put("readMaxPreRollBufferSizeAttribute", readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo); + result.put("readMaxContentBufferSizeAttribute", readCameraAvStreamManagementMaxContentBufferSizeAttributeInteractionInfo); Map readCameraAvStreamManagementTwoWayTalkSupportCommandParams = new LinkedHashMap(); InteractionInfo readCameraAvStreamManagementTwoWayTalkSupportAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt index c9f6d50d065f8f..c0993403079dbf 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt @@ -1327,7 +1327,7 @@ class CameraAvStreamManagementCluster( } } - suspend fun readMaxPreRollBufferSizeAttribute(): UInt? { + suspend fun readMaxContentBufferSizeAttribute(): UInt? { val ATTRIBUTE_ID: UInt = 6u val attributePath = @@ -1349,7 +1349,7 @@ class CameraAvStreamManagementCluster( it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Maxprerollbuffersize attribute not found in response" } + requireNotNull(attributeData) { "Maxcontentbuffersize attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) @@ -1363,7 +1363,7 @@ class CameraAvStreamManagementCluster( return decodedValue } - suspend fun subscribeMaxPreRollBufferSizeAttribute( + suspend fun subscribeMaxContentBufferSizeAttribute( minInterval: Int, maxInterval: Int, ): Flow { @@ -1399,7 +1399,7 @@ class CameraAvStreamManagementCluster( .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } requireNotNull(attributeData) { - "Maxprerollbuffersize attribute not found in Node State update" + "Maxcontentbuffersize attribute not found in Node State update" } // Decode the TLV data into the appropriate type diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index c49674fbbefe7e..c8247c5d4d31a8 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -40112,8 +40112,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::MaxPreRollBufferSize::Id: { - using TypeInfo = Attributes::MaxPreRollBufferSize::TypeInfo; + case Attributes::MaxContentBufferSize::Id: { + using TypeInfo = Attributes::MaxContentBufferSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 395506b33bb843..08f8182e6b6886 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -12543,7 +12543,7 @@ class ChipClusters: "reportable": True, }, 0x00000006: { - "attributeName": "MaxPreRollBufferSize", + "attributeName": "MaxContentBufferSize", "attributeId": 0x00000006, "type": "int", "reportable": True, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 0cdc2a54549cce..b7b73282715a22 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -44779,7 +44779,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="nightVisionCapable", Tag=0x00000003, Type=typing.Optional[bool]), ClusterObjectFieldDescriptor(Label="minViewport", Tag=0x00000004, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), ClusterObjectFieldDescriptor(Label="rateDistortionTradeOffPoints", Tag=0x00000005, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]), - ClusterObjectFieldDescriptor(Label="maxPreRollBufferSize", Tag=0x00000006, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxContentBufferSize", Tag=0x00000006, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="microphoneCapabilities", Tag=0x00000007, Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), ClusterObjectFieldDescriptor(Label="speakerCapabilities", Tag=0x00000008, Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), ClusterObjectFieldDescriptor(Label="twoWayTalkSupport", Tag=0x00000009, Type=typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]), @@ -44833,7 +44833,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: nightVisionCapable: typing.Optional[bool] = None minViewport: typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct] = None rateDistortionTradeOffPoints: typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]] = None - maxPreRollBufferSize: typing.Optional[uint] = None + maxContentBufferSize: typing.Optional[uint] = None microphoneCapabilities: typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct] = None speakerCapabilities: typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct] = None twoWayTalkSupport: typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum] = None @@ -45561,7 +45561,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]] = None @dataclass - class MaxPreRollBufferSize(ClusterAttributeDescriptor): + class MaxContentBufferSize(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x00000551 diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index a298b296849d51..2f75038eda97a2 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -613,7 +613,9 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue } } -static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) +// writer is allowed to be null to just validate the incoming object without +// actually encoding. +static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::TLV::TLVWriter * writer, chip::TLV::Tag tag) { if (![object isKindOfClass:[NSDictionary class]]) { MTR_LOG_ERROR("Error: Unsupported object to encode: %@", [object class]); @@ -631,60 +633,62 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::T MTR_LOG_ERROR("Error: Object to encode has corrupt signed integer type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, [value longLongValue]); + return writer ? writer->Put(tag, [value longLongValue]) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRUnsignedIntegerValueType]) { if (![value isKindOfClass:[NSNumber class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt unsigned integer type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, [value unsignedLongLongValue]); + return writer ? writer->Put(tag, [value unsignedLongLongValue]) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRBooleanValueType]) { if (![value isKindOfClass:[NSNumber class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt boolean type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, static_cast([value boolValue])); + return writer ? writer->Put(tag, static_cast([value boolValue])) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRFloatValueType]) { if (![value isKindOfClass:[NSNumber class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt float type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, [value floatValue]); + return writer ? writer->Put(tag, [value floatValue]) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRDoubleValueType]) { if (![value isKindOfClass:[NSNumber class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt double type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, [value doubleValue]); + return writer ? writer->Put(tag, [value doubleValue]) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRNullValueType]) { - return writer.PutNull(tag); + return writer ? writer->PutNull(tag) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRUTF8StringValueType]) { if (![value isKindOfClass:[NSString class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt UTF8 string type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.PutString(tag, AsCharSpan(value)); + return writer ? writer->PutString(tag, AsCharSpan(value)) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTROctetStringValueType]) { if (![value isKindOfClass:[NSData class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt octet string type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - return writer.Put(tag, AsByteSpan(value)); + return writer ? writer->Put(tag, AsByteSpan(value)) : CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRStructureValueType]) { if (![value isKindOfClass:[NSArray class]]) { MTR_LOG_ERROR("Error: Object to encode has corrupt structure type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, chip::TLV::kTLVType_Structure, outer)); + TLV::TLVType outer = TLV::kTLVType_NotSpecified; + if (writer) { + ReturnErrorOnFailure(writer->StartContainer(tag, chip::TLV::kTLVType_Structure, outer)); + } for (id element in value) { if (![element isKindOfClass:[NSDictionary class]]) { MTR_LOG_ERROR("Error: Structure element to encode has corrupt type: %@", [element class]); @@ -713,7 +717,9 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::T ReturnErrorOnFailure( MTREncodeTLVFromDataValueDictionaryInternal(elementValue, writer, tag)); } - ReturnErrorOnFailure(writer.EndContainer(outer)); + if (writer) { + ReturnErrorOnFailure(writer->EndContainer(outer)); + } return CHIP_NO_ERROR; } if ([typeName isEqualToString:MTRArrayValueType]) { @@ -721,8 +727,10 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::T MTR_LOG_ERROR("Error: Object to encode has corrupt array type: %@", [value class]); return CHIP_ERROR_INVALID_ARGUMENT; } - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, chip::TLV::kTLVType_Array, outer)); + TLV::TLVType outer = TLV::kTLVType_NotSpecified; + if (writer) { + ReturnErrorOnFailure(writer->StartContainer(tag, chip::TLV::kTLVType_Array, outer)); + } for (id element in value) { if (![element isKindOfClass:[NSDictionary class]]) { MTR_LOG_ERROR("Error: Array element to encode has corrupt type: %@", [element class]); @@ -735,14 +743,16 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionaryInternal(id object, chip::T } ReturnErrorOnFailure(MTREncodeTLVFromDataValueDictionaryInternal(elementValue, writer, chip::TLV::AnonymousTag())); } - ReturnErrorOnFailure(writer.EndContainer(outer)); + if (writer) { + ReturnErrorOnFailure(writer->EndContainer(outer)); + } return CHIP_NO_ERROR; } MTR_LOG_ERROR("Error: Unsupported type to encode: %@", typeName); return CHIP_ERROR_INVALID_ARGUMENT; } -static CHIP_ERROR MTREncodeTLVFromDataValueDictionary(id object, chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) +static CHIP_ERROR MTREncodeTLVFromDataValueDictionary(id object, chip::TLV::TLVWriter * writer, chip::TLV::Tag tag) { CHIP_ERROR err = MTREncodeTLVFromDataValueDictionaryInternal(object, writer, tag); if (err != CHIP_NO_ERROR) { @@ -761,7 +771,7 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionary(id object, chip::TLV::TLVW TLV::TLVWriter writer; writer.Init(buffer); - CHIP_ERROR err = MTREncodeTLVFromDataValueDictionary(value, writer, TLV::AnonymousTag()); + CHIP_ERROR err = MTREncodeTLVFromDataValueDictionary(value, &writer, TLV::AnonymousTag()); if (err != CHIP_NO_ERROR) { if (error) { *error = [MTRError errorForCHIPErrorCode:err]; @@ -772,6 +782,11 @@ static CHIP_ERROR MTREncodeTLVFromDataValueDictionary(id object, chip::TLV::TLVW return AsData(ByteSpan(buffer, writer.GetLengthWritten())); } +BOOL MTRDataValueDictionaryIsWellFormed(MTRDeviceDataValueDictionary value) +{ + return MTREncodeTLVFromDataValueDictionary(value, nullptr, TLV::AnonymousTag()) == CHIP_NO_ERROR; +} + // Callback type to pass data value as an NSObject typedef void (*MTRDataValueDictionaryCallback)(void * context, id value); @@ -798,7 +813,7 @@ CHIP_ERROR Decode(chip::TLV::TLVReader & data) CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const { - return MTREncodeTLVFromDataValueDictionary(decodedObj, writer, tag); + return MTREncodeTLVFromDataValueDictionary(decodedObj, &writer, tag); } static constexpr bool kIsFabricScoped = false; @@ -2212,7 +2227,7 @@ + (NSDictionary *)eventReportForHeader:(const chip::app::EventHeader &)header an // Commands never need chained buffers, since they cannot be chunked. writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - CHIP_ERROR errorCode = MTREncodeTLVFromDataValueDictionary(data, writer, TLV::AnonymousTag()); + CHIP_ERROR errorCode = MTREncodeTLVFromDataValueDictionary(data, &writer, TLV::AnonymousTag()); if (errorCode != CHIP_NO_ERROR) { LogStringAndReturnError(@"Unable to encode data-value to TLV", errorCode, error); return System::PacketBufferHandle(); @@ -3082,7 +3097,7 @@ static bool EncodeDataValueToTLV(System::PacketBufferHandle & buffer, Platform:: System::PacketBufferTLVWriter writer; writer.Init(std::move(buffer), /* useChainedBuffers = */ true); - CHIP_ERROR errorCode = MTREncodeTLVFromDataValueDictionary(data, writer, TLV::AnonymousTag()); + CHIP_ERROR errorCode = MTREncodeTLVFromDataValueDictionary(data, &writer, TLV::AnonymousTag()); if (errorCode != CHIP_NO_ERROR) { LogStringAndReturnError(@"Unable to encode data-value to TLV", errorCode, error); return false; diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index 1482d80634da43..075ee99da20990 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -18,6 +18,8 @@ #import "MTRBaseDevice.h" #import +#import "MTRDeviceDataValueDictionary.h" + #include #include #include @@ -257,6 +259,6 @@ NSDictionary * _Nullable MTRDecodeDataValueDictionaryFromCHIPTLV // TLV Data with an anonymous tag. This method assumes the encoding of the // value fits in a single UDP MTU; for lists this method might need to be used // on each list item separately. -NSData * _Nullable MTREncodeTLVFromDataValueDictionary(NSDictionary * value, NSError * __autoreleasing * error); +NSData * _Nullable MTREncodeTLVFromDataValueDictionary(MTRDeviceDataValueDictionary value, NSError * __autoreleasing * error); NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index e0154fdb8934e6..8e379980578f58 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -539,6 +539,8 @@ - (BOOL)deviceCachePrimed return NO; } +#pragma mark - Suspend/resume management + - (void)controllerSuspended { // Nothing to do for now. @@ -549,6 +551,166 @@ - (void)controllerResumed // Nothing to do for now. } +#pragma mark - Value comparisons + +- (BOOL)_attributeDataValue:(MTRDeviceDataValueDictionary)one isEqualToDataValue:(MTRDeviceDataValueDictionary)theOther +{ + // Sanity check for nil cases + if (!one && !theOther) { + MTR_LOG_ERROR("%@ attribute data-value comparison does not expect comparing two nil dictionaries", self); + return YES; + } + if (!one || !theOther) { + // Comparing against nil is expected, and should return NO quietly + return NO; + } + + // Attribute data-value dictionaries are equal if type and value are equal, and specifically, this should return true if values are both nil + return [one[MTRTypeKey] isEqual:theOther[MTRTypeKey]] && ((one[MTRValueKey] == theOther[MTRValueKey]) || [one[MTRValueKey] isEqual:theOther[MTRValueKey]]); +} + +// _attributeDataValue:satisfiesExpectedDataValue: checks whether the newly +// received attribute data value satisfies the expectation we have. +// +// For now, a value is considered to satisfy the expectation if it's equal to +// the expected value, though we allow the fields of structs to be in a +// different order than expected: while in theory the spec does require a +// specific ordering for struct fields, in practice we should not force certain +// API consumers to deal with knowing what that ordering is. +// +// Things to consider for future: +// +// 1) Should a value that has _extra_ fields in a struct compared to the expected +// value be considered as satisfying the expectation? Arguably, yes. +// +// 2) Should lists actually enforce order (as now), or should they allow +// reordering entries? +// +// 3) For fabric-scoped lists, should we have a way to check for just "our +// fabric's" entries? +- (BOOL)_attributeDataValue:(MTRDeviceDataValueDictionary)observed satisfiesValueExpectation:(MTRDeviceDataValueDictionary)expected +{ + // Sanity check for nil cases (which really should not happen!) + if (!observed && !expected) { + MTR_LOG_ERROR("%@ observed to expected attribute data-value comparison does not expect comparing two nil dictionaries", self); + return YES; + } + + if (!observed || !expected) { + // Again, not expected here. But clearly the expectation is not really + // satisfied, in some sense. + MTR_LOG_ERROR("@ observed to expected attribute data-value comparison does not expect a nil %s", observed ? "expected" : "observed"); + return NO; + } + + if (![observed[MTRTypeKey] isEqual:expected[MTRTypeKey]]) { + // Different types, does not satisfy expectation. + return NO; + } + + if ([MTRArrayValueType isEqual:expected[MTRTypeKey]]) { + // For array-values, check that sizes are same and entries satisfy expectations. + if (![observed[MTRValueKey] isKindOfClass:NSArray.class] || ![expected[MTRValueKey] isKindOfClass:NSArray.class]) { + // Malformed data, just claim expectation is not satisfied. + MTR_LOG_ERROR("%@ at least one of observed and expected value is not an NSArrray: %@, %@", self, observed, expected); + return NO; + } + + NSArray *> * observedArray = observed[MTRValueKey]; + NSArray *> * expectedArray = expected[MTRValueKey]; + + if (observedArray.count != expectedArray.count) { + return NO; + } + + for (NSUInteger i = 0; i < observedArray.count; ++i) { + NSDictionary * observedEntry = observedArray[i]; + NSDictionary * expectedEntry = expectedArray[i]; + + if (![observedEntry isKindOfClass:NSDictionary.class] || ![expectedEntry isKindOfClass:NSDictionary.class]) { + MTR_LOG_ERROR("%@ expected or observed array-value contains entries that are not NSDictionary: %@, %@", self, observedEntry, expectedEntry); + return NO; + } + + if (![self _attributeDataValue:observedEntry[MTRDataKey] satisfiesValueExpectation:expectedEntry[MTRDataKey]]) { + return NO; + } + } + + return YES; + } + + if (![MTRStructureValueType isEqual:expected[MTRTypeKey]]) { + // For everything except arrays and structs, expectation is satisfied + // exactly when the values are equal. + return [self _attributeDataValue:observed isEqualToDataValue:expected]; + } + + // Now we have two structure-values. Make sure they have the same number of fields + // in them. + if (![observed[MTRValueKey] isKindOfClass:NSArray.class] || ![expected[MTRValueKey] isKindOfClass:NSArray.class]) { + // Malformed data, just claim not equivalent. + MTR_LOG_ERROR("%@ at least one of observed and expected value is not an NSArrray: %@, %@", self, observed, expected); + return NO; + } + + NSArray *> * observedArray = observed[MTRValueKey]; + NSArray *> * expectedArray = expected[MTRValueKey]; + + if (observedArray.count != expectedArray.count) { + return NO; + } + + for (NSDictionary * expectedField in expectedArray) { + if (![expectedField[MTRContextTagKey] isKindOfClass:NSNumber.class] || ![expectedField[MTRDataKey] isKindOfClass:NSDictionary.class]) { + MTR_LOG_ERROR("%@ expected structure-value contains invalid field %@", self, expectedField); + return NO; + } + + NSNumber * expectedContextTag = expectedField[MTRContextTagKey]; + + // Make sure it's present in the other array. In practice, these are + // pretty small arrays, so the O(N^2) behavior here is ok. + BOOL found = NO; + for (NSDictionary * observedField in observedArray) { + if (![observedField[MTRContextTagKey] isKindOfClass:NSNumber.class] || ![observedField[MTRDataKey] isKindOfClass:NSDictionary.class]) { + MTR_LOG_ERROR("%@ observed structure-value contains invalid field %@", self, observedField); + return NO; + } + + NSNumber * observedContextTag = observedField[MTRContextTagKey]; + if ([expectedContextTag isEqual:observedContextTag]) { + found = YES; + + // Compare the data. + if (![self _attributeDataValue:observedField[MTRDataKey] satisfiesValueExpectation:expectedField[MTRDataKey]]) { + return NO; + } + + // Found a match for the context tag, stop looking. + break; + } + } + + if (!found) { + // Context tag present in expected but not observed. + return NO; + } + } + + // All entries in the first field array matched entries in the second field + // array. Since the lengths are equal, the two arrays must match, as long + // as all the context tags listed are distinct. If someone produces invalid + // TLV with the same context tag set in it multiple times, this method could + // claim two structure-values are equivalent when the first has two fields + // with context tag N and the second has a field with context tag N and + // another field with context tag M. That should be ok, in practice, but if + // we discover it's not we will need a better algorithm here. It's not + // clear what "equivalent" should mean for such malformed TLV, expecially if + // the same context tag maps to different values in one of the structs. + return YES; +} + @end /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */ diff --git a/src/darwin/Framework/CHIP/MTRDeviceDataValueDictionary.h b/src/darwin/Framework/CHIP/MTRDeviceDataValueDictionary.h index 34e46b7ccd7ef3..53a6b2e6f914b7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceDataValueDictionary.h +++ b/src/darwin/Framework/CHIP/MTRDeviceDataValueDictionary.h @@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN +/** + * A data-value as defined in MTRBaseDevice.h. + */ typedef NSDictionary * MTRDeviceDataValueDictionary; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 7276a5b5342eb1..2423e4e8769c45 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -3307,22 +3307,6 @@ - (void)_performScheduledExpirationCheck return nil; } -- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther -{ - // Sanity check for nil cases - if (!one && !theOther) { - MTR_LOG_ERROR("%@ attribute data-value comparison does not expect comparing two nil dictionaries", self); - return YES; - } - if (!one || !theOther) { - // Comparing against nil is expected, and should return NO quietly - return NO; - } - - // Attribute data-value dictionaries are equal if type and value are equal, and specifically, this should return true if values are both nil - return [one[MTRTypeKey] isEqual:theOther[MTRTypeKey]] && ((one[MTRValueKey] == theOther[MTRValueKey]) || [one[MTRValueKey] isEqual:theOther[MTRValueKey]]); -} - // Utility to return data value dictionary without data version - (NSDictionary *)_dataValueWithoutDataVersion:(NSDictionary *)attributeValue { @@ -3538,9 +3522,9 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray * attributeResponseValue in reportedAttributeValues) { MTRAttributePath * attributePath = attributeResponseValue[MTRAttributePathKey]; - NSDictionary * attributeDataValue = attributeResponseValue[MTRDataKey]; - NSError * attributeError = attributeResponseValue[MTRErrorKey]; - NSDictionary * previousValue; + MTRDeviceDataValueDictionary _Nullable attributeDataValue = attributeResponseValue[MTRDataKey]; + NSError * _Nullable attributeError = attributeResponseValue[MTRErrorKey]; + MTRDeviceDataValueDictionary _Nullable previousValue; // sanity check either data value or error must exist if (!attributeDataValue && !attributeError) { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index f954979f131084..4414b3c6133b07 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -22,6 +22,7 @@ #import "MTRAsyncWorkQueue.h" #import "MTRDefines_Internal.h" +#import "MTRDeviceDataValueDictionary.h" #import "MTRDeviceStorageBehaviorConfiguration_Internal.h" NS_ASSUME_NONNULL_BEGIN @@ -164,6 +165,10 @@ MTR_DIRECT_MEMBERS - (void)controllerSuspended; - (void)controllerResumed; +// Methods for comparing attribute data values. +- (BOOL)_attributeDataValue:(MTRDeviceDataValueDictionary)one isEqualToDataValue:(MTRDeviceDataValueDictionary)theOther; +- (BOOL)_attributeDataValue:(MTRDeviceDataValueDictionary)observed satisfiesValueExpectation:(MTRDeviceDataValueDictionary)expected; + @end #pragma mark - MTRDevice internal state monitoring @@ -171,6 +176,13 @@ MTR_DIRECT_MEMBERS - (void)devicePrivateInternalStateChanged:(MTRDevice *)device internalState:(NSDictionary *)state; @end +// Returns whether a data-value dictionary is well-formed (in the sense that all +// the types of the objects inside are as expected, so it's actually a valid +// representation of some TLV). Implemented in MTRBaseDevice.mm because that's +// where the pieces needed to implement it are, but declared here so our tests +// can see it. +MTR_EXTERN MTR_TESTABLE BOOL MTRDataValueDictionaryIsWellFormed(MTRDeviceDataValueDictionary value); + #pragma mark - Constants static NSString * const kDefaultSubscriptionPoolSizeOverrideKey = @"subscriptionPoolSizeOverride"; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 5495d6a9d7a0ca..43e0528c252c14 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5613,7 +5613,7 @@ static BOOL AttributeIsSpecifiedInCameraAVStreamManagementCluster(AttributeId aA case Attributes::RateDistortionTradeOffPoints::Id: { return YES; } - case Attributes::MaxPreRollBufferSize::Id: { + case Attributes::MaxContentBufferSize::Id: { return YES; } case Attributes::MicrophoneCapabilities::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index b894c30f6cfc8e..16f882fe473a43 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16999,8 +16999,8 @@ static id _Nullable DecodeAttributeValueForCameraAVStreamManagementCluster(Attri } return value; } - case Attributes::MaxPreRollBufferSize::Id: { - using TypeInfo = Attributes::MaxPreRollBufferSize::TypeInfo; + case Attributes::MaxContentBufferSize::Id: { + using TypeInfo = Attributes::MaxContentBufferSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index d3f7ba442b3c80..9c1755c5414f8f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14260,11 +14260,11 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams *)params +- (void)readAttributeMaxContentBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxContentBufferSizeWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxContentBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeMicrophoneCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeMicrophoneCapabilitiesWithParams:(MTRSubscribeParams *)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index eb2a2f5687c1f5..3c347c4472e132 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -98643,9 +98643,9 @@ + (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClust completion:completion]; } -- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeMaxContentBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + using TypeInfo = CameraAvStreamManagement::Attributes::MaxContentBufferSize::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -98654,11 +98654,11 @@ - (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nu completion:completion]; } -- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams * _Nonnull)params +- (void)subscribeAttributeMaxContentBufferSizeWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + using TypeInfo = CameraAvStreamManagement::Attributes::MaxContentBufferSize::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -98668,9 +98668,9 @@ - (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams * _ subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeMaxContentBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + using TypeInfo = CameraAvStreamManagement::Attributes::MaxContentBufferSize::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7ee2c7d88af1c0..da2ce72f59373d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -4641,7 +4641,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewportID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxContentBufferSizeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, @@ -7625,6 +7625,7 @@ typedef NS_ENUM(uint32_t, MTRDeviceTypeIDType) { MTRDeviceTypeIDTypeHumiditySensorID MTR_NEWLY_AVAILABLE = 0x00000307, MTRDeviceTypeIDTypeEVSEID MTR_NEWLY_AVAILABLE = 0x0000050C, MTRDeviceTypeIDTypeDeviceEnergyManagementID MTR_NEWLY_AVAILABLE = 0x0000050D, + MTRDeviceTypeIDTypeWaterHeaterID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRDeviceTypeIDTypeElectricalSensorID MTR_NEWLY_AVAILABLE = 0x00000510, MTRDeviceTypeIDTypeControlBridgeID MTR_NEWLY_AVAILABLE = 0x00000840, MTRDeviceTypeIDTypeOnOffSensorID MTR_NEWLY_AVAILABLE = 0x00000850, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 08373371a7c5e2..ef41bc6487b379 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -7751,8 +7751,8 @@ result = @"RateDistortionTradeOffPoints"; break; - case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID: - result = @"MaxPreRollBufferSize"; + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxContentBufferSizeID: + result = @"MaxContentBufferSize"; break; case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index d9ca769e250aaa..111cab13f8af49 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6660,7 +6660,7 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeRateDistortionTradeOffPointsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeMaxContentBufferSizeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 0923caca7cead0..b473aed7020e46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19454,9 +19454,9 @@ - (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetIma return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID) params:params]; } -- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params +- (NSDictionary * _Nullable)readAttributeMaxContentBufferSizeWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID) params:params]; + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxContentBufferSizeID) params:params]; } - (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index f0530c41a54f00..b4ea67c2ed66fe 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -85,6 +85,7 @@ { 0x00000307, MTRDeviceTypeClass::Simple, "Humidity Sensor" }, { 0x0000050C, MTRDeviceTypeClass::Simple, "EVSE" }, { 0x0000050D, MTRDeviceTypeClass::Simple, "Device Energy Management" }, + { 0x0000050F, MTRDeviceTypeClass::Simple, "Water Heater" }, { 0x00000510, MTRDeviceTypeClass::Utility, "Electrical Sensor" }, { 0x00000840, MTRDeviceTypeClass::Simple, "Control Bridge" }, { 0x00000850, MTRDeviceTypeClass::Simple, "On/Off Sensor" }, diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 5fb3549a49216a..3fa4ff45449f89 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -4467,6 +4467,726 @@ - (void)test039_GetAllAttributesReport } } +- (void)test040_AttributeValueExpectationSatisfaction +{ + __auto_type * device = [MTRDevice deviceWithNodeID:kDeviceId deviceController:sController]; + + __auto_type * testData = @[ + @{ + @"expected" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + }, + @"observed" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7) + }, + // Equal unsigned integer should satisfy expectation. + @"expectedComparison" : @(YES), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + }, + @"observed" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(9), + }, + // Unequal unsigned integer should not satisfy expectation + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + }, + @"observed" : @ { + MTRTypeKey : MTRSignedIntegerValueType, + MTRValueKey : @(7), + }, + // A signed integer does not satisfy expectation for an unsigned integer. + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRNullValueType, + }, + @"observed" : @ { + MTRTypeKey : MTRNullValueType, + }, + // Null satisfies expectation for null. + @"expectedComparison" : @(YES), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + } + }, + ], + }, + // A longer list does not satisfy expectation for a shorter array. + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + } + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + ], + }, + // A shorter list does not satisfy expectation for a longer array. + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + ], + }, + // An observed array identical to an expected one satisfies the expectation. + @"expectedComparison" : @(YES), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + } + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + } + }, + ], + }, + // An array with entries in a different order does not satisfy the expectation. + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abc"), + }, + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abc"), + }, + }, + ], + }, + // A struct that has the same fields in the same order satisfiess the + // expectation. + @"expectedComparison" : @(YES), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abc"), + }, + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abcd"), + }, + }, + ], + }, + // A struct that has different fields in the same order does not + // satisfy the expectation. + @"expectedComparison" : @(NO), + }, + @{ + @"expected" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abc"), + }, + }, + ], + }, + @"observed" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("abc"), + }, + }, + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(6), + }, + }, + ], + }, + // A struct that has the same fields in a different order satisfies + // the expectation. + @"expectedComparison" : @(YES), + }, + ]; + + for (NSDictionary * test in testData) { + XCTAssertEqual([device _attributeDataValue:test[@"observed"] satisfiesValueExpectation:test[@"expected"]], [test[@"expectedComparison"] boolValue], + "observed: %@, expected: %@", test[@"observed"], test[@"expected"]); + } +} + +- (void)test041_AttributeDataValueValidation +{ + __auto_type * testData = @[ + @{ + @"input" : @ { + MTRTypeKey : MTRSignedIntegerValueType, + MTRValueKey : @(-5), + }, + // -5 is a valid signed integer. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRSignedIntegerValueType, + MTRValueKey : @ {}, + }, + // A dictionary is not a valid signed integer. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(7), + }, + // 7 is a valid unsigned integer. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @("abc"), + }, + // "abc" is not an unsigned integer. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRBooleanValueType, + MTRValueKey : @(YES), + }, + // YES is a boolean. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRBooleanValueType, + MTRValueKey : [NSData data], + }, + // NSData is not a boolean integer. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRFloatValueType, + MTRValueKey : @(8), + }, + // 8 is a valid float. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRFloatValueType, + MTRValueKey : @(8.5), + }, + // 8.5 is a valid float. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRFloatValueType, + MTRValueKey : @[], + }, + // An array is not a float. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRDoubleValueType, + MTRValueKey : @(180), + }, + // 180 is a valid double. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRDoubleValueType, + MTRValueKey : @(9.5), + }, + // 9.5 is a valid double. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRDoubleValueType, + MTRValueKey : [NSDate date], + }, + // A date is not a double. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRNullValueType, + }, + // This is a valid null value. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : @("def"), + }, + // "def" is a valid string. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRUTF8StringValueType, + MTRValueKey : [NSData data], + }, + // NSData is not a string. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTROctetStringValueType, + MTRValueKey : [NSData data], + }, + // NSData is an octet string. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTROctetStringValueType, + MTRValueKey : @(7), + }, + // 7 is not an octet string. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTROctetStringValueType, + MTRValueKey : @("abc"), + }, + // "abc" is not an octet string. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[], + }, + // This is a valid empty structure. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[], + }, + // This is a valid empty structure. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(7), + MTRDataKey : @ { + MTRTypeKey : MTRNullValueType + }, + }, + ], + }, + // This is a valid structure, one null field. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(1), + MTRDataKey : @ { + MTRTypeKey : MTRNullValueType + }, + }, + @{ + MTRContextTagKey : @(2), + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(9) + }, + }, + ], + }, + // This is a valid structure with two fields. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @(19), + }, + // 19 is not a structure. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRNullValueType + }, + }, + ], + }, + // Field does not have a context tag. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(7), + }, + ], + }, + // Field does not have a value. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(7), + MTRDataKey : @(5), + }, + ], + }, + // Field value is a number, not a data-value + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(7), + MTRDataKey : @[], + }, + ], + }, + // Field value is an array, not a data-value + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(7), + MTRDataKey : @ {}, + }, + ], + }, + // Field value is an invalid data-value + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @("abc"), + MTRDataKey : @ { + MTRTypeKey : MTRNullValueType + }, + }, + ], + }, + // Tag is not a number. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[], + }, + // This is a valid empty array. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRNullValueType + }, + }, + ], + }, + // This is an array with a single null value in it. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(8), + }, + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(10), + }, + }, + ], + }, + // This is an array with two integers in it. + @"valid" : @(YES), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(8), + }, + ], + }, + // This does not have a proper array-value in the array: missing MTRDataKey. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ @(7) ], + }, + // This does not have a proper array-value in the array: not a dictionary. + @"valid" : @(NO), + }, + @{ + @"input" : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ @{} ], + }, + // This does not have a proper array-value in the array: empty + // dictionary, so no MTRDataKey. + @"valid" : @(NO), + }, + ]; + + for (NSDictionary * test in testData) { + XCTAssertEqual(MTRDataValueDictionaryIsWellFormed(test[@"input"]), [test[@"valid"] boolValue], + "input: %@", test[@"input"]); + } +} + @end @interface MTRDeviceEncoderTests : XCTestCase diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h index 74a7dc280b1216..b00507d665a9f0 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h @@ -49,7 +49,6 @@ NS_ASSUME_NONNULL_BEGIN @end @interface MTRDevice (Test) -- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther; - (NSMutableArray *)arrayOfNumbersFromAttributeValue:(MTRDeviceDataValueDictionary)dataDictionary; - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration; @end diff --git a/src/lib/address_resolve/tool.cpp b/src/lib/address_resolve/tool.cpp index 53d01b4011806f..042f7c6f891753 100644 --- a/src/lib/address_resolve/tool.cpp +++ b/src/lib/address_resolve/tool.cpp @@ -147,7 +147,7 @@ extern "C" void StopSignalHandler(int signal) } // namespace -extern "C" int main(int argc, const char ** argv) +int main(int argc, const char ** argv) { Platform::MemoryInit(); diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index 6d901db16e95db..9380accce38e55 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -58,12 +58,12 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) // Used for posting the event in the BLE queue void BlePostEvent(SilabsBleWrapper::BleEvent_t * event); - void HandleConnectEvent(SilabsBleWrapper::sl_wfx_msg_t * evt); - void HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * evt); - void HandleWriteEvent(SilabsBleWrapper::sl_wfx_msg_t * evt); - void UpdateMtu(SilabsBleWrapper::sl_wfx_msg_t * evt); + void HandleConnectEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt); + void HandleConnectionCloseEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt); + void HandleWriteEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt); + void UpdateMtu(const SilabsBleWrapper::sl_wfx_msg_t & evt); void HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId); - void HandleTXCharCCCDWrite(SilabsBleWrapper::sl_wfx_msg_t * evt); + void HandleTXCharCCCDWrite(const SilabsBleWrapper::sl_wfx_msg_t & evt); void HandleSoftTimerEvent(void); int32_t SendBLEAdvertisementCommand(void); #else @@ -194,7 +194,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla #endif #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) - void HandleRXCharWrite(SilabsBleWrapper::sl_wfx_msg_t * evt); + void HandleRXCharWrite(const SilabsBleWrapper::sl_wfx_msg_t & evt); #else void HandleRXCharWrite(volatile sl_bt_msg_t * evt); #endif diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index a99ac5ea2908f9..cf60cf5c5892fe 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -36,8 +36,15 @@ extern "C" { #include "sl_event_handler.h" #include "sl_si91x_button.h" #include "sl_si91x_button_pin_config.h" +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED +#include "sl_si91x_rgb_led.h" +#include "sl_si91x_rgb_led_config.h" +#include "sl_si91x_rgb_led_instances.h" +#else #include "sl_si91x_led.h" #include "sl_si91x_led_config.h" +#include "sl_si91x_led_instances.h" +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED #if CHIP_CONFIG_ENABLE_ICD_SERVER == 0 void soc_pll_config(void); @@ -51,14 +58,15 @@ void soc_pll_config(void); #if SILABS_LOG_OUT_UART || ENABLE_CHIP_SHELL #include "uart.h" #endif -// TODO Remove this when SI91X-16606 is addressed -#ifdef SI917_DEVKIT -#define SL_LED_COUNT 1 -uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LEDB_PIN }; + +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED +#define SL_LED_COUNT SL_SI91X_RGB_LED_COUNT +const sl_rgb_led_t * ledPinArray[SL_LED_COUNT] = { &led_led0 }; +#define SL_RGB_LED_INSTANCE(n) (ledPinArray[n]) #else #define SL_LED_COUNT SL_SI91x_LED_COUNT uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LED0_PIN, SL_LED_LED1_PIN }; -#endif +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED namespace chip { namespace DeviceLayer { @@ -111,7 +119,11 @@ void SilabsPlatform::InitLed(void) CHIP_ERROR SilabsPlatform::SetLed(bool state, uint8_t led) { VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED + (state) ? sl_si91x_simple_rgb_led_on(SL_RGB_LED_INSTANCE(led)) : sl_si91x_simple_rgb_led_off(SL_RGB_LED_INSTANCE(led)); +#else (state) ? sl_si91x_led_set(ledPinArray[led]) : sl_si91x_led_clear(ledPinArray[led]); +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED return CHIP_NO_ERROR; } @@ -124,7 +136,11 @@ bool SilabsPlatform::GetLedState(uint8_t led) CHIP_ERROR SilabsPlatform::ToggleLed(uint8_t led) { VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED + sl_si91x_simple_rgb_led_toggle(SL_RGB_LED_INSTANCE(led)); +#else sl_si91x_led_toggle(ledPinArray[led]); +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED return CHIP_NO_ERROR; } #endif // ENABLE_WSTK_LEDS diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 44b2a17199b330..176f396f44cd1f 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -57,24 +57,7 @@ extern "C" { #define BLE_TIMEOUT_MS 400 #define BLE_SEND_INDICATION_TIMER_PERIOD_MS (5000) -// Used to send the Indication Confirmation -uint8_t dev_address[RSI_DEV_ADDR_LEN]; -uint16_t ble_measurement_hndl; - osSemaphoreId_t sl_rs_ble_init_sem; -osTimerId_t sbleAdvTimeoutTimer; - -static osThreadId_t sBleThread; -constexpr uint32_t kBleTaskSize = 2048; -static uint8_t bleStack[kBleTaskSize]; -static osThread_t sBleTaskControlBlock; -constexpr osThreadAttr_t kBleTaskAttr = { .name = "rsi_ble", - .attr_bits = osThreadDetached, - .cb_mem = &sBleTaskControlBlock, - .cb_size = osThreadCbSize, - .stack_mem = bleStack, - .stack_size = kBleTaskSize, - .priority = osPriorityHigh }; using namespace ::chip; using namespace ::chip::Ble; @@ -111,6 +94,84 @@ const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00 0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 }; const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF }; +// Used to send the Indication Confirmation +uint8_t dev_address[RSI_DEV_ADDR_LEN]; +uint16_t rsi_ble_measurement_hndl; +uint16_t rsi_ble_gatt_server_client_config_hndl; + +osTimerId_t sbleAdvTimeoutTimer; + +osThreadId_t sBleThread; +constexpr uint32_t kBleTaskSize = 2560; +uint8_t bleStack[kBleTaskSize]; +osThread_t sBleTaskControlBlock; +constexpr osThreadAttr_t kBleTaskAttr = { .name = "rsi_ble", + .attr_bits = osThreadDetached, + .cb_mem = &sBleTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = bleStack, + .stack_size = kBleTaskSize, + .priority = osPriorityHigh }; + +void rsi_ble_add_matter_service(void) +{ + constexpr uuid_t custom_service = { .size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE, + .val = { .val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16 } }; + uint8_t data[RSI_BLE_MATTER_CUSTOM_SERVICE_DATA_LENGTH] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; + + constexpr uuid_t custom_characteristic_RX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE, + .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED }, + .val = { .val128 = { + .data1 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_1 }, + .data2 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_2 }, + .data3 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_3 }, + .data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_4 } } } }; + + rsi_ble_resp_add_serv_t new_serv_resp = { 0 }; + rsi_ble_add_service(custom_service, &new_serv_resp); + + // Adding custom characteristic declaration to the custom service + SilabsBleWrapper::rsi_ble_add_char_serv_att( + new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION, + RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, custom_characteristic_RX); + + // Adding characteristic value attribute to the service + SilabsBleWrapper::rsi_ble_add_char_val_att( + new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, + custom_characteristic_RX, + RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response + data, sizeof(data), ATT_REC_IN_HOST); + + constexpr uuid_t custom_characteristic_TX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE, + .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_RESERVED }, + .val = { .val128 = { + .data1 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_1 }, + .data2 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_2 }, + .data3 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_3 }, + .data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_4 } } } }; + + // Adding custom characteristic declaration to the custom service + SilabsBleWrapper::rsi_ble_add_char_serv_att( + new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION, + RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ | + RSI_BLE_ATT_PROPERTY_NOTIFY | RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION, custom_characteristic_TX); + + // Adding characteristic value attribute to the service + rsi_ble_measurement_hndl = new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION; + + // Adding characteristic value attribute to the service + rsi_ble_gatt_server_client_config_hndl = + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION; + + SilabsBleWrapper::rsi_ble_add_char_val_att(new_serv_resp.serv_handler, rsi_ble_measurement_hndl, custom_characteristic_TX, + RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | + RSI_BLE_ATT_PROPERTY_READ | RSI_BLE_ATT_PROPERTY_NOTIFY | + RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response + data, sizeof(data), ATT_REC_MAINTAIN_IN_HOST); +} + } // namespace BLEManagerImpl BLEManagerImpl::sInstance; @@ -120,15 +181,14 @@ void BLEManagerImpl::ProcessEvent(SilabsBleWrapper::BleEvent_t inEvent) switch (inEvent.eventType) { case SilabsBleWrapper::BleEventType::RSI_BLE_CONN_EVENT: { - BLEMgrImpl().HandleConnectEvent((inEvent.eventData)); + BLEMgrImpl().HandleConnectEvent(inEvent.eventData); // Requests the connection parameters change with the remote device - rsi_ble_conn_params_update(inEvent.eventData->resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS, + rsi_ble_conn_params_update(inEvent.eventData.resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS, BLE_MAX_CONNECTION_INTERVAL_MS, BLE_SLAVE_LATENCY_MS, BLE_TIMEOUT_MS); - rsi_ble_set_data_len(inEvent.eventData->resp_enh_conn.dev_addr, RSI_BLE_TX_OCTETS, RSI_BLE_TX_TIME); + rsi_ble_set_data_len(inEvent.eventData.resp_enh_conn.dev_addr, RSI_BLE_TX_OCTETS, RSI_BLE_TX_TIME); // Used to send the Indication confirmation - memcpy(dev_address, inEvent.eventData->resp_enh_conn.dev_addr, RSI_DEV_ADDR_LEN); - ble_measurement_hndl = inEvent.eventData->rsi_ble_measurement_hndl; + memcpy(dev_address, inEvent.eventData.resp_enh_conn.dev_addr, RSI_DEV_ADDR_LEN); } break; case SilabsBleWrapper::BleEventType::RSI_BLE_DISCONN_EVENT: { @@ -143,7 +203,7 @@ void BLEManagerImpl::ProcessEvent(SilabsBleWrapper::BleEvent_t inEvent) break; case SilabsBleWrapper::BleEventType::RSI_BLE_EVENT_GATT_RD: { #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - if (inEvent.eventData->rsi_ble_read_req->type == 0) + if (inEvent.eventData.rsi_ble_read_req->type == 0) { BLEMgrImpl().HandleC3ReadRequest(inEvent.eventData); } @@ -220,10 +280,10 @@ void BLEManagerImpl::sl_ble_init() SilabsBleWrapper::rsi_ble_on_event_indication_confirmation, NULL); // Exchange of GATT info with BLE stack - SilabsBleWrapper::rsi_ble_add_matter_service(); + rsi_ble_add_matter_service(); rsi_ble_set_random_address_with_value(randomAddrBLE); - sInstance.sBleEventQueue = osMessageQueueNew(WFX_QUEUE_SIZE, sizeof(WfxEvent_t), NULL); + sInstance.sBleEventQueue = osMessageQueueNew(WFX_QUEUE_SIZE, sizeof(SilabsBleWrapper::BleEvent_t), NULL); VerifyOrDie(sInstance.sBleEventQueue != nullptr); chip::DeviceLayer::Internal::BLEMgrImpl().HandleBootEvent(); @@ -440,7 +500,7 @@ CHIP_ERROR BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const Chi PacketBufferHandle data) { int32_t status = 0; - status = rsi_ble_indicate_value(dev_address, ble_measurement_hndl, data->DataLength(), data->Start()); + status = rsi_ble_indicate_value(dev_address, rsi_ble_measurement_hndl, data->DataLength(), data->Start()); if (status != RSI_SUCCESS) { ChipLogProgress(DeviceLayer, "indication failed with error code %lx ", status); @@ -734,9 +794,9 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return err; } -void BLEManagerImpl::UpdateMtu(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::UpdateMtu(const SilabsBleWrapper::sl_wfx_msg_t & evt) { - CHIPoBLEConState * bleConnState = GetConnectionState(evt->connectionHandle); + CHIPoBLEConState * bleConnState = GetConnectionState(evt.connectionHandle); if (bleConnState != NULL) { // bleConnState->MTU is a 10-bit field inside a uint16_t. We're @@ -748,10 +808,10 @@ void BLEManagerImpl::UpdateMtu(SilabsBleWrapper::sl_wfx_msg_t * evt) // TODO: https://github.com/project-chip/connectedhomeip/issues/2569 // tracks making this safe with a check or explaining why no check // is needed. - ChipLogProgress(DeviceLayer, "DriveBLEState UpdateMtu %d", evt->rsi_ble_mtu.mtu_size); + ChipLogProgress(DeviceLayer, "DriveBLEState UpdateMtu %d", evt.rsi_ble_mtu.mtu_size); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" - bleConnState->mtu = evt->rsi_ble_mtu.mtu_size; + bleConnState->mtu = evt.rsi_ble_mtu.mtu_size; #pragma GCC diagnostic pop ; } @@ -763,14 +823,13 @@ void BLEManagerImpl::HandleBootEvent(void) PlatformMgr().ScheduleWork(DriveBLEState, 0); } -void BLEManagerImpl::HandleConnectEvent(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleConnectEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt) { - AddConnection(evt->connectionHandle, evt->bondingHandle); + AddConnection(evt.connectionHandle, evt.bondingHandle); PlatformMgr().ScheduleWork(DriveBLEState, 0); } -// TODO:: Implementation need to be done. -void BLEManagerImpl::HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleConnectionCloseEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt) { uint8_t connHandle = 1; @@ -780,7 +839,7 @@ void BLEManagerImpl::HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * event.Type = DeviceEventType::kCHIPoBLEConnectionError; event.CHIPoBLEConnectionError.ConId = connHandle; - switch (evt->reason) + switch (evt.reason) { case RSI_BT_CTRL_REMOTE_USER_TERMINATED: @@ -792,7 +851,7 @@ void BLEManagerImpl::HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; } - ChipLogProgress(DeviceLayer, "BLE GATT connection closed (con %u, reason %x)", connHandle, evt->reason); + ChipLogProgress(DeviceLayer, "BLE GATT connection closed (con %u, reason %x)", connHandle, evt.reason); PlatformMgr().PostEventOrDie(&event); @@ -804,11 +863,11 @@ void BLEManagerImpl::HandleConnectionCloseEvent(SilabsBleWrapper::sl_wfx_msg_t * } } -void BLEManagerImpl::HandleWriteEvent(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleWriteEvent(const SilabsBleWrapper::sl_wfx_msg_t & evt) { - ChipLogProgress(DeviceLayer, "Char Write Req, packet type %d", evt->rsi_ble_write.pkt_type); + ChipLogProgress(DeviceLayer, "Char Write Req, packet type %d", evt.rsi_ble_write.pkt_type); - if (evt->rsi_ble_write.handle[0] == (uint8_t) evt->rsi_ble_gatt_server_client_config_hndl) // TODO:: compare the handle exactly + if (evt.rsi_ble_write.handle[0] == (uint8_t) rsi_ble_gatt_server_client_config_hndl) // TODO:: compare the handle exactly { HandleTXCharCCCDWrite(evt); } @@ -818,23 +877,22 @@ void BLEManagerImpl::HandleWriteEvent(SilabsBleWrapper::sl_wfx_msg_t * evt) } } -// TODO:: Need to implement this -void BLEManagerImpl::HandleTXCharCCCDWrite(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleTXCharCCCDWrite(const SilabsBleWrapper::sl_wfx_msg_t & evt) { CHIP_ERROR err = CHIP_NO_ERROR; bool isIndicationEnabled = false; ChipDeviceEvent event; CHIPoBLEConState * bleConnState; - bleConnState = GetConnectionState(evt->connectionHandle); + bleConnState = GetConnectionState(evt.connectionHandle); VerifyOrExit(bleConnState != NULL, err = CHIP_ERROR_NO_MEMORY); // Determine if the client is enabling or disabling notification/indication. - if (evt->rsi_ble_write.att_value[0] != 0) + if (evt.rsi_ble_write.att_value[0] != 0) { isIndicationEnabled = true; } - ChipLogProgress(DeviceLayer, "HandleTXcharCCCDWrite - Config Flags value : %d", evt->rsi_ble_write.att_value[0]); + ChipLogProgress(DeviceLayer, "HandleTXcharCCCDWrite - Config Flags value : %d", evt.rsi_ble_write.att_value[0]); ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isIndicationEnabled ? "subscribe" : "unsubscribe"); if (isIndicationEnabled) @@ -864,13 +922,13 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(SilabsBleWrapper::sl_wfx_msg_t * evt) } } -void BLEManagerImpl::HandleRXCharWrite(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleRXCharWrite(const SilabsBleWrapper::sl_wfx_msg_t & evt) { uint8_t conId = 1; CHIP_ERROR err = CHIP_NO_ERROR; System::PacketBufferHandle buf; - uint16_t writeLen = evt->rsi_ble_write.length; - uint8_t * data = (uint8_t *) evt->rsi_ble_write.att_value; + uint16_t writeLen = evt.rsi_ble_write.length; + uint8_t * data = (uint8_t *) evt.rsi_ble_write.att_value; // Copy the data to a packet buffer. buf = System::PacketBufferHandle::NewWithData(data, writeLen, 0, 0); @@ -997,9 +1055,9 @@ CHIP_ERROR BLEManagerImpl::EncodeAdditionalDataTlv() return err; } -void BLEManagerImpl::HandleC3ReadRequest(SilabsBleWrapper::sl_wfx_msg_t * evt) +void BLEManagerImpl::HandleC3ReadRequest(const SilabsBleWrapper::sl_wfx_msg_t & evt) { - sl_status_t ret = rsi_ble_gatt_read_response(evt->rsi_ble_read_req->dev_addr, GATT_READ_RESP, evt->rsi_ble_read_req->handle, + sl_status_t ret = rsi_ble_gatt_read_response(evt.rsi_ble_read_req->dev_addr, GATT_READ_RESP, evt.rsi_ble_read_req->handle, GATT_READ_ZERO_OFFSET, sInstance.c3AdditionalDataBufferHandle->DataLength(), sInstance.c3AdditionalDataBufferHandle->Start()); if (ret != SL_STATUS_OK) diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index de207a99af1601..f508c3396f4e09 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -232,7 +232,6 @@ //! Scan types #define SCAN_TYPE_ACTIVE (0x01) -#define SCAN_TYPE_PASSIVE (0x00) //! Scan filters #define SCAN_FILTER_TYPE_ALL (0x00) @@ -267,15 +266,22 @@ (SL_SI91X_TCP_IP_FEAT_DHCPV4_CLIENT) //! TCP/IP feature select bitmap for selecting TCP/IP features #define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map +// Enable front-end internal switch control for ACX module boards +#if (SL_SI91X_ACX_MODULE == 1) +#define FRONT_END_SWITCH_CTRL SL_SI91X_EXT_FEAT_FRONT_END_INTERNAL_SWITCH +#else +#define FRONT_END_SWITCH_CTRL SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0 +#endif + #ifdef SLI_SI917 #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION // Adding Support for WPA3 transition #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ - SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0 | SL_SI91X_EXT_FEAT_IEEE_80211W) + FRONT_END_SWITCH_CTRL | SL_SI91X_EXT_FEAT_IEEE_80211W) #else #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ - SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0) + FRONT_END_SWITCH_CTRL) #endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */ #else // EXP_BOARD #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)) diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.cpp b/src/platform/silabs/rs911x/wfx_sl_ble_init.cpp index c1af13e2cd807c..971852592c3e2e 100644 --- a/src/platform/silabs/rs911x/wfx_sl_ble_init.cpp +++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.cpp @@ -26,9 +26,6 @@ using namespace chip::DeviceLayer::Internal; -// Global Variables -SilabsBleWrapper::BleEvent_t bleEvent; - /*==============================================*/ /** * @fn rsi_ble_on_mtu_event @@ -40,8 +37,9 @@ SilabsBleWrapper::BleEvent_t bleEvent; */ void SilabsBleWrapper::rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu) { - bleEvent.eventType = BleEventType::RSI_BLE_MTU_EVENT; - memcpy(&bleEvent.eventData->rsi_ble_mtu, rsi_ble_mtu, sizeof(rsi_ble_event_mtu_t)); + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_MTU_EVENT, + .eventData = { .connectionHandle = 1, .rsi_ble_mtu = *rsi_ble_mtu } }; + BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -57,9 +55,9 @@ void SilabsBleWrapper::rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu) */ void SilabsBleWrapper::rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write) { - bleEvent.eventType = BleEventType::RSI_BLE_GATT_WRITE_EVENT; - bleEvent.eventData->event_id = event_id; - memcpy(&bleEvent.eventData->rsi_ble_write, rsi_ble_write, sizeof(rsi_ble_event_write_t)); + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_GATT_WRITE_EVENT, + .eventData = { + .connectionHandle = 1, .event_id = event_id, .rsi_ble_write = *rsi_ble_write } }; BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -74,10 +72,12 @@ void SilabsBleWrapper::rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_ev */ void SilabsBleWrapper::rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn) { - bleEvent.eventType = BleEventType::RSI_BLE_CONN_EVENT; - bleEvent.eventData->connectionHandle = 1; - bleEvent.eventData->bondingHandle = 255; - memcpy(bleEvent.eventData->resp_enh_conn.dev_addr, resp_enh_conn->dev_addr, RSI_DEV_ADDR_LEN); + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_CONN_EVENT, + .eventData = { + .connectionHandle = 1, + .bondingHandle = 255, + } }; + memcpy(bleEvent.eventData.resp_enh_conn.dev_addr, resp_enh_conn->dev_addr, RSI_DEV_ADDR_LEN); BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -93,8 +93,7 @@ void SilabsBleWrapper::rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhanc */ void SilabsBleWrapper::rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason) { - bleEvent.eventType = BleEventType::RSI_BLE_DISCONN_EVENT; - bleEvent.eventData->reason = reason; + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_DISCONN_EVENT, .eventData = { .reason = reason } }; BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -110,9 +109,9 @@ void SilabsBleWrapper::rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * void SilabsBleWrapper::rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp) { - bleEvent.eventType = BleEventType::RSI_BLE_GATT_INDICATION_CONFIRMATION; - bleEvent.eventData->resp_status = resp_status; - memcpy(&bleEvent.eventData->rsi_ble_event_set_att_rsp, rsi_ble_event_set_att_rsp, sizeof(rsi_ble_set_att_resp_t)); + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_GATT_INDICATION_CONFIRMATION, + .eventData = { .resp_status = resp_status, + .rsi_ble_event_set_att_rsp = *rsi_ble_event_set_att_rsp } }; BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -128,9 +127,8 @@ void SilabsBleWrapper::rsi_ble_on_event_indication_confirmation(uint16_t resp_st */ void SilabsBleWrapper::rsi_ble_on_read_req_event(uint16_t event_id, rsi_ble_read_req_t * rsi_ble_read_req) { - bleEvent.eventType = BleEventType::RSI_BLE_EVENT_GATT_RD; - bleEvent.eventData->event_id = event_id; - memcpy(&bleEvent.eventData->rsi_ble_read_req, rsi_ble_read_req, sizeof(rsi_ble_read_req_t)); + SilabsBleWrapper::BleEvent_t bleEvent = { .eventType = BleEventType::RSI_BLE_EVENT_GATT_RD, + .eventData = { .event_id = event_id, .rsi_ble_read_req = rsi_ble_read_req } }; BLEMgrImpl().BlePostEvent(&bleEvent); } @@ -282,77 +280,3 @@ void SilabsBleWrapper::rsi_ble_add_char_val_att(void * serv_handler, uint16_t ha return; } - -/*==============================================*/ -/** - * @fn rsi_ble_add_matter_service - * @brief this function is used to add service for matter - * @return status (uint32_t) 0 for success. - * @section description - * This function is used at application to create new service. - */ - -uint32_t SilabsBleWrapper::rsi_ble_add_matter_service(void) -{ - uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; - custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; - custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; - uint8_t data[RSI_BLE_MATTER_CUSTOM_SERVICE_DATA_LENGTH] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; - - static const uuid_t custom_characteristic_RX = { - .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE, - .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED }, - .val = { .val128 = { .data1 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_1 }, - .data2 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_2 }, - .data3 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_3 }, - .data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_4 } } } - }; - - rsi_ble_resp_add_serv_t new_serv_resp = { 0 }; - rsi_ble_add_service(custom_service, &new_serv_resp); - - // Adding custom characteristic declaration to the custom service - rsi_ble_add_char_serv_att( - new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION, - RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response - new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, custom_characteristic_RX); - - // Adding characteristic value attribute to the service - rsi_ble_add_char_val_att(new_serv_resp.serv_handler, - new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, custom_characteristic_RX, - RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response - data, sizeof(data), ATT_REC_IN_HOST); - - static const uuid_t custom_characteristic_TX = { - .size = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE, - .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_RESERVED }, - .val = { .val128 = { .data1 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_1 }, - .data2 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_2 }, - .data3 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_3 }, - .data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_4 } } } - }; - - // Adding custom characteristic declaration to the custom service - rsi_ble_add_char_serv_att( - new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION, - RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ | - RSI_BLE_ATT_PROPERTY_NOTIFY | RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response - new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION, custom_characteristic_TX); - - // Adding characteristic value attribute to the service - bleEvent.eventData->rsi_ble_measurement_hndl = - new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION; - - // Adding characteristic value attribute to the service - bleEvent.eventData->rsi_ble_gatt_server_client_config_hndl = - new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION; - - rsi_ble_add_char_val_att(new_serv_resp.serv_handler, bleEvent.eventData->rsi_ble_measurement_hndl, custom_characteristic_TX, - RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ | - RSI_BLE_ATT_PROPERTY_NOTIFY | - RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response - data, sizeof(data), ATT_REC_MAINTAIN_IN_HOST); - - memset(&data, 0, sizeof(data)); - return 0; -} diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.h b/src/platform/silabs/rs911x/wfx_sl_ble_init.h index 1e770de0727100..54351674ef121e 100644 --- a/src/platform/silabs/rs911x/wfx_sl_ble_init.h +++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.h @@ -104,15 +104,13 @@ class SilabsBleWrapper rsi_ble_event_disconnect_t * resp_disconnect; rsi_ble_read_req_t * rsi_ble_read_req; rsi_ble_set_att_resp_t rsi_ble_event_set_att_rsp; - uint16_t rsi_ble_measurement_hndl; - uint16_t rsi_ble_gatt_server_client_config_hndl; uint16_t subscribed; }; struct BleEvent_t { BleEventType eventType; - sl_wfx_msg_t * eventData; + sl_wfx_msg_t eventData; }; // ALL Ble functions @@ -129,7 +127,6 @@ class SilabsBleWrapper uuid_t att_val_uuid); static void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data, uint8_t data_len, uint8_t auth_read); - static uint32_t rsi_ble_add_matter_service(void); }; } // namespace Internal diff --git a/src/platform/silabs/wifi/wfx_host_events.h b/src/platform/silabs/wifi/wfx_host_events.h index de1759951c86a1..3bd973467bf915 100644 --- a/src/platform/silabs/wifi/wfx_host_events.h +++ b/src/platform/silabs/wifi/wfx_host_events.h @@ -147,12 +147,13 @@ typedef enum /* Note that these are same as RSI_security */ typedef enum { - WFX_SEC_UNSPECIFIED = 0, - WFX_SEC_NONE = 1, - WFX_SEC_WEP = 2, - WFX_SEC_WPA = 3, - WFX_SEC_WPA2 = 4, - WFX_SEC_WPA3 = 5, + WFX_SEC_UNSPECIFIED = 0, + WFX_SEC_NONE = 1, + WFX_SEC_WEP = 2, + WFX_SEC_WPA = 3, + WFX_SEC_WPA2 = 4, + WFX_SEC_WPA3 = 5, + WFX_SEC_WPA_WPA2_MIXED = 6, } wfx_sec_t; typedef struct diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index 638b99624bae6c..4bf1aa55217c57 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -232,7 +232,15 @@ CHIP_ERROR PASESession::Pair(SessionManager & sessionManager, uint32_t peerSetUp exit: if (err != CHIP_NO_ERROR) { + // If a failure happens before we have placed the incoming exchange into `mExchangeCtxt`, we need to make + // sure to close the exchange to fulfill our API contract. + if (!mExchangeCtxt.HasValue()) + { + exchangeCtxt->Close(); + } Clear(); + ChipLogError(SecureChannel, "Failed during PASE session pairing request: %" CHIP_ERROR_FORMAT, err.Format()); + MATTER_TRACE_COUNTER("PASEFail"); } return err; } diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index 2e731283c88aa8..92b4ee3d8b991c 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -99,6 +99,8 @@ class DLL_EXPORT PASESession : public Messaging::UnsolicitedMessageHandler, * ownership of the exchangeCtxt to PASESession object. PASESession * will close the exchange on (successful/failed) handshake completion. * @param delegate Callback object + * The delegate will be notified if and only if Pair() returns success. Errors occurring after Pair() + * returns success will be reported via the delegate. * * @return CHIP_ERROR The result of initialization */ diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 2868d9548f7733..1672eb65af2a51 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -54,16 +54,16 @@ async def write_acl(self, acl): asserts.assert_equal(result[0].Status, Status.Success, "ACL write failed") print(result) - async def read_descriptor_expect_success(self, th, endpoint: int): + async def read_descriptor_expect_success(self, th): cluster = Clusters.Objects.Descriptor attribute = Clusters.Descriptor.Attributes.DeviceTypeList - await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=endpoint, cluster=cluster, attribute=attribute) + await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute) - async def read_descriptor_expect_unsupported_access(self, th, endpoint: int): + async def read_descriptor_expect_unsupported_access(self, th): cluster = Clusters.Objects.Descriptor attribute = Clusters.Descriptor.Attributes.DeviceTypeList await self.read_single_attribute_expect_error( - dev_ctrl=th, endpoint=endpoint, cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess) + dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess) def desc_TC_ACE_1_3(self) -> str: return "[TC-ACE-1.3] Subjects" @@ -144,8 +144,6 @@ async def test_TC_ACE_1_3(self): cat2v3 = cat2_id | 0x0003 logging.info('cat1v1 0x%x', cat1v1) - endpoint = 0 - self.step(1) fabric_admin = self.certificate_authority_manager.activeCaList[0].adminList[0] @@ -165,266 +163,266 @@ async def test_TC_ACE_1_3(self): paaTrustStorePath=str(self.matter_test_config.paa_trust_store_path), catTags=[cat1v1, cat2v2]) - self.step(2, endpoint) + self.step(2) TH0_admin_acl = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH0_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint, cluster=0x001f)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0, cluster=0x001f)]) all_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, all_view] await self.write_acl(acl) - self.step(3, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(3) + await self.read_descriptor_expect_success(TH1) - self.step(4, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(4) + await self.read_descriptor_expect_success(TH2) - self.step(5, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(5) + await self.read_descriptor_expect_success(TH3) - self.step(6, endpoint) + self.step(6) th1_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH1_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th1_view] await self.write_acl(acl) - self.step(7, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(7) + await self.read_descriptor_expect_success(TH1) - self.step(8, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(8) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(9, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(9) + await self.read_descriptor_expect_unsupported_access(TH3) - self.step(10, endpoint) + self.step(10) th2_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH2_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th2_view] await self.write_acl(acl) - self.step(11, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(11) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(12, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(12) + await self.read_descriptor_expect_success(TH2) - self.step(13, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(13) + await self.read_descriptor_expect_unsupported_access(TH3) - self.step(14, endpoint) + self.step(14) th3_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH3_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th3_view] await self.write_acl(acl) - self.step(15, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(15) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(16, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(16) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(17, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(17) + await self.read_descriptor_expect_success(TH3) - self.step(18, endpoint) + self.step(18) th12_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH1_nodeid, TH2_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th12_view] await self.write_acl(acl) - self.step(19, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(19) + await self.read_descriptor_expect_success(TH1) - self.step(20, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(20) + await self.read_descriptor_expect_success(TH2) - self.step(21, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(21) + await self.read_descriptor_expect_unsupported_access(TH3) - self.step(22, endpoint) + self.step(22) th13_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH1_nodeid, TH3_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th13_view] await self.write_acl(acl) - self.step(23, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(23) + await self.read_descriptor_expect_success(TH1) - self.step(24, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(24) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(25, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(25) + await self.read_descriptor_expect_success(TH3) - self.step(26, endpoint) + self.step(26) th23_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH2_nodeid, TH3_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th23_view] await self.write_acl(acl) - self.step(27, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(27) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(28, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(28) + await self.read_descriptor_expect_success(TH2) - self.step(29, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(29) + await self.read_descriptor_expect_success(TH3) - self.step(30, endpoint) + self.step(30) th123_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[TH1_nodeid, TH2_nodeid, TH3_nodeid], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, th123_view] await self.write_acl(acl) - self.step(31, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(31) + await self.read_descriptor_expect_success(TH1) - self.step(32, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(32) + await self.read_descriptor_expect_success(TH2) - self.step(33, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(33) + await self.read_descriptor_expect_success(TH3) - self.step(34, endpoint) + self.step(34) cat1v1_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat1v1)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat1v1_view] await self.write_acl(acl) - self.step(35, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(35) + await self.read_descriptor_expect_success(TH1) - self.step(36, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(36) + await self.read_descriptor_expect_success(TH2) - self.step(37, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(37) + await self.read_descriptor_expect_success(TH3) - self.step(38, endpoint) + self.step(38) cat1v2_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat1v2)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat1v2_view] await self.write_acl(acl) - self.step(39, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(39) + await self.read_descriptor_expect_success(TH1) - self.step(40, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(40) + await self.read_descriptor_expect_success(TH2) - self.step(41, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(41) + await self.read_descriptor_expect_unsupported_access(TH3) - self.step(42, endpoint) + self.step(42) cat1v3_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat1v3)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat1v3_view] await self.write_acl(acl) - self.step(43, endpoint) - await self.read_descriptor_expect_success(TH1, endpoint) + self.step(43) + await self.read_descriptor_expect_success(TH1) - self.step(44, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(44) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(45, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(45) + await self.read_descriptor_expect_unsupported_access(TH3) - self.step(46, endpoint) + self.step(46) cat2v1_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat2v1)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat2v1_view] await self.write_acl(acl) - self.step(47, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(47) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(48, endpoint) - await self.read_descriptor_expect_success(TH2, endpoint) + self.step(48) + await self.read_descriptor_expect_success(TH2) - self.step(49, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(49) + await self.read_descriptor_expect_success(TH3) - self.step(50, endpoint) + self.step(50) cat2v2_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat2v2)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat2v2_view] await self.write_acl(acl) - self.step(51, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(51) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(52, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(52) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(53, endpoint) - await self.read_descriptor_expect_success(TH3, endpoint) + self.step(53) + await self.read_descriptor_expect_success(TH3) - self.step(54, endpoint) + self.step(54) cat2v3_view = Clusters.AccessControl.Structs.AccessControlEntryStruct( privilege=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, authMode=Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase, subjects=[acl_subject(cat2v3)], - targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=endpoint)]) + targets=[Clusters.AccessControl.Structs.AccessControlTargetStruct(endpoint=0)]) acl = [TH0_admin_acl, cat2v3_view] await self.write_acl(acl) - self.step(55, endpoint) - await self.read_descriptor_expect_unsupported_access(TH1, endpoint) + self.step(55) + await self.read_descriptor_expect_unsupported_access(TH1) - self.step(56, endpoint) - await self.read_descriptor_expect_unsupported_access(TH2, endpoint) + self.step(56) + await self.read_descriptor_expect_unsupported_access(TH2) - self.step(57, endpoint) - await self.read_descriptor_expect_unsupported_access(TH3, endpoint) + self.step(57) + await self.read_descriptor_expect_unsupported_access(TH3) self.step(58) diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 2e90245f479d3d..2456457ce26ae7 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -81,12 +81,12 @@ async def test_TC_BOOLCFG_2_1(self): self.step(1) attributes = Clusters.BooleanStateConfiguration.Attributes - self.step(2, endpoint) + self.step(2) attribute_list = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) number_of_supported_levels = 0 - self.step(3, endpoint) + self.step(3) if attributes.SupportedSensitivityLevels.attribute_id in attribute_list: number_of_supported_levels = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.SupportedSensitivityLevels) asserts.assert_less_equal(number_of_supported_levels, 10, "SupportedSensitivityLevels attribute is out of range") @@ -94,7 +94,7 @@ async def test_TC_BOOLCFG_2_1(self): else: logging.info("Test step skipped") - self.step(4, endpoint) + self.step(4) if attributes.CurrentSensitivityLevel.attribute_id in attribute_list: current_sensitivity_level_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.CurrentSensitivityLevel) asserts.assert_less_equal(current_sensitivity_level_dut, number_of_supported_levels, @@ -102,7 +102,7 @@ async def test_TC_BOOLCFG_2_1(self): else: logging.info("Test step skipped") - self.step(5, endpoint) + self.step(5) if attributes.DefaultSensitivityLevel.attribute_id in attribute_list: default_sensitivity_level_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultSensitivityLevel) asserts.assert_less_equal(default_sensitivity_level_dut, number_of_supported_levels, @@ -110,35 +110,35 @@ async def test_TC_BOOLCFG_2_1(self): else: logging.info("Test step skipped") - self.step(6, endpoint) + self.step(6) if attributes.AlarmsActive.attribute_id in attribute_list: alarms_active_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsActive) asserts.assert_equal(alarms_active_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsActive is not in valid range") else: logging.info("Test step skipped") - self.step(7, endpoint) + self.step(7) if attributes.AlarmsSuppressed.attribute_id in attribute_list: alarms_suppressed_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsSuppressed) asserts.assert_equal(alarms_suppressed_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsSuppressed is not in valid range") else: logging.info("Test step skipped") - self.step(8, endpoint) + self.step(8) if attributes.AlarmsEnabled.attribute_id in attribute_list: alarms_enabled_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsEnabled) asserts.assert_equal(alarms_enabled_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsEnabled is not in valid range") else: logging.info("Test step skipped") - self.step(9, endpoint) + self.step(9) if attributes.AlarmsSupported.attribute_id in attribute_list: alarms_supported_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsSupported) asserts.assert_equal(alarms_supported_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsSupported is not in valid range") else: logging.info("Test step skipped") - self.step(10, endpoint) + self.step(10) if attributes.SensorFault.attribute_id in attribute_list: sensor_fault_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.SensorFault) asserts.assert_equal(sensor_fault_dut & ~all_sensor_fault_bitmap_bits, 0, "SensorFault is not in valid range") diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 59182fa4e2fcb2..0f227c2c672ea4 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -108,7 +108,8 @@ from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import AttributeIdType, ClusterIdType, GlobalAttributeIds, attribute_id_type, cluster_id_type +from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, CommandIdType, GlobalAttributeIds, attribute_id_type, + cluster_id_type, command_id_type) from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, async_test_body, default_matter_test_main) from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, @@ -503,7 +504,7 @@ class RequiredMandatoryAttribute: location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad_cmd_id) vendor_id = get_vendor_id(bad_cmd_id) self.record_error(self.get_test_name( - ), location=location, problem=f'Command 0x{bad_cmd_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}', spec_location='Manufacturer Extensible Identifier (MEI)') + ), location=location, problem=f'Command 0x{bad_cmd_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}' + (' (Test Vendor)' if command_id_type(bad_cmd_id) == CommandIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)') success = False self.print_step(7, "Validate that none of the MEI global attribute IDs contain values outside of the allowed suffix range") diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index eda01ef9556493..c86d4bfe6d0d0b 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,9 +15,9 @@ # limitations under the License. # -from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, - is_valid_device_type_id) +from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, CommandIdType, DeviceTypeIdType, attribute_id_type, + cluster_id_type, command_id_type, device_type_id_type, is_valid_attribute_id, + is_valid_cluster_id, is_valid_command_id, is_valid_device_type_id) from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from mobly import asserts @@ -210,6 +210,71 @@ def check_all_bad(id): for id in prefix_bad: check_all_bad(id) + def test_command_ids(self): + standard_global_good = [0x0000_00E0, 0x0000_00FF, 0x0000_00E1, 0x0000_00FE] + standard_global_bad = [0x0000_01E0, 0x0000_0FFF, 0x0000_AAE1, 0x0000_BBFE, 0x0000_FFFF] + scoped_non_global_good = [0x0000_0000, 0x0000_00DF, 0x0000_0001] + scoped_non_global_bad = [0x0000_0F00, 0x0000_01DF, 0x0000_0F01] + manufacturer_good = [0x0001_0000, 0x0001_00FF, 0xFFF0_0000, 0xFFF0_00FF, 0x0001_00FE] + manufacturer_bad = [0x0001_0A00, 0x0001_0BFF, 0x0001_FFFF, 0xFFF0_0C00, 0xFFF0_D0FF, 0x0001_F0FE] + test_good = [0xFFF1_0000, 0xFFF1_00E0, 0xFFF1_00FF, 0xFFF4_0000, 0xFFF4_00E0, 0xFFF4_00FF] + test_bad = [0xFFF1_5000, 0xFFF1_F000, 0xFFF1_FFFF, 0xFFF4_5000, 0xFFF4_F000, 0xFFF4_FFFF] + prefix_bad = [0xFFF5_0000, 0xFFF5_4FFF, 0xFFF5_5000, 0xFFF5_F000, 0xFFF5_FFFF] + + def check_standard_global(id): + id_type = command_id_type(id) + msg = f"Incorrect command range assessment, expecting standard global {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, CommandIdType.kStandardGlobal, msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=False), msg) + + def check_scoped_non_global(id): + id_type = command_id_type(id) + msg = f"Incorrect command range assessment, expecting scoped non-global {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, CommandIdType.kScopedNonGlobal, msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=False), msg) + + def check_manufacturer(id): + id_type = command_id_type(id) + msg = f"Incorrect command range assessment, expecting manufacturer {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, CommandIdType.kManufacturer, msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=False), msg) + + def check_test(id): + id_type = command_id_type(id) + msg = f"Incorrect command range assessment, expecting test {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, CommandIdType.kTest, msg) + asserts.assert_true(is_valid_command_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_command_id(id_type, allow_test=False), msg) + + def check_all_bad(id): + id_type = command_id_type(id) + msg = f"Incorrect command range assessment, expecting invalid {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, CommandIdType.kInvalid, msg) + asserts.assert_false(is_valid_command_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_command_id(id_type, allow_test=False), msg) + + for id in standard_global_good: + check_standard_global(id) + for id in standard_global_bad: + check_all_bad(id) + for id in scoped_non_global_good: + check_scoped_non_global(id) + for id in scoped_non_global_bad: + check_all_bad(id) + for id in manufacturer_good: + check_manufacturer(id) + for id in manufacturer_bad: + check_all_bad(id) + for id in test_good: + check_test(id) + for id in test_bad: + check_all_bad(id) + for id in prefix_bad: + check_all_bad(id) + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py b/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py index e692adfdfb5a10..f9fbd2e2ade835 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py @@ -61,6 +61,15 @@ class AttributeIdType(Enum): kManufacturer = auto(), kTest = auto(), + +class CommandIdType(Enum): + kInvalid = auto() + kStandardGlobal = auto(), + kScopedNonGlobal = auto(), + kManufacturer = auto(), + kTest = auto(), + + # ID helper classes - this allows us to use the values from the prefix and suffix table directly # because the class handles the non-inclusive range. @@ -92,6 +101,9 @@ def __contains__(self, id: int): CLUSTER_ID_MANUFACTURER_RANGE_SUFFIX = SuffixIdRange(0xFC00, 0xFFFE) ATTRIBUTE_ID_GLOBAL_RANGE_SUFFIX = SuffixIdRange(0xF000, 0xFFFE) ATTRIBUTE_ID_NON_GLOBAL_RANGE_SUFFIX = SuffixIdRange(0x0000, 0x4FFF) +COMMAND_ID_GLOBAL_STANDARD_SUFFIX = SuffixIdRange(0x00E0, 0x00FF) +COMMAND_ID_NON_GLOBAL_SCOPED_SUFFIX = SuffixIdRange(0x0000, 0x00DF) +COMMAND_ID_SUFFIX = SuffixIdRange(0x0000, 0x00FF) def device_type_id_type(id: int) -> DeviceTypeIdType: @@ -145,3 +157,22 @@ def is_valid_attribute_id(id_type: AttributeIdType, allow_test: bool = False): if allow_test: valid.append(AttributeIdType.kTest) return id_type in valid + + +def command_id_type(id: int) -> CommandIdType: + if id in STANDARD_PREFIX and id in COMMAND_ID_GLOBAL_STANDARD_SUFFIX: + return CommandIdType.kStandardGlobal + if id in STANDARD_PREFIX and id in COMMAND_ID_NON_GLOBAL_SCOPED_SUFFIX: + return CommandIdType.kScopedNonGlobal + if id in MANUFACTURER_PREFIX and id in COMMAND_ID_SUFFIX: + return CommandIdType.kManufacturer + if id in TEST_PREFIX and id in COMMAND_ID_SUFFIX: + return CommandIdType.kTest + return CommandIdType.kInvalid + + +def is_valid_command_id(id_type: CommandIdType, allow_test: bool = False): + valid = [CommandIdType.kStandardGlobal, CommandIdType.kScopedNonGlobal, CommandIdType.kManufacturer] + if allow_test: + valid.append(CommandIdType.kTest) + return id_type in valid diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index b16d1b42a08b45..053fa575c6452d 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -585,9 +585,9 @@ def step_skipped(self, name: str, expression: str): # TODO: Do we really need the expression as a string? We can evaluate this in code very easily logging.info(f'\t\t**** Skipping: {name}') - def step_start(self, name: str, endpoint: int | None = None): - # TODO: The way I'm calling this, the name already includes the step number, but it seems like it might be good to separate these - logging.info(f'\t\t***** Test Step {name} started with endpoint {endpoint} ') + def step_start(self, name: str): + # The way I'm calling this, the name is already includes the step number, but it seems like it might be good to separate these + logging.info(f'\t\t***** Test Step {name}') def step_success(self, logger, logs, duration: int, request): pass @@ -916,10 +916,12 @@ def hex_from_bytes(b: bytes) -> str: class TestStep: test_plan_number: typing.Union[int, str] description: str - endpoint: int | None = None expectation: str = "" is_commissioning: bool = False + def __str__(self): + return f'{self.test_plan_number}: {self.description}\tExpected outcome: {self.expectation}' + @dataclass class TestInfo: @@ -1284,9 +1286,8 @@ async def check_test_event_triggers_enabled(self): test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") - def print_step(self, stepnum: typing.Union[int, str], title: str, endpoint: int | None = None) -> None: - endpoint_info = f" with endpoint {endpoint}" if endpoint is not None else "" - logging.info(f'***** Test Step {stepnum} : {title}{endpoint_info}') + def print_step(self, stepnum: typing.Union[int, str], title: str) -> None: + logging.info(f'***** Test Step {stepnum} : {title}') def record_error(self, test_name: str, location: ProblemLocation, problem: str, spec_location: str = ""): self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.ERROR, problem, spec_location)) @@ -1327,7 +1328,7 @@ def extract_error_text() -> tuple[str, str]: if not trace: return no_stack_trace - if isinstance(exception, signals.TestError): + if isinstance(exception, signals.TestError) or isinstance(exception, signals.TestFailure): # Exception gets raised by the mobly framework, so the proximal error is one line back in the stack trace assert_candidates = [idx for idx, line in enumerate(trace) if "asserts" in line and "asserts.py" not in line] if not assert_candidates: @@ -1345,6 +1346,9 @@ def extract_error_text() -> tuple[str, str]: return probable_error.strip(), trace[file_candidates[-1]].strip() probable_error, probable_file = extract_error_text() + test_steps = self.get_defined_test_steps(self.current_test_info.name) + test_step = str(test_steps[self.current_step_index-1] + ) if test_steps is not None else 'UNKNOWN - no test steps provided in test script' logging.error(textwrap.dedent(f""" ****************************************************************** @@ -1355,8 +1359,12 @@ def extract_error_text() -> tuple[str, str]: * {probable_file} * {probable_error} * + * Test step: + * {test_step} + * + * Endpoint: {self.matter_test_config.endpoint} + * ******************************************************************* - """)) def on_pass(self, record): @@ -1455,7 +1463,7 @@ def skip_all_remaining_steps(self, starting_step_number): for step in remaining: self.skip_step(step.test_plan_number) - def step(self, step: typing.Union[int, str], endpoint: Optional[int] = None): + def step(self, step: typing.Union[int, str]): test_name = self.current_test_info.name steps = self.get_test_steps(test_name) @@ -1464,7 +1472,7 @@ def step(self, step: typing.Union[int, str], endpoint: Optional[int] = None): asserts.fail(f'Unexpected test step: {step} - steps not called in order, or step does not exist') current_step = steps[self.current_step_index] - self.print_step(step, current_step.description, endpoint) + self.print_step(step, current_step.description) if self.runner_hook: # If we've reached the next step with no assertion and the step wasn't skipped, it passed @@ -1473,14 +1481,12 @@ def step(self, step: typing.Union[int, str], endpoint: Optional[int] = None): step_duration = (datetime.now(timezone.utc) - self.step_start_time) / timedelta(microseconds=1) self.runner_hook.step_success(logger=None, logs=None, duration=step_duration, request=None) - current_step.endpoint = endpoint - # TODO: it seems like the step start should take a number and a name name = f'{step} : {current_step.description}' + self.runner_hook.step_start(name=name) - self.runner_hook.step_start(name=name, endpoint=current_step.endpoint) self.step_start_time = datetime.now(tz=timezone.utc) - self.current_step_index += 1 + self.current_step_index = self.current_step_index + 1 self.step_skipped = False def get_setup_payload_info(self) -> List[SetupPayloadInfo]: diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index ce32518b71c7c3..c4851eaee56c35 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -76,7 +76,7 @@ def test_stop(self, exception: Exception, duration: int): def step_skipped(self, name: str, expression: str): pass - def step_start(self, name: str, endpoint: Optional[int] = None): + def step_start(self, name: str): pass def step_success(self, logger, logs, duration: int, request): diff --git a/src/test_driver/nrfconnect/main/runner.cpp b/src/test_driver/nrfconnect/main/runner.cpp index 44fb5bae2a6183..bd719fbd4e5b33 100644 --- a/src/test_driver/nrfconnect/main/runner.cpp +++ b/src/test_driver/nrfconnect/main/runner.cpp @@ -29,7 +29,7 @@ using namespace ::chip::DeviceLayer; LOG_MODULE_REGISTER(runner, CONFIG_MATTER_LOG_LEVEL); -extern "C" int main(void) +int main(void) { VerifyOrDie(settings_subsys_init() == 0); diff --git a/src/tools/chip-cert/chip-cert.cpp b/src/tools/chip-cert/chip-cert.cpp index 571a00421f2569..a06a7341fafc09 100644 --- a/src/tools/chip-cert/chip-cert.cpp +++ b/src/tools/chip-cert/chip-cert.cpp @@ -85,7 +85,7 @@ bool PrintVersion() } // namespace -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { bool res = false; diff --git a/src/tools/spake2p/spake2p.cpp b/src/tools/spake2p/spake2p.cpp index 45f5cc9d7c4323..ce1c0f82c60212 100644 --- a/src/tools/spake2p/spake2p.cpp +++ b/src/tools/spake2p/spake2p.cpp @@ -62,7 +62,7 @@ bool PrintVersion() } // namespace -extern "C" int main(int argc, char * argv[]) +int main(int argc, char * argv[]) { bool res = false; diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 69e55a5d76151d..e270db2ae8757f 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -65,7 +65,6 @@ source_set("libopenthread-efr32") { "${sl_ot_efr32_root}/flash.c", "${sl_ot_efr32_root}/ieee802154-packet-utils.cpp", "${sl_ot_efr32_root}/misc.c", - "${sl_ot_efr32_root}/radio.c", "${sl_ot_efr32_root}/radio_coex.c", "${sl_ot_efr32_root}/radio_extension.c", "${sl_ot_efr32_root}/radio_power_manager.c", @@ -73,6 +72,9 @@ source_set("libopenthread-efr32") { "${sl_ot_efr32_root}/sleep.c", "${sl_ot_efr32_root}/soft_source_match_table.c", "${sl_ot_efr32_root}/system.c", + + # Temporary file until the files in the SI SDK is fixed + "${sdk_support_root}/protocol/openthread/platform-abstraction/efr32/radio.c", ] include_dirs = [ "${openthread_root}/examples/platforms/utils" ] diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index d5fcc90b39ee75..ce0e3e2d1b7eec 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit d5fcc90b39ee7568855390535fa854cea8f33c95 +Subproject commit ce0e3e2d1b7eec7cdf59fbb2ceed2b1cb3edd1ec diff --git a/third_party/pigweed/update.sh b/third_party/pigweed/update.sh old mode 100644 new mode 100755 index c8dd96862d7285..b15e967930577b --- a/third_party/pigweed/update.sh +++ b/third_party/pigweed/update.sh @@ -3,8 +3,8 @@ # Update the submodule. cd "$(dirname "${BASH_SOURCE[0]}")/repo" -git fetch origin master -git checkout origin/master +git fetch origin main +git checkout origin/main # Copy the CIPD manifest but change the Python line so we don't use CIPD # Python on Linux. diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index e08c7cd0bd11bd..16e0ba68c4607a 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -206,7 +206,9 @@ if (wifi_soc != true) { # CCP board "${openthread_root}/src/core/mac/mac_frame.cpp", "${openthread_root}/src/core/mac/sub_mac.cpp", "${openthread_root}/src/core/thread/mle.cpp", - "${sl_ot_platform_abstraction}/efr32/radio.c", + + # Temporary file until the files in the SI SDK is fixed + "${sdk_support_root}/protocol/openthread/platform-abstraction/efr32/radio.c", ] include_dirs = [ "${sl_ot_platform_abstraction}/include" ] diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index d338ea7d0a9162..3accbed0bc12f2 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -137,8 +137,6 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/service/iostream/inc", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/inc", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/config", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/inc", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/config", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/config", # sl memory manager @@ -156,6 +154,18 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/inc", ] + if (sl_enable_rgb_led) { + _include_dirs += [ + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/config", + ] + } else { + _include_dirs += [ + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/config", + ] + } + if (use_system_view) { _include_dirs += [ "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", @@ -299,6 +309,12 @@ template("siwx917_sdk") { defines += [ "ENABLE_WSTK_LEDS" ] } + if (sl_enable_rgb_led) { + defines += [ "SL_MATTER_RGB_LED_ENABLED=1" ] + } else { + defines += [ "SL_MATTER_RGB_LED_ENABLED=0" ] + } + if (chip_enable_icd_server) { defines += [ "SL_ICD_ENABLED=1", @@ -649,7 +665,6 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_temp_sensor.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ulpss_clk.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_driver_gpio.c", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_usart.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/src/sl_si91x_peripheral_gpio.c", "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_ram.c", "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_rom.c", @@ -687,11 +702,9 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_event_handler.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_button_instances.c", - "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_led_instances.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_ulp_timer_init.c", "${sdk_support_root}/matter/si91x/support/hal/rsi_hal_mcu_m4.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/src/sl_si91x_button.c", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/src/sl_si91x_led.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", # sl memory manager @@ -716,6 +729,18 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/wireless/firmware_upgrade/firmware_upgradation.c", ] + if (sl_enable_rgb_led) { + sources += [ + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_rgb_led_instances.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/src/sl_si91x_rgb_led.c", + ] + } else { + sources += [ + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_led_instances.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/src/sl_si91x_led.c", + ] + } + if (use_system_view) { sources += [ "${chip_root}/examples/platform/silabs/sl_systemview_config.h", diff --git a/third_party/silabs/lwip.gni b/third_party/silabs/lwip.gni index b0b6a0db0d2c9f..9a35e7c45f7a61 100644 --- a/third_party/silabs/lwip.gni +++ b/third_party/silabs/lwip.gni @@ -169,10 +169,8 @@ template("lwip_target") { "${_lwip_root}/src/core/ipv6/ip6.c", "${_lwip_root}/src/core/ipv6/ip6_addr.c", "${_lwip_root}/src/core/ipv6/ip6_frag.c", + "${_lwip_root}/src/core/ipv6/mld6.c", "${_lwip_root}/src/core/ipv6/nd6.c", - - # TODO: When updating to next Si SDK version, revert change. - "${sdk_support_root}/src/core/ipv6/mld6.c", ] } diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 841d43db7e8687..bf647de36d841e 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 841d43db7e86877636cd73b5244da4c34d38d544 +Subproject commit bf647de36d841e62fdac5d37c0cdfc5ebf9200bc diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 03b2ea7cb67cb5..aa51817fffdae7 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -56,6 +56,9 @@ declare_args() { # Temperature Sensor support sl_enable_si70xx_sensor = false + + # RGB LED support + sl_enable_rgb_led = false } declare_args() { @@ -74,6 +77,9 @@ assert(silabs_board != "", "silabs_board must be specified") # Si917 WIFI board ---------- if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { + if (silabs_board == "BRD2605A") { + sl_enable_rgb_led = true + } silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" wifi_soc = true diff --git a/third_party/silabs/simplicity_sdk b/third_party/silabs/simplicity_sdk index aa5ce2e835dfdc..36e12f01947c2b 160000 --- a/third_party/silabs/simplicity_sdk +++ b/third_party/silabs/simplicity_sdk @@ -1 +1 @@ -Subproject commit aa5ce2e835dfdce8c20fb828f27d3a261946f946 +Subproject commit 36e12f01947c2bed82922015e87b926df0745bc2 diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index b5d6422f300cc0..a6390dd746f006 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit b5d6422f300cc075c7eaeec96e9f7e3f4e23bf06 +Subproject commit a6390dd746f0067b855a6b41293159244f3ca1b4 diff --git a/third_party/silabs/wiseconnect-wifi-bt-sdk b/third_party/silabs/wiseconnect-wifi-bt-sdk index f94b83d050fe62..b6d6cb552beb4e 160000 --- a/third_party/silabs/wiseconnect-wifi-bt-sdk +++ b/third_party/silabs/wiseconnect-wifi-bt-sdk @@ -1 +1 @@ -Subproject commit f94b83d050fe6200c5ec2dacfafa2edc92ad5ef3 +Subproject commit b6d6cb552beb4ecb6e690e0db4c9d374f8ba1b15 diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 382c808a78cc62..762cedbf1b5aa3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -37056,7 +37056,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) } // namespace NightVisionCapable -namespace MaxPreRollBufferSize { +namespace MaxContentBufferSize { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { @@ -37101,7 +37101,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -} // namespace MaxPreRollBufferSize +} // namespace MaxContentBufferSize namespace TwoWayTalkSupport { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e0a965b732a743..98aebd50964980 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5620,11 +5620,11 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); } // namespace NightVisionCapable -namespace MaxPreRollBufferSize { +namespace MaxContentBufferSize { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MaxPreRollBufferSize +} // namespace MaxContentBufferSize namespace TwoWayTalkSupport { Protocols::InteractionModel::Status diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 7e9752db4a888c..111324e9cb51ae 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -30138,8 +30138,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, minViewport); case Attributes::RateDistortionTradeOffPoints::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, rateDistortionTradeOffPoints); - case Attributes::MaxPreRollBufferSize::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, maxPreRollBufferSize); + case Attributes::MaxContentBufferSize::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxContentBufferSize); case Attributes::MicrophoneCapabilities::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, microphoneCapabilities); case Attributes::SpeakerCapabilities::TypeInfo::GetAttributeId(): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 4ec96663f8becd..d7f69cc3818e3e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -41980,7 +41980,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace RateDistortionTradeOffPoints -namespace MaxPreRollBufferSize { +namespace MaxContentBufferSize { struct TypeInfo { using Type = uint32_t; @@ -41988,10 +41988,10 @@ struct TypeInfo using DecodableArgType = uint32_t; static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MaxPreRollBufferSize::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxContentBufferSize::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace MaxPreRollBufferSize +} // namespace MaxContentBufferSize namespace MicrophoneCapabilities { struct TypeInfo { @@ -42529,7 +42529,7 @@ struct TypeInfo Attributes::NightVisionCapable::TypeInfo::DecodableType nightVisionCapable = static_cast(0); Attributes::MinViewport::TypeInfo::DecodableType minViewport; Attributes::RateDistortionTradeOffPoints::TypeInfo::DecodableType rateDistortionTradeOffPoints; - Attributes::MaxPreRollBufferSize::TypeInfo::DecodableType maxPreRollBufferSize = static_cast(0); + Attributes::MaxContentBufferSize::TypeInfo::DecodableType maxContentBufferSize = static_cast(0); Attributes::MicrophoneCapabilities::TypeInfo::DecodableType microphoneCapabilities; Attributes::SpeakerCapabilities::TypeInfo::DecodableType speakerCapabilities; Attributes::TwoWayTalkSupport::TypeInfo::DecodableType twoWayTalkSupport = diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 8ee5cb21be8e31..e9375f5dad786a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -6890,9 +6890,9 @@ namespace RateDistortionTradeOffPoints { static constexpr AttributeId Id = 0x00000005; } // namespace RateDistortionTradeOffPoints -namespace MaxPreRollBufferSize { +namespace MaxContentBufferSize { static constexpr AttributeId Id = 0x00000006; -} // namespace MaxPreRollBufferSize +} // namespace MaxContentBufferSize namespace MicrophoneCapabilities { static constexpr AttributeId Id = 0x00000007; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index afcc2abd01d6fb..4ee3c3e1f98afa 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -13732,7 +13732,7 @@ class ZoneManagementRemoveZone : public ClusterCommand | * NightVisionCapable | 0x0003 | | * MinViewport | 0x0004 | | * RateDistortionTradeOffPoints | 0x0005 | -| * MaxPreRollBufferSize | 0x0006 | +| * MaxContentBufferSize | 0x0006 | | * MicrophoneCapabilities | 0x0007 | | * SpeakerCapabilities | 0x0008 | | * TwoWayTalkSupport | 0x0009 | @@ -26925,7 +26925,7 @@ void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssu make_unique(Id, "min-viewport", Attributes::MinViewport::Id, credsIssuerConfig), // make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, credsIssuerConfig), // - make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + make_unique(Id, "max-content-buffer-size", Attributes::MaxContentBufferSize::Id, credsIssuerConfig), // make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, credsIssuerConfig), // make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // make_unique(Id, "two-way-talk-support", Attributes::TwoWayTalkSupport::Id, credsIssuerConfig), // @@ -26993,7 +26993,7 @@ void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssu const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type>>>( Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "max-pre-roll-buffer-size", 0, UINT32_MAX, Attributes::MaxPreRollBufferSize::Id, + make_unique>(Id, "max-content-buffer-size", 0, UINT32_MAX, Attributes::MaxContentBufferSize::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>( Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, WriteCommandType::kForceWrite, @@ -27114,8 +27114,8 @@ void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssu make_unique(Id, "night-vision-capable", Attributes::NightVisionCapable::Id, credsIssuerConfig), // make_unique(Id, "min-viewport", Attributes::MinViewport::Id, credsIssuerConfig), // make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, - credsIssuerConfig), // - make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + credsIssuerConfig), // + make_unique(Id, "max-content-buffer-size", Attributes::MaxContentBufferSize::Id, credsIssuerConfig), // make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, credsIssuerConfig), // make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8a0e26cbca4bc1..ac4e3adbbbebc3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -18513,10 +18513,10 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RateDistortionTradeOffPoints", 1, value); } - case CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: { + case CameraAvStreamManagement::Attributes::MaxContentBufferSize::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxPreRollBufferSize", 1, value); + return DataModelLogger::LogValue("MaxContentBufferSize", 1, value); } case CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: { chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType value; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index a5739f1228aad6..7c4c38ae6cec3f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -4181,8 +4181,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "MinViewport"; case chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id: return "RateDistortionTradeOffPoints"; - case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: - return "MaxPreRollBufferSize"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxContentBufferSize::Id: + return "MaxContentBufferSize"; case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: return "MicrophoneCapabilities"; case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id: @@ -6495,6 +6495,8 @@ char const * DeviceTypeIdToText(chip::DeviceTypeId id) return "EVSE"; case 0x0000050D: return "Device Energy Management"; + case 0x0000050F: + return "Water Heater"; case 0x00000510: return "Electrical Sensor"; case 0x00000840: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 4dc01523ea8db8..bf6bff38ba079b 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -150650,7 +150650,7 @@ class SubscribeAttributeZoneManagementClusterRevision : public SubscribeAttribut | * NightVisionCapable | 0x0003 | | * MinViewport | 0x0004 | | * RateDistortionTradeOffPoints | 0x0005 | -| * MaxPreRollBufferSize | 0x0006 | +| * MaxContentBufferSize | 0x0006 | | * MicrophoneCapabilities | 0x0007 | | * SpeakerCapabilities | 0x0008 | | * TwoWayTalkSupport | 0x0009 | @@ -152134,34 +152134,34 @@ class SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints : p #if MTR_ENABLE_PROVISIONAL /* - * Attribute MaxPreRollBufferSize + * Attribute MaxContentBufferSize */ -class ReadCameraAvStreamManagementMaxPreRollBufferSize : public ReadAttribute { +class ReadCameraAvStreamManagementMaxContentBufferSize : public ReadAttribute { public: - ReadCameraAvStreamManagementMaxPreRollBufferSize() - : ReadAttribute("max-pre-roll-buffer-size") + ReadCameraAvStreamManagementMaxContentBufferSize() + : ReadAttribute("max-content-buffer-size") { } - ~ReadCameraAvStreamManagementMaxPreRollBufferSize() + ~ReadCameraAvStreamManagementMaxContentBufferSize() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxContentBufferSize::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeMaxPreRollBufferSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize response %@", [value description]); + [cluster readAttributeMaxContentBufferSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxContentBufferSize response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("CameraAVStreamManagement MaxPreRollBufferSize read Error", error); + LogNSError("CameraAVStreamManagement MaxContentBufferSize read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -152170,21 +152170,21 @@ class ReadCameraAvStreamManagementMaxPreRollBufferSize : public ReadAttribute { } }; -class SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize : public SubscribeAttribute { +class SubscribeAttributeCameraAvStreamManagementMaxContentBufferSize : public SubscribeAttribute { public: - SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() - : SubscribeAttribute("max-pre-roll-buffer-size") + SubscribeAttributeCameraAvStreamManagementMaxContentBufferSize() + : SubscribeAttribute("max-content-buffer-size") { } - ~SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() + ~SubscribeAttributeCameraAvStreamManagementMaxContentBufferSize() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxContentBufferSize::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); @@ -152199,10 +152199,10 @@ class SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize : public Su if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeMaxPreRollBufferSizeWithParams:params + [cluster subscribeAttributeMaxContentBufferSizeWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize response %@", [value description]); + NSLog(@"CameraAVStreamManagement.MaxContentBufferSize response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -181984,8 +181984,8 @@ void registerClusterCameraAvStreamManagement(Commands & commands) make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), //