diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 870c5f379e5eb8..dc9eaa40f7e4ba 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 83ecc7e00a2192..0617b05d657008 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -138,7 +138,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -283,7 +283,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -346,7 +346,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -457,7 +457,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 642cdb6cf87e92..07f4cac37cc008 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 options: --user root steps: @@ -56,7 +56,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:74 + image: ghcr.io/project-chip/chip-build-esp32:76 options: --user root steps: @@ -77,7 +77,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:74 + image: ghcr.io/project-chip/chip-build-nrf-platform:76 options: --user root steps: @@ -98,7 +98,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:74 + image: ghcr.io/project-chip/chip-build-telink:76 options: --user root steps: diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index d29b620c374165..40bf2b9e8c1c96 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:74 + image: ghcr.io/project-chip/chip-build-doxygen:76 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 62a3bf55119b3d..b18f44ec9d9206 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:74 + image: ghcr.io/project-chip/chip-build-ameba:76 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 840811d13daa6a..46881ea4810a33 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:74 + image: ghcr.io/project-chip/chip-build-asr:76 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index af20a4c5b0872f..d3191c598b57a0 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:74 + image: ghcr.io/project-chip/chip-build-bouffalolab:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml index 53c813d0b4c433..22a1d727284247 100644 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -45,7 +45,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:74 + image: ghcr.io/project-chip/chip-build-ti:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index 091a5eeabc4361..c07313f82cb8d8 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -43,7 +43,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:74 + image: ghcr.io/project-chip/chip-build-ti:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index c236b4ca3db4c3..66b62945978077 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:74 + image: ghcr.io/project-chip/chip-build-efr32:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -128,6 +128,24 @@ jobs: /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out + - name: Build BRD2605A WiFi Soc variants + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd2605a-light-skip-rps-generation \ + --target efr32-brd2605a-lock-skip-rps-generation \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare bloat report for brd2605a lock app + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD2605a lock-app \ + out/efr32-brd2605a-lock-skip-rps-generation/matter-silabs-lock-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out - name: Build EFR32 with WiFi NCP run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 5d84540eda4676..168b84ddc66779 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:74 + image: ghcr.io/project-chip/chip-build-esp32:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -126,7 +126,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:74 + image: ghcr.io/project-chip/chip-build-esp32:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 0fcfac2ce7890e..f4547d86a71bcb 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:74 + image: ghcr.io/project-chip/chip-build-infineon:76 env: # TODO: this should probably be part of the dockerfile itself CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2 diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 41fe2456518850..8ea6b400f23b74 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:74 + image: ghcr.io/project-chip/chip-build-crosscompile:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 6ad5f4c9d9c31e..d1224852b734e9 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:74 + image: ghcr.io/project-chip/chip-build-imx:76 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index aa4051ea308a56..a3ca553632a956 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml index e2ff0f9f6697da..3159685f8f4704 100644 --- a/.github/workflows/examples-linux-tv-casting-app.yaml +++ b/.github/workflows/examples-linux-tv-casting-app.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 steps: - name: Checkout diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 04664c28cf339e..212bebfe3c70b9 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 13b0ae9c691d7c..c9b16f36072295 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:74 + image: ghcr.io/project-chip/chip-build-nrf-platform:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml index d1bf7594b0a332..2de7f00e13dbd5 100644 --- a/.github/workflows/examples-nuttx.yaml +++ b/.github/workflows/examples-nuttx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nuttx:74 + image: ghcr.io/project-chip/chip-build-nuttx:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index d09e893f2909dd..61291fc885e582 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-k32w:74 + image: ghcr.io/project-chip/chip-build-k32w:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -120,6 +120,7 @@ jobs: ./scripts/build/build_examples.py \ --target nxp-k32w1-freertos-lighting \ --target nxp-k32w1-freertos-contact-sensor-low-power \ + --target nxp-k32w1-freertos-lock-app \ build \ --copy-artifacts-to out/artifacts \ " @@ -135,6 +136,12 @@ jobs: nxp k32w1+release contact \ out/artifacts/nxp-k32w1-freertos-contact-sensor-low-power/chip-k32w1-contact-example.elf \ /tmp/bloat_reports/ + - name: Get lock app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp k32w1+release lock \ + out/artifacts/nxp-k32w1-freertos-lock-app/chip-k32w1-lock-example.elf \ + /tmp/bloat_reports/ - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} @@ -174,6 +181,7 @@ jobs: ./scripts/build/build_examples.py \ --target nxp-mcxw71-freertos-lighting \ --target nxp-mcxw71-freertos-contact-sensor-low-power \ + --target nxp-mcxw71-freertos-lock-app \ build \ --copy-artifacts-to out/artifacts \ " @@ -189,6 +197,12 @@ jobs: nxp mcxw71+release contact \ out/artifacts/nxp-mcxw71-freertos-contact-sensor-low-power/chip-mcxw71-contact-example.elf \ /tmp/bloat_reports/ + - name: Get lock app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp mcxw71+release lock \ + out/artifacts/nxp-mcxw71-freertos-lock-app/chip-mcxw71-lock-example.elf \ + /tmp/bloat_reports/ - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} @@ -204,7 +218,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:74 + image: ghcr.io/project-chip/chip-build-nxp:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -266,7 +280,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp-zephyr:74 + image: ghcr.io/project-chip/chip-build-nxp-zephyr:76 steps: - name: Checkout diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index d85a789a0bcef7..c1bf85860cb65e 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:74 + image: ghcr.io/project-chip/chip-build-openiotsdk:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 18d47cf8ef9937..bd0ef01d7aba60 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 6c4fa05864efff..291b9264c626da 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 904ae98fbcabcc..f67da724ca0764 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:74 + image: ghcr.io/project-chip/chip-build-telink:76 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index f6571342a84618..abec382c564f43 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:74 + image: ghcr.io/project-chip/chip-build-tizen:76 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 43aee09a821be9..29822767571416 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:74 + image: ghcr.io/project-chip/chip-build-android:76 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index d839317bc4248e..19e0bcdd2075ef 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index a43fdfb7f49d4d..f585829f29f589 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:74 + image: ghcr.io/project-chip/chip-build-java:76 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 15004c5aca5037..0bb74745cf96af 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 steps: - name: Checkout diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index ade1bd56ea36ff..a3cdc697f9ef3d 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:74 + image: ghcr.io/project-chip/chip-build-minimal:76 steps: - name: Checkout @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:74 + image: ghcr.io/project-chip/chip-build-minimal:76 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 7c8564958d1350..8e1ab281803e0e 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:74 + image: ghcr.io/project-chip/chip-build-esp32-qemu:76 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -78,7 +78,8 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen-qemu:54 + image: ghcr.io/project-chip/chip-build-tizen-qemu:76 + options: --user root volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 9f25dee51324fb..e4fc02b77a2e16 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:74 + image: ghcr.io/project-chip/chip-build-esp32:76 steps: - name: Checkout @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:74 + image: ghcr.io/project-chip/chip-build-efr32:76 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 8ac6cd93131617..bac25a017629e5 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:74 + image: ghcr.io/project-chip/chip-build-android:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2c68b91222bf80..65ba9ac4114303 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -455,7 +455,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 040e50f1535079..db6e8e129b6693 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index dca68cc94e88ad..4a86caf18301e5 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 5ed20b29ada3d6..3eb7a5c60fb03c 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:74 + image: ghcr.io/project-chip/chip-build:76 defaults: run: shell: sh diff --git a/build/chip/esp32/esp32_codegen.cmake b/build/chip/esp32/esp32_codegen.cmake index d83bdb7ccf12c8..7febb089875172 100644 --- a/build/chip/esp32/esp32_codegen.cmake +++ b/build/chip/esp32/esp32_codegen.cmake @@ -17,6 +17,7 @@ macro(chip_app_component_codegen IDL_NAME) include("${CHIP_ROOT}/build/chip/chip_codegen.cmake") + include("${CHIP_ROOT}/src/app/codegen-data-model-provider/model.cmake") # The IDF build system performs a two-pass expansion to determine # component expansion. The first pass runs in script-mode @@ -71,5 +72,14 @@ macro(chip_app_component_zapgen ZAP_NAME) add_dependencies(${COMPONENT_LIB} app-zapgen) target_include_directories(${COMPONENT_LIB} PUBLIC "${APP_TEMPLATE_GEN_DIR}") target_sources(${COMPONENT_LIB} PRIVATE ${APP_TEMPLATE_GEN_FILES}) + + # When data model interface is used, provide a default code-generation data model as + # part of zapgen. See `chip_data_model.cmake` for similar logic + set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled") + + if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled") + target_sources(${COMPONENT_LIB} PRIVATE ${CODEGEN_DATA_MODEL_SOURCES}) + endif() + endif() endmacro() diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py index f44667242de807..73a33e4f0e8694 100755 --- a/build/config/linux/pkg-config.py +++ b/build/config/linux/pkg-config.py @@ -142,6 +142,8 @@ def main(): dest='dridriverdir') parser.add_option('--version-as-components', action='store_true', dest='version_as_components') + parser.add_option('--static', action='store_true', + dest='static') (options, args) = parser.parse_args() # Make a list of regular expressions to strip out. @@ -203,7 +205,13 @@ def main(): sys.stdout.write(dridriverdir.strip()) return - cmd = [options.pkg_config, "--cflags", "--libs"] + args + cmd = [options.pkg_config, "--cflags", "--libs"] + + if options.static: + cmd.append("--static") + + cmd.extend(args) + if options.debug: sys.stderr.write('Running: %s\n' % ' '.join(cmd)) diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index d6892d97fb976f..04419ecee24260 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -137,10 +137,19 @@ template("pkg_config") { # Link libraries statically for OSS-Fuzz fuzzer build if (oss_fuzz) { + # Output libs needed for static linking (direct + transitive/non-direct libs), we will re-execute the script to get those libs + args += [ "--static" ] + pkgresult_static = exec_script(pkg_config_script, args, "value") libs = [] ldflags = [ "-Wl,-Bstatic" ] - foreach(lib, pkgresult[3]) { - ldflags += [ "-l$lib" ] + foreach(lib, pkgresult_static[3]) { + # dl(dynamic loading) lib is not needed for linking statically and its presence triggers errors. + # example of errors: + # ld.lld: error: undefined symbol: __dlsym + # >>> referenced by dlsym.o:(dlsym) in archive /lib/x86_64-linux-gnu/libdl.a + if (lib != "dl") { + ldflags += [ "-l$lib" ] + } } ldflags += [ "-Wl,-Bdynamic" ] lib_dirs = pkgresult[4] diff --git a/config/common/cmake/chip_gn_args.cmake b/config/common/cmake/chip_gn_args.cmake index 663e7f49977030..8fde49c3438098 100644 --- a/config/common/cmake/chip_gn_args.cmake +++ b/config/common/cmake/chip_gn_args.cmake @@ -171,7 +171,7 @@ macro(matter_common_gn_args) LIB_PW_RPC DEVICE_INFO_EXAMPLE_PROVIDER PROJECT_CONFIG - + DATA_MODEL_INTERFACE ) set(multiValueArgs PROJECT_CONFIG_INC_DIR @@ -203,6 +203,11 @@ macro(matter_common_gn_args) if (ARG_DEVICE_INFO_EXAMPLE_PROVIDER) matter_add_gn_arg_bool ("chip_build_example_providers" ${ARG_DEVICE_INFO_EXAMPLE_PROVIDER}) endif() # ARG_DEVICE_INFO_EXAMPLE_PROVIDER + + if (ARG_DATA_MODEL_INTERFACE) + matter_add_gn_arg_string("chip_use_data_model_interface" "${ARG_DATA_MODEL_INTERFACE}") + endif() + if (ARG_PROJECT_CONFIG) get_filename_component(PROJECT_CONFIG ${ARG_PROJECT_CONFIG} @@ -220,4 +225,4 @@ endmacro() # Generate the temporary GN arguments file from the settings macro(matter_generate_args_tmp_file) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${MATTER_GN_ARGS}) -endmacro() \ No newline at end of file +endmacro() diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 85141d5f962241..161a3ce6e2249c 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -33,6 +33,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake) set(CHIP_REQUIRE_COMPONENTS esp_eth freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash) +set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled") + if(NOT "${IDF_TARGET}" STREQUAL "esp32h2") list(APPEND CHIP_REQUIRE_COMPONENTS mdns) endif() @@ -64,6 +66,12 @@ macro(chip_gn_arg_bool arg boolean) endif() endmacro() +if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled") + chip_gn_arg_append("chip_use_data_model_interface" "\"enabled\"") +else() + chip_gn_arg_append("chip_use_data_model_interface" "\"disabled\"") +endif() + # ESP-IDF lets user set software version string by two ways: # 1. Project's CMakeLists.txt file and 2. Config option # It depends on CONFIG_APP_PROJECT_VER_FROM_CONFIG option diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index 88567b604e3254..37dad135327e07 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -112,6 +112,9 @@ if (CONFIG_MBED_BSD_SOCKET_TRACE) matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1) endif() +# Option can be set with `-DCHIP_DATA_MODEL_INTERFACE=enabled` or similar on the command line +set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled") + # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== @@ -121,6 +124,7 @@ matter_common_gn_args( LIB_TESTS CONFIG_CHIP_BUILD_TESTS LIB_PW_RPC CONFIG_CHIP_PW_RPC PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + DATA_MODEL_INTERFACE ${CHIP_DATA_MODEL_INTERFACE} ) if (CONFIG_CHIP_PW_RPC) matter_add_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni") diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index ee169106ffc8f9..98fee746485cc3 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -106,6 +106,13 @@ endif() get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE) + +if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) + set(DATA_MODEL_INTERFACE "enabled") +else() + set(DATA_MODEL_INTERFACE "disabled") +endif() + # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== @@ -116,6 +123,7 @@ matter_common_gn_args( LIB_TESTS CONFIG_CHIP_BUILD_TESTS PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} ) matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) diff --git a/config/nxp/chip-cmake-freertos/CMakeLists.txt b/config/nxp/chip-cmake-freertos/CMakeLists.txt index b639e23ff65034..db078e69df4f64 100644 --- a/config/nxp/chip-cmake-freertos/CMakeLists.txt +++ b/config/nxp/chip-cmake-freertos/CMakeLists.txt @@ -40,6 +40,12 @@ matter_add_gn_arg("chip_with_factory_data" ${CONFIG_CHIP_FACTORY_DATA}) matter_add_gn_arg("chip_enable_secure_dac_private_key_storage" ${CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE}) matter_add_gn_arg("chip_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA}) +if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) + set(DATA_MODEL_INTERFACE "enabled") +else() + set(DATA_MODEL_INTERFACE "disabled") +endif() + matter_common_gn_args( DEBUG CONFIG_DEBUG LIB_SHELL CONFIG_CHIP_LIB_SHELL @@ -47,6 +53,7 @@ matter_common_gn_args( PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} PROJECT_CONFIG_INC_DIR ${CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS} DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} ) matter_generate_args_tmp_file() diff --git a/config/nxp/chip-module/CMakeLists.txt b/config/nxp/chip-module/CMakeLists.txt index 32a85a606c71e0..f5cb1bf88a0fce 100644 --- a/config/nxp/chip-module/CMakeLists.txt +++ b/config/nxp/chip-module/CMakeLists.txt @@ -91,6 +91,13 @@ endif() get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE) +if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) + set(DATA_MODEL_INTERFACE "enabled") +else() + set(DATA_MODEL_INTERFACE "disabled") +endif() + + # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== @@ -101,6 +108,7 @@ matter_common_gn_args( LIB_TESTS CONFIG_CHIP_BUILD_TESTS PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} ) matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) diff --git a/config/openiotsdk/cmake/chip.cmake b/config/openiotsdk/cmake/chip.cmake index a0eef560f926a9..fb1386e45d5dc6 100644 --- a/config/openiotsdk/cmake/chip.cmake +++ b/config/openiotsdk/cmake/chip.cmake @@ -74,7 +74,6 @@ function(chip_add_data_model target scope model_name) include(${CHIP_ROOT}/src/app/chip_data_model.cmake) chip_configure_data_model(${target} SCOPE ${scope} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${model_name}-common/${model_name}-app.zap ) endfunction() diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 7b58f5c4b6fc05..d4c02aa5d621b8 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -77,6 +77,12 @@ if (CONFIG_CHIP_OPENTHREAD_CONFIG) zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG}) endif() +if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) + set(DATA_MODEL_INTERFACE "enabled") +else() + set(DATA_MODEL_INTERFACE "disabled") +endif() + # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== @@ -87,6 +93,7 @@ matter_common_gn_args( LIB_TESTS CONFIG_CHIP_BUILD_TESTS PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} ) matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 62efe30c07fda4..2a3a2d5495bf96 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -574,4 +574,11 @@ config CHIP_BLE_ADVERTISING_DURATION If CHIP_BLE_EXT_ADVERTISING is set to false, the maximum duration time is 15 minutes, else the maximum duration time can be extended to 2880 minutes (48h). +config USE_CHIP_DATA_MODEL_INTERFACE + bool "Use a DataModel::Provider interface for data access" + help + This enables a level of indiraction in the CHIP interaction model engine in + accessing underlying data and executing operations such as + wildcard-expansion, read, write and invoke. + endif diff --git a/config/zephyr/chip-module/CMakeLists.txt b/config/zephyr/chip-module/CMakeLists.txt index 8449398b4f480b..fb94465b772bf6 100644 --- a/config/zephyr/chip-module/CMakeLists.txt +++ b/config/zephyr/chip-module/CMakeLists.txt @@ -70,6 +70,12 @@ if(CONFIG_CHIP) zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG}) endif() + if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) + set(DATA_MODEL_INTERFACE "enabled") + else() + set(DATA_MODEL_INTERFACE "disabled") + endif() + # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== @@ -78,6 +84,7 @@ if(CONFIG_CHIP) LIB_SHELL CONFIG_CHIP_LIB_SHELL LIB_TESTS CONFIG_CHIP_BUILD_TESTS PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} ) matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) @@ -139,4 +146,4 @@ if(CONFIG_CHIP) GN_DEPENDENCIES kernel ) set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) -endif() # CONFIG_CHIP \ No newline at end of file +endif() # CONFIG_CHIP diff --git a/docs/code_generation.md b/docs/code_generation.md index e12bf40f100cff..bf5b6f3036963a 100644 --- a/docs/code_generation.md +++ b/docs/code_generation.md @@ -66,7 +66,7 @@ Since this is tedious to type, the SDK provides a `scripts/tools/zap/run_zaptool.sh` script to automate this: ```bash -# Ensure zap is in $PATH or set $ZAP_INSTALL_PATH or $ZAP_DEVELOPMENT_PATH +# Ensure `zap` is in $PATH, specify the `--zap ZAP` option to `run_zaptool.sh` to specify the path to `zap`, set $ZAP_INSTALL_PATH, or set $ZAP_DEVELOPMENT_PATH ./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap ``` diff --git a/examples/air-purifier-app/ameba/chip_main.cmake b/examples/air-purifier-app/ameba/chip_main.cmake index c2a8d0e928fa0c..22a325bf6eddec 100755 --- a/examples/air-purifier-app/ameba/chip_main.cmake +++ b/examples/air-purifier-app/ameba/chip_main.cmake @@ -162,7 +162,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../air-purifier-common/air-purifier-app.zap ) diff --git a/examples/air-quality-sensor-app/telink/CMakeLists.txt b/examples/air-quality-sensor-app/telink/CMakeLists.txt index 4d34c74fcdba68..0cde6d4eb3f84a 100644 --- a/examples/air-quality-sensor-app/telink/CMakeLists.txt +++ b/examples/air-quality-sensor-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../air-quality-sensor-common/air-quality-sensor-app.zap ) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index cc36d5c6160113..1aa3c8007507d3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7798,16 +7798,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Groups { ram attribute nameSupport; ram attribute featureMap default = 0; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0140adbbd9a461..94747c1fbf40c8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -69,98 +69,6 @@ "deviceTypeCode": 17, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Groups", "code": 4, diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index 4251291f486ef4..0569c919fc330e 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -27,11 +27,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 - Setup build environment: diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 363b01e05ac2de..852673d07dd20c 100644 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -212,7 +212,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../all-clusters-common/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/linux/fuzzing-main.cpp b/examples/all-clusters-app/linux/fuzzing-main.cpp index 4fe21865727371..793a70a6a9fa3e 100644 --- a/examples/all-clusters-app/linux/fuzzing-main.cpp +++ b/examples/all-clusters-app/linux/fuzzing-main.cpp @@ -31,6 +31,7 @@ LinuxCommissionableDataProvider gCommissionableDataProvider; void CleanShutdown() { + ApplicationShutdown(); Server::GetInstance().Shutdown(); PlatformMgr().Shutdown(); // TODO: We don't Platform::MemoryShutdown because ~CASESessionManager calls diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index b2e54ed28a78d6..ea1ce468b53852 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -87,7 +87,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index bed8169e40bd92..adfc76c299eb09 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -77,7 +77,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt b/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt index 2fa2d558a2724a..e5b9dff398abc7 100644 --- a/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt +++ b/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt @@ -82,7 +82,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 1eba5072690a6d..ddec4db229adc6 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -76,7 +76,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 77ad5a9fc5d0a5..9b30603b156ee2 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -6242,15 +6242,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - } - server cluster Groups { ram attribute nameSupport; ram attribute featureMap default = 0; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 528dd80c73bfd2..249b28707df21b 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -69,90 +69,6 @@ "deviceTypeCode": 17, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Groups", "code": 4, diff --git a/examples/all-clusters-minimal-app/ameba/README.md b/examples/all-clusters-minimal-app/ameba/README.md index 31969a2196b343..c136008cb18456 100644 --- a/examples/all-clusters-minimal-app/ameba/README.md +++ b/examples/all-clusters-minimal-app/ameba/README.md @@ -27,13 +27,13 @@ The CHIP demo application is supported on - Pull docker image: ``` - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 ``` - Run docker container: ``` - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 ``` - Setup build environment: diff --git a/examples/all-clusters-minimal-app/ameba/chip_main.cmake b/examples/all-clusters-minimal-app/ameba/chip_main.cmake index e8fa8393ddeb1c..a2d1e364d63ee9 100755 --- a/examples/all-clusters-minimal-app/ameba/chip_main.cmake +++ b/examples/all-clusters-minimal-app/ameba/chip_main.cmake @@ -147,7 +147,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/mbed/CMakeLists.txt b/examples/all-clusters-minimal-app/mbed/CMakeLists.txt index e50fcef67663f8..d90c3faaa496b3 100644 --- a/examples/all-clusters-minimal-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/mbed/CMakeLists.txt @@ -65,7 +65,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt index 08feb83a62a40b..d18fb15d33dd1a 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index 3cfcc56d36783c..a9da3ae4331a15 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 1da3944812e014..f2e80864d46e01 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../bridge-common/bridge-app.zap ) diff --git a/examples/chef/ameba/chip_main.cmake b/examples/chef/ameba/chip_main.cmake index df9f7fedd10ecc..87c8aa158db8bb 100755 --- a/examples/chef/ameba/chip_main.cmake +++ b/examples/chef/ameba/chip_main.cmake @@ -51,7 +51,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../devices/${SAMPLE_NAME}.zap ) diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index a274b1055195f9..6aa6a2502fb4b4 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -3594,4 +3594,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 9a567896dfdd24..4ab3e0f003c457 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -1368,16 +1368,6 @@ endpoint 0 { device type ma_rootdevice = 22, version 1; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index e0ee90ac36fc3b..bedf611487efa1 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -61,98 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index e160cd4fe8cb82..b7b8c92c1e655c 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -234,56 +234,6 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } -/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ -cluster Identify = 3 { - revision 4; - - enum EffectIdentifierEnum : enum8 { - kBlink = 0; - kBreathe = 1; - kOkay = 2; - kChannelChange = 11; - kFinishEffect = 254; - kStopEffect = 255; - } - - enum EffectVariantEnum : enum8 { - kDefault = 0; - } - - enum IdentifyTypeEnum : enum8 { - kNone = 0; - kLightOutput = 1; - kVisibleIndicator = 2; - kAudibleBeep = 3; - kDisplay = 4; - kActuator = 5; - } - - attribute int16u identifyTime = 0; - readonly attribute IdentifyTypeEnum identifyType = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct IdentifyRequest { - int16u identifyTime = 0; - } - - request struct TriggerEffectRequest { - EffectIdentifierEnum effectIdentifier = 0; - EffectVariantEnum effectVariant = 1; - } - - /** Command description for Identify */ - command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; - /** Command description for TriggerEffect */ - command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -1457,16 +1407,6 @@ endpoint 0 { device type ma_rootdevice = 22, version 1; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 7b3d2d49a9a95d..163f7e1b17ee79 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -61,98 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index ff4a49b7778298..de332faefc57ea 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -2902,4 +2902,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index cf0c9c20e47438..9f7942e9284b44 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -234,56 +234,6 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } -/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ -cluster Identify = 3 { - revision 4; - - enum EffectIdentifierEnum : enum8 { - kBlink = 0; - kBreathe = 1; - kOkay = 2; - kChannelChange = 11; - kFinishEffect = 254; - kStopEffect = 255; - } - - enum EffectVariantEnum : enum8 { - kDefault = 0; - } - - enum IdentifyTypeEnum : enum8 { - kNone = 0; - kLightOutput = 1; - kVisibleIndicator = 2; - kAudibleBeep = 3; - kDisplay = 4; - kActuator = 5; - } - - attribute int16u identifyTime = 0; - readonly attribute IdentifyTypeEnum identifyType = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct IdentifyRequest { - int16u identifyTime = 0; - } - - request struct TriggerEffectRequest { - EffectIdentifierEnum effectIdentifier = 0; - EffectVariantEnum effectVariant = 1; - } - - /** Command description for Identify */ - command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; - /** Command description for TriggerEffect */ - command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -1334,16 +1284,6 @@ endpoint 0 { device type ma_rootdevice = 22, version 1; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index b93bcb05fec24a..79d3f881487e8e 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -61,98 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 081c510435c1e6..13ddc003e3b878 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -106,7 +106,6 @@ target_sources(app PRIVATE message(STATUS ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap ) diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index 3c6b352e55b873..364725c34383fc 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -77,7 +77,6 @@ target_sources(app PRIVATE message(STATUS ${CHEF}/devices/${SAMPLE_NAME}.zap) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CHEF}/devices/${SAMPLE_NAME}.zap ) diff --git a/examples/contact-sensor-app/nxp/common/AppTask.cpp b/examples/contact-sensor-app/nxp/common/AppTask.cpp index f49c603cbb16a6..7539bc61e09a1f 100644 --- a/examples/contact-sensor-app/nxp/common/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/common/AppTask.cpp @@ -22,8 +22,15 @@ #include "PWR_Interface.h" #endif +#include #include +#ifndef APP_DEVICE_TYPE_ENDPOINT +#define APP_DEVICE_TYPE_ENDPOINT 1 +#endif + +using namespace chip::app::Clusters; + void ContactSensorApp::AppTask::PreInitMatterStack() { ChipLogProgress(DeviceLayer, "Welcome to NXP Contact Sensor Demo App"); @@ -47,6 +54,24 @@ ContactSensorApp::AppTask & ContactSensorApp::AppTask::GetDefaultInstance() return sAppTask; } +bool ContactSensorApp::AppTask::CheckStateClusterHandler(void) +{ + bool val = false; + BooleanState::Attributes::StateValue::Get(APP_DEVICE_TYPE_ENDPOINT, &val); + return val; +} + +CHIP_ERROR ContactSensorApp::AppTask::ProcessSetStateClusterHandler(void) +{ + bool val = false; + BooleanState::Attributes::StateValue::Get(APP_DEVICE_TYPE_ENDPOINT, &val); + auto status = BooleanState::Attributes::StateValue::Set(APP_DEVICE_TYPE_ENDPOINT, (bool) !val); + + VerifyOrReturnError(status == chip::Protocols::InteractionModel::Status::Success, CHIP_ERROR_WRITE_FAILED); + + return CHIP_NO_ERROR; +} + chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask() { return ContactSensorApp::AppTask::GetDefaultInstance(); diff --git a/examples/contact-sensor-app/nxp/common/include/AppTask.h b/examples/contact-sensor-app/nxp/common/include/AppTask.h index 69b3ffc8200804..407572aad254e6 100644 --- a/examples/contact-sensor-app/nxp/common/include/AppTask.h +++ b/examples/contact-sensor-app/nxp/common/include/AppTask.h @@ -28,6 +28,10 @@ namespace ContactSensorApp { class AppTask : public chip::NXP::App::AppTaskFreeRTOS { public: + // AppTaskBase virtual methods + bool CheckStateClusterHandler(void) override; + CHIP_ERROR ProcessSetStateClusterHandler(void) override; + // AppTaskFreeRTOS virtual methods void PreInitMatterStack() override; #if CONFIG_LOW_POWER diff --git a/examples/contact-sensor-app/nxp/k32w1/include/config/AppConfig.h b/examples/contact-sensor-app/nxp/k32w1/include/config/AppConfig.h index 0c8019d8e7e33c..89f4bf9333c4c8 100644 --- a/examples/contact-sensor-app/nxp/k32w1/include/config/AppConfig.h +++ b/examples/contact-sensor-app/nxp/k32w1/include/config/AppConfig.h @@ -18,8 +18,6 @@ #pragma once /* ---- App Config ---- */ -#define APP_DEVICE_TYPE_ENDPOINT 1 -#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::BooleanState::Attributes::StateValue /* ---- Button Manager Config ---- */ #define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 diff --git a/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h b/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h index 0c8019d8e7e33c..89f4bf9333c4c8 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h +++ b/examples/contact-sensor-app/nxp/mcxw71/include/config/AppConfig.h @@ -18,8 +18,6 @@ #pragma once /* ---- App Config ---- */ -#define APP_DEVICE_TYPE_ENDPOINT 1 -#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::BooleanState::Attributes::StateValue /* ---- Button Manager Config ---- */ #define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index fb8098b36fdbee..47ec8757942519 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../contact-sensor-common/contact-sensor-app.zap ) diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 578a806c9d7253..0c7c4044810c6b 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -1466,16 +1466,6 @@ endpoint 0 { device type ma_rootdevice = 22, version 1; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Groups { ram attribute nameSupport; ram attribute featureMap default = 0; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index d8804e9526b4af..857f5a0192f38f 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -61,98 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Groups", "code": 4, diff --git a/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp b/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp index aabcb09f2314b2..47947bb5a86151 100644 --- a/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp +++ b/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp @@ -119,11 +119,13 @@ void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState) { if (StartRpcClient() == CHIP_NO_ERROR) { - ChipLogProgress(NotSpecified, "Connected to Fabric-Bridge"); + // print to console + fprintf(stderr, "Connected to Fabric-Bridge\n"); } else { - ChipLogError(NotSpecified, "Failed to connect to Fabric-Bridge, retry in %d seconds....", kRetryIntervalS); + // print to console + fprintf(stderr, "Failed to connect to Fabric-Bridge, retry in %d seconds....\n", kRetryIntervalS); systemLayer->StartTimer(System::Clock::Seconds16(kRetryIntervalS), AttemptRpcClientConnect, nullptr); } } diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt index 23583ffe6e3169..cb8bb53e233be6 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt @@ -58,13 +58,7 @@ class PairOnNetworkLongImInvokeCommand( if (element != null) { logger.log(Level.INFO, element.toString() + element.getJsonString()) val clusterId = element.getClusterId().getId() - if (clusterId == CLUSTER_ID_IDENTIFY) { - logger.log(Level.INFO, "success code is $successCode") - setSuccess() - return - } else if ( - clusterId == CLUSTER_ID_TEST && element.getJsonString().equals("""{"0:UINT":2}""") - ) { + if (clusterId == CLUSTER_ID_TEST && element.getJsonString().equals("""{"0:UINT":2}""")) { logger.log(Level.INFO, "success code is $successCode") setSuccess() return @@ -91,41 +85,18 @@ class PairOnNetworkLongImInvokeCommand( val tlvWriter1 = TlvWriter() tlvWriter1.startStructure(AnonymousTag) tlvWriter1.put(ContextSpecificTag(0), number) + tlvWriter1.put(ContextSpecificTag(1), number) tlvWriter1.endStructure() val element1: InvokeElement = - InvokeElement.newInstance( - /* endpointId= */ 0, - CLUSTER_ID_IDENTIFY, - IDENTIFY_COMMAND, - tlvWriter1.getEncoded(), - null - ) - - val tlvWriter2 = TlvWriter() - tlvWriter2.startStructure(AnonymousTag) - tlvWriter2.put(ContextSpecificTag(0), number) - tlvWriter2.put(ContextSpecificTag(1), number) - tlvWriter2.endStructure() - - val element2: InvokeElement = InvokeElement.newInstance( /* endpointId= */ 1, CLUSTER_ID_TEST, TEST_ADD_ARGUMENT_COMMAND, - tlvWriter2.getEncoded(), + tlvWriter1.getEncoded(), null ) - val element3: InvokeElement = - InvokeElement.newInstance( - /* endpointId= */ 1, - CLUSTER_ID_IDENTIFY, - IDENTIFY_COMMAND, - null, - """{"0:UINT":1}""" - ) - currentCommissioner() .pairDeviceWithAddress( getNodeId(), @@ -142,20 +113,11 @@ class PairOnNetworkLongImInvokeCommand( clear() currentCommissioner().invoke(InternalInvokeCallback(), devicePointer, element1, 0, 0) waitCompleteMs(getTimeoutMillis()) - clear() - currentCommissioner().invoke(InternalInvokeCallback(), devicePointer, element2, 0, 0) - waitCompleteMs(getTimeoutMillis()) - clear() - currentCommissioner().invoke(InternalInvokeCallback(), devicePointer, element3, 0, 0) - waitCompleteMs(getTimeoutMillis()) } companion object { private val logger = Logger.getLogger(PairOnNetworkLongImInvokeCommand::class.java.name) - private const val MATTER_PORT = 5540 - private const val CLUSTER_ID_IDENTIFY = 0x0003L - private const val IDENTIFY_COMMAND = 0L private const val CLUSTER_ID_TEST = 0xFFF1FC05L private const val TEST_ADD_ARGUMENT_COMMAND = 0X04L } diff --git a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt index 1b66fa5886f7f4..22559bc1ca091d 100644 --- a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt +++ b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt @@ -22,7 +22,7 @@ import java.util.logging.Level import java.util.logging.Logger import kotlinx.coroutines.runBlocking import matter.controller.MatterController -import matter.controller.cluster.clusters.IdentifyCluster +import matter.controller.cluster.clusters.UnitTestingCluster class PairOnNetworkLongImInvokeCommand( controller: MatterController, @@ -39,12 +39,14 @@ class PairOnNetworkLongImInvokeCommand( override fun runCommand() { runBlocking { try { - val identifyTime: UShort = 1u - val identifyCluster = IdentifyCluster(controller = currentCommissioner(), endpointId = 0u) + val arg1: UByte = 1u + val arg2: UByte = 2u + val testCluster = UnitTestingCluster(controller = currentCommissioner(), endpointId = 1u) - // By running command identify, we are implicitly requesting CASE to be established if it's + // By running command testAddArguments, we are implicitly requesting CASE to be established + // if it's // not already present. - identifyCluster.identify(identifyTime) + testCluster.testAddArguments(arg1, arg2) logger.log(Level.INFO, "Invoke command succeeded") } catch (ex: Exception) { setFailure("invoke failure: ${ex.message}") diff --git a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt index 85295328bc40a5..8ca1324d9e228e 100644 --- a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt +++ b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt @@ -5,11 +5,11 @@ import java.util.logging.Level import java.util.logging.Logger import kotlinx.coroutines.flow.takeWhile import kotlinx.coroutines.runBlocking +import matter.controller.BooleanSubscriptionState import matter.controller.MatterController import matter.controller.SubscribeRequest import matter.controller.SubscriptionState -import matter.controller.UShortSubscriptionState -import matter.controller.cluster.clusters.IdentifyCluster +import matter.controller.cluster.clusters.UnitTestingCluster import matter.controller.model.AttributePath import matter.controller.model.EventPath @@ -42,8 +42,8 @@ class PairOnNetworkLongImSubscribeCommand( // Verify Wildcard subscription startWildcardSubscription() - // Verify IdentifyTime attribute subscription - subscribeIdentifyTimeAttribute() + // Verify Boolean attribute subscription + subscribeBooleanAttribute() } catch (ex: Exception) { logger.log(Level.WARNING, "General subscribe failure occurred with error ${ex.message}") setFailure("subscribe failure") @@ -107,30 +107,30 @@ class PairOnNetworkLongImSubscribeCommand( } } - private suspend fun subscribeIdentifyTimeAttribute() { - logger.log(Level.INFO, "Subscribe IdentifyTime attribute") + private suspend fun subscribeBooleanAttribute() { + logger.log(Level.INFO, "Subscribe Boolean attribute") - val identifyCluster = IdentifyCluster(controller = currentCommissioner(), endpointId = 0u) + val testCluster = UnitTestingCluster(controller = currentCommissioner(), endpointId = 1u) - identifyCluster - .subscribeIdentifyTimeAttribute(minInterval = 0, maxInterval = 5) + testCluster + .subscribeBooleanAttribute(minInterval = 0, maxInterval = 5) .takeWhile { subscriptionState -> // Keep collecting as long as it's not SubscriptionEstablished - subscriptionState !is UShortSubscriptionState.SubscriptionEstablished + subscriptionState !is BooleanSubscriptionState.SubscriptionEstablished } .collect { subscriptionState -> when (subscriptionState) { - is UShortSubscriptionState.Success -> { - logger.log(Level.INFO, "Received IdentifyTime Update: ${subscriptionState.value}") + is BooleanSubscriptionState.Success -> { + logger.log(Level.INFO, "Received Boolean Update: ${subscriptionState.value}") } - is UShortSubscriptionState.Error -> { + is BooleanSubscriptionState.Error -> { logger.log( Level.WARNING, "Received SubscriptionErrorNotification with terminationCause: ${subscriptionState.exception}" ) } - is UShortSubscriptionState.SubscriptionEstablished -> { - logger.log(Level.INFO, "IdentifyTime Subscription is established") + is BooleanSubscriptionState.SubscriptionEstablished -> { + logger.log(Level.INFO, "Boolean Subscription is established") } else -> { logger.log(Level.SEVERE, "Unexpected subscription state: $subscriptionState") diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index e3ba743cb6f971..e9bd6ba5caf036 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -2150,15 +2150,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap index 001bfbc945f132..189241e5005e7a 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap @@ -61,90 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt b/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt index f7b32881ada959..9103b6a5567102 100644 --- a/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt +++ b/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt @@ -84,7 +84,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/../../laundry-washer-app/nxp/zap/laundry-washer-app.zap ) diff --git a/examples/light-switch-app/ameba/README.md b/examples/light-switch-app/ameba/README.md index 7d168d3f480d84..d24c9a54906553 100644 --- a/examples/light-switch-app/ameba/README.md +++ b/examples/light-switch-app/ameba/README.md @@ -26,11 +26,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 - Setup build environment: diff --git a/examples/light-switch-app/ameba/chip_main.cmake b/examples/light-switch-app/ameba/chip_main.cmake index 75e0d0116425fe..629c423c0fe5ec 100755 --- a/examples/light-switch-app/ameba/chip_main.cmake +++ b/examples/light-switch-app/ameba/chip_main.cmake @@ -173,7 +173,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 48329e053be562..3eec4764d96ec9 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -64,6 +64,5 @@ if(CONFIG_MCUMGR_TRANSPORT_BT) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/light-switch-app/silabs/build_for_wifi_gnfile.gn b/examples/light-switch-app/silabs/build_for_wifi_gnfile.gn index d391814190d09f..1d6a71e88dd16f 100644 --- a/examples/light-switch-app/silabs/build_for_wifi_gnfile.gn +++ b/examples/light-switch-app/silabs/build_for_wifi_gnfile.gn @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_enable_wifi = true + chip_device_platform = "SiWx917" import("//build_for_wifi_args.gni") } diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 7b98b235ea66e1..660769df9a59c4 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/lighting-app/ameba/README.md b/examples/lighting-app/ameba/README.md index d94d642dbd3934..810aa6d1d0af5b 100644 --- a/examples/lighting-app/ameba/README.md +++ b/examples/lighting-app/ameba/README.md @@ -23,11 +23,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 - Setup build environment: diff --git a/examples/lighting-app/ameba/chip_main.cmake b/examples/lighting-app/ameba/chip_main.cmake index 3165047d3955be..11590553cf327d 100755 --- a/examples/lighting-app/ameba/chip_main.cmake +++ b/examples/lighting-app/ameba/chip_main.cmake @@ -166,7 +166,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index abe63789638f23..69456ae04664dd 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -62,7 +62,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 5b2647894e9ffb..59bf2f26bed466 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/PWMDevice.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/nxp/README.md b/examples/lighting-app/nxp/README.md index 67444a99e1bf8d..d611b24c8dff75 100644 --- a/examples/lighting-app/nxp/README.md +++ b/examples/lighting-app/nxp/README.md @@ -119,9 +119,9 @@ where `device` can be one of the [Supported devices](#supported-devices). The application uses an NXP specific data model file: -| path | description | -| ----------------------------- | --------------------------------------- | -| `zap-lit/lighting-on-off.zap` | Data model for On/Off Light device type | +| path | description | +| ------------------------- | --------------------------------------- | +| `zap/lighting-on-off.zap` | Data model for On/Off Light device type | The data model can be changed by simply replacing the gn `deps` statement corresponding to data model target. diff --git a/examples/lighting-app/nxp/common/AppTask.cpp b/examples/lighting-app/nxp/common/AppTask.cpp index 6bca4669760c2a..095afb869b1e15 100644 --- a/examples/lighting-app/nxp/common/AppTask.cpp +++ b/examples/lighting-app/nxp/common/AppTask.cpp @@ -18,8 +18,15 @@ #include "AppTask.h" +#include #include +#ifndef APP_DEVICE_TYPE_ENDPOINT +#define APP_DEVICE_TYPE_ENDPOINT 1 +#endif + +using namespace chip::app::Clusters; + void LightingApp::AppTask::PreInitMatterStack() { ChipLogProgress(DeviceLayer, "Welcome to NXP Lighting Demo App"); @@ -31,6 +38,24 @@ LightingApp::AppTask & LightingApp::AppTask::GetDefaultInstance() return sAppTask; } +bool LightingApp::AppTask::CheckStateClusterHandler(void) +{ + bool val = false; + OnOff::Attributes::OnOff::Get(APP_DEVICE_TYPE_ENDPOINT, &val); + return val; +} + +CHIP_ERROR LightingApp::AppTask::ProcessSetStateClusterHandler(void) +{ + bool val = false; + OnOff::Attributes::OnOff::Get(APP_DEVICE_TYPE_ENDPOINT, &val); + auto status = OnOff::Attributes::OnOff::Set(APP_DEVICE_TYPE_ENDPOINT, (bool) !val); + + VerifyOrReturnError(status == chip::Protocols::InteractionModel::Status::Success, CHIP_ERROR_WRITE_FAILED); + + return CHIP_NO_ERROR; +} + chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask() { return LightingApp::AppTask::GetDefaultInstance(); diff --git a/examples/lighting-app/nxp/common/include/AppTask.h b/examples/lighting-app/nxp/common/include/AppTask.h index 9f73d340f35957..a98c26a97dbb07 100644 --- a/examples/lighting-app/nxp/common/include/AppTask.h +++ b/examples/lighting-app/nxp/common/include/AppTask.h @@ -28,6 +28,10 @@ namespace LightingApp { class AppTask : public chip::NXP::App::AppTaskFreeRTOS { public: + // AppTaskBase virtual methods + bool CheckStateClusterHandler(void) override; + CHIP_ERROR ProcessSetStateClusterHandler(void) override; + // AppTaskFreeRTOS virtual methods void PreInitMatterStack() override; diff --git a/examples/lighting-app/nxp/k32w1/include/config/AppConfig.h b/examples/lighting-app/nxp/k32w1/include/config/AppConfig.h index 6dcccf749bbebe..89f4bf9333c4c8 100644 --- a/examples/lighting-app/nxp/k32w1/include/config/AppConfig.h +++ b/examples/lighting-app/nxp/k32w1/include/config/AppConfig.h @@ -18,8 +18,6 @@ #pragma once /* ---- App Config ---- */ -#define APP_DEVICE_TYPE_ENDPOINT 1 -#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::OnOff::Attributes::OnOff /* ---- Button Manager Config ---- */ #define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 diff --git a/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h b/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h index 6dcccf749bbebe..89f4bf9333c4c8 100644 --- a/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h +++ b/examples/lighting-app/nxp/mcxw71/include/config/AppConfig.h @@ -18,8 +18,6 @@ #pragma once /* ---- App Config ---- */ -#define APP_DEVICE_TYPE_ENDPOINT 1 -#define APP_CLUSTER_ATTRIBUTE chip::app::Clusters::OnOff::Attributes::OnOff /* ---- Button Manager Config ---- */ #define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 diff --git a/examples/lighting-app/silabs/build_for_wifi_gnfile.gn b/examples/lighting-app/silabs/build_for_wifi_gnfile.gn index d391814190d09f..1d6a71e88dd16f 100644 --- a/examples/lighting-app/silabs/build_for_wifi_gnfile.gn +++ b/examples/lighting-app/silabs/build_for_wifi_gnfile.gn @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_enable_wifi = true + chip_device_platform = "SiWx917" import("//build_for_wifi_args.gni") } diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 056f6d4173c49a..9e29436a05f5fa 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 6c5e4af56cbee4..a1beda368f8f29 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -1818,15 +1818,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap index c7354adc058a6f..09567dcb43c99f 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap @@ -69,90 +69,6 @@ "deviceTypeCode": 17, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/lit-icd-app/nrfconnect/CMakeLists.txt b/examples/lit-icd-app/nrfconnect/CMakeLists.txt index 36133c49ec12d1..a624da1b22fef0 100644 --- a/examples/lit-icd-app/nrfconnect/CMakeLists.txt +++ b/examples/lit-icd-app/nrfconnect/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lit-icd-common/lit-icd-server-app.zap ) diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 29cb86631ab749..5d9a5f5554c8d4 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -62,7 +62,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 6c92305f378dec..27ed04aceb4e01 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/lock-app/nxp/README.md b/examples/lock-app/nxp/README.md new file mode 100644 index 00000000000000..c3cf4c112f8dfd --- /dev/null +++ b/examples/lock-app/nxp/README.md @@ -0,0 +1,133 @@ +# Matter NXP Door Lock Example Application + +This reference application implements an Door Lock device type. It uses board +buttons or `matter-cli` for user input and LEDs for state feedback. You can use +this example as a reference for creating your own application. + +The example is based on: + +- [Matter](https://github.com/project-chip/connectedhomeip) +- [NXP github SDK](https://github.com/nxp-mcuxpresso/mcux-sdk) + +- [Matter NXP Door Lock Example Application](#matter-nxp-door-lock-example-application) + - [Supported devices](#supported-devices) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Prerequisites for building](#prerequisites-for-building) + - [Building](#building) + - [Data model](#data-model) + - [Manufacturing data](#manufacturing-data) + - [Flashing and debugging](#flashing-and-debugging) + +## Supported devices + +- [k32w1](k32w1/README.md) +- [mcxw71](mcxw71/README.md) + +## Introduction + +The application showcases a door lock device that communicates with clients over +a low-power, 802.15.4 Thread network. + +It can be commissioned into an existing Matter network using a controller such +as `chip-tool`. + +This example implements a `User-Intent Commissioning Flow`, meaning the user has +to press a button in order for the device to be ready for commissioning. The +initial commissioning is done through `ble-thread` pairing method. + +The Thread network dataset will be transferred on the device using a secure +session over Bluetooth LE. In order to start the commissioning process, the user +must enable BLE advertising on the device manually. To pair successfully, the +commissioner must know the commissioning information corresponding to the +device: setup passcode and discriminator. This data is usually encoded within a +QR code or printed to the UART console. + +## Device UI + +The example application provides a simple UI that depicts the state of the +device and offers basic user control. This UI is implemented via the +general-purpose LEDs and buttons built in the evaluation boards. Please see each +supported device readme file for details. + +## Prerequisites for building + +In order to build the example, it is recommended to use a Linux distribution. +Please visit the supported Operating Systems list in +[BUILDING.md](../../../docs/guides/BUILDING.md#prerequisites). + +- Make sure that below prerequisites are correctly installed (as described in + [BUILDING.md](../../../docs/guides/BUILDING.md#prerequisites)) + +``` +sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev +``` + +- Step 1: checkout NXP specific submodules only + + ``` + user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive + ``` + +- Step 2: activate local environment + + ``` + user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/activate.sh + ``` + + If the script says the environment is out of date, you can update it by + running the following command: + + ``` + user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/bootstrap.sh + ``` + +- Step 3: Init NXP SDK(s) + + ``` + user@ubuntu:~/Desktop/git/connectedhomeip$ third_party/nxp/nxp_matter_support/scripts/update_nxp_sdk.py --platform common + ``` + +Note: By default, `update_nxp_sdk.py` will try to initialize all NXP SDKs. +Please run the script with arg `--help` to view all available options. + +## Building + +There are two options for building this reference app: + +- Using `build_examples.py` framework. +- Manually generating `ninja` files using `gn`. + +For manual generation and building, please see the specific readme file for your +device. + +A list of all available contact sensor targets can be viewed in the following +table: + +| target name | description | +| ---------------------------- | ---------------- | +| nxp-device-freertos-lock-app | Default lock app | + +where `device` can be one of the [Supported devices](#supported-devices). + +### Data model + +The application uses an NXP specific data model file: + +| path | description | +| ------------------ | ------------------------------------ | +| `zap/lock-app.zap` | Data model for Door Lock device type | + +The data model can be changed by simply replacing the gn `deps` statement +corresponding to data model target. + +### Manufacturing data + +Use `chip_with_factory_data=1` in the gn build command to enable factory data. + +For a full guide on manufacturing flow, please see +[Guide for writing manufacturing data on NXP devices](../../../docs/guides/nxp/nxp_manufacturing_flow.md). + +## Flashing and debugging + +Please see the device specific readme file. diff --git a/examples/lock-app/nxp/common/main/AppTask.cpp b/examples/lock-app/nxp/common/main/AppTask.cpp new file mode 100644 index 00000000000000..26a385ec0b2c97 --- /dev/null +++ b/examples/lock-app/nxp/common/main/AppTask.cpp @@ -0,0 +1,170 @@ +/* + * + * Copyright (c) 2021-2023 Project CHIP Authors + * Copyright (c) 2021 Google LLC. + * Copyright 2023-2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "CHIPDeviceManager.h" +#include "LockManager.h" +#include +#include +#include +#include +#include + +#if !CHIP_CONFIG_ENABLE_ICD_SERVER +#include "ICDUtil.h" +#endif + +#ifdef ENABLE_CHIP_SHELL +#include +#include +using namespace chip::Shell; +#define MATTER_CLI_LOG(message) (streamer_printf(streamer_get(), message)) +#endif /* ENABLE_CHIP_SHELL */ + +#ifndef APP_DEVICE_TYPE_ENDPOINT +#define APP_DEVICE_TYPE_ENDPOINT 1 +#endif + +using namespace chip; +using namespace ::chip::DeviceLayer; +using namespace chip::app::Clusters; +using namespace chip::app::DataModel; +using namespace chip::Protocols::InteractionModel; + +#ifdef ENABLE_CHIP_SHELL + +static CHIP_ERROR cliDoorLock(int argc, char * argv[]) +{ + bool inputErr = false; + if ((argc != 1) && (argc != 2)) + { + inputErr = true; + goto exit; + } + + if (!strcmp(argv[0], "open")) + { + ChipLogDetail(Shell, "Door : Set to %s state", argv[0]); + DoorLockServer::Instance().SetDoorState(1, DoorStateEnum::kDoorOpen); + } + else if (!strcmp(argv[0], "closed")) + { + ChipLogDetail(Shell, "Door : Set to %s state", argv[0]); + DoorLockServer::Instance().SetDoorState(1, DoorStateEnum::kDoorClosed); + } + else if (!strcmp(argv[0], "jammedalarm")) + { + ChipLogDetail(Shell, "Send out Lock Jammed Alarm..."); + DoorLockServer::Instance().SendLockAlarmEvent(1, AlarmCodeEnum::kLockJammed); + } + else if (!strcmp(argv[0], "locked")) + { + ChipLogDetail(Shell, "Lock : lock set to %s state", argv[0]); + DoorLockServer::Instance().SetLockState(1, DlLockState::kLocked, OperationSourceEnum::kManual, NullNullable, NullNullable, + NullNullable, NullNullable); + } + else if (!strcmp(argv[0], "unlocked")) + { + ChipLogDetail(Shell, "Lock : lock set to %s state", argv[0]); + DoorLockServer::Instance().SetLockState(1, DlLockState::kUnlocked, OperationSourceEnum::kManual, NullNullable, NullNullable, + NullNullable, NullNullable); + } + else if (!strcmp(argv[0], "unlatched")) + { + ChipLogDetail(Shell, "Lock : lock set to %s state", argv[0]); + DoorLockServer::Instance().SetLockState(1, DlLockState::kUnlatched, OperationSourceEnum::kManual, NullNullable, + NullNullable, NullNullable, NullNullable); + } + else if (!strcmp(argv[0], "notfullylocked")) + { + ChipLogDetail(Shell, "Lock : lock set to %s state", argv[0]); + DoorLockServer::Instance().SetLockState(1, DlLockState::kNotFullyLocked, OperationSourceEnum::kManual, NullNullable, + NullNullable, NullNullable, NullNullable); + } + else + { + inputErr = true; + } +exit: + if (inputErr) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + return CHIP_NO_ERROR; +} +#endif /* ENABLE_CHIP_SHELL */ + +void LockApp::AppTask::PreInitMatterStack() +{ + ChipLogProgress(DeviceLayer, "Welcome to NXP Lock Demo App"); +} + +void LockApp::AppTask::PostInitMatterStack() +{ +#if !CHIP_CONFIG_ENABLE_ICD_SERVER + chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&chip::NXP::App::GetICDUtil()); +#endif +} + +void LockApp::AppTask::AppMatter_RegisterCustomCliCommands() +{ +#ifdef ENABLE_CHIP_SHELL + /* Register application commands */ + static const shell_command_t kCommands[] = { + { .cmd_func = cliDoorLock, + .cmd_name = "doorlock", + .cmd_help = "Set the Door Lock State or trigger Lock Jammed Alarm. " + "Usage:[open|closed|jammedalarm|locked|unlocked|notfullylocked|unlatched] " }, + }; + Engine::Root().RegisterCommands(kCommands, sizeof(kCommands) / sizeof(kCommands[0])); +#endif +} + +bool LockApp::AppTask::CheckStateClusterHandler(void) +{ + Nullable state(DlLockState::kUnlocked); + DoorLock::Attributes::LockState::Get(APP_DEVICE_TYPE_ENDPOINT, state); + return (state.Value() == DlLockState::kUnlocked); +} + +CHIP_ERROR LockApp::AppTask::ProcessSetStateClusterHandler(void) +{ + Nullable state; + DoorLock::Attributes::LockState::Get(APP_DEVICE_TYPE_ENDPOINT, state); + auto newState = (state.Value() == DlLockState::kUnlocked) ? DlLockState::kLocked : DlLockState::kUnlocked; + auto status = DoorLock::Attributes::LockState::Set(APP_DEVICE_TYPE_ENDPOINT, newState); + + VerifyOrReturnError(status == Status::Success, CHIP_ERROR_WRITE_FAILED); + + return CHIP_NO_ERROR; +} + +// This returns an instance of this class. +LockApp::AppTask & LockApp::AppTask::GetDefaultInstance() +{ + static LockApp::AppTask sAppTask; + return sAppTask; +} + +chip::NXP::App::AppTaskBase & chip::NXP::App::GetAppTask() +{ + return LockApp::AppTask::GetDefaultInstance(); +} diff --git a/examples/lock-app/nxp/common/main/DeviceCallbacks.cpp b/examples/lock-app/nxp/common/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..440696b4a85ce3 --- /dev/null +++ b/examples/lock-app/nxp/common/main/DeviceCallbacks.cpp @@ -0,0 +1,107 @@ +/* + * + * Copyright (c) 2020-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" + +#include +#include +#include +#include +#include +#include + +#include + +#if CONFIG_ENABLE_FEEDBACK +#include "UserInterfaceFeedback.h" +#endif + +using namespace chip::app; +void OnTriggerEffect(::Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case Clusters::Identify::EffectIdentifierEnum::kBlink: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBlink"); + break; + case Clusters::Identify::EffectIdentifierEnum::kBreathe: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBreathe"); + break; + case Clusters::Identify::EffectIdentifierEnum::kOkay: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kOkay"); + break; + case Clusters::Identify::EffectIdentifierEnum::kChannelChange: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kChannelChange"); + break; + default: + ChipLogProgress(Zcl, "No identifier effect"); + return; + } +} + +Identify gIdentify0 = { + chip::EndpointId{ 0 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + chip::app::Clusters::Identify::IdentifyTypeEnum::kNone, + OnTriggerEffect, +}; + +Identify gIdentify1 = { + chip::EndpointId{ 1 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + chip::app::Clusters::Identify::IdentifyTypeEnum::kNone, + OnTriggerEffect, +}; + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; +using namespace chip::app::Clusters; + +void LockApp::DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value) +{ + ChipLogProgress(DeviceLayer, + "endpointId " ChipLogFormatMEI " clusterId " ChipLogFormatMEI " attribute ID: " ChipLogFormatMEI + " Type: %u Value: %u, length %u", + ChipLogValueMEI(endpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId), type, *value, size); +#if CONFIG_ENABLE_FEEDBACK + FeedbackMgr().RestoreState(); +#endif +} + +// This returns an instance of this class. +LockApp::DeviceCallbacks & LockApp::DeviceCallbacks::GetDefaultInstance() +{ + static DeviceCallbacks sDeviceCallbacks; + return sDeviceCallbacks; +} + +chip::DeviceManager::CHIPDeviceManagerCallbacks & chip::NXP::App::GetDeviceCallbacks() +{ + return LockApp::DeviceCallbacks::GetDefaultInstance(); +} diff --git a/examples/lock-app/nxp/common/main/ZclCallbacks.cpp b/examples/lock-app/nxp/common/main/ZclCallbacks.cpp new file mode 100644 index 00000000000000..98fb0f8c2bc20f --- /dev/null +++ b/examples/lock-app/nxp/common/main/ZclCallbacks.cpp @@ -0,0 +1,160 @@ +/* + * + * Copyright (c) 2021-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "AppTask.h" +#include "CHIPDeviceManager.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "LockManager.h" + +#if CONFIG_ENABLE_FEEDBACK +#include "UserInterfaceFeedback.h" +#endif + +using namespace ::chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DoorLock; +using chip::app::DataModel::Nullable; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value) +{ + chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = + chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks(); + if (cb != nullptr) + { + // propagate event to device manager + cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, type, size, value); + } +} + +// App handles physical aspects of locking but not locking logic. That is it +// should wait for door to be locked on lock command and return success) but +// door lock server should check pin before even calling the lock-door +// callback. +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) +{ + return LockManager::Instance().Lock(endpointId, fabricIdx, nodeId, pinCode, err, OperationSourceEnum::kRemote); +} + +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) +{ + return LockManager::Instance().Unlock(endpointId, fabricIdx, nodeId, pinCode, err, OperationSourceEnum::kRemote); +} + +bool emberAfPluginDoorLockOnDoorUnboltCommand(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pinCode, + OperationErrorEnum & err) +{ + return LockManager::Instance().Unbolt(endpointId, fabricIdx, nodeId, pinCode, err, OperationSourceEnum::kRemote); +} + +bool emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) +{ + return LockManager::Instance().GetUser(endpointId, userIndex, user); +} + +bool emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, + chip::FabricIndex modifier, const chip::CharSpan & userName, uint32_t uniqueId, + UserStatusEnum userStatus, UserTypeEnum usertype, CredentialRuleEnum credentialRule, + const CredentialStruct * credentials, size_t totalCredentials) +{ + + return LockManager::Instance().SetUser(endpointId, userIndex, creator, modifier, userName, uniqueId, userStatus, usertype, + credentialRule, credentials, totalCredentials); +} + +bool emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, CredentialTypeEnum credentialType, + EmberAfPluginDoorLockCredentialInfo & credential) +{ + return LockManager::Instance().GetCredential(endpointId, credentialIndex, credentialType, credential); +} + +bool emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, + chip::FabricIndex modifier, DlCredentialStatus credentialStatus, + CredentialTypeEnum credentialType, const chip::ByteSpan & credentialData) +{ + return LockManager::Instance().SetCredential(endpointId, credentialIndex, creator, modifier, credentialStatus, credentialType, + credentialData); +} + +DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, + EmberAfPluginDoorLockWeekDaySchedule & schedule) +{ + return LockManager::Instance().GetSchedule(endpointId, weekdayIndex, userIndex, schedule); +} + +DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, + EmberAfPluginDoorLockHolidaySchedule & schedule) +{ + return LockManager::Instance().GetSchedule(endpointId, holidayIndex, schedule); +} + +DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, + DlScheduleStatus status, DaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, + uint8_t endHour, uint8_t endMinute) +{ + return LockManager::Instance().SetSchedule(endpointId, weekdayIndex, userIndex, status, daysMask, startHour, startMinute, + endHour, endMinute); +} + +DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, + DlScheduleStatus status, uint32_t localStartTime, uint32_t localEndTime) +{ + return LockManager::Instance().SetSchedule(endpointId, yearDayIndex, userIndex, status, localStartTime, localEndTime); +} + +DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, + EmberAfPluginDoorLockYearDaySchedule & schedule) +{ + return LockManager::Instance().GetSchedule(endpointId, yearDayIndex, userIndex, schedule); +} + +DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, + uint32_t localStartTime, uint32_t localEndTime, OperatingModeEnum operatingMode) +{ + return LockManager::Instance().SetSchedule(endpointId, holidayIndex, status, localStartTime, localEndTime, operatingMode); +} + +void emberAfDoorLockClusterInitCallback(EndpointId endpoint) +{ + DoorLockServer::Instance().InitServer(endpoint); + LockManager::Instance().InitEndpoint(endpoint); +#if CONFIG_ENABLE_FEEDBACK + FeedbackMgr().RestoreState(); +#endif +} + +void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId) +{ + // Apply the relock state in the application control + DoorLockServer::Instance().SetLockState(1, DlLockState::kLocked, OperationSourceEnum::kAuto, NullNullable, NullNullable, + NullNullable, NullNullable); +} diff --git a/examples/lock-app/nxp/common/main/include/AppEvent.h b/examples/lock-app/nxp/common/main/include/AppEvent.h new file mode 100644 index 00000000000000..065078a52e7a72 --- /dev/null +++ b/examples/lock-app/nxp/common/main/include/AppEvent.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +struct AppEvent; +using EventHandler = void (*)(const AppEvent &); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Timer = 0, + kEventType_TurnOn, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } ClusterEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/lock-app/nxp/common/main/include/AppTask.h b/examples/lock-app/nxp/common/main/include/AppTask.h new file mode 100644 index 00000000000000..ea180e197c8455 --- /dev/null +++ b/examples/lock-app/nxp/common/main/include/AppTask.h @@ -0,0 +1,59 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021-2023 Google LLC. + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#if CONFIG_APP_FREERTOS_OS +#include "AppTaskFreeRTOS.h" +#else +#include "AppTaskZephyr.h" +#endif + +namespace LockApp { +#if CONFIG_APP_FREERTOS_OS +class AppTask : public chip::NXP::App::AppTaskFreeRTOS +#else +class AppTask : public chip::NXP::App::AppTaskZephyr +#endif +{ +public: + // AppTaskBase virtual methods + bool CheckStateClusterHandler(void) override; + CHIP_ERROR ProcessSetStateClusterHandler(void) override; + + ~AppTask() override{}; + void PostInitMatterStack(void) override; + void PreInitMatterStack(void) override; + void AppMatter_RegisterCustomCliCommands(void) override; + // This returns an instance of this class. + static AppTask & GetDefaultInstance(); + +private: + static AppTask sAppTask; +}; +} // namespace LockApp + +/** + * Returns the application-specific implementation of the AppTaskBase object. + * + * Applications can use this to gain access to features of the AppTaskBase + * that are specific to the selected application. + */ +chip::NXP::App::AppTaskBase & GetAppTask(); diff --git a/examples/lock-app/nxp/common/main/include/DeviceCallbacks.h b/examples/lock-app/nxp/common/main/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..9e6f1d47993821 --- /dev/null +++ b/examples/lock-app/nxp/common/main/include/DeviceCallbacks.h @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2020-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#pragma once + +#include "CHIPDeviceManager.h" +#include "CommonDeviceCallbacks.h" + +namespace LockApp { +class DeviceCallbacks : public chip::NXP::App::CommonDeviceCallbacks +{ +public: + // This returns an instance of this class. + static DeviceCallbacks & GetDefaultInstance(); + + void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value); + +private: + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +}; +} // namespace LockApp + +/** + * Returns the application-specific implementation of the CommonDeviceCallbacks object. + * + * Applications can use this to gain access to features of the CommonDeviceCallbacks + * that are specific to the selected application. + */ +chip::DeviceManager::CHIPDeviceManagerCallbacks & GetDeviceCallbacks(); diff --git a/examples/lock-app/nxp/common/main/main.cpp b/examples/lock-app/nxp/common/main/main.cpp new file mode 100644 index 00000000000000..09de048127518b --- /dev/null +++ b/examples/lock-app/nxp/common/main/main.cpp @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021-2023 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ================================================================================ +// Main Code +// ================================================================================ + +#include "FreeRTOS.h" +#include +#include +#include + +#if configAPPLICATION_ALLOCATED_HEAP +uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE]; +#endif + +using namespace ::chip::DeviceLayer; + +#if FSL_OSA_MAIN_FUNC_ENABLE +extern "C" void main_task(void const * argument) +{ + chip::DeviceLayer::PlatformMgrImpl().HardwareInit(); + chip::NXP::App::GetAppTask().Start(); +} +#else +extern "C" int main(int argc, char * argv[]) +{ + chip::DeviceLayer::PlatformMgrImpl().HardwareInit(); + chip::NXP::App::GetAppTask().Start(); + vTaskStartScheduler(); +} +#endif + +#if (defined(configCHECK_FOR_STACK_OVERFLOW) && (configCHECK_FOR_STACK_OVERFLOW > 0)) +void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + assert(0); +} +#endif diff --git a/examples/lock-app/nxp/k32w1/.gn b/examples/lock-app/nxp/k32w1/.gn new file mode 100644 index 00000000000000..5d6e10a31e334d --- /dev/null +++ b/examples/lock-app/nxp/k32w1/.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") + + # Import default platform configs + import("${chip_root}/src/platform/nxp/mcxw71_k32w1/args.gni") +} diff --git a/examples/lock-app/nxp/k32w1/BUILD.gn b/examples/lock-app/nxp/k32w1/BUILD.gn new file mode 100644 index 00000000000000..b8b6b7f67fa34c --- /dev/null +++ b/examples/lock-app/nxp/k32w1/BUILD.gn @@ -0,0 +1,276 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/nxp_sdk.gni") +import("//build_overrides/openthread.gni") + +import("${nxp_sdk_build_root}/nxp_sdk.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni") + +import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni") + +declare_args() { + # Setup discriminator as argument + setup_discriminator = 3840 + chip_with_diag_logs_demo = true +} + +assert(current_os == "freertos") +assert(target_os == "freertos") + +example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" +common_example_dir = "${chip_root}/examples/platform/nxp/common" + +mcxw71_k32w1_sdk("sdk") { + defines = [] + include_dirs = [] + sources = [] + + # Indicate the path to CHIPProjectConfig.h + include_dirs += [ "include/config" ] + + # Indicate the default path to FreeRTOSConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ] + + # Indicate the default path to OpenThreadConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + + include_dirs += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", + ] + + sources += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480/clock_config.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480/pin_mux.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/app_services_init.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_comp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_dcdc.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + ] + + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } + + defines += [ + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}", + ] + + if (chip_key_storage == "littlefs") { + include_dirs += [ "${example_platform_dir}/board" ] + sources += [ + "${example_platform_dir}/board/peripherals.c", + "${example_platform_dir}/board/peripherals.h", + ] + } +} + +mcxw71_k32w1_executable("lock_app") { + output_name = "chip-k32w1-lock-example" + + defines = [] + deps = [] + include_dirs = [] + sources = [] + + # Defines used by common code + defines += [ + "CONFIG_NET_L2_OPENTHREAD=1", + "CONFIG_NETWORK_LAYER_BLE=1", + "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", + "CONFIG_OPERATIONAL_KEYSTORE=1", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "CONFIG_APP_FREERTOS_OS=1", + ] + + if (chip_with_diag_logs_demo) { + defines += [ "CONFIG_DIAG_LOGS_DEMO=1" ] + } + + if (chip_with_low_power == 1) { + defines += [ "CONFIG_LOW_POWER=1" ] + } else { + defines += [ + "CONFIG_ENABLE_FEEDBACK=1", + "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", + ] + } + + # App common files + include_dirs += [ + "${common_example_dir}/icd/include", + "${common_example_dir}/app_task/include", + "${common_example_dir}/matter_button/include", + "${common_example_dir}/matter_cli/include", + "${common_example_dir}/clusters/include", + "${common_example_dir}/device_callbacks/include", + "${common_example_dir}/device_manager/include", + "${common_example_dir}/diagnostic_logs/include", + "${common_example_dir}/factory_data/include", + "${common_example_dir}/led_widget/include", + "${common_example_dir}/low_power/include", + "${common_example_dir}/operational_keystore/include", + "${common_example_dir}/ui_feedback/include", + ] + + sources += [ + "${common_example_dir}/app_task/source/AppTaskBase.cpp", + "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", + + #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", + "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", + "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/icd/source/ICDUtil.cpp", + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", + ] + + if (chip_with_low_power == 1) { + sources += [ "${common_example_dir}/low_power/source/LowPower.cpp" ] + } + + if (chip_with_factory_data == 1) { + include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] + } + + if (chip_enable_matter_cli) { + defines += [ "ENABLE_CHIP_SHELL" ] + deps += [ + "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/lib/shell:shell", + ] + sources += [ + "${common_example_dir}/matter_cli/source/AppCLIBase.cpp", + "${common_example_dir}/matter_cli/source/AppCLIFreeRTOS.cpp", + ] + } + + if (chip_enable_ota_requestor) { + defines += [ + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. + "LED_MANAGER_ENABLE_STATUS_LED=0", + ] + + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] + } + + if (chip_with_diag_logs_demo) { + sources += [ + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsProviderDelegateImpl.cpp", + ] + } + + # Platform specific files + include_dirs += [ + "${example_platform_dir}/util", + "${example_platform_dir}/app/support", + "${example_platform_dir}/button", + ] + + sources += [ + "${example_platform_dir}/button/ButtonManager.cpp", + "${example_platform_dir}/clusters/Identify.cpp", + "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", + ] + + if (chip_enable_ota_requestor) { + sources += [ "${example_platform_dir}/ota/OtaUtils.cpp" ] + } + + include_dirs += [ + "include/config", + "../common/main", + "../common/main/include", + "${chip_root}/examples/lock-app/lock-common/include", + ] + + sources += [ + "${chip_root}/examples/lock-app/lock-common/src/LockEndpoint.cpp", + "${chip_root}/examples/lock-app/lock-common/src/LockManager.cpp", + "../common/main/AppTask.cpp", + "../common/main/DeviceCallbacks.cpp", + "../common/main/ZclCallbacks.cpp", + "../common/main/main.cpp", + ] + + if (chip_with_low_power == 0) { + sources += [ + "${common_example_dir}/ui_feedback/source/LedManager.cpp", + "${example_platform_dir}/util/LedOnOff.cpp", + ] + } + + deps += [ + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/platform/logging:default", + ] + + deps += [ "${chip_root}/examples/lock-app/nxp/zap:zap" ] + + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", + ] + } + + cflags = [ + "-Wconversion", + "-Wno-error=format=", + ] + + ldscript = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-Wl,--defsym=__heap_size__=0", + "-Wl,--defsym=__stack_size__=0x480", + "-Wl,-print-memory-usage", + "-Wl,--no-warn-rwx-segments", + "-T" + rebase_path(ldscript, root_build_dir), + ] + + if (chip_with_factory_data == 1) { + ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ] + } + + output_dir = root_out_dir +} + +group("default") { + deps = [ ":lock_app" ] +} diff --git a/examples/lock-app/nxp/k32w1/README.md b/examples/lock-app/nxp/k32w1/README.md new file mode 100644 index 00000000000000..9b3cd33c1d4ed2 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/README.md @@ -0,0 +1,165 @@ +# Matter K32W1 Door Lock Example Application + +For generic information related to door lock application, please see the +[common README](../README.md). + +- [Matter K32W1 Door Lock Example Application](#matter-k32w1-door-lock-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Flashing](#flashing) + - [Flashing the `NBU` image](#flashing-the-nbu-image) + - [Flashing the host image](#flashing-the-host-image) + - [Debugging](#debugging) + - [OTA](#ota) + +## Introduction + +The following board was used when testing this Matter reference app for a +`k32w1` device: +![K32W1 EVK](../../../platform/nxp/mcxw71_k32w1/doc/images/k32w1-evk.jpg) + +## Device UI + +The state feedback is provided through LED effects: + +| widget | effect | description | +| ------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------- | +| LED2 | short flash on (50ms on/950ms off) | The device is in an unprovisioned (unpaired) state and is waiting for a commissioner to connect. | +| LED2 | rapid even flashing (100ms period) | The device is in an unprovisioned state and a commissioner is connected via BLE. | +| LED2 | short flash off (950ms on/50ms off) | The device is fully provisioned, but does not yet have full network (Thread) or service connectivity. | +| LED2 | solid on | The device is fully provisioned and has full network and service connectivity. | +| RGB LED | on | The `LockState` attribute of the `DoorLock` cluster is `Unlocked`. | +| RGB LED | off | The `LockState` attribute of the `DoorLock` cluster is `Locked`. | + +NOTE: `LED2` will be disabled when OTA is used. On K32W1 EVK board, `PTB0` is +wired to both `LED2` and CS (Chip Select) of the External Flash Memory. Since +the OTA image is stored in external memory, `LED2` operations will affect OTA +operation by corrupting packages and OTA will not work. + +The user actions are summarized below: + +| button | action | state | output | +| ------ | ----------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| SW2 | short press | not commissioned | Enable BLE advertising | +| SW2 | short press | commissioned + device is LIT | Enable Active Mode | +| SW2 | long press | NA | Initiate a factory reset (can be cancelled by pressing the button again within the factory reset timeout limit - 6 seconds by default) | +| SW3 | short press | NA | Toggle attribute `LockState` value | +| SW3 | long press | NA | Clean soft reset of the device (takes into account proper Matter shutdown procedure) | + +## Building + +Manually building requires running the following commands: + +``` +user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lock-app/nxp/k32w1 +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w1$ gn gen out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w1$ ninja -C out/debug +``` + +Please note that running `gn gen out/debug` without `--args` option will use the +default gn args values found in `args.gni`. + +After a successful build, the `elf` and `srec` files are found in `out/debug/`. +See the files prefixed with `chip-k32w1-lock-example`. + +## Flashing + +Two images must be written to the board: one for the host (CM33) and one for the +`NBU` (CM3). + +The image needed on the host side is the one generated in `out/debug/` while the +one needed on the `NBU` side can be found in the downloaded NXP-SDK package at +path - +`middleware\wireless\ieee-802.15.4\bin\k32w1\k32w1_nbu_ble_15_4_dyn_matter.sb3`. + +### Flashing the `NBU` image + +`NBU` image should be written only when a new NXP-SDK is released. + +[K32W148 board quick start guide](https://www.nxp.com/document/guide/getting-started-with-the-k32w148-development-platform:GS-K32W148EVK) +can be used for updating the `NBU/radio` core: + +- Section 2.5 – Get Software – install `SPSDK` (Secure Provisioning Command + Line Tool) +- Section 3.3 – Updating `NBU` for Wireless examples - use the corresponding + `.sb3` file found in the SDK package at path + `middleware\wireless\ieee-802.15.4\bin\k32w1\` + +### Flashing the host image + +Host image is the one found under `out/debug/`. It should be written after each +build process. + +If debugging is needed then jump directly to the [Debugging](#debugging) +section. Otherwise, if only flashing is needed then +[JLink 7.84b or greater](https://www.segger.com/downloads/jlink/) can be used: + +- Plug K32W1 to the USB port (no need to keep the SW4 button pressed while + doing this, e.g. ISP mode is not needed for host flashing) + +- Connect JLink to the device: + + ```bash + JLinkExe -device K32W1480 -if SWD -speed 4000 -autoconnect 1 + ``` + +- Run the following commands: + ```bash + reset + halt + loadfile chip-k32w1-lock-example.srec + reset + go + quit + ``` + +## Debugging + +One option for debugging would be to use MCUXpresso IDE. + +- Drag-and-drop the zip file containing the NXP SDK in the "Installed SDKs" + tab: + +![Installed SDKs](../../../platform/nxp/mcxw71_k32w1/doc/images/installed_sdks.jpg) + +- Import any demo application from the installed SDK: + +``` +Import SDK example(s).. -> choose a demo app (demo_apps -> hello_world) -> Finish +``` + +![Import demo](../../../platform/nxp/mcxw71_k32w1/doc/images/import_demo.jpg) + +- Flash the previously imported demo application on the board: + +``` +Right click on the application (from Project Explorer) -> Debug as -> JLink/CMSIS-DAP +``` + +After this step, a debug configuration specific for the K32W1 board was created. +This debug configuration will be used later on for debugging the application +resulted after ot-nxp compilation. + +- Import Matter repo in MCUXpresso IDE as Makefile Project. Use _none_ as + _Toolchain for Indexer Settings_: + +``` +File -> Import -> C/C++ -> Existing Code as Makefile Project +``` + +![New Project](../../../platform/nxp/mcxw71_k32w1/doc/images/new_project.jpg) + +- Replace the path of the existing demo application with the path of the K32W1 + application: + +``` +Run -> Debug Configurations... -> C/C++ Application +``` + +![Debug K32W1](../../../platform/nxp/mcxw71_k32w1/doc/images/debug_k32w1.jpg) + +## OTA + +Please see +[k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/lock-app/nxp/k32w1/args.gni b/examples/lock-app/nxp/k32w1/args.gni new file mode 100644 index 00000000000000..e0c41d1e34f870 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/args.gni @@ -0,0 +1,45 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") + +# SDK target. This is overridden to add our SDK app_config.h & defines. +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") +nxp_device = "K32W1480" + +chip_enable_ota_requestor = true +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true +chip_generate_link_map_file = true + +chip_system_config_provide_statistics = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_with_lwip = false + +chip_enable_icd_server = true +chip_enable_icd_lit = false +icd_enforce_sit_slow_poll_limit = true +chip_persist_subscriptions = true +chip_subscription_timeout_resumption = true + +is_debug = false + +chip_crypto = "platform" +chip_openthread_ftd = false +chip_with_ot_cli = 0 +chip_enable_matter_cli = true + +chip_with_diag_logs_demo = true +chip_with_low_power = 0 diff --git a/examples/lock-app/nxp/k32w1/build_overrides b/examples/lock-app/nxp/k32w1/build_overrides new file mode 120000 index 00000000000000..ee19c065d619a2 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/build_overrides @@ -0,0 +1 @@ +../../../build_overrides/ \ No newline at end of file diff --git a/examples/lock-app/nxp/k32w1/include/config/AppConfig.h b/examples/lock-app/nxp/k32w1/include/config/AppConfig.h new file mode 100644 index 00000000000000..89f4bf9333c4c8 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/include/config/AppConfig.h @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/* ---- App Config ---- */ + +/* ---- Button Manager Config ---- */ +#define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 + +/* ---- LED Manager Config ---- */ +#define LED_MANAGER_STATUS_LED_INDEX 0 +#define LED_MANAGER_LIGHT_LED_INDEX 1 diff --git a/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h new file mode 100644 index 00000000000000..6bb18eef5a0fc9 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use hard-coded test certificates already embedded in generic chip code => set it to 0 +// Use real/development certificates => set it to 1 + file the provisioning section from +// the internal flash +#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA +#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0 +#endif + +#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +// VID/PID for product => will be used by Basic Information Cluster +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037 +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA221 + +// Set the following define to use the Certification Declaration from below and not use it stored in factory data section +#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION +#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0 +#endif + +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0x1037 +//-> product_id_array = [ 0xA221 ] +//-> device_type_id = 0x000A +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 1 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x81, 0xe8, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xda, 0x30, 0x81, 0xd7, \ + 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x44, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x37, 0x04, 0x35, 0x15, 0x24, 0x00, \ + 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x21, 0xa2, 0x18, 0x24, 0x03, 0x0a, 0x2c, 0x04, 0x13, 0x5a, 0x49, \ + 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, 0x05, \ + 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, 0x03, \ + 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, \ + 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, \ + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0x94, 0xea, 0x03, \ + 0xe1, 0x95, 0xdc, 0xad, 0x43, 0x99, 0xa5, 0x94, 0x68, 0x1e, 0x62, 0x5f, 0x82, 0xfa, 0x6f, 0x61, 0x9e, 0x71, 0x79, \ + 0x63, 0x5f, 0xe5, 0x5e, 0x5d, 0xaf, 0x33, 0x91, 0xf0, 0x72, 0x02, 0x20, 0x16, 0xd1, 0x0c, 0x6f, 0x83, 0xbe, 0xbd, \ + 0x45, 0xa5, 0x59, 0xa7, 0x13, 0x8c, 0x5c, 0xd0, 0xd1, 0x68, 0x90, 0x9b, 0x6c, 0x40, 0x12, 0x9b, 0xc3, 0x3e, 0x6e, \ + 0x3c, 0xa6, 0x80, 0xbf, 0x7c, 0xd9 \ + } + +// All remaining data will be pulled from the provisioning region of flash. +#endif + +#else + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +// Use a default setup PIN code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors" +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App" +#endif + +/** + * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE should change his advertisements + * from fast interval to slow interval. + * + * 30000 (30 secondes). + */ +#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000) + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE advertisement should be disabled, counting + * from the moment of slow advertisement commencement. + * + * Defaults to 9000000 (15 minutes). + */ +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) + +/** + * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * + * NFC commissioning is not supported on K32W1 + */ +#define CONFIG_CHIP_NFC_COMMISSIONING 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 + +/** + * @def CHIP_CONFIG_MAX_FABRICS + * + * @brief + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. + */ +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics + +/** + * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER + * + * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server. + */ +#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 2 + +/** + * @def CHIP_IM_MAX_NUM_WRITE_HANDLER + * + * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server. + */ +#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#if CONFIG_DIAG_LOGS_DEMO +#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1 +#define CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE 1024 +#endif diff --git a/examples/lock-app/nxp/k32w1/third_party/connectedhomeip b/examples/lock-app/nxp/k32w1/third_party/connectedhomeip new file mode 120000 index 00000000000000..59307833b4fee9 --- /dev/null +++ b/examples/lock-app/nxp/k32w1/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../.. \ No newline at end of file diff --git a/examples/lock-app/nxp/mcxw71/.gn b/examples/lock-app/nxp/mcxw71/.gn new file mode 100644 index 00000000000000..5d6e10a31e334d --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") + + # Import default platform configs + import("${chip_root}/src/platform/nxp/mcxw71_k32w1/args.gni") +} diff --git a/examples/lock-app/nxp/mcxw71/BUILD.gn b/examples/lock-app/nxp/mcxw71/BUILD.gn new file mode 100644 index 00000000000000..effa43f226640b --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/BUILD.gn @@ -0,0 +1,276 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/nxp_sdk.gni") +import("//build_overrides/openthread.gni") + +import("${nxp_sdk_build_root}/nxp_sdk.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni") + +import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni") + +import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni") + +declare_args() { + # Setup discriminator as argument + setup_discriminator = 3840 + chip_with_diag_logs_demo = true +} + +assert(current_os == "freertos") +assert(target_os == "freertos") + +example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" +common_example_dir = "${chip_root}/examples/platform/nxp/common" + +mcxw71_k32w1_sdk("sdk") { + defines = [] + include_dirs = [] + sources = [] + + # Indicate the path to CHIPProjectConfig.h + include_dirs += [ "include/config" ] + + # Indicate the default path to FreeRTOSConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ] + + # Indicate the default path to OpenThreadConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + + include_dirs += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", + ] + + sources += [ + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480/clock_config.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480/pin_mux.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/app_services_init.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_comp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_dcdc.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", + "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + ] + + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } + + defines += [ + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setup_discriminator}", + ] + + if (chip_key_storage == "littlefs") { + include_dirs += [ "${example_platform_dir}/board" ] + sources += [ + "${example_platform_dir}/board/peripherals.c", + "${example_platform_dir}/board/peripherals.h", + ] + } +} + +mcxw71_k32w1_executable("lock_app") { + output_name = "chip-mcxw71-lock-example" + + defines = [] + deps = [] + include_dirs = [] + sources = [] + + # Defines used by common code + defines += [ + "CONFIG_NET_L2_OPENTHREAD=1", + "CONFIG_NETWORK_LAYER_BLE=1", + "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", + "CONFIG_OPERATIONAL_KEYSTORE=1", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "CONFIG_APP_FREERTOS_OS=1", + ] + + if (chip_with_diag_logs_demo) { + defines += [ "CONFIG_DIAG_LOGS_DEMO=1" ] + } + + if (chip_with_low_power == 1) { + defines += [ "CONFIG_LOW_POWER=1" ] + } else { + defines += [ + "CONFIG_ENABLE_FEEDBACK=1", + "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", + ] + } + + # App common files + include_dirs += [ + "${common_example_dir}/icd/include", + "${common_example_dir}/app_task/include", + "${common_example_dir}/matter_button/include", + "${common_example_dir}/matter_cli/include", + "${common_example_dir}/clusters/include", + "${common_example_dir}/device_callbacks/include", + "${common_example_dir}/device_manager/include", + "${common_example_dir}/diagnostic_logs/include", + "${common_example_dir}/factory_data/include", + "${common_example_dir}/led_widget/include", + "${common_example_dir}/low_power/include", + "${common_example_dir}/operational_keystore/include", + "${common_example_dir}/ui_feedback/include", + ] + + sources += [ + "${common_example_dir}/app_task/source/AppTaskBase.cpp", + "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", + + #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", + "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", + "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/icd/source/ICDUtil.cpp", + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", + ] + + if (chip_with_low_power == 1) { + sources += [ "${common_example_dir}/low_power/source/LowPower.cpp" ] + } + + if (chip_with_factory_data == 1) { + include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] + } + + if (chip_enable_matter_cli) { + defines += [ "ENABLE_CHIP_SHELL" ] + deps += [ + "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/lib/shell:shell", + ] + sources += [ + "${common_example_dir}/matter_cli/source/AppCLIBase.cpp", + "${common_example_dir}/matter_cli/source/AppCLIFreeRTOS.cpp", + ] + } + + if (chip_enable_ota_requestor) { + defines += [ + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. + "LED_MANAGER_ENABLE_STATUS_LED=0", + ] + + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] + deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] + } + + if (chip_with_diag_logs_demo) { + sources += [ + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsProviderDelegateImpl.cpp", + ] + } + + # Platform specific files + include_dirs += [ + "${example_platform_dir}/util", + "${example_platform_dir}/app/support", + "${example_platform_dir}/button", + ] + + sources += [ + "${example_platform_dir}/button/ButtonManager.cpp", + "${example_platform_dir}/clusters/Identify.cpp", + "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", + ] + + if (chip_enable_ota_requestor) { + sources += [ "${example_platform_dir}/ota/OtaUtils.cpp" ] + } + + include_dirs += [ + "include/config", + "../common/main", + "../common/main/include", + "${chip_root}/examples/lock-app/lock-common/include", + ] + + sources += [ + "${chip_root}/examples/lock-app/lock-common/src/LockEndpoint.cpp", + "${chip_root}/examples/lock-app/lock-common/src/LockManager.cpp", + "../common/main/AppTask.cpp", + "../common/main/DeviceCallbacks.cpp", + "../common/main/ZclCallbacks.cpp", + "../common/main/main.cpp", + ] + + if (chip_with_low_power == 0) { + sources += [ + "${common_example_dir}/ui_feedback/source/LedManager.cpp", + "${example_platform_dir}/util/LedOnOff.cpp", + ] + } + + deps += [ + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/platform/logging:default", + ] + + deps += [ "${chip_root}/examples/lock-app/nxp/zap:zap" ] + + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", + ] + } + + cflags = [ + "-Wconversion", + "-Wno-error=format=", + ] + + ldscript = "${nxp_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-Wl,--defsym=__heap_size__=0", + "-Wl,--defsym=__stack_size__=0x480", + "-Wl,-print-memory-usage", + "-Wl,--no-warn-rwx-segments", + "-T" + rebase_path(ldscript, root_build_dir), + ] + + if (chip_with_factory_data == 1) { + ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ] + } + + output_dir = root_out_dir +} + +group("default") { + deps = [ ":lock_app" ] +} diff --git a/examples/lock-app/nxp/mcxw71/README.md b/examples/lock-app/nxp/mcxw71/README.md new file mode 100644 index 00000000000000..593aed82f58641 --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/README.md @@ -0,0 +1,197 @@ +# Matter `MCXW71` Door Lock Example Application + +For generic information related to door lock application, please see the +[common README](../README.md). + +- [Matter `MCXW71` Door Lock Example Application](#matter-mcxw71-door-lock-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Flashing](#flashing) + - [Flashing the `NBU` image](#flashing-the-nbu-image) + - [Flashing the host image](#flashing-the-host-image) + - [Debugging](#debugging) + - [OTA](#ota) + +## Introduction + +The following board was used when testing this Matter reference app for an +`mcxw71` device: +![FRDM-MCXW71](../../../platform/nxp/mcxw71_k32w1/doc/images/frdm-mcxw71.jpg) + +## Device UI + +The state feedback is provided through LED effects: + +| widget | effect | description | +| ------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------- | +| LED2 | short flash on (50ms on/950ms off) | The device is in an unprovisioned (unpaired) state and is waiting for a commissioner to connect. | +| LED2 | rapid even flashing (100ms period) | The device is in an unprovisioned state and a commissioner is connected via BLE. | +| LED2 | short flash off (950ms on/50ms off) | The device is fully provisioned, but does not yet have full network (Thread) or service connectivity. | +| LED2 | solid on | The device is fully provisioned and has full network and service connectivity. | +| RGB LED | on | The `LockState` attribute of the `DoorLock` cluster is `Unlocked`. | +| RGB LED | off | The `LockState` attribute of the `DoorLock` cluster is `Locked`. | + +NOTE: `LED2` will be disabled when OTA is used. On `MCXW71` board, `PTB0` is +wired to both `LED2` and CS (Chip Select) of the External Flash Memory. Since +the OTA image is stored in external memory, `LED2` operations will affect OTA +operation by corrupting packages and OTA will not work. + +The user actions are summarized below: + +| button | action | state | output | +| ------ | ----------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| SW2 | short press | not commissioned | Enable BLE advertising | +| SW2 | short press | commissioned + device is LIT | Enable Active Mode | +| SW2 | long press | NA | Initiate a factory reset (can be cancelled by pressing the button again within the factory reset timeout limit - 6 seconds by default) | +| SW3 | short press | NA | Toggle attribute `LockState` value | +| SW3 | long press | NA | Clean soft reset of the device (takes into account proper Matter shutdown procedure) | + +## Building + +Manually building requires running the following commands: + +``` +user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lock-app/nxp/mcxw71 +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/mcxw71$ gn gen out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/mcxw71$ ninja -C out/debug +``` + +Please note that running `gn gen out/debug` without `--args` option will use the +default gn args values found in `args.gni`. + +After a successful build, the `elf` and `srec` files are found in `out/debug/`. +See the files prefixed with `chip-mcxw71-lock-example`. + +## Flashing + +Two images must be written to the board: one for the host (CM33) and one for the +`NBU` (CM3). + +The image needed on the host side is the one generated in `out/debug/` while the +one needed on the `NBU` side can be found in the downloaded NXP-SDK package at +path - +`middleware\wireless\ieee-802.15.4\bin\k32w1\k32w1_nbu_ble_15_4_dyn_matter.sb3`. + +### Flashing the `NBU` image + +`NBU` image should be written only when a new NXP SDK is released. + +1. Install + [Secure Provisioning SDK tool](https://www.nxp.com/design/design-center/software/development-software/secure-provisioning-sdk-spsdk:SPSDK) + using Python: + + ``` + pip install spsdk + ``` + + Note: There might be some dependencies that cause conflicts with already + installed Python modules. However, `blhost` tool is still installed and can + be used. + +2. Updating `NBU` for Wireless examples + + It is necessary to work with the matching `NBU` image for the SDK version of + the application you are working with. This means that when you download your + SDK, prior to loading any wireless SDK example, update your `NBU` image with + the SDK provided binaries. For `FRDM` users, please write the following + binary: + + `middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3` + + Please note that `` may vary depending on the SDK version. + + 1. Place your device in `ISP` mode. + + - Make sure a jumper is placed on `JP25` + - Press and hold `SW4`, press and release Reset, then release `SW4` + + 2. Once the device is connected, you may find the assigned port by running: + + ``` + nxpdevscan + ``` + + 3. Run the `blhost` command to write the `sb3` file: + + ``` + blhost -p receive-sb-file \middleware\wireless\ieee-802.15.4\bin\mcxw71\mcxw71_nbu_ble_15_4_dyn_matter_.sb3 + ``` + +### Flashing the host image + +Host image is the one found under `out/debug/`. It should be written after each +build process. + +If debugging is needed then jump directly to the [Debugging](#debugging) +section. Otherwise, if only flashing is needed then +[JLink 7.84b or greater](https://www.segger.com/downloads/jlink/) can be used: + +- Plug `MCXW71` to the USB port (no need to keep the `SW4` button pressed + while doing this, e.g. ISP mode is not needed for host flashing) + +- Connect JLink to the device: + + ```bash + JLinkExe -device MCXW71 -if SWD -speed 4000 -autoconnect 1 + ``` + +- Run the following commands: + ```bash + reset + halt + loadfile chip-mcxw71-lock-example.srec + reset + go + quit + ``` + +## Debugging + +One option for debugging would be to use MCUXpresso IDE. + +- Drag-and-drop the zip file containing the NXP SDK in the "Installed SDKs" + tab: + +![Installed SDKs](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_installed_sdks.jpg) + +- Import any demo application from the installed SDK: + +``` +Import SDK example(s).. -> choose a demo app (demo_apps -> hello_world) -> Finish +``` + +![Import demo](../../../platform/nxp/mcxw71_k32w1/doc/images/import_demo.jpg) + +- Flash the previously imported demo application on the board: + +``` +Right click on the application (from Project Explorer) -> Debug as -> JLink/CMSIS-DAP +``` + +After this step, a debug configuration specific for the `MCXW71` board was +created. This debug configuration will be used later on for debugging the +application resulted after ot-nxp compilation. + +- Import Matter repo in MCUXpresso IDE as Makefile Project. Use _none_ as + _Toolchain for Indexer Settings_: + +``` +File -> Import -> C/C++ -> Existing Code as Makefile Project +``` + +![New Project](../../../platform/nxp/mcxw71_k32w1/doc/images/new_project.jpg) + +- Replace the path of the existing demo application with the path of the + `MCXW71` application: + +``` +Run -> Debug Configurations... -> C/C++ Application +``` + +![Debug MCXW71](../../../platform/nxp/mcxw71_k32w1/doc/images/mcxw71_debug.jpg) + +## OTA + +Please see +[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/lock-app/nxp/mcxw71/args.gni b/examples/lock-app/nxp/mcxw71/args.gni new file mode 100644 index 00000000000000..761b050b80cbec --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/args.gni @@ -0,0 +1,45 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") + +# SDK target. This is overridden to add our SDK app_config.h & defines. +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") +nxp_device = "MCXW716C" + +chip_enable_ota_requestor = true +chip_stack_lock_tracking = "fatal" +chip_enable_ble = true +chip_generate_link_map_file = true + +chip_system_config_provide_statistics = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_with_lwip = false + +chip_enable_icd_server = true +chip_enable_icd_lit = false +icd_enforce_sit_slow_poll_limit = true +chip_persist_subscriptions = true +chip_subscription_timeout_resumption = true + +is_debug = false + +chip_crypto = "platform" +chip_openthread_ftd = false +chip_with_ot_cli = 0 +chip_enable_matter_cli = true + +chip_with_diag_logs_demo = true +chip_with_low_power = 0 diff --git a/examples/lock-app/nxp/mcxw71/build_overrides b/examples/lock-app/nxp/mcxw71/build_overrides new file mode 120000 index 00000000000000..ee19c065d619a2 --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/build_overrides @@ -0,0 +1 @@ +../../../build_overrides/ \ No newline at end of file diff --git a/examples/lock-app/nxp/mcxw71/include/config/AppConfig.h b/examples/lock-app/nxp/mcxw71/include/config/AppConfig.h new file mode 100644 index 00000000000000..89f4bf9333c4c8 --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/include/config/AppConfig.h @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/* ---- App Config ---- */ + +/* ---- Button Manager Config ---- */ +#define BUTTON_MANAGER_FACTORY_RESET_TIMEOUT_MS 6000 + +/* ---- LED Manager Config ---- */ +#define LED_MANAGER_STATUS_LED_INDEX 0 +#define LED_MANAGER_LIGHT_LED_INDEX 1 diff --git a/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h new file mode 100644 index 00000000000000..984dd98b3adb6c --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use hard-coded test certificates already embedded in generic chip code => set it to 0 +// Use real/development certificates => set it to 1 + file the provisioning section from +// the internal flash +#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA +#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0 +#endif + +#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +// VID/PID for product => will be used by Basic Information Cluster +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037 +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA401 + +// Set the following define to use the Certification Declaration from below and not use it stored in factory data section +#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION +#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0 +#endif + +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0x1037 +//-> product_id_array = [ 0xA401 ] +//-> device_type_id = 0x0100 +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 1 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x81, 0xe8, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xda, 0x30, 0x81, 0xd7, \ + 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x44, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x37, 0x04, 0x35, 0x15, 0x24, 0x00, \ + 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x01, 0xa4, 0x18, 0x24, 0x03, 0x0a, 0x2c, 0x04, 0x13, 0x5a, 0x49, \ + 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, 0x05, \ + 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, 0x03, \ + 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, \ + 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, \ + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xca, 0x6f, 0xf9, \ + 0xae, 0x3b, 0x2f, 0xc1, 0xf4, 0x07, 0x8f, 0x6d, 0x6e, 0x3b, 0x99, 0xff, 0x98, 0x18, 0x6b, 0x6b, 0xed, 0xa0, 0x27, \ + 0x88, 0xa4, 0x09, 0xc2, 0x0f, 0xc5, 0xa3, 0x21, 0xc2, 0x15, 0x02, 0x20, 0x67, 0x5a, 0xef, 0xe3, 0x0c, 0xcc, 0x9f, \ + 0xcb, 0x1e, 0x45, 0xe1, 0x20, 0xf2, 0xf1, 0x14, 0x19, 0x49, 0xf7, 0x2b, 0xdd, 0x34, 0x85, 0x16, 0xbd, 0x88, 0x9c, \ + 0xc8, 0xac, 0xd0, 0x70, 0x9e, 0x05 \ + } + +// All remaining data will be pulled from the provisioning region of flash. +#endif + +#else + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +// Use a default setup PIN code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors" +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App" +#endif + +/** + * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE should change his advertisements + * from fast interval to slow interval. + * + * 30000 (30 secondes). + */ +#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000) + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT + * + * The amount of time in miliseconds after which BLE advertisement should be disabled, counting + * from the moment of slow advertisement commencement. + * + * Defaults to 9000000 (15 minutes). + */ +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) + +/** + * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * + * NFC commissioning is not supported on K32W1 + */ +#define CONFIG_CHIP_NFC_COMMISSIONING 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 + +/** + * @def CHIP_CONFIG_MAX_FABRICS + * + * @brief + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. + */ +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics + +#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 + +/** + * @def CHIP_DEVICE_CONFIG_KVS_WEAR_STATS + * + * @brief Toggle support for key value store wear stats on or off. + */ +#define CHIP_DEVICE_CONFIG_KVS_WEAR_STATS 0 + +/** + * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER + * + * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server. + */ +#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 2 + +/** + * @def CHIP_IM_MAX_NUM_WRITE_HANDLER + * + * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server. + */ +#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#if CONFIG_DIAG_LOGS_DEMO +#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1 +#define CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE 1024 +#endif diff --git a/examples/lock-app/nxp/mcxw71/third_party/connectedhomeip b/examples/lock-app/nxp/mcxw71/third_party/connectedhomeip new file mode 120000 index 00000000000000..59307833b4fee9 --- /dev/null +++ b/examples/lock-app/nxp/mcxw71/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../.. \ No newline at end of file diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 347ad97fbe2946..7c39ef0fe254eb 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -539,6 +539,177 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -810,6 +981,53 @@ cluster NetworkCommissioning = 49 { command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; } +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ cluster GeneralDiagnostics = 51 { revision 2; @@ -1398,6 +1616,104 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +cluster IcdManagement = 70 { + revision 3; + + enum ClientTypeEnum : enum8 { + kPermanent = 0; + kEphemeral = 1; + } + + enum OperatingModeEnum : enum8 { + kSIT = 0; + kLIT = 1; + } + + bitmap Feature : bitmap32 { + kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + kDynamicSitLitSupport = 0x8; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_sensitive ClientTypeEnum clientType = 4; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute access(read: administer) optional MonitoringRegistrationStruct registeredClients[] = 3; + readonly attribute access(read: administer) optional int32u ICDCounter = 4; + readonly attribute optional int16u clientsSupportedPerFabric = 5; + provisional readonly attribute optional UserActiveModeTriggerBitmap userActiveModeTriggerHint = 6; + provisional readonly attribute optional char_string<128> userActiveModeTriggerInstruction = 7; + provisional readonly attribute optional OperatingModeEnum operatingMode = 8; + provisional readonly attribute optional int32u maximumCheckInBackOff = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RegisterClientRequest { + node_id checkInNodeID = 0; + int64u monitoredSubject = 1; + octet_string<16> key = 2; + optional octet_string<16> verificationKey = 3; + ClientTypeEnum clientType = 4; + } + + response struct RegisterClientResponse = 1 { + int32u ICDCounter = 0; + } + + request struct UnregisterClientRequest { + node_id checkInNodeID = 0; + optional octet_string<16> verificationKey = 1; + } + + request struct StayActiveRequestRequest { + int32u stayActiveDuration = 0; + } + + response struct StayActiveResponse = 4 { + int32u promisedActiveDuration = 0; + } + + /** Register a client to the end device */ + fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0; + /** Unregister a client from an end device */ + fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2; + /** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */ + command access(invoke: manage) StayActiveRequest(StayActiveRequestRequest): StayActiveResponse = 3; +} + /** An interface to a generic way to secure a door */ cluster DoorLock = 257 { revision 7; @@ -2050,8 +2366,9 @@ cluster DoorLock = 257 { } endpoint 0 { - device type ma_rootdevice = 22, version 1; + device type ma_rootdevice = 22, version 2; + binding cluster OtaSoftwareUpdateProvider; server cluster Descriptor { callback attribute deviceTypeList; @@ -2066,9 +2383,13 @@ endpoint 0 { emits event AccessControlEntryChanged; emits event AccessControlExtensionChanged; callback attribute acl; + callback attribute extension; callback attribute subjectsPerAccessControlEntry; callback attribute targetsPerAccessControlEntry; callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; callback attribute clusterRevision; @@ -2093,16 +2414,49 @@ endpoint 0 { callback attribute capabilityMinima; callback attribute specificationVersion; callback attribute maxPathsPerInvoke; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } + server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; + callback attribute defaultOTAProviders; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; callback attribute regulatoryConfig; callback attribute locationCapability; callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -2123,8 +2477,14 @@ endpoint 0 { ram attribute lastNetworkingStatus; ram attribute lastNetworkID; ram attribute lastConnectErrorValue; + ram attribute supportedThreadFeatures; + ram attribute threadVersion; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 2; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ScanNetworks; handle command ScanNetworksResponse; @@ -2136,12 +2496,29 @@ endpoint 0 { handle command ReorderNetwork; } + server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + server cluster GeneralDiagnostics { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount; callback attribute upTime; + callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap; callback attribute clusterRevision; @@ -2222,6 +2599,10 @@ endpoint 0 { callback attribute channelPage0Mask; callback attribute operationalDatasetComponents; callback attribute activeNetworkFaultsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0x000F; ram attribute clusterRevision default = 2; @@ -2278,16 +2659,29 @@ endpoint 0 { handle command KeySetReadAllIndices; handle command KeySetReadAllIndicesResponse; } + + server cluster IcdManagement { + callback attribute idleModeDuration; + callback attribute activeModeDuration; + callback attribute activeModeThreshold; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0000; + ram attribute clusterRevision default = 1; + } } endpoint 1 { device type ma_doorlock = 10, version 1; server cluster Identify { - ram attribute identifyTime default = 0x0; + ram attribute identifyTime default = 0x0000; ram attribute identifyType default = 0x0; callback attribute generatedCommandList; callback attribute acceptedCommandList; + callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 4; @@ -2303,6 +2697,7 @@ endpoint 1 { callback attribute partsList; callback attribute generatedCommandList; callback attribute acceptedCommandList; + callback attribute eventList; callback attribute attributeList; callback attribute featureMap; callback attribute clusterRevision; @@ -2310,34 +2705,41 @@ endpoint 1 { server cluster DoorLock { emits event DoorLockAlarm; + emits event DoorStateChange; emits event LockOperation; emits event LockOperationError; emits event LockUserChange; - ram attribute lockState; + persist attribute lockState default = 1; ram attribute lockType; ram attribute actuatorEnabled; - ram attribute numberOfTotalUsersSupported default = 0; + ram attribute doorState; + ram attribute numberOfTotalUsersSupported default = 10; + ram attribute numberOfPINUsersSupported default = 10; + ram attribute numberOfRFIDUsersSupported default = 10; + ram attribute maxPINCodeLength default = 8; + ram attribute minPINCodeLength default = 6; + ram attribute maxRFIDCodeLength default = 20; + ram attribute minRFIDCodeLength default = 10; ram attribute credentialRulesSupport default = 1; + ram attribute numberOfCredentialsSupportedPerUser default = 5; ram attribute autoRelockTime; - ram attribute operatingMode; + ram attribute operatingMode default = 0x00; ram attribute supportedOperatingModes default = 0xFFF6; - ram attribute expiringUserTimeout default = 1440; + ram attribute enableOneTouchLocking default = 0x00; + ram attribute enablePrivacyModeButton default = 0x00; + ram attribute wrongCodeEntryLimit default = 3; + ram attribute userCodeTemporaryDisableTime default = 10; + ram attribute requirePINforRemoteOperation default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; + callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0x1000; - ram attribute clusterRevision default = 6; + ram attribute featureMap default = 0x0001; + ram attribute clusterRevision default = 7; handle command LockDoor; handle command UnlockDoor; - handle command SetUser; - handle command GetUser; - handle command GetUserResponse; - handle command ClearUser; - handle command SetCredential; - handle command SetCredentialResponse; - handle command GetCredentialStatus; - handle command GetCredentialStatusResponse; + handle command UnlockWithTimeout; } } diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 70442ac916c7fe..67da76956d2e1d 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -52,7 +52,7 @@ } ], "deviceVersions": [ - 1 + 2 ], "deviceIdentifiers": [ 22 @@ -191,6 +191,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "SubjectsPerAccessControlEntry", "code": 2, @@ -239,6 +255,54 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -553,6 +617,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -611,138 +739,132 @@ ] }, { - "name": "General Commissioning", - "code": 48, + "name": "OTA Software Update Provider", + "code": 41, "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "server", + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", "enabled": 1, "commands": [ { - "name": "ArmFailSafe", + "name": "QueryImage", "code": 0, "mfgCode": null, "source": "client", - "isIncoming": 1, + "isIncoming": 0, "isEnabled": 1 }, { - "name": "ArmFailSafeResponse", + "name": "QueryImageResponse", "code": 1, "mfgCode": null, "source": "server", - "isIncoming": 0, + "isIncoming": 1, "isEnabled": 1 }, { - "name": "SetRegulatoryConfig", + "name": "ApplyUpdateRequest", "code": 2, "mfgCode": null, "source": "client", - "isIncoming": 1, + "isIncoming": 0, "isEnabled": 1 }, { - "name": "SetRegulatoryConfigResponse", + "name": "ApplyUpdateResponse", "code": 3, "mfgCode": null, "source": "server", - "isIncoming": 0, + "isIncoming": 1, "isEnabled": 1 }, { - "name": "CommissioningComplete", + "name": "NotifyUpdateApplied", "code": 4, "mfgCode": null, "source": "client", - "isIncoming": 1, + "isIncoming": 0, "isEnabled": 1 - }, + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ { - "name": "CommissioningCompleteResponse", - "code": 5, + "name": "AnnounceOTAProvider", + "code": 0, "mfgCode": null, - "source": "server", - "isIncoming": 0, + "source": "client", + "isIncoming": 1, "isEnabled": 1 } ], "attributes": [ { - "name": "Breadcrumb", + "name": "DefaultOTAProviders", "code": 0, "mfgCode": null, "side": "server", - "type": "int64u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "BasicCommissioningInfo", + "name": "UpdatePossible", "code": 1, "mfgCode": null, "side": "server", - "type": "BasicCommissioningInfo", + "type": "boolean", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RegulatoryConfig", + "name": "UpdateState", "code": 2, "mfgCode": null, "side": "server", - "type": "RegulatoryLocationTypeEnum", + "type": "UpdateStateEnum", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 }, { - "name": "LocationCapability", + "name": "UpdateStateProgress", "code": 3, "mfgCode": null, "side": "server", - "type": "RegulatoryLocationTypeEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportsConcurrentConnection", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "boolean", + "type": "int8u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -780,33 +902,430 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { - "name": "Network Commissioning", - "code": 49, + "name": "Localization Configuration", + "code": 43, "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "attributes": [ { - "name": "ScanNetworks", + "name": "ActiveLocale", "code": 0, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ScanNetworksResponse", + "name": "SupportedLocales", "code": 1, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { "name": "AddOrUpdateThreadNetwork", "code": 3, "mfgCode": null, @@ -815,66 +1334,258 @@ "isEnabled": 1 }, { - "name": "RemoveNetwork", - "code": 4, + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedThreadFeatures", + "code": 9, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "ThreadCapabilitiesBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "NetworkConfigResponse", - "code": 5, + "name": "ThreadVersion", + "code": 10, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ConnectNetwork", - "code": 6, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ConnectNetworkResponse", - "code": 7, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ReorderNetwork", - "code": 8, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "MaxNetworks", - "code": 0, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "Networks", - "code": 1, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", "type": "array", @@ -889,96 +1600,124 @@ "reportableChange": 0 }, { - "name": "ScanMaxTimeSeconds", - "code": 2, + "name": "FeatureMap", + "code": 65532, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ConnectMaxTimeSeconds", - "code": 3, + "name": "ClusterRevision", + "code": 65533, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "InterfaceEnabled", - "code": 4, + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "LastNetworkingStatus", - "code": 5, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "NetworkCommissioningStatusEnum", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "LastNetworkID", - "code": 6, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", - "type": "octet_string", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "LastConnectErrorValue", - "code": 7, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "int32s", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -994,7 +1733,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1012,8 +1751,8 @@ "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -1089,7 +1828,87 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int64u", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1101,16 +1920,16 @@ "reportableChange": 0 }, { - "name": "TestEventTriggersEnabled", - "code": 8, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "false", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2253,6 +3072,70 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -2786,12 +3669,166 @@ "reportableChange": 0 } ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdleModeDuration", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeDuration", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] }, { "id": 2, - "name": "Anonymous Endpoint Type", + "name": "MA-dimmablelight", "deviceTypeRef": { "code": 10, "profileId": 259, @@ -2852,10 +3889,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0", + "defaultValue": "0x0000", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 }, { @@ -2906,6 +3943,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -2950,8 +4003,8 @@ "bounded": 0, "defaultValue": "4", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 } ] @@ -3013,8 +4066,24 @@ "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -3029,8 +4098,8 @@ "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -3045,8 +4114,8 @@ "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", "type": "array", @@ -3135,130 +4204,186 @@ "isEnabled": 1 }, { - "name": "SetUser", - "code": 26, + "name": "UnlockWithTimeout", + "code": 3, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 - }, + } + ], + "attributes": [ { - "name": "GetUser", - "code": 27, + "name": "LockState", + "code": 0, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "DlLockState", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "GetUserResponse", - "code": 28, + "name": "LockType", + "code": 1, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 + "side": "server", + "type": "DlLockType", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ClearUser", - "code": 29, + "name": "ActuatorEnabled", + "code": 2, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "SetCredential", - "code": 34, + "name": "DoorState", + "code": 3, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "DoorStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "SetCredentialResponse", - "code": 35, + "name": "NumberOfTotalUsersSupported", + "code": 17, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "GetCredentialStatus", - "code": 36, + "name": "NumberOfPINUsersSupported", + "code": 18, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "GetCredentialStatusResponse", - "code": 37, + "name": "NumberOfRFIDUsersSupported", + "code": 19, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { - "name": "LockState", - "code": 0, + "name": "MaxPINCodeLength", + "code": 23, "mfgCode": null, "side": "server", - "type": "DlLockState", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "8", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "LockType", - "code": 1, + "name": "MinPINCodeLength", + "code": 24, "mfgCode": null, "side": "server", - "type": "DlLockType", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "6", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ActuatorEnabled", - "code": 2, + "name": "MaxRFIDCodeLength", + "code": 25, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NumberOfTotalUsersSupported", - "code": 17, + "name": "MinRFIDCodeLength", + "code": 26, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3280,6 +4405,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "NumberOfCredentialsSupportedPerUser", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AutoRelockTime", "code": 35, @@ -3306,7 +4447,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3329,16 +4470,80 @@ "reportableChange": 0 }, { - "name": "ExpiringUserTimeout", - "code": 53, + "name": "EnableOneTouchLocking", + "code": 41, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnablePrivacyModeButton", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WrongCodeEntryLimit", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserCodeTemporaryDisableTime", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RequirePINforRemoteOperation", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1440", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3376,6 +4581,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -3402,7 +4623,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x1000", + "defaultValue": "0x0001", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3418,7 +4639,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "6", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3433,6 +4654,13 @@ "side": "server", "included": 1 }, + { + "name": "DoorStateChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, { "name": "LockOperation", "code": 2, @@ -3469,7 +4697,7 @@ "parentEndpointIdentifier": null }, { - "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeName": "MA-dimmablelight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, diff --git a/examples/lock-app/silabs/build_for_wifi_gnfile.gn b/examples/lock-app/silabs/build_for_wifi_gnfile.gn index d391814190d09f..1d6a71e88dd16f 100644 --- a/examples/lock-app/silabs/build_for_wifi_gnfile.gn +++ b/examples/lock-app/silabs/build_for_wifi_gnfile.gn @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_enable_wifi = true + chip_device_platform = "SiWx917" import("//build_for_wifi_args.gni") } diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index ee3b67b82eb15d..b2598b171f7712 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 273b523ce5060f..0ed34e7eea61fb 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -234,56 +234,6 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } -/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ -cluster Identify = 3 { - revision 4; - - enum EffectIdentifierEnum : enum8 { - kBlink = 0; - kBreathe = 1; - kOkay = 2; - kChannelChange = 11; - kFinishEffect = 254; - kStopEffect = 255; - } - - enum EffectVariantEnum : enum8 { - kDefault = 0; - } - - enum IdentifyTypeEnum : enum8 { - kNone = 0; - kLightOutput = 1; - kVisibleIndicator = 2; - kAudibleBeep = 3; - kDisplay = 4; - kActuator = 5; - } - - attribute int16u identifyTime = 0; - readonly attribute IdentifyTypeEnum identifyType = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct IdentifyRequest { - int16u identifyTime = 0; - } - - request struct TriggerEffectRequest { - EffectIdentifierEnum effectIdentifier = 0; - EffectVariantEnum effectVariant = 1; - } - - /** Command description for Identify */ - command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; - /** Command description for TriggerEffect */ - command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -1594,16 +1544,6 @@ endpoint 0 { device type ma_rootdevice = 22, version 1; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.zap b/examples/network-manager-app/network-manager-common/network-manager-app.zap index da1c431a49157f..a016ef57f5c9e9 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.zap +++ b/examples/network-manager-app/network-manager-common/network-manager-app.zap @@ -61,98 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/ota-requestor-app/ameba/README.md b/examples/ota-requestor-app/ameba/README.md index 607a9abd08bee3..b3efb9db0a5b9d 100644 --- a/examples/ota-requestor-app/ameba/README.md +++ b/examples/ota-requestor-app/ameba/README.md @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities. - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 - Setup build environment: diff --git a/examples/ota-requestor-app/ameba/chip_main.cmake b/examples/ota-requestor-app/ameba/chip_main.cmake index 1a418260dbb294..28b2fb5d20431d 100644 --- a/examples/ota-requestor-app/ameba/chip_main.cmake +++ b/examples/ota-requestor-app/ameba/chip_main.cmake @@ -39,7 +39,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/ota-requestor-app/mbed/CMakeLists.txt b/examples/ota-requestor-app/mbed/CMakeLists.txt index d377b0ee60b6b3..3bb074ea49e213 100644 --- a/examples/ota-requestor-app/mbed/CMakeLists.txt +++ b/examples/ota-requestor-app/mbed/CMakeLists.txt @@ -60,7 +60,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CHIP_ROOT}/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index 62ed3c85deb51a..c4ac02600cb1ef 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/pigweed-app/ameba/README.md b/examples/pigweed-app/ameba/README.md index da4dd83ca3f31b..acf8c4810bda8a 100644 --- a/examples/pigweed-app/ameba/README.md +++ b/examples/pigweed-app/ameba/README.md @@ -31,11 +31,11 @@ following features are available: - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:74 + $ docker pull ghcr.io/project-chip/chip-build-ameba:76 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:74 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 - Setup build environment: diff --git a/examples/platform/nxp/common/app_task/include/AppTaskBase.h b/examples/platform/nxp/common/app_task/include/AppTaskBase.h index 76e18df7f47eb0..b9348eff3f7e69 100644 --- a/examples/platform/nxp/common/app_task/include/AppTaskBase.h +++ b/examples/platform/nxp/common/app_task/include/AppTaskBase.h @@ -177,6 +177,13 @@ class AppTaskBase virtual void SwitchCommissioningStateHandler(void); virtual void FactoryResetHandler(void); + /** + * Cluster-handling functions + * Must be overridden by a child class per cluster configuration + */ + virtual bool CheckStateClusterHandler(void) { return false; } + virtual CHIP_ERROR ProcessSetStateClusterHandler(void) { return CHIP_ERROR_NOT_IMPLEMENTED; } + private: inline static chip::CommonCaseDeviceServerInitParams initParams; diff --git a/examples/platform/nxp/common/icd/source/ICDUtil.cpp b/examples/platform/nxp/common/icd/source/ICDUtil.cpp index 98986c4a7a09f9..f42281719494fc 100644 --- a/examples/platform/nxp/common/icd/source/ICDUtil.cpp +++ b/examples/platform/nxp/common/icd/source/ICDUtil.cpp @@ -26,17 +26,12 @@ chip::NXP::App::ICDUtil chip::NXP::App::ICDUtil::sICDUtil; CHIP_ERROR chip::NXP::App::ICDUtil::OnSubscriptionRequested(chip::app::ReadHandler & aReadHandler, chip::Transport::SecureSession & aSecureSession) { - uint16_t agreedMaxInterval = kSubscriptionMaxIntervalPublisherLimit; uint16_t requestedMinInterval = 0; uint16_t requestedMaxInterval = 0; aReadHandler.GetReportingIntervals(requestedMinInterval, requestedMaxInterval); - if (requestedMaxInterval < agreedMaxInterval) - { - agreedMaxInterval = requestedMaxInterval; - } #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR chip::NXP::App::OTARequestorInitiator::Instance().gImageProcessor.SetRebootDelaySec(requestedMinInterval); #endif - return aReadHandler.SetMaxReportingInterval(agreedMaxInterval); + return CHIP_NO_ERROR; } diff --git a/examples/platform/nxp/common/ui_feedback/source/LedManager.cpp b/examples/platform/nxp/common/ui_feedback/source/LedManager.cpp index ac2456f327b61c..42caeaf22ac66d 100644 --- a/examples/platform/nxp/common/ui_feedback/source/LedManager.cpp +++ b/examples/platform/nxp/common/ui_feedback/source/LedManager.cpp @@ -61,8 +61,6 @@ void LedManager::Init() #endif /* The parameters will not be used by the dimmer init. */ lightLed.Init(LED_MANAGER_LIGHT_LED_INDEX, false); - - RestoreState(); } void LedManager::DisplayInLoop() @@ -97,7 +95,7 @@ void LedManager::RestoreState() chip::DeviceLayer::PlatformMgr().ScheduleWork([](intptr_t arg) { bool val = false; - APP_CLUSTER_ATTRIBUTE::Get(APP_DEVICE_TYPE_ENDPOINT, &val); + val = chip::NXP::App::GetAppTask().CheckStateClusterHandler(); if (val) LightingMgr().ApplyTurnOn(); else diff --git a/examples/platform/nxp/mcxw71_k32w1/app/support/Memconfig.cpp b/examples/platform/nxp/mcxw71_k32w1/app/support/Memconfig.cpp index e05281fdee4f4d..f3f820d9e3422b 100644 --- a/examples/platform/nxp/mcxw71_k32w1/app/support/Memconfig.cpp +++ b/examples/platform/nxp/mcxw71_k32w1/app/support/Memconfig.cpp @@ -135,4 +135,9 @@ void * __wrap__realloc_r(void * REENT, void * ptr, size_t new_size) return __wrap_realloc(ptr, new_size); } +void * __wrap__calloc_r(void * REENT, size_t num, size_t size) +{ + return __wrap_calloc(num, size); +} + } // extern "C" diff --git a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp index 47e5f9fd4b6c9d..09b0546c30968c 100644 --- a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp +++ b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp @@ -144,10 +144,8 @@ void ButtonManager::AppActionEventHandler(const AppEvent & event) { chip::DeviceLayer::PlatformMgr().ScheduleWork( [](intptr_t arg) { - bool val = false; - APP_CLUSTER_ATTRIBUTE::Get(APP_DEVICE_TYPE_ENDPOINT, &val); - auto status = APP_CLUSTER_ATTRIBUTE::Set(APP_DEVICE_TYPE_ENDPOINT, (bool) !val); - if (status != chip::Protocols::InteractionModel::Status::Success) + auto status = chip::NXP::App::GetAppTask().ProcessSetStateClusterHandler(); + if (status != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "Error when updating cluster attribute"); } diff --git a/examples/pump-app/nrfconnect/CMakeLists.txt b/examples/pump-app/nrfconnect/CMakeLists.txt index b599faaa1dd863..476494c4c07056 100644 --- a/examples/pump-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-common/pump-app.zap ) diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 79334332003646..707abb6ee26def 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-common/pump-app.zap ) diff --git a/examples/pump-controller-app/nrfconnect/CMakeLists.txt b/examples/pump-controller-app/nrfconnect/CMakeLists.txt index 98d43aefafeb71..8eea9be7dac58d 100644 --- a/examples/pump-controller-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-controller-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-controller-common/pump-controller-app.zap ) diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index 3aeb7775e0555f..4b54bd87242b9a 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-controller-common/pump-controller-app.zap ) diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index 768123896dc3e2..2f5690fb4f0576 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../smoke-co-alarm-common/smoke-co-alarm-app.zap ) diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 7089f7ca50fb0b..a271abf295765b 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../temperature-measurement-common/temperature-measurement.zap ) diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 179a2c5bf19a90..d38dfd294c9d82 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -2562,20 +2562,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index 0ed071f900d8b4..6b19e3da7c61fd 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -61,162 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 820bd331ad6a6d..ef0e5fca27b72b 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -2473,20 +2473,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - handle command TriggerEffect; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index 000bc243947016..e3868768ae56bc 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -61,162 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/thermostat/nxp/zephyr/CMakeLists.txt b/examples/thermostat/nxp/zephyr/CMakeLists.txt index 2b0fb87a55e7f9..b478cfff9f2566 100644 --- a/examples/thermostat/nxp/zephyr/CMakeLists.txt +++ b/examples/thermostat/nxp/zephyr/CMakeLists.txt @@ -84,7 +84,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/../../thermostat/nxp/zap/thermostat_matter_wifi.zap ) diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index d88d6ec1feee1a..0da91d75b18ecf 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -2204,15 +2204,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap index 6077dfb9d0f599..07d5830e2909bb 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap @@ -61,90 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/thermostat/silabs/build_for_wifi_gnfile.gn b/examples/thermostat/silabs/build_for_wifi_gnfile.gn index d391814190d09f..1d6a71e88dd16f 100644 --- a/examples/thermostat/silabs/build_for_wifi_gnfile.gn +++ b/examples/thermostat/silabs/build_for_wifi_gnfile.gn @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_enable_wifi = true + chip_device_platform = "SiWx917" import("//build_for_wifi_args.gni") } diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 74a2565ba4a60e..166d8b8189a8e8 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../thermostat-common/thermostat.zap ) diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 6feefe3bba1c14..b99e3f1d4b436c 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2384,15 +2384,6 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - - handle command Identify; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index ffb9da2b136de9..bd5d8084997fe9 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -61,90 +61,6 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, diff --git a/examples/window-app/nrfconnect/CMakeLists.txt b/examples/window-app/nrfconnect/CMakeLists.txt index e6f7ebca632047..7418f7054649ef 100644 --- a/examples/window-app/nrfconnect/CMakeLists.txt +++ b/examples/window-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/PWMDevice.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${WIN_APP_COMMON_DIR}/window-app.zap ) diff --git a/examples/window-app/silabs/build_for_wifi_gnfile.gn b/examples/window-app/silabs/build_for_wifi_gnfile.gn index d391814190d09f..1d6a71e88dd16f 100644 --- a/examples/window-app/silabs/build_for_wifi_gnfile.gn +++ b/examples/window-app/silabs/build_for_wifi_gnfile.gn @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_enable_wifi = true + chip_device_platform = "SiWx917" import("//build_for_wifi_args.gni") } diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index a5ff986798de1e..1a7a4611c81d9f 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../common/window-app.zap ) diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 7ba0882e0310ac..8931f73d3f7931 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" 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:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" # 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: @@ -23,7 +23,7 @@ steps: - name: pwenv path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -38,7 +38,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index af3ed1f3b4c869..152d8344531b46 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:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" 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:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" # 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:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" 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:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -66,7 +66,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -88,7 +88,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -141,7 +141,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:74" + - name: "ghcr.io/project-chip/chip-build-vscode:76" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 6ee6f069675a0c..ab4dc8eb78bdf3 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -75 : remove workaround for bloaty build, workaround involved cloning and installing abseil +76 : [Telink] Update Docker image (Zephyr update) diff --git a/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt b/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt index 5c9ae9889f5ef3..94a277ac3666db 100644 --- a/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt +++ b/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt @@ -1,5 +1,5 @@ # codegen.py build requirements -Jinja2==3.1.3 +Jinja2==3.1.4 lark==1.1.7 # Sphinx dependencies (for slc-cli) linkify-it-py==2.0.2 diff --git a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile index e9c3da681291cc..348d6989d57d9f 100644 --- a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile @@ -18,7 +18,7 @@ RUN set -x \ && : # last line # Setup Zephyr -ARG ZEPHYR_REVISION=446337fb7b31cd9751720a57d0add62da89c962a +ARG ZEPHYR_REVISION=9ea364fd3b48c97f7cea6d69935f1fa630e30fb7 WORKDIR /opt/telink/zephyrproject RUN set -x \ && python3 -m pip install --break-system-packages -U --no-cache-dir west \ diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 4c90164b2d1c12..0464c51f7b0e6b 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -232,6 +232,8 @@ def BuildEsp32Target(): target.AppendModifier('rpc', enable_rpcs=True) target.AppendModifier('ipv6only', enable_ipv4=False) target.AppendModifier('tracing', enable_insights_trace=True).OnlyIfRe("light") + target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', data_model_interface="enabled").ExceptIfRe('-data-model-disabled') return target @@ -253,6 +255,7 @@ def BuildEfr32Target(): TargetPart('brd4186c', board=Efr32Board.BRD4186C), TargetPart('brd2703a', board=Efr32Board.BRD2703A), TargetPart('brd4338a', board=Efr32Board.BRD4338A, enable_wifi=True, enable_917_soc=True), + TargetPart('brd2605a', board=Efr32Board.BRD2605A, enable_wifi=True, enable_917_soc=True), ]) # apps @@ -330,6 +333,8 @@ def BuildNrfTarget(): ]) target.AppendModifier('rpc', enable_rpcs=True) + target.AppendModifier('data-model-disabled', use_data_model_interface=False).ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', use_data_model_interface=True).ExceptIfRe('-data-model-disabled') return target @@ -415,6 +420,8 @@ def BuildMbedTarget(): '-(release|debug)') target.AppendModifier('debug', profile=MbedProfile.DEBUG).ExceptIfRe( '-(release|develop)') + target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', data_model_interface="enabled").ExceptIfRe('-data-model-disabled') return target @@ -521,6 +528,7 @@ def BuildNxpTarget(): target.AppendFixedTargets([ TargetPart('lighting', app=NxpApp.LIGHTING).OnlyIfRe('(k32w0|k32w1|mcxw71)'), TargetPart('contact-sensor', app=NxpApp.CONTACT).OnlyIfRe('(k32w0|k32w1|mcxw71)'), + TargetPart('lock-app', app=NxpApp.LOCK_APP).OnlyIfRe('(k32w1|mcxw71)'), TargetPart('all-clusters', app=NxpApp.ALLCLUSTERS).OnlyIfRe('rw61x'), TargetPart('laundry-washer', app=NxpApp.LAUNDRYWASHER).OnlyIfRe('rw61x'), TargetPart('thermostat', app=NxpApp.THERMOSTAT).OnlyIfRe('rw61x') @@ -538,6 +546,8 @@ def BuildNxpTarget(): target.AppendModifier(name="wifi", enable_wifi=True).OnlyIfRe('rw61x') target.AppendModifier(name="thread", enable_thread=True).ExceptIfRe('zephyr') target.AppendModifier(name="matter-shell", enable_shell=True).ExceptIfRe('k32w0|k32w1') + target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', data_model_interface="enabled").ExceptIfRe('-data-model-disabled') return target @@ -618,6 +628,8 @@ def BuildQorvoTarget(): ]) target.AppendModifier('updateimage', update_image=True) + target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', data_model_interface="enabled").ExceptIfRe('-data-model-disabled') return target @@ -779,6 +791,8 @@ def BuildTelinkTarget(): target.AppendModifier('4mb', enable_4mb_flash=True) target.AppendModifier('mars', mars_board_config=True) target.AppendModifier('usb', usb_board_config=True) + target.AppendModifier('data-model-disabled', use_data_model_interface=False).ExceptIfRe('-data-model-enabled') + target.AppendModifier('data-model-enabled', use_data_model_interface=True).ExceptIfRe('-data-model-disabled') return target diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 6545f75b55da6b..3c15cd4ccec452 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -104,6 +104,7 @@ class Efr32Board(Enum): BRD4186C = 10 BRD4338A = 11 BRD2703A = 12 + BRD2605A = 13 def GnArgName(self): if self == Efr32Board.BRD2704B: @@ -130,6 +131,8 @@ def GnArgName(self): return 'BRD4338A' elif self == Efr32Board.BRD2703A: return 'BRD2703A' + elif self == Efr32Board.BRD2605A: + return 'BRD2605A' else: raise Exception('Unknown board #: %r' % self) diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index 018e20170b194b..a225315fc613c6 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -16,6 +16,7 @@ import os import shlex from enum import Enum, auto +from typing import Optional from .builder import Builder, BuilderOutput @@ -153,7 +154,8 @@ def __init__(self, app: Esp32App = Esp32App.ALL_CLUSTERS, enable_rpcs: bool = False, enable_ipv4: bool = True, - enable_insights_trace: bool = False + enable_insights_trace: bool = False, + data_model_interface: Optional[str] = None, ): super(Esp32Builder, self).__init__(root, runner) self.board = board @@ -161,6 +163,7 @@ def __init__(self, self.enable_rpcs = enable_rpcs self.enable_ipv4 = enable_ipv4 self.enable_insights_trace = enable_insights_trace + self.data_model_interface = data_model_interface if not app.IsCompatible(board): raise Exception( @@ -215,6 +218,9 @@ def generate(self): cmake_flags.append( f"-DCHIP_CODEGEN_PREGEN_DIR={shlex.quote(self.options.pregen_dir)}") + if self.data_model_interface: + cmake_flags.append(f'-DCHIP_DATA_MODEL_INTERFACE={self.data_model_interface}') + cmake_args = ['-C', self.ExamplePath, '-B', shlex.quote(self.output_dir)] + cmake_flags diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 12d21fbe8ba62e..61fbd006824a39 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -322,7 +322,7 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_test_event_triggers=None, enable_dnssd_tests: Optional[bool] = None, chip_casting_simplified: Optional[bool] = None, - data_model_interface: Optional[bool] = None, + data_model_interface: Optional[str] = None, chip_data_model_check_die_on_failure: Optional[bool] = None, ): super(HostBuilder, self).__init__( diff --git a/scripts/build/builders/mbed.py b/scripts/build/builders/mbed.py index 6dc47d0aa4aa27..cc4eb83a665621 100644 --- a/scripts/build/builders/mbed.py +++ b/scripts/build/builders/mbed.py @@ -15,6 +15,7 @@ import os import shlex from enum import Enum, auto +from typing import Optional from .builder import Builder, BuilderOutput @@ -101,7 +102,9 @@ def __init__(self, runner, app: MbedApp = MbedApp.LOCK, board: MbedBoard = MbedBoard.CY8CPROTO_062_4343W, - profile: MbedProfile = MbedProfile.RELEASE): + profile: MbedProfile = MbedProfile.RELEASE, + data_model_interface: Optional[str] = None, + ): super(MbedBuilder, self).__init__(root, runner) self.app = app self.board = board @@ -111,6 +114,7 @@ def __init__(self, self.root, 'third_party', 'mbed-os', 'repo') self.mbed_os_posix_socket_path = os.path.join( self.root, 'third_party', 'mbed-os-posix-socket', 'repo') + self.data_model_interface = data_model_interface @property def ExamplePath(self): @@ -131,6 +135,9 @@ def generate(self): flags.append(f"-DMBED_OS_PATH={shlex.quote(self.mbed_os_path)}") flags.append(f"-DMBED_OS_POSIX_SOCKET_PATH={shlex.quote(self.mbed_os_posix_socket_path)}") + if self.data_model_interface is not None: + flags.append(f"-DCHIP_DATA_MODEL_INTERFACE={self.data_model_interface}") + if self.options.pregen_dir: flags.append(f"-DCHIP_CODEGEN_PREGEN_DIR={shlex.quote(self.options.pregen_dir)}") diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index f9c801da0b5dd1..5fbc417ffe2c13 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -16,6 +16,7 @@ import os import shlex from enum import Enum, auto +from typing import Optional from .builder import Builder, BuilderOutput @@ -139,11 +140,14 @@ def __init__(self, runner, app: NrfApp = NrfApp.LIGHT, board: NrfBoard = NrfBoard.NRF52840DK, - enable_rpcs: bool = False): + enable_rpcs: bool = False, + use_data_model_interface: Optional[bool] = None, + ): super(NrfConnectBuilder, self).__init__(root, runner) self.app = app self.board = board self.enable_rpcs = enable_rpcs + self.use_data_model_interface = use_data_model_interface def generate(self): if not os.path.exists(self.output_dir): @@ -187,18 +191,18 @@ def generate(self): if self.options.pregen_dir: flags.append(f"-DCHIP_CODEGEN_PREGEN_DIR={shlex.quote(self.options.pregen_dir)}") + if self.use_data_model_interface is not None: + value = 'y' if self.use_data_model_interface else 'n' + flags.append(f"-DCONFIG_USE_CHIP_DATA_MODEL_INTERFACE={value}") + build_flags = " -- " + " ".join(flags) if len(flags) > 0 else "" - cmd = ''' -source "$ZEPHYR_BASE/zephyr-env.sh"; -export ZEPHYR_TOOLCHAIN_VARIANT=zephyr;''' + cmd = 'source "$ZEPHYR_BASE/zephyr-env.sh";\nexport ZEPHYR_TOOLCHAIN_VARIANT=zephyr;' + if zephyr_sdk_dir: - cmd += f''' -export ZEPHYR_SDK_INSTALL_DIR={zephyr_sdk_dir};''' + cmd += f'\nexport ZEPHYR_SDK_INSTALL_DIR={zephyr_sdk_dir};' - cmd += ''' -west build --cmake-only -d {outdir} -b {board} --sysbuild {sourcedir}{build_flags} - '''.format( + cmd += '\nwest build --cmake-only -d {outdir} -b {board} --sysbuild {sourcedir}{build_flags}\n'.format( outdir=shlex.quote(self.output_dir), board=self.board.GnArgName(), sourcedir=shlex.quote(os.path.join( diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 1124a03142472c..6a297cf8174d6a 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -16,6 +16,7 @@ import logging import os from enum import Enum, auto +from typing import Optional from .builder import BuilderOutput from .gn import GnBuilder @@ -77,6 +78,7 @@ class NxpApp(Enum): ALLCLUSTERS = auto() LAUNDRYWASHER = auto() THERMOSTAT = auto() + LOCK_APP = auto() def ExampleName(self): if self == NxpApp.LIGHTING: @@ -89,6 +91,8 @@ def ExampleName(self): return "laundry-washer-app" elif self == NxpApp.THERMOSTAT: return "thermostat" + elif self == NxpApp.LOCK_APP: + return "lock-app" else: raise Exception('Unknown app type: %r' % self) @@ -103,6 +107,8 @@ def NameSuffix(self): return "laundry-washer-example" elif self == NxpApp.THERMOSTAT: return "thermostat-example" + elif self == NxpApp.LOCK_APP: + return "lock-example" else: raise Exception('Unknown app type: %r' % self) @@ -131,7 +137,9 @@ def __init__(self, enable_wifi: bool = False, disable_ipv4: bool = False, enable_shell: bool = False, - enable_ota: bool = False): + enable_ota: bool = False, + data_model_interface: Optional[str] = None, + ): super(NxpBuilder, self).__init__( root=app.BuildRoot(root, board, os_env), runner=runner) @@ -153,6 +161,7 @@ def __init__(self, self.enable_wifi = enable_wifi self.enable_ota = enable_ota self.enable_shell = enable_shell + self.data_model_interface = data_model_interface def GnBuildArgs(self): args = [] @@ -202,6 +211,9 @@ def GnBuildArgs(self): if self.board == NxpBoard.RW61X: args.append('chip_enable_openthread=true chip_inet_config_enable_ipv4=false') + if self.data_model_interface is not None: + args.append(f'chip_use_data_model_interface="{self.data_model_interface}"') + return args def WestBuildArgs(self): @@ -212,27 +224,30 @@ def WestBuildArgs(self): if self.has_sw_version_2: args.append('-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2') + if self.data_model_interface: + # NOTE: this is not supporting "check" + enabled = "y" if self.data_model_interface.lower() == "enabled" else "n" + args.append(f"-DCONFIG_USE_CHIP_DATA_MODEL_INTERFACE={enabled}") + build_args = " -- " + " ".join(args) if len(args) > 0 else "" return build_args def generate(self): if self.os_env == NxpOsUsed.ZEPHYR: - if 'ZEPHYR_NXP_SDK_INSTALL_DIR' in os.environ: - cmd = 'export ZEPHYR_SDK_INSTALL_DIR="$ZEPHYR_NXP_SDK_INSTALL_DIR"\n' - else: - raise Exception("ZEPHYR_SDK_INSTALL_DIR need to be set") - if 'ZEPHYR_NXP_BASE' in os.environ: - cmd += 'export ZEPHYR_BASE="$ZEPHYR_NXP_BASE"\n' - else: + if 'ZEPHYR_NXP_SDK_INSTALL_DIR' not in os.environ: + raise Exception("ZEPHYR_NXP_SDK_INSTALL_DIR need to be set") + + if 'ZEPHYR_NXP_BASE' not in os.environ: raise Exception("ZEPHYR_NXP_BASE need to be set") - build_args = self.WestBuildArgs() - cmd += ''' - west build -p --cmake-only -b {board_name} -d {out_folder} {example_folder} {build_args} - '''.format( + + cmd = 'export ZEPHYR_SDK_INSTALL_DIR="$ZEPHYR_NXP_SDK_INSTALL_DIR"' + cmd += '\nexport ZEPHYR_BASE="$ZEPHYR_NXP_BASE"' + + cmd += '\nwest build -p --cmake-only -b {board_name} -d {out_folder} {example_folder}{build_args}'.format( board_name=self.board.Name(self.os_env), out_folder=self.output_dir, example_folder=self.app.BuildRoot(self.code_root, self.board, self.os_env), - build_args=build_args).strip() + build_args=self.WestBuildArgs()) self._Execute(['bash', '-c', cmd], title='Generating ' + self.identifier) else: cmd = '' @@ -264,7 +279,7 @@ def generate(self): extra_args.extend(self.GnBuildArgs() or []) if extra_args: - cmd += ' --args="%s' % ' '.join(extra_args) + '" ' + cmd += " --args='%s" % ' '.join(extra_args) + "' " cmd += self.output_dir diff --git a/scripts/build/builders/qpg.py b/scripts/build/builders/qpg.py index 330f4e3b74977d..93feaee78f6b99 100644 --- a/scripts/build/builders/qpg.py +++ b/scripts/build/builders/qpg.py @@ -14,6 +14,7 @@ import os from enum import Enum, auto +from typing import Optional from .builder import BuilderOutput from .gn import GnBuilder @@ -108,7 +109,9 @@ def __init__(self, board: QpgBoard = QpgBoard.QPG6105, flavour: QpgFlavour = QpgFlavour.EXT_FLASH, enable_rpcs: bool = False, - update_image: bool = False): + update_image: bool = False, + data_model_interface: Optional[str] = None, + ): super(QpgBuilder, self).__init__( root=app.BuildRoot(root), runner=runner) @@ -117,6 +120,7 @@ def __init__(self, self.flavour = flavour self.enable_rpcs = enable_rpcs self.update_image = update_image + self.data_model_interface = data_model_interface def GnBuildArgs(self): args = ['qpg_target_ic=\"%s\" qpg_flavour=\"%s\"' % (self.board.GnArgName(), self.flavour.GnFlavourName())] @@ -124,6 +128,8 @@ def GnBuildArgs(self): args.append('import("//with_pw_rpc.gni")') if self.update_image: args.append('matter_ota_test_image=true') + if self.data_model_interface: + args.append(f'chip_use_data_model_interface="{self.data_model_interface}"') return args def build_outputs(self): diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index b9cd709ba6b44c..6ac4c30ca241f5 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -16,6 +16,7 @@ import os import shlex from enum import Enum, auto +from typing import Optional from .builder import Builder, BuilderOutput @@ -152,7 +153,9 @@ def __init__(self, enable_factory_data: bool = False, enable_4mb_flash: bool = False, mars_board_config: bool = False, - usb_board_config: bool = False): + usb_board_config: bool = False, + use_data_model_interface: Optional[str] = None, + ): super(TelinkBuilder, self).__init__(root, runner) self.app = app self.board = board @@ -164,6 +167,7 @@ def __init__(self, self.enable_4mb_flash = enable_4mb_flash self.mars_board_config = mars_board_config self.usb_board_config = usb_board_config + self.use_data_model_interface = use_data_model_interface def get_cmd_prefixes(self): if not self._runner.dry_run: @@ -211,13 +215,16 @@ def generate(self): if self.options.pregen_dir: flags.append(f"-DCHIP_CODEGEN_PREGEN_DIR={shlex.quote(self.options.pregen_dir)}") + if self.use_data_model_interface is not None: + value = 'y' if self.use_data_model_interface else 'n' + flags.append(f"-DCONFIG_USE_CHIP_DATA_MODEL_INTERFACE={value}") + build_flags = " -- " + " ".join(flags) if len(flags) > 0 else "" cmd = self.get_cmd_prefixes() - cmd += ''' -source "$ZEPHYR_BASE/zephyr-env.sh"; -west build --cmake-only -d {outdir} -b {board} {sourcedir}{build_flags} - '''.format( + cmd += '\nsource "$ZEPHYR_BASE/zephyr-env.sh";' + + cmd += '\nwest build --cmake-only -d {outdir} -b {board} {sourcedir}{build_flags}\n'.format( outdir=shlex.quote(self.output_dir), board=self.board.GnArgName(), sourcedir=shlex.quote(os.path.join(self.root, 'examples', self.app.ExampleName(), 'telink')), diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index df54baa2ffec81..dbbf90508b0245 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -5,22 +5,22 @@ bouffalolab-{bl602dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-light,bl602- cc32xx-{lock,air-purifier} ti-cc13x4_26x4-{lighting,lock,pump,pump-controller}[-mtd][-ftd] cyw30739-{cyw30739b2_p5_evk_01,cyw30739b2_p5_evk_02,cyw30739b2_p5_evk_03,cyw930739m2evb_01,cyw930739m2evb_02}-{light,light-switch,lock,thermostat} -efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a}-{window-covering,switch,unit-test,light,lock,thermostat,pump}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation] -esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing] +efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a,brd2605a}-{window-covering,switch,unit-test,light,lock,thermostat,pump}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation] +esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing][-data-model-disabled][-data-model-enabled] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang] linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage][-trustm] -nxp-{k32w0,k32w1,rw61x,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell] -mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug] +nxp-{k32w0,k32w1,rw61x,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,lock-app,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell][-data-model-disabled][-data-model-enabled] +mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug][-data-model-disabled][-data-model-enabled] mw320-all-clusters-app -nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] +nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc][-data-model-disabled][-data-model-enabled] nrf-native-posix-64-tests nuttx-x64-light -qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage] +qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage][-data-model-disabled][-data-model-enabled] stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] -telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb] +telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-data-model-disabled][-data-model-enabled] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 55154782119992..45779260b241b0 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -297,10 +297,9 @@ else fi # 917 exception. TODO find a more generic way - if [ "$SILABS_BOARD" == "BRD4338A" ]; then + if [ "$SILABS_BOARD" == "BRD4338A" ] || [ "$SILABS_BOARD" == "BRD2605A" ]; then echo "Compiling for 917 WiFi SOC" USE_WIFI=true - optArgs+="chip_device_platform =\"SiWx917\" is_debug=false " fi if [ "$USE_GIT_SHA_FOR_VERSION" == true ]; then diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 16c1fa56e1de1e..ee27673ae5bb0b 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -156,10 +156,13 @@ endpoint 0 { require server cluster OperationalCredentials; require server cluster GeneralDiagnostics; - // Example rejection of clusters: + // It is disallowed to have Simple Device type cluster requirements on EP0. // + // TODO: Make sure for these commented rules that nothing breaks in CI // reject server cluster Scenes; + // reject server cluster ScenesManagement; // reject server cluster Groups; + reject server cluster Identify; // Required only if !CustomNetworkConfig. // require server cluster NetworkCommissioning; diff --git a/scripts/setup/requirements.esp32.txt b/scripts/setup/requirements.esp32.txt index b2584bbac08803..63ec11c1c452b6 100644 --- a/scripts/setup/requirements.esp32.txt +++ b/scripts/setup/requirements.esp32.txt @@ -14,3 +14,4 @@ python-socketio<5 itsdangerous<2.1 ; python_version < "3.11" esp_idf_monitor==1.1.1 esp-idf-kconfig==1.2.0 +esp_idf_nvs_partition_gen==0.1.2 diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index ef23dc61b337ef..dade2ff82463d8 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -25,6 +25,7 @@ from types import SimpleNamespace import cryptography.x509 +import esp_idf_nvs_partition_gen.nvs_partition_gen as nvs_partition_gen from esp_secure_cert.tlv_format import generate_partition_ds, generate_partition_no_ds, tlv_priv_key_t, tlv_priv_key_type_t CHIP_TOPDIR = os.path.dirname(os.path.realpath(__file__))[:-len(os.path.join('scripts', 'tools'))] @@ -33,15 +34,6 @@ sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python')) from SetupPayload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip -if os.getenv('IDF_PATH'): - sys.path.insert(0, os.path.join(os.getenv('IDF_PATH'), - 'components', - 'nvs_flash', - 'nvs_partition_generator')) - import nvs_partition_gen -else: - sys.stderr.write("Please set the IDF_PATH environment variable.") - exit(0) INVALID_PASSCODES = [00000000, 11111111, 22222222, 33333333, 44444444, 55555555, 66666666, 77777777, 88888888, 99999999, 12345678, 87654321] diff --git a/scripts/tools/zap/run_zaptool.sh b/scripts/tools/zap/run_zaptool.sh index 2895ef4e718d10..52efc26abeaaee 100755 --- a/scripts/tools/zap/run_zaptool.sh +++ b/scripts/tools/zap/run_zaptool.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2021-2024 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,20 +16,95 @@ # limitations under the License. # +readonly ZAP_CMD_DEFAULT="zap" + +ZAP_CMD="$ZAP_CMD_DEFAULT" +ZAP_FILE="" + function _get_fullpath() { cd "$(dirname "$1")" >/dev/null && echo "$PWD/$(basename "$1")" } -set -e +function _print_usage() { + local name="$(basename "${0}")" + local status="${1}" + + echo "Usage: $name [ option ... ] [ ]" + + if [ "$status" -ne 0 ]; then + echo "Try '$name -h' for more information." + fi + + if [ "$status" -ne 1 ]; then + echo "" + echo "ZAP Tool Wrapper" + echo "" + echo " General Options:" + echo "" + echo " -h, --help Display this help, then exit." + echo " --zap ZAP Use the zap program ZAP as the zap executable " + echo " to run (default: $ZAP_CMD_DEFAULT)." + echo "" + echo " Some influential environment variables:" + echo "" + echo " ZAP_DEVELOPMENT_PATH The path to a zap development environment. This " + echo " is likely a zap checkout, used for local " + echo " development (current: \"${ZAP_DEVELOPMENT_PATH:-}\")." + echo "" + echo " If set, this overrides both the '--zap' option " + echo " and the 'ZAP_INTALL_PATH' environment variable." + echo " ZAP_INSTALL_PATH The path where the 'zap' executable exists. " + echo " This may be used if 'zap' is NOT in the current " + echo " PATH (current: \"${ZAP_INSTALL_PATH:-}\")." + echo "" + echo " If set, this overrides the '--zap' option." + echo "" + fi -[[ "$1" == "--help" ]] && { - echo "Usage: $0 [ZAP-file-path]" >&2 - exit 0 + exit "$status" } +# Main + +set -e + +# Command Line Option Parsing + +while [ "${#}" -gt 0 ]; do + + case "${1}" in + + -h | --help) + _print_usage 0 + ;; + + --zap) + ZAP_CMD="${2}" + shift 2 + ;; + + -*) + echo "ERROR: Unknown or invalid option: '${1}'" >&2 + _print_usage 1 + ;; + + *) + if [ -z "$ZAP_FILE" ]; then + ZAP_FILE="${1}" + shift 1 + else + echo "ERROR: Unexpected argument: '${1}'" >&2 + _print_usage 1 + fi + ;; + + esac + +done + SCRIPT_PATH="$(_get_fullpath "$0")" CHIP_ROOT="${SCRIPT_PATH%/scripts/tools/zap/run_zaptool.sh}" -[[ -n "$1" ]] && ZAP_ARGS="-i \"$(_get_fullpath "$1")\"" || ZAP_ARGS="" +[[ -n "${ZAP_FILE}" ]] && ZAP_ARGS="-i \"$(_get_fullpath "$ZAP_FILE")\"" || ZAP_ARGS="" if [[ -z "$ZAP_INSTALL_PATH" && -n "$PW_ZAP_CIPD_INSTALL_DIR" ]]; then ZAP_INSTALL_PATH="$PW_ZAP_CIPD_INSTALL_DIR" @@ -50,13 +125,14 @@ elif [ -n "$ZAP_INSTALL_PATH" ]; then fi WORKING_DIR="$CHIP_ROOT" else - ZAP_CMD="zap" + [ -z "$ZAP_CMD" ] && ZAP_CMD="$ZAP_CMD_DEFAULT" WORKING_DIR="$CHIP_ROOT" fi ( cd "$WORKING_DIR" + echo "CMD: $ZAP_CMD" echo "ARGS: $ZAP_ARGS" if [[ "${ZAP_ARGS[*]}" == *"/all-clusters-app.zap"* ]]; then diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 0ec92a5c61294d..9d4ae062f054c8 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -69,98 +69,6 @@ "deviceTypeCode": 17, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Groups", "code": 4, @@ -25291,4 +25199,4 @@ "parentEndpointIdentifier": null } ] -} \ No newline at end of file +} 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 6ea480e199be51..08646d26bc566d 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 @@ -355,18 +355,12 @@ } // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 1054 +#define GENERATED_ATTRIBUTE_COUNT 1050 #define GENERATED_ATTRIBUTES \ { \ \ - /* Endpoint: 0, Cluster: Identify (server) */ \ - { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000000, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* IdentifyTime */ \ - { ZAP_SIMPLE_DEFAULT(0x0), 0x00000001, 1, ZAP_TYPE(ENUM8), 0 }, /* IdentifyType */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Groups (server) */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(BITMAP8), 0 }, /* NameSupport */ \ + /* Endpoint: 0, Cluster: Groups (server) */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(BITMAP8), 0 }, /* NameSupport */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ @@ -2164,10 +2158,6 @@ // Cluster function static arrays #define GENERATED_FUNCTION_ARRAYS \ - const EmberAfGenericClusterFunction chipFuncArrayIdentifyServer[] = { \ - (EmberAfGenericClusterFunction) emberAfIdentifyClusterServerInitCallback, \ - (EmberAfGenericClusterFunction) MatterIdentifyClusterServerAttributeChangedCallback, \ - }; \ const EmberAfGenericClusterFunction chipFuncArrayGroupsServer[] = { \ (EmberAfGenericClusterFunction) emberAfGroupsClusterServerInitCallback, \ }; \ @@ -2179,6 +2169,10 @@ (EmberAfGenericClusterFunction) emberAfTimeFormatLocalizationClusterServerInitCallback, \ (EmberAfGenericClusterFunction) MatterTimeFormatLocalizationClusterServerPreAttributeChangedCallback, \ }; \ + const EmberAfGenericClusterFunction chipFuncArrayIdentifyServer[] = { \ + (EmberAfGenericClusterFunction) emberAfIdentifyClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterIdentifyClusterServerAttributeChangedCallback, \ + }; \ const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ (EmberAfGenericClusterFunction) MatterOnOffClusterServerShutdownCallback, \ @@ -2238,13 +2232,8 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=0) */ \ - 0x00000000 /* Identify */, \ - 0x00000040 /* TriggerEffect */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=3) */ \ + /* AcceptedCommandList (index=0) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -2252,29 +2241,29 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=10)*/ \ + /* GeneratedCommandList (index=7)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */\ - /* AcceptedCommandList (index=15) */ \ + /* AcceptedCommandList (index=12) */ \ 0x00000000 /* AnnounceOTAProvider */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: General Commissioning (server) */\ - /* AcceptedCommandList (index=17) */ \ + /* AcceptedCommandList (index=14) */ \ 0x00000000 /* ArmFailSafe */, \ 0x00000002 /* SetRegulatoryConfig */, \ 0x00000004 /* CommissioningComplete */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=21)*/ \ + /* GeneratedCommandList (index=18)*/ \ 0x00000001 /* ArmFailSafeResponse */, \ 0x00000003 /* SetRegulatoryConfigResponse */, \ 0x00000005 /* CommissioningCompleteResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=25) */ \ + /* AcceptedCommandList (index=22) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -2282,63 +2271,63 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=32)*/ \ + /* GeneratedCommandList (index=29)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */\ - /* AcceptedCommandList (index=36) */ \ + /* AcceptedCommandList (index=33) */ \ 0x00000000 /* RetrieveLogsRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=38)*/ \ + /* GeneratedCommandList (index=35)*/ \ 0x00000001 /* RetrieveLogsResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: General Diagnostics (server) */\ - /* AcceptedCommandList (index=40) */ \ + /* AcceptedCommandList (index=37) */ \ 0x00000000 /* TestEventTrigger */, \ 0x00000001 /* TimeSnapshot */, \ 0x00000003 /* PayloadTestRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=44)*/ \ + /* GeneratedCommandList (index=41)*/ \ 0x00000002 /* TimeSnapshotResponse */, \ 0x00000004 /* PayloadTestResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */\ - /* AcceptedCommandList (index=47) */ \ + /* AcceptedCommandList (index=44) */ \ 0x00000000 /* ResetWatermarks */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */\ - /* AcceptedCommandList (index=49) */ \ + /* AcceptedCommandList (index=46) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Wi-Fi Network Diagnostics (server) */\ - /* AcceptedCommandList (index=51) */ \ + /* AcceptedCommandList (index=48) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */\ - /* AcceptedCommandList (index=53) */ \ + /* AcceptedCommandList (index=50) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Time Synchronization (server) */\ - /* AcceptedCommandList (index=55) */ \ + /* AcceptedCommandList (index=52) */ \ 0x00000000 /* SetUTCTime */, \ 0x00000001 /* SetTrustedTimeSource */, \ 0x00000002 /* SetTimeZone */, \ 0x00000004 /* SetDSTOffset */, \ 0x00000005 /* SetDefaultNTP */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=61)*/ \ + /* GeneratedCommandList (index=58)*/ \ 0x00000003 /* SetTimeZoneResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Administrator Commissioning (server) */\ - /* AcceptedCommandList (index=63) */ \ + /* AcceptedCommandList (index=60) */ \ 0x00000000 /* OpenCommissioningWindow */, \ 0x00000001 /* OpenBasicCommissioningWindow */, \ 0x00000002 /* RevokeCommissioning */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Operational Credentials (server) */\ - /* AcceptedCommandList (index=67) */ \ + /* AcceptedCommandList (index=64) */ \ 0x00000000 /* AttestationRequest */, \ 0x00000002 /* CertificateChainRequest */, \ 0x00000004 /* CSRRequest */, \ @@ -2348,35 +2337,35 @@ 0x0000000A /* RemoveFabric */, \ 0x0000000B /* AddTrustedRootCertificate */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=76)*/ \ + /* GeneratedCommandList (index=73)*/ \ 0x00000001 /* AttestationResponse */, \ 0x00000003 /* CertificateChainResponse */, \ 0x00000005 /* CSRResponse */, \ 0x00000008 /* NOCResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Group Key Management (server) */\ - /* AcceptedCommandList (index=81) */ \ + /* AcceptedCommandList (index=78) */ \ 0x00000000 /* KeySetWrite */, \ 0x00000001 /* KeySetRead */, \ 0x00000003 /* KeySetRemove */, \ 0x00000004 /* KeySetReadAllIndices */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=86)*/ \ + /* GeneratedCommandList (index=83)*/ \ 0x00000002 /* KeySetReadResponse */, \ 0x00000005 /* KeySetReadAllIndicesResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Fault Injection (server) */\ - /* AcceptedCommandList (index=89) */ \ + /* AcceptedCommandList (index=86) */ \ 0x00000000 /* FailAtFault */, \ 0x00000001 /* FailRandomlyAtFault */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=92) */ \ + /* AcceptedCommandList (index=89) */ \ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=95) */ \ + /* AcceptedCommandList (index=92) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -2384,14 +2373,14 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=102)*/ \ + /* GeneratedCommandList (index=99)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=107) */ \ + /* AcceptedCommandList (index=104) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ @@ -2400,7 +2389,7 @@ 0x00000042 /* OnWithTimedOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Level Control (server) */\ - /* AcceptedCommandList (index=114) */ \ + /* AcceptedCommandList (index=111) */ \ 0x00000000 /* MoveToLevel */, \ 0x00000001 /* Move */, \ 0x00000002 /* Step */, \ @@ -2411,95 +2400,95 @@ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Oven Cavity Operational State (server) */\ - /* AcceptedCommandList (index=123) */ \ + /* AcceptedCommandList (index=120) */ \ 0x00000000 /* Pause */, \ 0x00000001 /* Stop */, \ 0x00000002 /* Start */, \ 0x00000003 /* Resume */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=128)*/ \ + /* GeneratedCommandList (index=125)*/ \ 0x00000004 /* OperationalCommandResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Oven Mode (server) */\ - /* AcceptedCommandList (index=130) */ \ + /* AcceptedCommandList (index=127) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=132)*/ \ + /* GeneratedCommandList (index=129)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Mode Select (server) */\ - /* AcceptedCommandList (index=134) */ \ + /* AcceptedCommandList (index=131) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Laundry Washer Mode (server) */\ - /* AcceptedCommandList (index=136) */ \ + /* AcceptedCommandList (index=133) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=138)*/ \ + /* GeneratedCommandList (index=135)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Refrigerator And Temperature Controlled Cabinet Mode (server) */\ - /* AcceptedCommandList (index=140) */ \ + /* AcceptedCommandList (index=137) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=142)*/ \ + /* GeneratedCommandList (index=139)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: RVC Run Mode (server) */\ - /* AcceptedCommandList (index=144) */ \ + /* AcceptedCommandList (index=141) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=146)*/ \ + /* GeneratedCommandList (index=143)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: RVC Clean Mode (server) */\ - /* AcceptedCommandList (index=148) */ \ + /* AcceptedCommandList (index=145) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=150)*/ \ + /* GeneratedCommandList (index=147)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Temperature Control (server) */\ - /* AcceptedCommandList (index=152) */ \ + /* AcceptedCommandList (index=149) */ \ 0x00000000 /* SetTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Dishwasher Mode (server) */\ - /* AcceptedCommandList (index=154) */ \ + /* AcceptedCommandList (index=151) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=156)*/ \ + /* GeneratedCommandList (index=153)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Smoke CO Alarm (server) */\ - /* AcceptedCommandList (index=158) */ \ + /* AcceptedCommandList (index=155) */ \ 0x00000000 /* SelfTestRequest */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Dishwasher Alarm (server) */\ - /* AcceptedCommandList (index=160) */ \ + /* AcceptedCommandList (index=157) */ \ 0x00000000 /* Reset */, \ 0x00000001 /* ModifyEnabledAlarms */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Operational State (server) */\ - /* AcceptedCommandList (index=163) */ \ + /* AcceptedCommandList (index=160) */ \ 0x00000000 /* Pause */, \ 0x00000001 /* Stop */, \ 0x00000002 /* Start */, \ 0x00000003 /* Resume */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=168)*/ \ + /* GeneratedCommandList (index=165)*/ \ 0x00000004 /* OperationalCommandResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: RVC Operational State (server) */\ - /* AcceptedCommandList (index=170) */ \ + /* AcceptedCommandList (index=167) */ \ 0x00000000 /* Pause */, \ 0x00000003 /* Resume */, \ 0x00000080 /* GoHome */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=174)*/ \ + /* GeneratedCommandList (index=171)*/ \ 0x00000004 /* OperationalCommandResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Scenes Management (server) */\ - /* AcceptedCommandList (index=176) */ \ + /* AcceptedCommandList (index=173) */ \ 0x00000000 /* AddScene */, \ 0x00000001 /* ViewScene */, \ 0x00000002 /* RemoveScene */, \ @@ -2509,7 +2498,7 @@ 0x00000006 /* GetSceneMembership */, \ 0x00000040 /* CopyScene */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=185)*/ \ + /* GeneratedCommandList (index=182)*/ \ 0x00000000 /* AddSceneResponse */, \ 0x00000001 /* ViewSceneResponse */, \ 0x00000002 /* RemoveSceneResponse */, \ @@ -2519,25 +2508,25 @@ 0x00000040 /* CopySceneResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: HEPA Filter Monitoring (server) */\ - /* AcceptedCommandList (index=193) */ \ + /* AcceptedCommandList (index=190) */ \ 0x00000000 /* ResetCondition */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Activated Carbon Filter Monitoring (server) */\ - /* AcceptedCommandList (index=195) */ \ + /* AcceptedCommandList (index=192) */ \ 0x00000000 /* ResetCondition */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Boolean State Configuration (server) */\ - /* AcceptedCommandList (index=197) */ \ + /* AcceptedCommandList (index=194) */ \ 0x00000000 /* SuppressAlarm */, \ 0x00000001 /* EnableDisableAlarm */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */\ - /* AcceptedCommandList (index=200) */ \ + /* AcceptedCommandList (index=197) */ \ 0x00000000 /* Open */, \ 0x00000001 /* Close */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Device Energy Management (server) */\ - /* AcceptedCommandList (index=203) */ \ + /* AcceptedCommandList (index=200) */ \ 0x00000000 /* PowerAdjustRequest */, \ 0x00000001 /* CancelPowerAdjustRequest */, \ 0x00000002 /* StartTimeAdjustRequest */, \ @@ -2548,7 +2537,7 @@ 0x00000007 /* CancelRequest */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Energy EVSE (server) */\ - /* AcceptedCommandList (index=212) */ \ + /* AcceptedCommandList (index=209) */ \ 0x00000001 /* Disable */, \ 0x00000002 /* EnableCharging */, \ 0x00000003 /* EnableDischarging */, \ @@ -2557,25 +2546,25 @@ 0x00000006 /* GetTargets */, \ 0x00000007 /* ClearTargets */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=220)*/ \ + /* GeneratedCommandList (index=217)*/ \ 0x00000000 /* GetTargetsResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Energy EVSE Mode (server) */\ - /* AcceptedCommandList (index=222) */ \ + /* AcceptedCommandList (index=219) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=224)*/ \ + /* GeneratedCommandList (index=221)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Device Energy Management Mode (server) */\ - /* AcceptedCommandList (index=226) */ \ + /* AcceptedCommandList (index=223) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=228)*/ \ + /* GeneratedCommandList (index=225)*/ \ 0x00000001 /* ChangeToModeResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Window Covering (server) */\ - /* AcceptedCommandList (index=230) */ \ + /* AcceptedCommandList (index=227) */ \ 0x00000000 /* UpOrOpen */, \ 0x00000001 /* DownOrClose */, \ 0x00000002 /* StopMotion */, \ @@ -2585,26 +2574,26 @@ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Barrier Control (server) */\ - /* AcceptedCommandList (index=238) */ \ + /* AcceptedCommandList (index=235) */ \ 0x00000000 /* BarrierControlGoToPercent */, \ 0x00000001 /* BarrierControlStop */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Thermostat (server) */\ - /* AcceptedCommandList (index=241) */ \ + /* AcceptedCommandList (index=238) */ \ 0x00000000 /* SetpointRaiseLower */, \ 0x00000005 /* SetActiveScheduleRequest */, \ 0x00000006 /* SetActivePresetRequest */, \ 0x000000FE /* AtomicRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=246)*/ \ + /* GeneratedCommandList (index=243)*/ \ 0x000000FD /* AtomicResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Fan Control (server) */\ - /* AcceptedCommandList (index=248) */ \ + /* AcceptedCommandList (index=245) */ \ 0x00000000 /* Step */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Color Control (server) */\ - /* AcceptedCommandList (index=250) */ \ + /* AcceptedCommandList (index=247) */ \ 0x00000000 /* MoveToHue */, \ 0x00000001 /* MoveHue */, \ 0x00000002 /* StepHue */, \ @@ -2626,11 +2615,11 @@ 0x0000004C /* StepColorTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Low Power (server) */\ - /* AcceptedCommandList (index=270) */ \ + /* AcceptedCommandList (index=267) */ \ 0x00000000 /* Sleep */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Unit Testing (server) */\ - /* AcceptedCommandList (index=272) */ \ + /* AcceptedCommandList (index=269) */ \ 0x00000000 /* Test */, \ 0x00000001 /* TestNotHandled */, \ 0x00000002 /* TestSpecific */, \ @@ -2653,7 +2642,7 @@ 0x00000017 /* TestSecondBatchHelperRequest */, \ 0xFFF200AA /* TestDifferentVendorMeiRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=294)*/ \ + /* GeneratedCommandList (index=291)*/ \ 0x00000000 /* TestSpecificResponse */, \ 0x00000001 /* TestAddArgumentsResponse */, \ 0x00000004 /* TestListInt8UReverseResponse */, \ @@ -2667,12 +2656,12 @@ 0xFFF200BB /* TestDifferentVendorMeiResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=306) */ \ + /* AcceptedCommandList (index=303) */ \ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=309) */ \ + /* AcceptedCommandList (index=306) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -2680,14 +2669,14 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=316)*/ \ + /* GeneratedCommandList (index=313)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=321) */ \ + /* AcceptedCommandList (index=318) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ @@ -2696,7 +2685,7 @@ 0x00000042 /* OnWithTimedOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Scenes Management (server) */\ - /* AcceptedCommandList (index=328) */ \ + /* AcceptedCommandList (index=325) */ \ 0x00000000 /* AddScene */, \ 0x00000001 /* ViewScene */, \ 0x00000002 /* RemoveScene */, \ @@ -2706,7 +2695,7 @@ 0x00000006 /* GetSceneMembership */, \ 0x00000040 /* CopyScene */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=337)*/ \ + /* GeneratedCommandList (index=334)*/ \ 0x00000000 /* AddSceneResponse */, \ 0x00000001 /* ViewSceneResponse */, \ 0x00000002 /* RemoveSceneResponse */, \ @@ -2716,7 +2705,7 @@ 0x00000040 /* CopySceneResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=345) */ \ + /* AcceptedCommandList (index=342) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -2724,7 +2713,7 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=352)*/ \ + /* GeneratedCommandList (index=349)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ @@ -2734,39 +2723,26 @@ // clang-format on // This is an array of EmberAfCluster structures. -#define GENERATED_CLUSTER_COUNT 112 +#define GENERATED_CLUSTER_COUNT 111 // clang-format off #define GENERATED_CLUSTERS { \ - { \ - /* Endpoint: 0, Cluster: Identify (server) */ \ - .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(0), \ - .attributeCount = 4, \ - .clusterSize = 9, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ), \ - .generatedCommandList = nullptr, \ - .eventList = nullptr, \ - .eventCount = 0, \ - },\ { \ /* Endpoint: 0, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(4), \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(7), \ + .attributes = ZAP_ATTRIBUTE_INDEX(3), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2779,7 +2755,7 @@ { \ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(14), \ + .attributes = ZAP_ATTRIBUTE_INDEX(10), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2792,7 +2768,7 @@ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(17), \ + .attributes = ZAP_ATTRIBUTE_INDEX(13), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2805,7 +2781,7 @@ { \ /* Endpoint: 0, Cluster: Basic Information (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(24), \ + .attributes = ZAP_ATTRIBUTE_INDEX(20), \ .attributeCount = 24, \ .clusterSize = 40, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2818,7 +2794,7 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(48), \ + .attributes = ZAP_ATTRIBUTE_INDEX(44), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2831,12 +2807,12 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ .clusterId = 0x0000002A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(48), \ + .attributes = ZAP_ATTRIBUTE_INDEX(44), \ .attributeCount = 6, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 5 ), \ .eventCount = 3, \ @@ -2844,7 +2820,7 @@ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(54), \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ .attributeCount = 4, \ .clusterSize = 42, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2857,7 +2833,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(58), \ + .attributes = ZAP_ATTRIBUTE_INDEX(54), \ .attributeCount = 5, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2870,7 +2846,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(63), \ + .attributes = ZAP_ATTRIBUTE_INDEX(59), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2883,7 +2859,7 @@ { \ /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ .clusterId = 0x0000002E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributes = ZAP_ATTRIBUTE_INDEX(62), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2896,7 +2872,7 @@ { \ /* Endpoint: 0, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(69), \ + .attributes = ZAP_ATTRIBUTE_INDEX(65), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2909,64 +2885,64 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(78), \ + .attributes = ZAP_ATTRIBUTE_INDEX(74), \ .attributeCount = 7, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 17 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 14 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(85), \ + .attributes = ZAP_ATTRIBUTE_INDEX(81), \ .attributeCount = 13, \ .clusterSize = 48, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(98), \ + .attributes = ZAP_ATTRIBUTE_INDEX(94), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(100), \ + .attributes = ZAP_ATTRIBUTE_INDEX(96), \ .attributeCount = 11, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 41 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 8 ), \ .eventCount = 4, \ },\ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(111), \ + .attributes = ZAP_ATTRIBUTE_INDEX(107), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 47 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 12 ), \ .eventCount = 1, \ @@ -2974,12 +2950,12 @@ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(117), \ + .attributes = ZAP_ATTRIBUTE_INDEX(113), \ .attributeCount = 65, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2987,12 +2963,12 @@ { \ /* Endpoint: 0, Cluster: Wi-Fi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(182), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 15, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 13 ), \ .eventCount = 3, \ @@ -3000,12 +2976,12 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(197), \ + .attributes = ZAP_ATTRIBUTE_INDEX(193), \ .attributeCount = 11, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3013,25 +2989,25 @@ { \ /* Endpoint: 0, Cluster: Time Synchronization (server) */ \ .clusterId = 0x00000038, \ - .attributes = ZAP_ATTRIBUTE_INDEX(208), \ + .attributes = ZAP_ATTRIBUTE_INDEX(204), \ .attributeCount = 14, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 16 ), \ .eventCount = 5, \ },\ { \ /* Endpoint: 0, Cluster: Administrator Commissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(222), \ + .attributes = ZAP_ATTRIBUTE_INDEX(218), \ .attributeCount = 5, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 60 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3039,33 +3015,33 @@ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributes = ZAP_ATTRIBUTE_INDEX(223), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 64 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(235), \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 81 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(241), \ + .attributes = ZAP_ATTRIBUTE_INDEX(237), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3078,7 +3054,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributes = ZAP_ATTRIBUTE_INDEX(240), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3091,7 +3067,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(247), \ + .attributes = ZAP_ATTRIBUTE_INDEX(243), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3104,12 +3080,12 @@ { \ /* Endpoint: 0, Cluster: Fault Injection (server) */ \ .clusterId = 0xFFF1FC06, \ - .attributes = ZAP_ATTRIBUTE_INDEX(252), \ + .attributes = ZAP_ATTRIBUTE_INDEX(248), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3117,12 +3093,12 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(254), \ + .attributes = ZAP_ATTRIBUTE_INDEX(250), \ .attributeCount = 4, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3130,20 +3106,20 @@ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(258), \ + .attributes = ZAP_ATTRIBUTE_INDEX(254), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 102 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 99 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: On/Off (client) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(261), \ + .attributes = ZAP_ATTRIBUTE_INDEX(257), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -3156,12 +3132,12 @@ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(261), \ + .attributes = ZAP_ATTRIBUTE_INDEX(257), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 107 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3169,7 +3145,7 @@ { \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ .clusterId = 0x00000007, \ - .attributes = ZAP_ATTRIBUTE_INDEX(268), \ + .attributes = ZAP_ATTRIBUTE_INDEX(264), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3182,12 +3158,12 @@ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(272), \ + .attributes = ZAP_ATTRIBUTE_INDEX(268), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 114 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 111 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3195,7 +3171,7 @@ { \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(288), \ + .attributes = ZAP_ATTRIBUTE_INDEX(284), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3208,7 +3184,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(293), \ + .attributes = ZAP_ATTRIBUTE_INDEX(289), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3221,7 +3197,7 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(300), \ + .attributes = ZAP_ATTRIBUTE_INDEX(296), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3234,7 +3210,7 @@ { \ /* Endpoint: 1, Cluster: Actions (server) */ \ .clusterId = 0x00000025, \ - .attributes = ZAP_ATTRIBUTE_INDEX(303), \ + .attributes = ZAP_ATTRIBUTE_INDEX(299), \ .attributeCount = 5, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3247,7 +3223,7 @@ { \ /* Endpoint: 1, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(308), \ + .attributes = ZAP_ATTRIBUTE_INDEX(304), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3260,7 +3236,7 @@ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(317), \ + .attributes = ZAP_ATTRIBUTE_INDEX(313), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3273,7 +3249,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(321), \ + .attributes = ZAP_ATTRIBUTE_INDEX(317), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3286,7 +3262,7 @@ { \ /* Endpoint: 1, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(324), \ + .attributes = ZAP_ATTRIBUTE_INDEX(320), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3299,7 +3275,7 @@ { \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ .clusterId = 0x00000045, \ - .attributes = ZAP_ATTRIBUTE_INDEX(327), \ + .attributes = ZAP_ATTRIBUTE_INDEX(323), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3312,33 +3288,33 @@ { \ /* Endpoint: 1, Cluster: Oven Cavity Operational State (server) */ \ .clusterId = 0x00000048, \ - .attributes = ZAP_ATTRIBUTE_INDEX(330), \ + .attributes = ZAP_ATTRIBUTE_INDEX(326), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 123 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 128 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 120 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 23 ), \ .eventCount = 2, \ },\ { \ /* Endpoint: 1, Cluster: Oven Mode (server) */ \ .clusterId = 0x00000049, \ - .attributes = ZAP_ATTRIBUTE_INDEX(338), \ + .attributes = ZAP_ATTRIBUTE_INDEX(334), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 130 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Laundry Dryer Controls (server) */ \ .clusterId = 0x0000004A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(342), \ + .attributes = ZAP_ATTRIBUTE_INDEX(338), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3351,12 +3327,12 @@ { \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ - .attributes = ZAP_ATTRIBUTE_INDEX(346), \ + .attributes = ZAP_ATTRIBUTE_INDEX(342), \ .attributeCount = 9, \ .clusterSize = 77, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayModeSelectServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 134 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 131 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3364,33 +3340,33 @@ { \ /* Endpoint: 1, Cluster: Laundry Washer Mode (server) */ \ .clusterId = 0x00000051, \ - .attributes = ZAP_ATTRIBUTE_INDEX(355), \ + .attributes = ZAP_ATTRIBUTE_INDEX(351), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 136 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 133 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 135 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Refrigerator And Temperature Controlled Cabinet Mode (server) */ \ .clusterId = 0x00000052, \ - .attributes = ZAP_ATTRIBUTE_INDEX(361), \ + .attributes = ZAP_ATTRIBUTE_INDEX(357), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 137 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 139 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ .clusterId = 0x00000053, \ - .attributes = ZAP_ATTRIBUTE_INDEX(367), \ + .attributes = ZAP_ATTRIBUTE_INDEX(363), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3403,38 +3379,38 @@ { \ /* Endpoint: 1, Cluster: RVC Run Mode (server) */ \ .clusterId = 0x00000054, \ - .attributes = ZAP_ATTRIBUTE_INDEX(373), \ + .attributes = ZAP_ATTRIBUTE_INDEX(369), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 144 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 143 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: RVC Clean Mode (server) */ \ .clusterId = 0x00000055, \ - .attributes = ZAP_ATTRIBUTE_INDEX(377), \ + .attributes = ZAP_ATTRIBUTE_INDEX(373), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 148 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 150 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 145 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 147 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Temperature Control (server) */ \ .clusterId = 0x00000056, \ - .attributes = ZAP_ATTRIBUTE_INDEX(381), \ + .attributes = ZAP_ATTRIBUTE_INDEX(377), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 152 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 149 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3442,7 +3418,7 @@ { \ /* Endpoint: 1, Cluster: Refrigerator Alarm (server) */ \ .clusterId = 0x00000057, \ - .attributes = ZAP_ATTRIBUTE_INDEX(385), \ + .attributes = ZAP_ATTRIBUTE_INDEX(381), \ .attributeCount = 5, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3455,20 +3431,20 @@ { \ /* Endpoint: 1, Cluster: Dishwasher Mode (server) */ \ .clusterId = 0x00000059, \ - .attributes = ZAP_ATTRIBUTE_INDEX(390), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 154 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 151 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Air Quality (server) */ \ .clusterId = 0x0000005B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(396), \ + .attributes = ZAP_ATTRIBUTE_INDEX(392), \ .attributeCount = 3, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3481,12 +3457,12 @@ { \ /* Endpoint: 1, Cluster: Smoke CO Alarm (server) */ \ .clusterId = 0x0000005C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(399), \ + .attributes = ZAP_ATTRIBUTE_INDEX(395), \ .attributeCount = 15, \ .clusterSize = 22, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 158 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 155 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 26 ), \ .eventCount = 11, \ @@ -3494,12 +3470,12 @@ { \ /* Endpoint: 1, Cluster: Dishwasher Alarm (server) */ \ .clusterId = 0x0000005D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(414), \ + .attributes = ZAP_ATTRIBUTE_INDEX(410), \ .attributeCount = 6, \ .clusterSize = 22, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 160 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 37 ), \ .eventCount = 1, \ @@ -3507,7 +3483,7 @@ { \ /* Endpoint: 1, Cluster: Microwave Oven Mode (server) */ \ .clusterId = 0x0000005E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(420), \ + .attributes = ZAP_ATTRIBUTE_INDEX(416), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3520,51 +3496,51 @@ { \ /* Endpoint: 1, Cluster: Operational State (server) */ \ .clusterId = 0x00000060, \ - .attributes = ZAP_ATTRIBUTE_INDEX(424), \ + .attributes = ZAP_ATTRIBUTE_INDEX(420), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 163 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 168 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 160 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 165 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 38 ), \ .eventCount = 2, \ },\ { \ /* Endpoint: 1, Cluster: RVC Operational State (server) */ \ .clusterId = 0x00000061, \ - .attributes = ZAP_ATTRIBUTE_INDEX(432), \ + .attributes = ZAP_ATTRIBUTE_INDEX(428), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 170 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 174 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 167 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 171 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 40 ), \ .eventCount = 2, \ },\ { \ /* Endpoint: 1, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(440), \ + .attributes = ZAP_ATTRIBUTE_INDEX(436), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayScenesManagementServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 176 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 173 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: HEPA Filter Monitoring (server) */ \ .clusterId = 0x00000071, \ - .attributes = ZAP_ATTRIBUTE_INDEX(445), \ + .attributes = ZAP_ATTRIBUTE_INDEX(441), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 193 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3572,12 +3548,12 @@ { \ /* Endpoint: 1, Cluster: Activated Carbon Filter Monitoring (server) */ \ .clusterId = 0x00000072, \ - .attributes = ZAP_ATTRIBUTE_INDEX(453), \ + .attributes = ZAP_ATTRIBUTE_INDEX(449), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 195 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3585,12 +3561,12 @@ { \ /* Endpoint: 1, Cluster: Boolean State Configuration (server) */ \ .clusterId = 0x00000080, \ - .attributes = ZAP_ATTRIBUTE_INDEX(461), \ + .attributes = ZAP_ATTRIBUTE_INDEX(457), \ .attributeCount = 10, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 197 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 194 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 42 ), \ .eventCount = 2, \ @@ -3598,12 +3574,12 @@ { \ /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */ \ .clusterId = 0x00000081, \ - .attributes = ZAP_ATTRIBUTE_INDEX(471), \ + .attributes = ZAP_ATTRIBUTE_INDEX(467), \ .attributeCount = 13, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 197 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 44 ), \ .eventCount = 2, \ @@ -3611,7 +3587,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Power Measurement (server) */ \ .clusterId = 0x00000090, \ - .attributes = ZAP_ATTRIBUTE_INDEX(484), \ + .attributes = ZAP_ATTRIBUTE_INDEX(480), \ .attributeCount = 21, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3624,7 +3600,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Energy Measurement (server) */ \ .clusterId = 0x00000091, \ - .attributes = ZAP_ATTRIBUTE_INDEX(505), \ + .attributes = ZAP_ATTRIBUTE_INDEX(501), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3637,12 +3613,12 @@ { \ /* Endpoint: 1, Cluster: Device Energy Management (server) */ \ .clusterId = 0x00000098, \ - .attributes = ZAP_ATTRIBUTE_INDEX(513), \ + .attributes = ZAP_ATTRIBUTE_INDEX(509), \ .attributeCount = 10, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 203 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 49 ), \ .eventCount = 4, \ @@ -3650,20 +3626,20 @@ { \ /* Endpoint: 1, Cluster: Energy EVSE (server) */ \ .clusterId = 0x00000099, \ - .attributes = ZAP_ATTRIBUTE_INDEX(523), \ + .attributes = ZAP_ATTRIBUTE_INDEX(519), \ .attributeCount = 19, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 212 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 220 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 209 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 217 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 53 ), \ .eventCount = 6, \ },\ { \ /* Endpoint: 1, Cluster: Energy Preference (server) */ \ .clusterId = 0x0000009B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(542), \ + .attributes = ZAP_ATTRIBUTE_INDEX(538), \ .attributeCount = 7, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3676,7 +3652,7 @@ { \ /* Endpoint: 1, Cluster: Power Topology (server) */ \ .clusterId = 0x0000009C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(549), \ + .attributes = ZAP_ATTRIBUTE_INDEX(545), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3689,38 +3665,38 @@ { \ /* Endpoint: 1, Cluster: Energy EVSE Mode (server) */ \ .clusterId = 0x0000009D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(553), \ + .attributes = ZAP_ATTRIBUTE_INDEX(549), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 222 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 224 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 219 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 221 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Device Energy Management Mode (server) */ \ .clusterId = 0x0000009F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(557), \ + .attributes = ZAP_ATTRIBUTE_INDEX(553), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 226 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 228 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 225 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(561), \ + .attributes = ZAP_ATTRIBUTE_INDEX(557), \ .attributeCount = 24, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 230 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 227 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3728,12 +3704,12 @@ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(585), \ + .attributes = ZAP_ATTRIBUTE_INDEX(581), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayBarrierControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3741,7 +3717,7 @@ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(591), \ + .attributes = ZAP_ATTRIBUTE_INDEX(587), \ .attributeCount = 25, \ .clusterSize = 52, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3754,25 +3730,25 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(616), \ + .attributes = ZAP_ATTRIBUTE_INDEX(612), \ .attributeCount = 26, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 241 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 246 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 243 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(642), \ + .attributes = ZAP_ATTRIBUTE_INDEX(638), \ .attributeCount = 14, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayFanControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 248 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3780,7 +3756,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(656), \ + .attributes = ZAP_ATTRIBUTE_INDEX(652), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3793,12 +3769,12 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(661), \ + .attributes = ZAP_ATTRIBUTE_INDEX(657), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 250 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 247 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3806,7 +3782,7 @@ { \ /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ .clusterId = 0x00000301, \ - .attributes = ZAP_ATTRIBUTE_INDEX(715), \ + .attributes = ZAP_ATTRIBUTE_INDEX(711), \ .attributeCount = 16, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3819,7 +3795,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(731), \ + .attributes = ZAP_ATTRIBUTE_INDEX(727), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3832,7 +3808,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(738), \ + .attributes = ZAP_ATTRIBUTE_INDEX(734), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3845,7 +3821,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(744), \ + .attributes = ZAP_ATTRIBUTE_INDEX(740), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3858,7 +3834,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(749), \ + .attributes = ZAP_ATTRIBUTE_INDEX(745), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3871,7 +3847,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(755), \ + .attributes = ZAP_ATTRIBUTE_INDEX(751), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3884,7 +3860,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(761), \ + .attributes = ZAP_ATTRIBUTE_INDEX(757), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3897,7 +3873,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Monoxide Concentration Measurement (server) */ \ .clusterId = 0x0000040C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(766), \ + .attributes = ZAP_ATTRIBUTE_INDEX(762), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3910,7 +3886,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Dioxide Concentration Measurement (server) */ \ .clusterId = 0x0000040D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(779), \ + .attributes = ZAP_ATTRIBUTE_INDEX(775), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3923,7 +3899,7 @@ { \ /* Endpoint: 1, Cluster: Nitrogen Dioxide Concentration Measurement (server) */ \ .clusterId = 0x00000413, \ - .attributes = ZAP_ATTRIBUTE_INDEX(792), \ + .attributes = ZAP_ATTRIBUTE_INDEX(788), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3936,7 +3912,7 @@ { \ /* Endpoint: 1, Cluster: Ozone Concentration Measurement (server) */ \ .clusterId = 0x00000415, \ - .attributes = ZAP_ATTRIBUTE_INDEX(805), \ + .attributes = ZAP_ATTRIBUTE_INDEX(801), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3949,7 +3925,7 @@ { \ /* Endpoint: 1, Cluster: PM2.5 Concentration Measurement (server) */ \ .clusterId = 0x0000042A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(818), \ + .attributes = ZAP_ATTRIBUTE_INDEX(814), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3962,7 +3938,7 @@ { \ /* Endpoint: 1, Cluster: Formaldehyde Concentration Measurement (server) */ \ .clusterId = 0x0000042B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(831), \ + .attributes = ZAP_ATTRIBUTE_INDEX(827), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3975,7 +3951,7 @@ { \ /* Endpoint: 1, Cluster: PM1 Concentration Measurement (server) */ \ .clusterId = 0x0000042C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(844), \ + .attributes = ZAP_ATTRIBUTE_INDEX(840), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3988,7 +3964,7 @@ { \ /* Endpoint: 1, Cluster: PM10 Concentration Measurement (server) */ \ .clusterId = 0x0000042D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(857), \ + .attributes = ZAP_ATTRIBUTE_INDEX(853), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4001,7 +3977,7 @@ { \ /* Endpoint: 1, Cluster: Total Volatile Organic Compounds Concentration Measurement (server) */ \ .clusterId = 0x0000042E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(870), \ + .attributes = ZAP_ATTRIBUTE_INDEX(866), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4014,7 +3990,7 @@ { \ /* Endpoint: 1, Cluster: Radon Concentration Measurement (server) */ \ .clusterId = 0x0000042F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(883), \ + .attributes = ZAP_ATTRIBUTE_INDEX(879), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4027,7 +4003,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(896), \ + .attributes = ZAP_ATTRIBUTE_INDEX(892), \ .attributeCount = 3, \ .clusterSize = 19, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4040,12 +4016,12 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(899), \ + .attributes = ZAP_ATTRIBUTE_INDEX(895), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 270 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 267 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4053,7 +4029,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(901), \ + .attributes = ZAP_ATTRIBUTE_INDEX(897), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4066,25 +4042,25 @@ { \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ .clusterId = 0xFFF1FC05, \ - .attributes = ZAP_ATTRIBUTE_INDEX(914), \ + .attributes = ZAP_ATTRIBUTE_INDEX(910), \ .attributeCount = 84, \ .clusterSize = 2290, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 272 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 294 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 269 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 291 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 59 ), \ .eventCount = 3, \ },\ { \ /* Endpoint: 2, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(998), \ + .attributes = ZAP_ATTRIBUTE_INDEX(994), \ .attributeCount = 4, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 306 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 303 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4092,25 +4068,25 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1002), \ + .attributes = ZAP_ATTRIBUTE_INDEX(998), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 309 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 316 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 306 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 313 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1005), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1001), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 321 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 318 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4118,7 +4094,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1012), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1008), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4131,7 +4107,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1019), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1015), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4144,20 +4120,20 @@ { \ /* Endpoint: 2, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1028), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1024), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayScenesManagementServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 328 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 337 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 325 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 334 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1033), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1029), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4170,7 +4146,7 @@ { \ /* Endpoint: 65534, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1038), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1034), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4183,13 +4159,13 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1044), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1040), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 345 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 352 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 342 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 349 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -4197,13 +4173,13 @@ // clang-format on -#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 110 +#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 109 // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 29, 349 }, { ZAP_CLUSTER_INDEX(29), 74, 3517 }, { ZAP_CLUSTER_INDEX(103), 7, 122 }, \ - { ZAP_CLUSTER_INDEX(110), 2, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 28, 340 }, { ZAP_CLUSTER_INDEX(28), 74, 3517 }, { ZAP_CLUSTER_INDEX(102), 7, 122 }, \ + { ZAP_CLUSTER_INDEX(109), 2, 0 }, \ } // Largest attribute size is needed for various buffers @@ -4215,7 +4191,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (36) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3988) +#define ATTRIBUTE_MAX_SIZE (3979) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h index ec489b734afb7a..ccb66133d42412 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h @@ -21,7 +21,7 @@ #pragma once /**** Cluster endpoint counts ****/ -#define MATTER_DM_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (3) +#define MATTER_DM_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define MATTER_DM_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (3) #define MATTER_DM_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define MATTER_DM_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index 499bf100256546..e2d05adb01e4a1 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -60,7 +60,6 @@ endfunction() # Available options are: # SCOPE CMake scope keyword that defines the scope of included sources. # The default is PRIVATE scope. -# INCLUDE_SERVER Include source files from src/app/server directory. # ZAP_FILE Path to the ZAP file, used to determine the list of clusters # supported by the application. # IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE @@ -71,27 +70,26 @@ endfunction() # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) - cmake_parse_arguments(ARG "INCLUDE_SERVER" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) + cmake_parse_arguments(ARG "" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() - if(ARG_INCLUDE_SERVER) - target_sources(${APP_TARGET} ${SCOPE} - ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp - ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp - ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp - ${CHIP_APP_BASE_DIR}/server/Dnssd.cpp - ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp - ${CHIP_APP_BASE_DIR}/server/OnboardingCodesUtil.cpp - ${CHIP_APP_BASE_DIR}/server/Server.cpp - ) + # CMAKE data model auto-includes the server side implementation + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp + ${CHIP_APP_BASE_DIR}/server/Dnssd.cpp + ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp + ${CHIP_APP_BASE_DIR}/server/OnboardingCodesUtil.cpp + ${CHIP_APP_BASE_DIR}/server/Server.cpp + ) - target_compile_options(${APP_TARGET} ${SCOPE} - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" - ) - endif() + target_compile_options(${APP_TARGET} ${SCOPE} + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + ) if(ARG_ZAP_FILE) chip_configure_zap_file(${APP_TARGET} ${ARG_ZAP_FILE} "${ARG_EXTERNAL_CLUSTERS}") @@ -119,6 +117,27 @@ function(chip_configure_data_model APP_TARGET) set(APP_GEN_FILES) endif() + # These are: + # //src/app/icd/server:notfier + # //src/app/icd/server:monitoring-table + # //src/app/icd/server:configuration-data + # + # TODO: ideally we would avoid duplication and would link gn-built items. In this case + # it may be slightly harder because these are source_sets rather than libraries. + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp + ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp + ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp + ) + + # This is: + # //src/app/common:cluster-objects + # + # TODO: ideally we would avoid duplication and would link gn-built items + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp + ) + chip_zapgen(${APP_TARGET}-zapgen INPUT "${ARG_ZAP_FILE}" GENERATOR "app-templates" @@ -133,18 +152,12 @@ function(chip_configure_data_model APP_TARGET) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_TEMPLATES_GEN_DIR}") add_dependencies(${APP_TARGET} ${APP_TARGET}-zapgen) - # TODO: source for codedgen_data_model ??? - target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp - ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp ${CHIP_APP_BASE_DIR}/reporting/reporting.cpp ${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/ember-global-attribute-access-interface.cpp diff --git a/src/app/icd/server/BUILD.gn b/src/app/icd/server/BUILD.gn index f69c25015592af..b30b79d3d4a1d0 100644 --- a/src/app/icd/server/BUILD.gn +++ b/src/app/icd/server/BUILD.gn @@ -93,7 +93,6 @@ source_set("manager") { deps = [ ":icd-server-config" ] public_deps = [ - ":check-in-back-off", ":configuration-data", ":notifier", ":observer", @@ -106,6 +105,7 @@ source_set("manager") { if (chip_enable_icd_checkin) { public_deps += [ + ":check-in-back-off", ":monitoring-table", ":sender", "${chip_root}/src/app:app_config", diff --git a/src/app/icd/server/ICDManager.h b/src/app/icd/server/ICDManager.h index 4ec1dfe65231d3..19f5f0abeda955 100644 --- a/src/app/icd/server/ICDManager.h +++ b/src/app/icd/server/ICDManager.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -34,9 +33,10 @@ #include #if CHIP_CONFIG_ENABLE_ICD_CIP -#include // nogncheck -#include // nogncheck -#endif // CHIP_CONFIG_ENABLE_ICD_CIP +#include // nogncheck +#include // nogncheck +#include // nogncheck +#endif // CHIP_CONFIG_ENABLE_ICD_CIP namespace chip { namespace Crypto { diff --git a/src/app/icd/server/ICDMonitoringTable.cpp b/src/app/icd/server/ICDMonitoringTable.cpp index 8148a7fe33b237..c5543c74125f52 100644 --- a/src/app/icd/server/ICDMonitoringTable.cpp +++ b/src/app/icd/server/ICDMonitoringTable.cpp @@ -140,7 +140,6 @@ CHIP_ERROR ICDMonitoringEntry::SetKey(ByteSpan keyData) Crypto::Symmetric128BitsKeyByteArray keyMaterial; memcpy(keyMaterial, keyData.data(), sizeof(Crypto::Symmetric128BitsKeyByteArray)); - // TODO - Add function to set PSA key lifetime ReturnErrorOnFailure(symmetricKeystore->CreateKey(keyMaterial, aesKeyHandle)); CHIP_ERROR error = symmetricKeystore->CreateKey(keyMaterial, hmacKeyHandle); @@ -242,15 +241,22 @@ CHIP_ERROR ICDMonitoringTable::Get(uint16_t index, ICDMonitoringEntry & entry) c CHIP_ERROR ICDMonitoringTable::Find(NodeId id, ICDMonitoringEntry & entry) { - uint16_t index = 0; - while (index < this->Limit()) + uint16_t index; + ICDMonitoringEntry tempEntry(mSymmetricKeystore); + + for (index = 0; index < this->Limit(); index++) { - ReturnErrorOnFailure(this->Get(index++, entry)); - if (id == entry.checkInNodeID) + if (this->Get(index, tempEntry) != CHIP_NO_ERROR) + { + break; + } + if (id == tempEntry.checkInNodeID) { + entry = tempEntry; return CHIP_NO_ERROR; } } + entry.index = index; return CHIP_ERROR_NOT_FOUND; } @@ -263,16 +269,26 @@ CHIP_ERROR ICDMonitoringTable::Set(uint16_t index, const ICDMonitoringEntry & en VerifyOrReturnError(entry.keyHandleValid, CHIP_ERROR_INVALID_ARGUMENT); ICDMonitoringEntry e(this->mFabric, index); - e.checkInNodeID = entry.checkInNodeID; - e.monitoredSubject = entry.monitoredSubject; - e.clientType = entry.clientType; - e.index = index; + e.checkInNodeID = entry.checkInNodeID; + e.monitoredSubject = entry.monitoredSubject; + e.clientType = entry.clientType; + e.index = index; + e.symmetricKeystore = entry.symmetricKeystore; memcpy(e.aesKeyHandle.AsMutable(), entry.aesKeyHandle.As(), sizeof(Crypto::Symmetric128BitsKeyByteArray)); memcpy(e.hmacKeyHandle.AsMutable(), entry.hmacKeyHandle.As(), sizeof(Crypto::Symmetric128BitsKeyByteArray)); + ReturnErrorOnFailure(e.symmetricKeystore->PersistICDKey(e.aesKeyHandle)); + CHIP_ERROR error = e.symmetricKeystore->PersistICDKey(e.hmacKeyHandle); + if (error != CHIP_NO_ERROR) + { + // If setting the persistence of the HmacKeyHandle failed, we need to delete the AesKeyHandle to avoid a key leak + e.symmetricKeystore->DestroyKey(e.aesKeyHandle); + return error; + } + return e.Save(this->mStorage); } diff --git a/src/app/server/BUILD.gn b/src/app/server/BUILD.gn index 58524c3a648aab..4addf8eea938e3 100644 --- a/src/app/server/BUILD.gn +++ b/src/app/server/BUILD.gn @@ -54,7 +54,6 @@ static_library("server") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/app:test-event-trigger", - "${chip_root}/src/app/icd/server:check-in-back-off", "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/app/icd/server:observer", "${chip_root}/src/lib/address_resolve", diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 01bff4bf07db46..110a729d8f1b87 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -302,6 +302,20 @@ CHIP_ERROR CommissioningWindowManager::AdvertiseAndListenForPASE() return CHIP_NO_ERROR; } +System::Clock::Seconds32 CommissioningWindowManager::MaxCommissioningTimeout() const +{ +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING + /* Allow for extended announcement only if the device is uncomissioned. */ + if (mServer->GetFabricTable().FabricCount() == 0) + { + // Specification section 2.3.1 - Extended Announcement Duration up to 48h + return System::Clock::Seconds32(60 * 60 * 48); + } +#endif + // Specification section 5.4.2.3. Announcement Duration says 15 minutes. + return System::Clock::Seconds32(15 * 60); +} + CHIP_ERROR CommissioningWindowManager::OpenBasicCommissioningWindow(Seconds32 commissioningTimeout, CommissioningWindowAdvertisement advertisementMode) { diff --git a/src/app/server/CommissioningWindowManager.h b/src/app/server/CommissioningWindowManager.h index 51efb44b19376e..3bc50ed3e33685 100644 --- a/src/app/server/CommissioningWindowManager.h +++ b/src/app/server/CommissioningWindowManager.h @@ -58,16 +58,7 @@ class CommissioningWindowManager : public Messaging::UnsolicitedMessageHandler, return CHIP_NO_ERROR; } - static constexpr System::Clock::Seconds32 MaxCommissioningTimeout() - { -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING - // Specification section 2.3.1 - Extended Announcement Duration up to 48h - return System::Clock::Seconds32(60 * 60 * 48); -#else - // Specification section 5.4.2.3. Announcement Duration says 15 minutes. - return System::Clock::Seconds32(15 * 60); -#endif - } + System::Clock::Seconds32 MaxCommissioningTimeout() const; System::Clock::Seconds32 MinCommissioningTimeout() const { diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 27c850563f6e98..2f61197fcee2dd 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -72,14 +72,14 @@ #include #include -#include #if CHIP_CONFIG_ENABLE_ICD_SERVER #include // nogncheck #if CHIP_CONFIG_ENABLE_ICD_CIP #include // nogncheck -#endif -#endif +#include // nogncheck +#endif // CHIP_CONFIG_ENABLE_ICD_CIP +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER namespace chip { @@ -183,9 +183,11 @@ struct ServerInitParams Credentials::OperationalCertificateStore * opCertStore = nullptr; // Required, if not provided, the Server::Init() WILL fail. app::reporting::ReportScheduler * reportScheduler = nullptr; +#if CHIP_CONFIG_ENABLE_ICD_CIP // Optional. Support for the ICD Check-In BackOff strategy. Must be initialized before being provided. // If the ICD Check-In protocol use-case is supported and no strategy is provided, server will use the default strategy. app::ICDCheckInBackOffStrategy * icdCheckInBackOffStrategy = nullptr; +#endif // CHIP_CONFIG_ENABLE_ICD_CIP }; /** diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 39179e1143bd75..6f2725e0e98233 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -40,7 +40,6 @@ tests: attribute: "ServerList" response: value: [ - 0x0003, # Identify 0x0004, # Groups 0x001D, # Descriptor 0x001E, # Binding diff --git a/src/app/tests/suites/TestIdentifyCluster.yaml b/src/app/tests/suites/TestIdentifyCluster.yaml index 52e667ce4d0329..c373d1386149be 100644 --- a/src/app/tests/suites/TestIdentifyCluster.yaml +++ b/src/app/tests/suites/TestIdentifyCluster.yaml @@ -17,7 +17,7 @@ name: Identify Cluster Tests config: nodeId: 0x12344321 cluster: "Identify" - endpoint: 0 + endpoint: 1 tests: - label: "Wait for the commissioned device to be retrieved" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml index 19183ba79aff8d..5915fd6357bd67 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_7.yaml @@ -58,9 +58,9 @@ tests: } - label: - "Step 0b: TH binds GroupIds 0x0001 and 0x0002 with GroupKeySetID - 0x01a1 in the GroupKeyMap attribute list on GroupKeyManagement cluster - by writing the GroupKeyMap attribute with two entries as follows:" + "Step 0b: TH binds GroupIds 0x0001 with GroupKeySetID 0x01a1 in the + GroupKeyMap attribute list on GroupKeyManagement cluster by writing + the GroupKeyMap attribute with two entries as follows:" cluster: "Group Key Management" endpoint: 0 command: "writeAttribute" @@ -142,7 +142,7 @@ tests: value: 0 - label: - "Step 2b: TH sends a StoreScene command to DUT with the GroupID field + "Step 3: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." command: "StoreScene" arguments: @@ -160,7 +160,7 @@ tests: - name: "SceneID" value: 0x01 - - label: "Step 3: TH sends a AddScene command to DUT with the GroupID field + - label: "Step 4: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x02, the TransitionTime field set to 1000 (1s) and the ExtensionFieldSets set to: '[{ ClusterID: 0x0006, AttributeValueList: [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }]}]' @@ -195,7 +195,7 @@ tests: value: 0x02 - label: - "Step 4a: TH sends a RecallScene command to DUT with the GroupID field + "Step 5a: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x02." PICS: S.S.C05.Rsp command: "RecallScene" @@ -214,7 +214,7 @@ tests: - name: "ms" value: 2000 - - label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" cluster: "On/Off" command: "readAttribute" attribute: "OnOff" @@ -222,7 +222,7 @@ tests: value: 1 - label: - "Step 5a: TH sends a RecallScene command to DUT with the GroupID field + "Step 6a: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" @@ -241,7 +241,7 @@ tests: - name: "ms" value: 1000 - - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 6b: after a few seconds, TH reads OnOff attribute from DUT" cluster: "On/Off" command: "readAttribute" attribute: "OnOff" diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index 95005e30c40e42..0d78bccbe64e05 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -219,7 +219,14 @@ tests: "Step 2a: TH configures AC1 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC1? + ./chip-tool levelcontrol move-to-level-with-on-off 100 0 0 0 1 1 + + DUT is configured with AC1 for application clusters which is implemented and supporting scenes + + [1705040301.476123][6423:6425] CHIP:DMG: StatusIB = + [1705040301.476139][6423:6425] CHIP:DMG: { + [1705040301.476152][6423:6425] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040301.476164][6423:6425] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -315,7 +322,16 @@ tests: "Step 3a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC2 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -340,6 +356,47 @@ tests: - name: "SceneID" value: 0x01 + - label: "Wait 250 ms for instant transition" + PICS: PICS_SDK_CI_ONLY + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 250 + + - label: + "TH confirm the DUT reached AC1 (on level control cluster) after 250ms" + PICS: PICS_SDK_CI_ONLY && S.S.C05.Rsp + cluster: "Level Control" + command: "readAttribute" + attribute: "CurrentLevel" + response: + value: 100 + + - label: "Verify DUT returns to AC1." + verification: | + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please confirm AC1 on DUT and enter 'y'." + - name: "expectedValue" + value: "y" + - label: "Step 3c: TH reads attribute SceneTableSize from DUT." command: "readAttribute" attribute: "SceneTableSize" @@ -411,7 +468,16 @@ tests: "Step 4c: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -436,6 +502,47 @@ tests: - name: "SceneID" value: 0x01 + - label: "Wait 250 ms for instant transition" + PICS: PICS_SDK_CI_ONLY + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 250 + + - label: + "TH confirm the DUT reached AC1 (on level control cluster) after 250ms" + PICS: PICS_SDK_CI_ONLY && S.S.C05.Rsp + cluster: "Level Control" + command: "readAttribute" + attribute: "CurrentLevel" + response: + value: 100 + + - label: "Verify DUT returns to AC1." + verification: | + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please confirm AC1 on DUT and enter 'y'." + - name: "expectedValue" + value: "y" + - label: "Step 4e: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0xFF, which is outside of the @@ -516,24 +623,93 @@ tests: - label: "Step 5a: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." + verification: | + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + ./chip-tool scenesmanagement view-scene 0x0001 0x01 1 1 + + Verify DUT sends a ViewSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 0x0000 and a set of extension fields appropriate to AC1 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + + [1720440014.726] [13252:13254] [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 + [1720440014.726] [13252:13254] [TOO] Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 + [1720440014.726] [13252:13254] [TOO] ViewSceneResponse: { + [1720440014.726] [13252:13254] [TOO] status: 0 + [1720440014.726] [13252:13254] [TOO] groupID: 1 + [1720440014.726] [13252:13254] [TOO] sceneID: 1 + [1720440014.726] [13252:13254] [TOO] transitionTime: 0 + [1720440014.727] [13252:13254] [TOO] sceneName: + [1720440014.727] [13252:13254] [TOO] extensionFieldSets: 3 entries + [1720440014.727] [13252:13254] [TOO] [1]: { + [1720440014.727] [13252:13254] [TOO] ClusterID: 6 + [1720440014.727] [13252:13254] [TOO] AttributeValueList: 1 entries + [1720440014.727] [13252:13254] [TOO] [1]: { + [1720440014.727] [13252:13254] [TOO] AttributeID: 0 + [1720440014.727] [13252:13254] [TOO] ValueUnsigned8: 1 + [1720440014.727] [13252:13254] [TOO] } + [1720440014.727] [13252:13254] [TOO] } + [1720440014.727] [13252:13254] [TOO] [2]: { + [1720440014.727] [13252:13254] [TOO] ClusterID: 8 + [1720440014.727] [13252:13254] [TOO] AttributeValueList: 1 entries + [1720440014.727] [13252:13254] [TOO] [1]: { + [1720440014.727] [13252:13254] [TOO] AttributeID: 0 + [1720440014.727] [13252:13254] [TOO] ValueUnsigned8: 100 + [1720440014.727] [13252:13254] [TOO] } + [1720440014.727] [13252:13254] [TOO] } + [1720440014.727] [13252:13254] [TOO] [3]: { + [1720440014.727] [13252:13254] [TOO] ClusterID: 768 + [1720440014.727] [13252:13254] [TOO] AttributeValueList: 9 entries + [1720440014.727] [13252:13254] [TOO] [1]: { + [1720440014.727] [13252:13254] [TOO] AttributeID: 3 + [1720440014.727] [13252:13254] [TOO] ValueUnsigned16: 24939 + [1720440014.727] [13252:13254] [TOO] } + [1720440014.727] [13252:13254] [TOO] [2]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 4 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned16: 24701 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [3]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 16384 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned16: 0 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [4]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 1 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned8: 0 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [5]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 16386 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned8: 0 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [6]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 16387 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned8: 0 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [7]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 16388 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned16: 25 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [8]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 7 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned16: 0 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.728] [13252:13254] [TOO] [9]: { + [1720440014.728] [13252:13254] [TOO] AttributeID: 16385 + [1720440014.728] [13252:13254] [TOO] ValueUnsigned8: 2 + [1720440014.728] [13252:13254] [TOO] } + [1720440014.729] [13252:13254] [TOO] } + [1720440014.729] [13252:13254] [TOO] } PICS: S.S.C01.Rsp && PICS_SKIP_SAMPLE_APP - command: "ViewScene" + cluster: "LogCommands" + command: "UserPrompt" arguments: values: - - name: "GroupID" - value: G1 - - name: "SceneID" - value: 0x01 - response: - values: - - name: "Status" - value: 0x00 - - name: "GroupID" - value: G1 - - name: "SceneID" - value: 0x01 - - name: "TransitionTime" - value: 0x0000 + - name: "message" + value: + "Please execute the view-scene command and verify that the + extensionfieldsets, status, groupID and SceneID are in + accordance with AC1 on DUT and enter 'y' if the command is + successful" + - name: "expectedValue" + value: "y" - label: "Step 5b: TH sends a ViewScene command to DUT with the GroupID field @@ -728,7 +904,7 @@ tests: set to GI (Where GI is a group currently absent from the group table), the SceneID field set to 0x01, the TransitionTime field set to 1000 (1s) and a set of extension fields appropriate to AC1." - PICS: S.S.C00.Rsp + PICS: S.S.C00.Rsp && PICS_SDK_CI_ONLY command: "AddScene" arguments: values: @@ -751,6 +927,55 @@ tests: - name: "SceneID" value: 0x01 + - label: + "Step 8b: TH sends a AddScene command to DUT with the GroupID field + set to GI (Where GI is a group currently absent from the group table), + the SceneID field set to 0x01, the TransitionTime field set to 1000 + (1s) and a set of extension fields appropriate to AC1." + verification: | + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + ./chip-tool groupkeymanagement read group-table 1 0 + + Verify the GroupTable entries on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + [1705676728.146505][4668:4670] CHIP:DMG: } + [1705676728.146723][4668:4670] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 3010518007 + [1705676728.146781][4668:4670] CHIP:TOO: GroupTable: 1 entries + [1705676728.147147][4668:4670] CHIP:TOO: [1]: { + [1705676728.147155][4668:4670] CHIP:TOO: GroupId: 1 + [1705676728.147160][4668:4670] CHIP:TOO: Endpoints: 1 entries + [1705676728.147164][4668:4670] CHIP:TOO: [1]: 1 + [1705676728.147167][4668:4670] CHIP:TOO: GroupName: Gp1 + [1705676728.147170][4668:4670] CHIP:TOO: FabricIndex: 1 + [1705676728.147173][4668:4670] CHIP:TOO: } + + Select the group (G1) that is absent from the above group table + + ./chip-tool scenesmanagement add-scene 0x0002 0x01 1000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4000", "valueUnsigned16": "0x01"}]}]' 1 1 + + Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x85 (INVALID_COMMAND), the GroupID field set to GI and the SceneID field set to 0x01. on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: + + [1706763629.927365][4236:4238] CHIP:DMG: }, + [1706763629.927382][4236:4238] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0000 + [1706763629.927390][4236:4238] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0000 + [1706763629.927407][4236:4238] CHIP:TOO: AddSceneResponse: { + [1706763629.927413][4236:4238] CHIP:TOO: status: 133 + [1706763629.927416][4236:4238] CHIP:TOO: groupID: 2 + [1706763629.927419][4236:4238] CHIP:TOO: sceneID: 1 + [1706763629.927422][4236:4238] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: + "Please execute the add scene command with + extensionfieldsets in accordance with AC1 on DUT and enter + 'y' if the command is successful" + - name: "expectedValue" + value: "y" + - label: "Step 8c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1." @@ -1051,7 +1276,14 @@ tests: "Step 10a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -1099,7 +1331,14 @@ tests: "Step 11a: TH configures AC1 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC1? + ./chip-tool levelcontrol move-to-level-with-on-off 100 0 0 0 1 1 + + DUT is configured with AC1 for application clusters which is implemented and supporting scenes + + [1705040301.476123][6423:6425] CHIP:DMG: StatusIB = + [1705040301.476139][6423:6425] CHIP:DMG: { + [1705040301.476152][6423:6425] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040301.476164][6423:6425] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -1153,7 +1392,16 @@ tests: "Step 12a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + THIS COMMAND SHALL VARY DEPENDING ON THE DUT, TESTER NEEDS TO ENSURE THAT AC1 REPRESENTS CLUSTER ATTRIBUTES PRESENT ON DUT + + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -1304,7 +1552,14 @@ tests: clusters supporting scenes." runIf: ContinueTest verification: | - Is DUT configured with AC3? + ./chip-tool levelcontrol move-to-level-with-on-off 1 0 0 0 1 1 + + DUT is configured with AC3 for application clusters which is implemented, supporting scenes and different from AC1, AC2 + + [1705045707.240304][8006:8008] CHIP:DMG: StatusIB = + [1705045707.240308][8006:8008] CHIP:DMG: { + [1705045707.240311][8006:8008] CHIP:DMG: status = 0x00 (SUCCESS), + [1705045707.240314][8006:8008] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index 1e66f4c803834d..b3498affd8fd20 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -239,7 +239,8 @@ tests: - label: "Step 2: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to - 1000 (1s) and a set of extension fields appropriate to AC1." + 1,000(1s) and a set of extension fields appropriate to produce a + device state that will be referred as AC1 in further steps." PICS: S.S.C00.Rsp && PICS_SDK_CI_ONLY command: "AddScene" arguments: @@ -278,9 +279,10 @@ tests: - label: "Step 2: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to - 1000 (1s) and a set of extension fields appropriate to AC1." + 1,000(1s) and a set of extension fields appropriate to produce a + device state that will be referred as AC1 in further steps." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0006", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x01"}, ]}, {"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x64"}, ]}]' 1 1 + ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "valueUnsigned8": "0x64"}, ]}]' 1 1 Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to 257 and the SceneID field set to 0x01 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: @@ -350,35 +352,24 @@ tests: Verify DUT sends a ViewSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 1000 and a set of extension fields appropriate to AC1 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - NOTE: The values below are expected to match the values from the specific AC tested - - [1708071897.294470][7731:7733] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 - [1708071897.294486][7731:7733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 - [1708071897.294520][7731:7733] CHIP:TOO: ViewSceneResponse: { - [1708071897.294527][7731:7733] CHIP:TOO: status: 0 - [1708071897.294530][7731:7733] CHIP:TOO: groupID: 257 - [1708071897.294533][7731:7733] CHIP:TOO: sceneID: 1 - [1708071897.294536][7731:7733] CHIP:TOO: transitionTime: 1000 - [1708071897.294540][7731:7733] CHIP:TOO: sceneName: scene name - [1708071897.294554][7731:7733] CHIP:TOO: extensionFieldSets: 2 entries - [1708071897.294569][7731:7733] CHIP:TOO: [1]: { - [1708071897.294574][7731:7733] CHIP:TOO: ClusterID: 6 - [1708071897.294580][7731:7733] CHIP:TOO: AttributeValueList: 1 entries - [1708071897.294589][7731:7733] CHIP:TOO: [1]: { - [1708071897.294593][7731:7733] CHIP:TOO: AttributeID: 0 - [1708071897.294596][7731:7733] CHIP:TOO: ValueUnsigned8: 1 - [1708071897.294599][7731:7733] CHIP:TOO: } - [1708071897.294603][7731:7733] CHIP:TOO: } - [1708071897.294611][7731:7733] CHIP:TOO: [2]: { - [1708071897.294615][7731:7733] CHIP:TOO: ClusterID: 8 - [1708071897.294621][7731:7733] CHIP:TOO: AttributeValueList: 1 entries - [1708071897.294628][7731:7733] CHIP:TOO: [1]: { - [1708071897.294633][7731:7733] CHIP:TOO: AttributeID: 0 - [1708071897.294636][7731:7733] CHIP:TOO: ValueUnsigned8: 100 - [1708071897.294639][7731:7733] CHIP:TOO: } - [1708071897.294643][7731:7733] CHIP:TOO: } - [1708071897.294647][7731:7733] CHIP:TOO: } + [1722518510.318] [187478:187480] [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 + [1722518510.318] [187478:187480] [TOO] Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 + [1722518510.318] [187478:187480] [TOO] ViewSceneResponse: { + [1722518510.318] [187478:187480] [TOO] status: 0 + [1722518510.318] [187478:187480] [TOO] groupID: 257 + [1722518510.318] [187478:187480] [TOO] sceneID: 1 + [1722518510.318] [187478:187480] [TOO] transitionTime: 1000 + [1722518510.318] [187478:187480] [TOO] sceneName: scene name + [1722518510.318] [187478:187480] [TOO] extensionFieldSets: 1 entries + [1722518510.318] [187478:187480] [TOO] [1]: { + [1722518510.318] [187478:187480] [TOO] ClusterID: 8 + [1722518510.318] [187478:187480] [TOO] AttributeValueList: 1 entries + [1722518510.318] [187478:187480] [TOO] [1]: { + [1722518510.318] [187478:187480] [TOO] AttributeID: 0 + [1722518510.318] [187478:187480] [TOO] ValueUnsigned8: 100 + [1722518510.318] [187478:187480] [TOO] } + [1722518510.318] [187478:187480] [TOO] } + [1722518510.318] [187478:187480] [TOO] } cluster: "LogCommands" command: "UserPrompt" arguments: @@ -433,7 +424,14 @@ tests: "Step 5a: TH configures AC2 on DUT for all implemented application clusters supporting scenesmanagement." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -479,7 +477,16 @@ tests: - label: "Verify DUT returns to AC1." verification: | - Is DUT configured with AC1? + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 + cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -528,8 +535,9 @@ tests: field set to G1, the SceneID field set to 0x03, the TransitionTime field set to G1 and a set of extension fields appropriate to AC1." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x03 1 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "ValueUnsigned8": "0x01"}]}]' 0xffffffffffff0101 1 - Note: As this is a multicast command, no log is expected. + ./chip-tool scenesmanagement add-scene 0x0101 0x03 1000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "valueUnsigned8": "0x01"}]}]' 0xffffffffffff0101 1 + + There is no Status response since this was a groupcast cluster: "LogCommands" command: "UserPrompt" PICS: S.S.C00.Rsp && PICS_SKIP_SAMPLE_APP @@ -589,25 +597,24 @@ tests: NOTE: The values below are expected to match the values from the specific AC tested - [1707285444.028460][13682:13684] CHIP:DMG: }, - [1707285444.028553][13682:13684] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 - [1707285444.028579][13682:13684] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 - [1707285444.028670][13682:13684] CHIP:TOO: ViewSceneResponse: { - [1707285444.028685][13682:13684] CHIP:TOO: status: 0 - [1707285444.028696][13682:13684] CHIP:TOO: groupID: 257 - [1707285444.028706][13682:13684] CHIP:TOO: sceneID: 3 - [1707285444.028717][13682:13684] CHIP:TOO: transitionTime: 1 - [1707285444.028728][13682:13684] CHIP:TOO: sceneName: scene name - [1707285444.028766][13682:13684] CHIP:TOO: extensionFieldSets: 1 entries - [1707285444.028814][13682:13684] CHIP:TOO: [1]: { - [1707285444.028828][13682:13684] CHIP:TOO: ClusterID: 768 - [1707285444.028853][13682:13684] CHIP:TOO: AttributeValueList: 1 entries - [1707285444.028882][13682:13684] CHIP:TOO: [1]: { - [1707285444.028896][13682:13684] CHIP:TOO: AttributeID: 16386 - [1707285444.028913][13682:13684] CHIP:TOO: ValueUnsigned16: 1 - [1707285444.028925][13682:13684] CHIP:TOO: } - [1707285444.028937][13682:13684] CHIP:TOO: } - [1707285444.028950][13682:13684] CHIP:TOO: } + [1720504218.414] [3432:3434] [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_0062 Command=0x0000_0001 + [1720504218.414] [3432:3434] [TOO] Endpoint: 1 Cluster: 0x0000_0062 Command 0x0000_0001 + [1720504218.414] [3432:3434] [TOO] ViewSceneResponse: { + [1720504218.414] [3432:3434] [TOO] status: 0 + [1720504218.414] [3432:3434] [TOO] groupID: 257 + [1720504218.414] [3432:3434] [TOO] sceneID: 3 + [1720504218.414] [3432:3434] [TOO] transitionTime: 1000 + [1720504218.414] [3432:3434] [TOO] sceneName: scene name + [1720504218.414] [3432:3434] [TOO] extensionFieldSets: 1 entries + [1720504218.414] [3432:3434] [TOO] [1]: { + [1720504218.414] [3432:3434] [TOO] ClusterID: 768 + [1720504218.414] [3432:3434] [TOO] AttributeValueList: 1 entries + [1720504218.414] [3432:3434] [TOO] [1]: { + [1720504218.414] [3432:3434] [TOO] AttributeID: 16386 + [1720504218.415] [3432:3434] [TOO] ValueUnsigned8: 1 + [1720504218.415] [3432:3434] [TOO] } + [1720504218.415] [3432:3434] [TOO] } + [1720504218.415] [3432:3434] [TOO] } cluster: "LogCommands" command: "UserPrompt" arguments: diff --git a/src/crypto/BUILD.gn b/src/crypto/BUILD.gn index 1fb8b94f39a82f..6f82c93c191fa8 100644 --- a/src/crypto/BUILD.gn +++ b/src/crypto/BUILD.gn @@ -67,6 +67,7 @@ source_set("public_headers") { public_deps = [ ":crypto_buildconfig", + "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/lib/asn1", "${chip_root}/src/lib/core", "${chip_root}/src/lib/core:types", diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index 6eccb1dde8f1ab..99b947c18f5c78 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -263,6 +263,28 @@ void Hash_SHA256_stream::Clear() psa_hash_abort(toHashOperation(&mContext)); } +CHIP_ERROR FindFreeKeySlotInRange(psa_key_id_t & keyId, psa_key_id_t start, uint32_t range) +{ + psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; + psa_key_id_t end = start + range; + + VerifyOrReturnError(start >= PSA_KEY_ID_USER_MIN && end - 1 <= PSA_KEY_ID_USER_MAX, CHIP_ERROR_INVALID_ARGUMENT); + + for (keyId = start; keyId < end; keyId++) + { + psa_status_t status = psa_get_key_attributes(keyId, &attributes); + if (status == PSA_ERROR_INVALID_HANDLE) + { + return CHIP_NO_ERROR; + } + else if (status != PSA_SUCCESS) + { + return CHIP_ERROR_INTERNAL; + } + } + return CHIP_ERROR_NOT_FOUND; +} + CHIP_ERROR PsaKdf::Init(const ByteSpan & secret, const ByteSpan & salt, const ByteSpan & info) { psa_status_t status = PSA_SUCCESS; diff --git a/src/crypto/CHIPCryptoPALPSA.h b/src/crypto/CHIPCryptoPALPSA.h index 8fa3dc57a54024..508f2c4c3cd248 100644 --- a/src/crypto/CHIPCryptoPALPSA.h +++ b/src/crypto/CHIPCryptoPALPSA.h @@ -55,19 +55,58 @@ namespace Crypto { #define CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE 0x30000 #endif // CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE +/** + * @def CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END + * + * @brief + * End of the PSA key identifier range used by Matter. + * + * This setting establishes the maximum limit for the key range specific to Matter, in order to + * prevent any overlap with other firmware components that also employ the PSA crypto API. + */ +#ifndef CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END +#define CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END 0x3FFFF +#endif // CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END + +static_assert(PSA_KEY_ID_USER_MIN <= CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE && CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END <= PSA_KEY_ID_USER_MAX, + "Matter specific PSA key range doesn't fit within PSA allowed range"); + +// Each ICD client requires storing two keys- AES and HMAC +static constexpr uint32_t kMaxICDClientKeys = 2 * CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS; + +static_assert(kMaxICDClientKeys >= CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC * CHIP_CONFIG_MAX_FABRICS, + "Number of allocated ICD key slots is lower than maximum number of supported ICD clients"); + /** * @brief Defines subranges of the PSA key identifier space used by Matter. */ enum class KeyIdBase : psa_key_id_t { - Minimum = CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE, - Operational = Minimum, ///< Base of the PSA key ID range for Node Operational Certificate private keys - Maximum = Operational + kMaxValidFabricIndex, + Minimum = CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE, + Operational = Minimum, ///< Base of the PSA key ID range for Node Operational Certificate private keys + DACPrivKey = Operational + kMaxValidFabricIndex + 1, + ICDKeyRangeStart = DACPrivKey + 1, + Maximum = ICDKeyRangeStart + kMaxICDClientKeys, }; -static_assert(to_underlying(KeyIdBase::Minimum) >= PSA_KEY_ID_USER_MIN && to_underlying(KeyIdBase::Maximum) <= PSA_KEY_ID_USER_MAX, +static_assert(to_underlying(KeyIdBase::Minimum) >= CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE && + to_underlying(KeyIdBase::Maximum) <= CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END, "PSA key ID base out of allowed range"); +/** + * @brief Finds first free persistent Key slot ID within range. + * + * @param[out] keyId Key ID handler to which free ID will be set. + * @param[in] start Starting ID in search range. + * @param[in] range Search range. + * + * @retval CHIP_NO_ERROR On success. + * @retval CHIP_ERROR_INTERNAL On PSA crypto API error. + * @retval CHIP_ERROR_NOT_FOUND On no free Key ID within range. + * @retval CHIP_ERROR_INVALID_ARGUMENT On search arguments out of PSA allowed range. + */ +CHIP_ERROR FindFreeKeySlotInRange(psa_key_id_t & keyId, psa_key_id_t start, uint32_t range); + /** * @brief Calculates PSA key ID for Node Operational Certificate private key for the given fabric. */ diff --git a/src/crypto/PSASessionKeystore.cpp b/src/crypto/PSASessionKeystore.cpp index 304fa10086daba..68f8029211e480 100644 --- a/src/crypto/PSASessionKeystore.cpp +++ b/src/crypto/PSASessionKeystore.cpp @@ -24,20 +24,18 @@ namespace Crypto { namespace { -class AesKeyAttributes +class KeyAttributesBase { public: - AesKeyAttributes() + KeyAttributesBase(psa_key_type_t type, psa_algorithm_t algorithm, psa_key_usage_t usageFlags, size_t bits) { - constexpr psa_algorithm_t kAlgorithm = PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG(PSA_ALG_CCM, 8); - - psa_set_key_type(&mAttrs, PSA_KEY_TYPE_AES); - psa_set_key_algorithm(&mAttrs, kAlgorithm); - psa_set_key_usage_flags(&mAttrs, PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT); - psa_set_key_bits(&mAttrs, CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES * 8); + psa_set_key_type(&mAttrs, type); + psa_set_key_algorithm(&mAttrs, algorithm); + psa_set_key_usage_flags(&mAttrs, usageFlags); + psa_set_key_bits(&mAttrs, bits); } - ~AesKeyAttributes() { psa_reset_key_attributes(&mAttrs); } + ~KeyAttributesBase() { psa_reset_key_attributes(&mAttrs); } const psa_key_attributes_t & Get() { return mAttrs; } @@ -45,49 +43,43 @@ class AesKeyAttributes psa_key_attributes_t mAttrs = PSA_KEY_ATTRIBUTES_INIT; }; -class HmacKeyAttributes +class AesKeyAttributes : public KeyAttributesBase { public: - HmacKeyAttributes() - { - psa_set_key_type(&mAttrs, PSA_KEY_TYPE_HMAC); - psa_set_key_algorithm(&mAttrs, PSA_ALG_HMAC(PSA_ALG_SHA_256)); - psa_set_key_usage_flags(&mAttrs, PSA_KEY_USAGE_SIGN_MESSAGE); - psa_set_key_bits(&mAttrs, CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES * 8); - } - - ~HmacKeyAttributes() { psa_reset_key_attributes(&mAttrs); } - - const psa_key_attributes_t & Get() { return mAttrs; } - -private: - psa_key_attributes_t mAttrs = PSA_KEY_ATTRIBUTES_INIT; + AesKeyAttributes() : + KeyAttributesBase(PSA_KEY_TYPE_AES, PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG(PSA_ALG_CCM, 8), + PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT | PSA_KEY_USAGE_COPY, + CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES * 8) + {} }; -class HkdfKeyAttributes +class HmacKeyAttributes : public KeyAttributesBase { public: - HkdfKeyAttributes() - { - psa_set_key_type(&mAttrs, PSA_KEY_TYPE_DERIVE); - psa_set_key_algorithm(&mAttrs, PSA_ALG_HKDF(PSA_ALG_SHA_256)); - psa_set_key_usage_flags(&mAttrs, PSA_KEY_USAGE_DERIVE); - } - - ~HkdfKeyAttributes() { psa_reset_key_attributes(&mAttrs); } - - const psa_key_attributes_t & Get() { return mAttrs; } + HmacKeyAttributes() : + KeyAttributesBase(PSA_KEY_TYPE_HMAC, PSA_ALG_HMAC(PSA_ALG_SHA_256), PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_COPY, + CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES * 8) + {} +}; -private: - psa_key_attributes_t mAttrs = PSA_KEY_ATTRIBUTES_INIT; +class HkdfKeyAttributes : public KeyAttributesBase +{ +public: + HkdfKeyAttributes() : KeyAttributesBase(PSA_KEY_TYPE_DERIVE, PSA_ALG_HKDF(PSA_ALG_SHA_256), PSA_KEY_USAGE_DERIVE, 0) {} }; +void SetKeyId(Symmetric128BitsKeyHandle & key, psa_key_id_t newKeyId) +{ + auto & KeyId = key.AsMutable(); + + KeyId = newKeyId; +} } // namespace CHIP_ERROR PSASessionKeystore::CreateKey(const Symmetric128BitsKeyByteArray & keyMaterial, Aes128KeyHandle & key) { // Destroy the old key if already allocated - psa_destroy_key(key.As()); + DestroyKey(key); AesKeyAttributes attrs; psa_status_t status = @@ -101,7 +93,7 @@ CHIP_ERROR PSASessionKeystore::CreateKey(const Symmetric128BitsKeyByteArray & ke CHIP_ERROR PSASessionKeystore::CreateKey(const Symmetric128BitsKeyByteArray & keyMaterial, Hmac128KeyHandle & key) { // Destroy the old key if already allocated - psa_destroy_key(key.As()); + DestroyKey(key); HmacKeyAttributes attrs; psa_status_t status = @@ -192,5 +184,39 @@ void PSASessionKeystore::DestroyKey(HkdfKeyHandle & key) keyId = PSA_KEY_ID_NULL; } +#if CHIP_CONFIG_ENABLE_ICD_CIP +CHIP_ERROR PSASessionKeystore::PersistICDKey(Symmetric128BitsKeyHandle & key) +{ + CHIP_ERROR err; + psa_key_id_t newKeyId = PSA_KEY_ID_NULL; + psa_key_attributes_t attrs; + + psa_get_key_attributes(key.As(), &attrs); + + // Exit early if key is already persistent + if (psa_get_key_lifetime(&attrs) == PSA_KEY_LIFETIME_PERSISTENT) + { + psa_reset_key_attributes(&attrs); + return CHIP_NO_ERROR; + } + + SuccessOrExit(err = Crypto::FindFreeKeySlotInRange(newKeyId, to_underlying(KeyIdBase::ICDKeyRangeStart), kMaxICDClientKeys)); + psa_set_key_lifetime(&attrs, PSA_KEY_LIFETIME_PERSISTENT); + psa_set_key_id(&attrs, newKeyId); + VerifyOrExit(psa_copy_key(key.As(), &attrs, &newKeyId) == PSA_SUCCESS, err = CHIP_ERROR_INTERNAL); + +exit: + DestroyKey(key); + psa_reset_key_attributes(&attrs); + + if (err == CHIP_NO_ERROR) + { + SetKeyId(key, newKeyId); + } + + return err; +} +#endif + } // namespace Crypto } // namespace chip diff --git a/src/crypto/PSASessionKeystore.h b/src/crypto/PSASessionKeystore.h index 1a55713b82d167..b4d2742ae069e8 100644 --- a/src/crypto/PSASessionKeystore.h +++ b/src/crypto/PSASessionKeystore.h @@ -17,6 +17,7 @@ #pragma once +#include #include #include @@ -38,6 +39,9 @@ class PSASessionKeystore : public SessionKeystore AttestationChallenge & attestationChallenge) override; void DestroyKey(Symmetric128BitsKeyHandle & key) override; void DestroyKey(HkdfKeyHandle & key) override; +#if CHIP_CONFIG_ENABLE_ICD_CIP + CHIP_ERROR PersistICDKey(Symmetric128BitsKeyHandle & key) override; +#endif private: CHIP_ERROR DeriveSessionKeys(PsaKdf & kdf, Aes128KeyHandle & i2rKey, Aes128KeyHandle & r2iKey, diff --git a/src/crypto/SessionKeystore.h b/src/crypto/SessionKeystore.h index d668524ac93aed..654100fb95b28b 100644 --- a/src/crypto/SessionKeystore.h +++ b/src/crypto/SessionKeystore.h @@ -140,6 +140,17 @@ class SessionKeystore virtual CHIP_ERROR DeriveSessionKeys(const HkdfKeyHandle & secretKey, const ByteSpan & salt, const ByteSpan & info, Aes128KeyHandle & i2rKey, Aes128KeyHandle & r2iKey, AttestationChallenge & attestationChallenge) = 0; + + /** + * @brief Persistently store an ICD key. + * + * If input is already a persistent key handle, the function is a no-op and the original handle is returned. + * If input is a volatile key handle, key is persisted and the handle may be updated. + * + * If the method returns no error, the application is responsible for destroying the handle + * using the DestroyKey() method when the key is no longer needed. + */ + virtual CHIP_ERROR PersistICDKey(Symmetric128BitsKeyHandle & key) { return CHIP_NO_ERROR; } }; /** diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.h b/src/darwin/Framework/CHIP/MTRBaseDevice.h index d3a1b0833f11fd..71f6a9cec43962 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.h @@ -166,7 +166,7 @@ typedef NS_ENUM(uint8_t, MTRTransportType) { */ NS_SWIFT_SENDABLE MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) -@interface MTRAttributeRequestPath : NSObject +@interface MTRAttributeRequestPath : NSObject @property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * cluster MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) @@ -185,7 +185,7 @@ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) */ NS_SWIFT_SENDABLE MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) -@interface MTREventRequestPath : NSObject +@interface MTREventRequestPath : NSObject @property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * cluster MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * event MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 7f03a9690b8e61..8a1feefea20607 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -2333,6 +2333,57 @@ - (void)convertToAttributePathParams:(chip::app::AttributePathParams &)params params.SetWildcardAttributeId(); } } + +static NSString * const sEndpointIDKey = @"endpointIDKey"; +static NSString * const sClusterIDKey = @"clusterIDKey"; +static NSString * const sAttributeIDKey = @"attributeIDKey"; + ++ (BOOL)supportsSecureCoding +{ + return YES; +} + +- (nullable instancetype)initWithCoder:(NSCoder *)decoder +{ + self = [super init]; + if (self == nil) { + return nil; + } + + _endpoint = [decoder decodeObjectOfClass:[NSNumber class] forKey:sEndpointIDKey]; + if (_endpoint && ![_endpoint isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTRAttributeRequestPath decoded %@ for endpoint, not NSNumber.", _attribute); + return nil; + } + + _cluster = [decoder decodeObjectOfClass:[NSNumber class] forKey:sClusterIDKey]; + if (_cluster && ![_cluster isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTRAttributeRequestPath decoded %@ for cluster, not NSNumber.", _attribute); + return nil; + } + + _attribute = [decoder decodeObjectOfClass:[NSNumber class] forKey:sAttributeIDKey]; + if (_attribute && ![_attribute isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTRAttributeRequestPath decoded %@ for attribute, not NSNumber.", _attribute); + return nil; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + if (_endpoint) { + [coder encodeObject:_endpoint forKey:sEndpointIDKey]; + } + if (_cluster) { + [coder encodeObject:_cluster forKey:sClusterIDKey]; + } + if (_attribute) { + [coder encodeObject:_attribute forKey:sAttributeIDKey]; + } +} + @end @implementation MTREventRequestPath @@ -2406,6 +2457,56 @@ - (void)convertToEventPathParams:(chip::app::EventPathParams &)params params.SetWildcardEventId(); } } +static NSString * const sEventEndpointIDKey = @"endpointIDKey"; +static NSString * const sEventClusterIDKey = @"clusterIDKey"; +static NSString * const sEventAttributeIDKey = @"attributeIDKey"; + ++ (BOOL)supportsSecureCoding +{ + return YES; +} + +- (nullable instancetype)initWithCoder:(NSCoder *)decoder +{ + self = [super init]; + if (self == nil) { + return nil; + } + + _endpoint = [decoder decodeObjectOfClass:[NSNumber class] forKey:sEventEndpointIDKey]; + if (_endpoint && ![_endpoint isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTREventRequestPath decoded %@ for endpoint, not NSNumber.", _endpoint); + return nil; + } + + _cluster = [decoder decodeObjectOfClass:[NSNumber class] forKey:sEventClusterIDKey]; + if (_cluster && ![_cluster isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTREventRequestPath decoded %@ for cluster, not NSNumber.", _cluster); + return nil; + } + + _event = [decoder decodeObjectOfClass:[NSNumber class] forKey:sEventAttributeIDKey]; + if (_event && ![_event isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTREventRequestPath decoded %@ for event, not NSNumber.", _event); + return nil; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + if (_endpoint) { + [coder encodeObject:_endpoint forKey:sEventEndpointIDKey]; + } + if (_cluster) { + [coder encodeObject:_cluster forKey:sEventClusterIDKey]; + } + if (_event) { + [coder encodeObject:_event forKey:sEventAttributeIDKey]; + } +} + @end @implementation MTRClusterPath diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRDevice.h index 2858ae56924af9..5a8dcb8de08355 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.h +++ b/src/darwin/Framework/CHIP/MTRDevice.h @@ -186,6 +186,20 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) expectedValueInterval:(NSNumber *)expectedValueInterval timedWriteTimeout:(NSNumber * _Nullable)timeout; +/** + * Read the attributes identified by the provided attribute paths. The paths + * can include wildcards. + * + * Paths that do not correspond to any existing attributes, or that the + * MTRDevice does not have attribute values for, will not be present in the + * return value from this function. + * + * @return an array of response-value dictionaries as described in the + * documentation for MTRDeviceResponseHandler. Each one will have an + * MTRAttributePathKey and an MTRDataKey. + */ +- (NSArray *> *)readAttributePaths:(NSArray *)attributePaths MTR_NEWLY_AVAILABLE; + /** * Invoke a command with a designated command path * diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index a0f985bb4ac1f1..46fc8faa40ee1d 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1272,6 +1272,17 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID #undef MTRDeviceErrorStr } +- (NSArray *> *)readAttributePaths:(NSArray *)attributePaths +{ +#define MTRDeviceErrorStr "MTRDevice readAttributePaths: must be handled by subclasses" + MTR_LOG_ERROR(MTRDeviceErrorStr); +#ifdef DEBUG + NSAssert(NO, @MTRDeviceErrorStr); +#endif // DEBUG +#undef MTRDeviceErrorStr + return [NSArray array]; +} + - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID @@ -1313,6 +1324,21 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID // here for now. // TODO: https://github.com/project-chip/connectedhomeip/issues/24563 + if (![commandFields isKindOfClass:NSDictionary.class]) { + MTR_LOG_ERROR("%@ invokeCommandWithEndpointID passed a commandFields (%@) that is not a data-value NSDictionary object", + self, commandFields); + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]); + return; + } + + MTRDeviceDataValueDictionary fieldsDataValue = commandFields; + if (fieldsDataValue[MTRTypeKey] != MTRStructureValueType) { + MTR_LOG_ERROR("%@ invokeCommandWithEndpointID passed a commandFields (%@) that is not a structure-typed data-value object", + self, commandFields); + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]); + return; + } + [self _invokeCommandWithEndpointID:endpointID clusterID:clusterID commandID:commandID @@ -1328,7 +1354,7 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID - commandFields:(id)commandFields + commandFields:(MTRDeviceDataValueDictionary)commandFields expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval timedInvokeTimeout:(NSNumber * _Nullable)timeout diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index b84505f8185442..58ef5b58c8ed32 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -188,10 +188,6 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended _shutdownPending = NO; _assertionLock = OS_UNFAIR_LOCK_INIT; - // All synchronous suspend/resume activity has to be protected by - // @synchronized(self), so that parts of suspend/resume can't - // interleave with each other. Using @synchronized here because - // MTRDevice may call isSuspended. _suspended = startSuspended; _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; @@ -389,8 +385,8 @@ - (void)_notifyDelegatesOfSuspendState { BOOL isSuspended = [self isSuspended]; [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(controller:isSuspended:)]) { - [delegate controller:self isSuspended:isSuspended]; + if ([delegate respondsToSelector:@selector(controller:suspendedChangedTo:)]) { + [delegate controller:self suspendedChangedTo:isSuspended]; } } logString:__PRETTY_FUNCTION__]; } @@ -399,6 +395,11 @@ - (void)suspend { MTR_LOG("%@ suspending", self); + if (![self isRunning]) { + MTR_LOG_ERROR("%@ not running; can't suspend", self); + return; + } + NSArray * devicesToSuspend; { std::lock_guard lock(*self.deviceMapLock); @@ -406,6 +407,11 @@ - (void)suspend // for any given device exactly one of two things is true: // * It is in the snapshot we are creating // * It is created after we have changed our _suspended state. + if (_suspended) { + MTR_LOG("%@ already suspended", self); + return; + } + _suspended = YES; devicesToSuspend = [self.nodeIDToDeviceMap objectEnumerator].allObjects; } @@ -421,12 +427,24 @@ - (void)suspend // * CASE sessions in general. // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. [self _notifyDelegatesOfSuspendState]; + + [self _controllerSuspended]; +} + +- (void)_controllerSuspended +{ + // Subclass hook; nothing to do. } - (void)resume { MTR_LOG("%@ resuming", self); + if (![self isRunning]) { + MTR_LOG_ERROR("%@ not running; can't resume", self); + return; + } + NSArray * devicesToResume; { std::lock_guard lock(*self.deviceMapLock); @@ -434,6 +452,11 @@ - (void)resume // for any given device exactly one of two things is true: // * It is in the snapshot we are creating // * It is created after we have changed our _suspended state. + if (!_suspended) { + MTR_LOG("%@ already not suspended", self); + return; + } + _suspended = NO; devicesToResume = [self.nodeIDToDeviceMap objectEnumerator].allObjects; } @@ -444,6 +467,13 @@ - (void)resume } [self _notifyDelegatesOfSuspendState]; + + [self _controllerResumed]; +} + +- (void)_controllerResumed +{ + // Subclass hook; nothing to do. } - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDelegate.h index 40382c95ade9d9..374b8aec2064aa 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDelegate.h @@ -112,7 +112,7 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * the controller will be in the specified state. */ - (void)controller:(MTRDeviceController *)controller - isSuspended:(BOOL)suspended MTR_NEWLY_AVAILABLE; + suspendedChangedTo:(BOOL)suspended MTR_NEWLY_AVAILABLE; @end typedef NS_ENUM(NSUInteger, MTRPairingStatus) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 9cd3b62340d20a..e47415880cdb13 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -111,7 +111,7 @@ @implementation MTRDeviceControllerFactory { MTRSessionResumptionStorageBridge * _sessionResumptionStorage; PersistentStorageOperationalKeystore * _keystore; Credentials::PersistentStorageOpCertStore * _opCertStore; - MTROperationalBrowser * _operationalBrowser; + std::unique_ptr _operationalBrowser; // productAttestationAuthorityCertificates and certificationDeclarationCertificates are just copied // from MTRDeviceControllerFactoryParams. @@ -223,6 +223,8 @@ - (instancetype)init _serverEndpointsLock = OS_UNFAIR_LOCK_INIT; _serverEndpoints = [[NSMutableArray alloc] init]; + _operationalBrowser = std::make_unique(self, self->_chipWorkQueue); + return self; } @@ -557,12 +559,6 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * return nil; } - if ([_controllers count] == 0) { - dispatch_sync(_chipWorkQueue, ^{ - self->_operationalBrowser = new MTROperationalBrowser(self, self->_chipWorkQueue); - }); - } - // Add the controller to _controllers now, so if we fail partway through its // startup we will still do the right cleanups. os_unfair_lock_lock(&_controllersLock); @@ -943,9 +939,6 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller // OtaProviderDelegateBridge uses some services provided by the system // state without retaining it. if (_controllers.count == 0) { - delete self->_operationalBrowser; - self->_operationalBrowser = nullptr; - if (_otaProviderDelegateBridge) { _otaProviderDelegateBridge->Shutdown(); _otaProviderDelegateBridge.reset(); @@ -1246,6 +1239,11 @@ - (PersistentStorageDelegate *)storageDelegate return &_groupDataProvider; } +- (MTROperationalBrowser *)operationalBrowser +{ + return _operationalBrowser.get(); +} + @end @interface MTRDummyStorage : NSObject diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index c35a0b4a1692f0..58592b6ed4b670 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -30,6 +30,7 @@ #import "MTRDefines_Internal.h" #import "MTRDeviceControllerFactory.h" +#import "MTROperationalBrowser.h" #include #include @@ -108,6 +109,7 @@ MTR_DIRECT_MEMBERS @property (readonly) chip::PersistentStorageDelegate * storageDelegate; @property (readonly) chip::Credentials::GroupDataProvider * groupDataProvider; +@property (readonly, assign) MTROperationalBrowser * operationalBrowser; @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index bdcbafae1b6c9d..a73a644b85302a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -330,6 +330,15 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory self.rootPublicKey = nil; _storageBehaviorConfiguration = storageBehaviorConfiguration; + + // We let the operational browser know about ourselves here, because + // after this point we are guaranteed to have shutDownCppController + // called by the factory. + if (!startSuspended) { + dispatch_async(_chipWorkQueue, ^{ + factory.operationalBrowser->ControllerActivated(); + }); + } } return self; } @@ -344,6 +353,22 @@ - (BOOL)isRunning return _cppCommissioner != nullptr; } +- (void)_controllerSuspended +{ + MTRDeviceControllerFactory * factory = _factory; + dispatch_async(_chipWorkQueue, ^{ + factory.operationalBrowser->ControllerDeactivated(); + }); +} + +- (void)_controllerResumed +{ + MTRDeviceControllerFactory * factory = _factory; + dispatch_async(_chipWorkQueue, ^{ + factory.operationalBrowser->ControllerActivated(); + }); +} + - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate { if (!operationalCertificate || !rootCertificate) { @@ -471,6 +496,11 @@ - (void)shutDownCppController _operationalCredentialsDelegate->SetDeviceCommissioner(nullptr); } } + + if (!self.suspended) { + _factory.operationalBrowser->ControllerDeactivated(); + } + _shutdownPending = NO; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 29860fd41f1039..4cf30e1a34dd80 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -66,7 +66,7 @@ - (NSXPCInterface *)_interfaceForServerProtocol NSMutableSet * allowedClasses = [MTRDeviceController_XPC _allowedClasses]; [allowedClasses addObjectsFromArray:@[ [MTRCommandPath class], - [MTRAttributePath class] + [MTRAttributePath class], ]]; [interface setClasses:allowedClasses @@ -74,6 +74,27 @@ - (NSXPCInterface *)_interfaceForServerProtocol argumentIndex:0 ofReply:YES]; + // readAttributePaths: gets handed an array of MTRAttributeRequestPath. + allowedClasses = [MTRDeviceController_XPC _allowedClasses]; + [allowedClasses addObjectsFromArray:@[ + [MTRAttributeRequestPath class], + ]]; + [interface setClasses:allowedClasses + forSelector:@selector(deviceController:nodeID:readAttributePaths:withReply:) + argumentIndex:2 + ofReply:NO]; + + // readAttributePaths: returns response-value dictionaries that have + // attribute paths and values. + allowedClasses = [MTRDeviceController_XPC _allowedClasses]; + [allowedClasses addObjectsFromArray:@[ + [MTRAttributePath class], + ]]; + [interface setClasses:allowedClasses + forSelector:@selector(deviceController:nodeID:readAttributePaths:withReply:) + argumentIndex:0 + ofReply:YES]; + return interface; } @@ -82,7 +103,7 @@ - (NSXPCInterface *)_interfaceForClientProtocol NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; NSMutableSet * allowedClasses = [MTRDeviceController_XPC _allowedClasses]; [allowedClasses addObjectsFromArray:@[ - [MTRAttributePath class] + [MTRAttributePath class], ]]; [interface setClasses:allowedClasses @@ -92,7 +113,7 @@ - (NSXPCInterface *)_interfaceForClientProtocol allowedClasses = [MTRDeviceController_XPC _allowedClasses]; [allowedClasses addObjectsFromArray:@[ - [MTREventPath class] + [MTREventPath class], ]]; [interface setClasses:allowedClasses diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index a70e4953fbd24d..62f6a5f1769208 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -2963,10 +2963,83 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; } +- (NSArray *> *)readAttributePaths:(NSArray *)attributePaths +{ + // Determine the set of what the spec calls "existent paths" that correspond + // to the request paths. Building the whole set in-memory is OK, because + // we're going to need all those paths for our return value anyway. + NSMutableSet * existentPaths = [[NSMutableSet alloc] init]; + { + std::lock_guard lock(_lock); + for (MTRAttributeRequestPath * path in attributePaths) { + [self _addExistentPathsFor:path to:existentPaths]; + } + } + + NSMutableArray *> * result = [NSMutableArray arrayWithCapacity:existentPaths.count]; + for (MTRAttributePath * path in existentPaths) { + auto * value = [self readAttributeWithEndpointID:path.endpoint clusterID:path.cluster attributeID:path.attribute params:nil]; + if (!value) { + continue; + } + [result addObject:@{ + MTRAttributePathKey : path, + MTRDataKey : value, + }]; + } + + return result; +} + +- (void)_addExistentPathsFor:(MTRAttributeRequestPath *)path to:(NSMutableSet *)set +{ + os_unfair_lock_assert_owner(&_lock); + + if (path.endpoint != nil) { + [self _addExistentPathsForEndpoint:path.endpoint path:path to:set]; + return; + } + + NSArray * endpointList = [self _endpointList]; + for (NSNumber * endpoint in endpointList) { + [self _addExistentPathsForEndpoint:endpoint path:path to:set]; + } +} + +- (void)_addExistentPathsForEndpoint:(NSNumber *)endpoint path:(MTRAttributeRequestPath *)path to:(NSMutableSet *)set +{ + os_unfair_lock_assert_owner(&_lock); + + if (path.cluster != nil) { + [self _addExistentPathsForEndpoint:endpoint cluster:path.cluster attribute:path.attribute to:set]; + return; + } + + auto * clusterList = [self _serverListForEndpointID:endpoint]; + for (NSNumber * cluster in clusterList) { + [self _addExistentPathsForEndpoint:endpoint cluster:cluster attribute:path.attribute to:set]; + } +} + +- (void)_addExistentPathsForEndpoint:(NSNumber *)endpoint cluster:(NSNumber *)cluster attribute:(NSNumber * _Nullable)attribute to:(NSMutableSet *)set +{ + os_unfair_lock_assert_owner(&_lock); + + if (attribute != nil) { + [set addObject:[MTRAttributePath attributePathWithEndpointID:endpoint clusterID:cluster attributeID:attribute]]; + return; + } + + auto * attributeList = [self _attributeListForEndpointID:endpoint clusterID:cluster]; + for (NSNumber * existentAttribute in attributeList) { + [set addObject:[MTRAttributePath attributePathWithEndpointID:endpoint clusterID:cluster attributeID:existentAttribute]]; + } +} + - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID - commandFields:(id)commandFields + commandFields:(MTRDeviceDataValueDictionary)commandFields expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval timedInvokeTimeout:(NSNumber * _Nullable)timeout @@ -3968,19 +4041,55 @@ - (void)_updateAttributeDependentDescriptionData { os_unfair_lock_assert_owner(&_lock); - auto * partsListPath = [MTRAttributePath attributePathWithEndpointID:@(kRootEndpointId) - clusterID:@(MTRClusterIDTypeDescriptorID) - attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)]; - auto * partsList = [self _cachedAttributeValueForPath:partsListPath]; - NSMutableArray * endpointsOnDevice = [self arrayOfNumbersFromAttributeValue:partsList]; - if (!endpointsOnDevice) { - endpointsOnDevice = [[NSMutableArray alloc] init]; - } - // Add Root node! - [endpointsOnDevice addObject:@(0)]; + auto * partsList = [self _cachedListOfNumbersValueForEndpointID:@(kRootEndpointId) + clusterID:@(MTRClusterIDTypeDescriptorID) + attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)]; + NSMutableArray * endpointsOnDevice = [partsList mutableCopy]; + // Add Root Node endpoint. + [endpointsOnDevice addObject:@(kRootEndpointId)]; return endpointsOnDevice; } +/** + * Returns the cached value of the relevant attribute as a list of numbers. + * Returns an empty list if the value does not exist or can't be converted to a + * list of numbers. + */ +- (NSArray *)_cachedListOfNumbersValueForEndpointID:(NSNumber *)endpointID + clusterID:(NSNumber *)clusterID + attributeID:(NSNumber *)attributeID +{ + os_unfair_lock_assert_owner(&_lock); + + auto * path = [MTRAttributePath attributePathWithEndpointID:endpointID + clusterID:clusterID + attributeID:attributeID]; + auto * value = [self _cachedAttributeValueForPath:path]; + NSArray * arrayValue = [self arrayOfNumbersFromAttributeValue:value]; + if (arrayValue) { + return arrayValue; + } + return [NSArray array]; +} + +- (NSArray *)_serverListForEndpointID:(NSNumber *)endpointID +{ + os_unfair_lock_assert_owner(&_lock); + + return [self _cachedListOfNumbersValueForEndpointID:endpointID + clusterID:@(MTRClusterIDTypeDescriptorID) + attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeServerListID)]; +} + +- (NSArray *)_attributeListForEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID +{ + os_unfair_lock_assert_owner(&_lock); + + return [self _cachedListOfNumbersValueForEndpointID:endpointID + clusterID:clusterID + attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)]; +} + - (NSNumber * _Nullable)_networkFeatures { NSNumber * _Nullable result = nil; diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 794696f4a98c99..a8d9a48e9cbb35 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -203,13 +203,13 @@ - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)di MTR_DEVICE_SIMPLE_REMOTE_XPC_GETTER(estimatedStartTime, NSDate * _Nullable, nil, getEstimatedStartTimeWithReply) MTR_DEVICE_SIMPLE_REMOTE_XPC_GETTER(estimatedSubscriptionLatency, NSNumber * _Nullable, nil, getEstimatedSubscriptionLatencyWithReply) -typedef NSDictionary * _Nullable readAttributeResponseType; +typedef NSDictionary * _Nullable ReadAttributeResponseType; MTR_DEVICE_COMPLEX_REMOTE_XPC_GETTER(readAttributeWithEndpointID : (NSNumber *) endpointID clusterID : (NSNumber *) clusterID attributeID : (NSNumber *) attributeID params : (MTRReadParams * _Nullable) params, - readAttributeResponseType, + ReadAttributeResponseType, nil, readAttributeWithEndpointID : endpointID clusterID @@ -231,10 +231,18 @@ - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)di : expectedValueInterval timedWriteTimeout : timeout) +typedef NSArray *> * ReadAttributePathsResponseType; +MTR_DEVICE_COMPLEX_REMOTE_XPC_GETTER(readAttributePaths + : (NSArray *) attributePaths, + ReadAttributePathsResponseType, + [NSArray array], // Default return value + readAttributePaths + : attributePaths withReply) + - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID - commandFields:(id)commandFields + commandFields:(MTRDeviceDataValueDictionary)commandFields expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval timedInvokeTimeout:(NSNumber * _Nullable)timeout diff --git a/src/darwin/Framework/CHIP/MTROperationalBrowser.h b/src/darwin/Framework/CHIP/MTROperationalBrowser.h index 0cdcbf6d869736..4115f0e887d150 100644 --- a/src/darwin/Framework/CHIP/MTROperationalBrowser.h +++ b/src/darwin/Framework/CHIP/MTROperationalBrowser.h @@ -23,19 +23,29 @@ class MTROperationalBrowser { public: - // Should be created at a point when the factory starts up the event loop, - // and destroyed when the event loop is stopped. + // Should be created at a point when the dispatch queue is available. MTROperationalBrowser(MTRDeviceControllerFactory * aFactory, dispatch_queue_t aQueue); ~MTROperationalBrowser(); + // ControllerActivated should be called, on the Matter queue, when a + // controller is either started in a non-suspended state or stops being + // suspended. + + // ControllerDeactivated should be called, on the Matter queue, when a + // controller is either suspended or shut down while in a non-suspended + // state. + void ControllerActivated(); + void ControllerDeactivated(); + private: static void OnBrowse(DNSServiceRef aServiceRef, DNSServiceFlags aFlags, uint32_t aInterfaceId, DNSServiceErrorType aError, const char * aName, const char * aType, const char * aDomain, void * aContext); - void TryToStartBrowse(); + void EnsureBrowse(); + void StopBrowse(); - MTRDeviceControllerFactory * const mDeviceControllerFactory; + MTRDeviceControllerFactory * const __weak mDeviceControllerFactory; dispatch_queue_t mQueue; DNSServiceRef mBrowseRef; @@ -44,4 +54,8 @@ class MTROperationalBrowser // If mIsDestroying is true, we're in our destructor, shutting things down. bool mIsDestroying = false; + + // Count of controllers that are currently active; we aim to have a browse + // going while this is nonzero; + size_t mActiveControllerCount = 0; }; diff --git a/src/darwin/Framework/CHIP/MTROperationalBrowser.mm b/src/darwin/Framework/CHIP/MTROperationalBrowser.mm index 1ddc7868d88ecc..b5717373ab2933 100644 --- a/src/darwin/Framework/CHIP/MTROperationalBrowser.mm +++ b/src/darwin/Framework/CHIP/MTROperationalBrowser.mm @@ -37,26 +37,49 @@ : mDeviceControllerFactory(aFactory) , mQueue(aQueue) { - // If we fail to start a browse, there's nothing our consumer would do - // differently, so we might as well do this in the constructor. - TryToStartBrowse(); } -void MTROperationalBrowser::TryToStartBrowse() +void MTROperationalBrowser::ControllerActivated() { assertChipStackLockedByCurrentThread(); - ChipLogProgress(Controller, "Trying to start persistent operational browse"); + if (mActiveControllerCount == 0) { + EnsureBrowse(); + } + ++mActiveControllerCount; +} + +void MTROperationalBrowser::ControllerDeactivated() +{ + assertChipStackLockedByCurrentThread(); + + if (mActiveControllerCount == 1) { + StopBrowse(); + } + + --mActiveControllerCount; +} + +void MTROperationalBrowser::EnsureBrowse() +{ + assertChipStackLockedByCurrentThread(); + + if (mInitialized) { + ChipLogProgress(Controller, "%p already has a persistent operational browse running", this); + return; + } + + ChipLogProgress(Controller, "%p trying to start persistent operational browse", this); auto err = DNSServiceCreateConnection(&mBrowseRef); if (err != kDNSServiceErr_NoError) { - ChipLogError(Controller, "Failed to create connection for persistent operational browse: %" PRId32, err); + ChipLogError(Controller, "%p failed to create connection for persistent operational browse: %" PRId32, this, err); return; } err = DNSServiceSetDispatchQueue(mBrowseRef, mQueue); if (err != kDNSServiceErr_NoError) { - ChipLogError(Controller, "Failed to set up dispatch queue properly for persistent operational browse: %" PRId32, err); + ChipLogError(Controller, "%p failed to set up dispatch queue properly for persistent operational browse: %" PRId32, this, err); DNSServiceRefDeallocate(mBrowseRef); return; } @@ -67,11 +90,20 @@ auto browseRef = mBrowseRef; // Mandatory copy because of kDNSServiceFlagsShareConnection. err = DNSServiceBrowse(&browseRef, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexAny, kOperationalType, domain, OnBrowse, this); if (err != kDNSServiceErr_NoError) { - ChipLogError(Controller, "Failed to start persistent operational browse for \"%s\" domain: %" PRId32, StringOrNullMarker(domain), err); + ChipLogError(Controller, "%p failed to start persistent operational browse for \"%s\" domain: %" PRId32, this, StringOrNullMarker(domain), err); } } } +void MTROperationalBrowser::StopBrowse() +{ + ChipLogProgress(Controller, "%p stopping persistent operational browse", this); + if (mInitialized) { + DNSServiceRefDeallocate(mBrowseRef); + mInitialized = false; + } +} + void MTROperationalBrowser::OnBrowse(DNSServiceRef aServiceRef, DNSServiceFlags aFlags, uint32_t aInterfaceId, DNSServiceErrorType aError, const char * aName, const char * aType, const char * aDomain, void * aContext) { @@ -82,14 +114,13 @@ // We only expect to get notified about our type/domain. if (aError != kDNSServiceErr_NoError) { ChipLogError(Controller, "Operational browse failure: %" PRId32, aError); - DNSServiceRefDeallocate(self->mBrowseRef); - self->mInitialized = false; + self->StopBrowse(); // We shouldn't really get callbacks under our destructor, but guard // against it just in case. if (!self->mIsDestroying) { // Try to start a new browse, so we have one going. - self->TryToStartBrowse(); + self->EnsureBrowse(); } return; } @@ -116,7 +147,5 @@ mIsDestroying = true; - if (mInitialized) { - DNSServiceRefDeallocate(mBrowseRef); - } + StopBrowse(); } diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index eaaa4b655e18e9..bd7d0e6df0e99c 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -29,6 +29,8 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID readAttributeWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID params:(MTRReadParams * _Nullable)params withReply:(void (^)(NSDictionary * _Nullable))reply; - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID writeAttributeWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID value:(id)value expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval timedWriteTimeout:(NSNumber * _Nullable)timeout; +- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID readAttributePaths:(NSArray *)attributePaths withReply:(void (^)(NSArray *> *))reply; + - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID commandFields:(id)commandFields expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval timedInvokeTimeout:(NSNumber * _Nullable)timeout serverSideProcessingTimeout:(NSNumber * _Nullable)serverSideProcessingTimeout completion:(MTRDeviceResponseHandler)completion; diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 615ff63996a27e..459eec5919ceab 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -1451,8 +1451,23 @@ - (void)test017_TestMTRDeviceBasics [subscriptionExpectation fulfill]; }; + NSMutableSet * endpoints = [[NSMutableSet alloc] init]; + NSMutableSet * clusters = [[NSMutableSet alloc] init]; + NSMutableSet * rootBasicInformationAttributes = [[NSMutableSet alloc] init]; __block unsigned attributeReportsReceived = 0; delegate.onAttributeDataReceived = ^(NSArray *> * data) { + for (NSDictionary * dataItem in data) { + MTRAttributePath * path = dataItem[MTRAttributePathKey]; + XCTAssertNotNil(path); + if (dataItem[MTRDataKey]) { + [endpoints addObject:path.endpoint]; + [clusters addObject:[MTRClusterPath clusterPathWithEndpointID:path.endpoint clusterID:path.cluster]]; + if (path.endpoint.unsignedLongValue == 0 && path.cluster.unsignedLongValue == MTRClusterIDTypeBasicInformationID) { + [rootBasicInformationAttributes addObject:path.attribute]; + } + } + } + attributeReportsReceived += data.count; }; @@ -1539,6 +1554,39 @@ - (void)test017_TestMTRDeviceBasics XCTAssertNotEqual(attributeReportsReceived, 0); XCTAssertNotEqual(eventReportsReceived, 0); + // Test readAttributePaths. First, try DeviceTypeList across all endpoints. + __auto_type * deviceTypeListPath = [MTRAttributeRequestPath requestPathWithEndpointID:nil clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID)]; + __auto_type * deviceTypes = [device readAttributePaths:@[ deviceTypeListPath ]]; + XCTAssertEqual(deviceTypes.count, endpoints.count); + + // Now try ClusterRevision across all clusters. + __auto_type * clusterRevisionsPath = [MTRAttributeRequestPath requestPathWithEndpointID:nil clusterID:nil attributeID:@(MTRAttributeIDTypeGlobalAttributeClusterRevisionID)]; + __auto_type * clusterRevisions = [device readAttributePaths:@[ clusterRevisionsPath ]]; + XCTAssertEqual(clusterRevisions.count, clusters.count); + + // Now try BasicInformation in a few different ways: + __auto_type * basicInformationAllAttributesPath = [MTRAttributeRequestPath requestPathWithEndpointID:nil clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:nil]; + __auto_type * basicInformationAllAttributes = [device readAttributePaths:@[ basicInformationAllAttributesPath ]]; + + __auto_type * basicInformationAllRootAttributesPath = [MTRAttributeRequestPath requestPathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:nil]; + __auto_type * basicInformationAllRootAttributes = [device readAttributePaths:@[ basicInformationAllRootAttributesPath ]]; + // Should have gotten the same things, because Basic Information only exists + // on the root endpoint. + XCTAssertEqualObjects([NSSet setWithArray:basicInformationAllAttributes], [NSSet setWithArray:basicInformationAllRootAttributes]); + XCTAssertEqual(basicInformationAllAttributes.count, rootBasicInformationAttributes.count); + + // Now try multiple paths. Should just get the union of all the things for + // each path. + __auto_type * variousThings = [device readAttributePaths:@[ deviceTypeListPath, basicInformationAllRootAttributesPath ]]; + XCTAssertEqualObjects([NSSet setWithArray:variousThings], + [[NSSet setWithArray:deviceTypes] setByAddingObjectsFromSet:[NSSet setWithArray:basicInformationAllRootAttributes]]); + + // And similar if the paths expand to overlapping sets of existent paths + // (e.g. because Basic Information has a ClusterRevision). + variousThings = [device readAttributePaths:@[ clusterRevisionsPath, basicInformationAllRootAttributesPath ]]; + XCTAssertEqualObjects([NSSet setWithArray:variousThings], + [[NSSet setWithArray:clusterRevisions] setByAddingObjectsFromSet:[NSSet setWithArray:basicInformationAllRootAttributes]]); + // Before resubscribe, first test write failure and expected value effects NSNumber * testEndpointID = @(1); NSNumber * testClusterID = @(8); @@ -3117,48 +3165,49 @@ - (void)test031_MTRDeviceAttributeCacheLocalTestStorage XCTAssertTrue(storedAttributeCountDifferenceFromMTRDeviceReport > 300); } -- (void)test032_MTRPathClassesEncoding +- (void)doEncodeDecodeRoundTrip:(id)encodable { + // We know all our encodables are in fact NSObject. + NSObject * obj = (NSObject *) encodable; + NSError * encodeError; - NSData * encodedData; - NSError * decodeError; - id decodedValue; + NSData * encodedData = [NSKeyedArchiver archivedDataWithRootObject:encodable requiringSecureCoding:YES error:&encodeError]; + XCTAssertNil(encodeError, @"Failed to encode %@", NSStringFromClass(obj.class)); - // Test attribute path encode / decode - MTRAttributePath * originalAttributePath = [MTRAttributePath attributePathWithEndpointID:@(101) clusterID:@(102) attributeID:@(103)]; - encodedData = [NSKeyedArchiver archivedDataWithRootObject:originalAttributePath requiringSecureCoding:YES error:&encodeError]; - XCTAssertNil(encodeError); + NSError * decodeError; + id decodedValue = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithObject:obj.class] fromData:encodedData error:&decodeError]; + XCTAssertNil(decodeError, @"Failed to decode %@", NSStringFromClass([obj class])); + XCTAssertTrue([decodedValue isKindOfClass:obj.class], @"Expected %@ but got %@", NSStringFromClass(obj.class), NSStringFromClass([decodedValue class])); - decodedValue = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithObject:[MTRAttributePath class]] fromData:encodedData error:&decodeError]; - XCTAssertNil(decodeError); - XCTAssertTrue([decodedValue isKindOfClass:[MTRAttributePath class]]); + XCTAssertEqualObjects(obj, decodedValue, @"Decoding for %@ did not round-trip correctly", NSStringFromClass([obj class])); +} - MTRAttributePath * decodedAttributePath = decodedValue; - XCTAssertEqualObjects(originalAttributePath, decodedAttributePath); +- (void)test032_MTRPathClassesEncoding +{ + // Test attribute path encode / decode + MTRAttributePath * attributePath = [MTRAttributePath attributePathWithEndpointID:@(101) clusterID:@(102) attributeID:@(103)]; + [self doEncodeDecodeRoundTrip:attributePath]; // Test event path encode / decode - MTREventPath * originalEventPath = [MTREventPath eventPathWithEndpointID:@(201) clusterID:@(202) eventID:@(203)]; - encodedData = [NSKeyedArchiver archivedDataWithRootObject:originalEventPath requiringSecureCoding:YES error:&encodeError]; - XCTAssertNil(encodeError); + MTREventPath * eventPath = [MTREventPath eventPathWithEndpointID:@(201) clusterID:@(202) eventID:@(203)]; + [self doEncodeDecodeRoundTrip:eventPath]; - decodedValue = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithObject:[MTREventPath class]] fromData:encodedData error:&decodeError]; - XCTAssertNil(decodeError); - XCTAssertTrue([decodedValue isKindOfClass:[MTREventPath class]]); + // Test command path encode / decode + MTRCommandPath * commandPath = [MTRCommandPath commandPathWithEndpointID:@(301) clusterID:@(302) commandID:@(303)]; + [self doEncodeDecodeRoundTrip:commandPath]; - MTREventPath * decodedEventPath = decodedValue; - XCTAssertEqualObjects(originalEventPath, decodedEventPath); + // Test attribute request path encode/decode + MTRAttributeRequestPath * attributeRequestPath = [MTRAttributeRequestPath requestPathWithEndpointID:nil clusterID:nil attributeID:nil]; + [self doEncodeDecodeRoundTrip:attributeRequestPath]; - // Test command path encode / decode - MTRCommandPath * originalCommandPath = [MTRCommandPath commandPathWithEndpointID:@(301) clusterID:@(302) commandID:@(303)]; - encodedData = [NSKeyedArchiver archivedDataWithRootObject:originalCommandPath requiringSecureCoding:YES error:&encodeError]; - XCTAssertNil(encodeError); + attributeRequestPath = [MTRAttributeRequestPath requestPathWithEndpointID:@(101) clusterID:@(102) attributeID:@(103)]; + [self doEncodeDecodeRoundTrip:attributeRequestPath]; - decodedValue = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithObject:[MTRCommandPath class]] fromData:encodedData error:&decodeError]; - XCTAssertNil(decodeError); - XCTAssertTrue([decodedValue isKindOfClass:[MTRCommandPath class]]); + attributeRequestPath = [MTRAttributeRequestPath requestPathWithEndpointID:nil clusterID:@(105) attributeID:@(106)]; + [self doEncodeDecodeRoundTrip:attributeRequestPath]; - MTRCommandPath * decodedCommandPath = decodedValue; - XCTAssertEqualObjects(originalCommandPath, decodedCommandPath); + attributeRequestPath = [MTRAttributeRequestPath requestPathWithEndpointID:@(107) clusterID:nil attributeID:@(109)]; + [self doEncodeDecodeRoundTrip:attributeRequestPath]; } // Helper API to test if changes in an attribute with a path specified by endpointId, clusterId and attributeId trigger diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 48500f2933dcb4..b7dad2e542c264 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -76,6 +76,30 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr @end +@interface MTRPerControllerStorageTestsSuspensionDelegate : NSObject +@property (nonatomic, strong) XCTestExpectation * expectation; +@property (nonatomic, assign) BOOL expectedSuspensionState; +@end + +@implementation MTRPerControllerStorageTestsSuspensionDelegate +- (id)initWithExpectation:(XCTestExpectation *)expectation expectedSuspensionState:(BOOL)expectedSuspensionState +{ + self = [super init]; + if (self) { + _expectation = expectation; + _expectedSuspensionState = expectedSuspensionState; + } + return self; +} + +- (void)controller:(MTRDeviceController *)controller + suspendedChangedTo:(BOOL)suspended +{ + XCTAssertEqual(suspended, self.expectedSuspensionState); + [self.expectation fulfill]; +} +@end + @interface MTRPerControllerStorageTestsCertificateIssuer : NSObject - (instancetype)initWithRootCertificate:(MTRCertificateDERBytes)rootCertificate intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate @@ -1713,6 +1737,17 @@ - (void)test013_suspendDevices [becameUnreachableExpectation fulfill]; }; + XCTestExpectation * suspendedExpectation = [self expectationWithDescription:@"Controller has been suspended"]; + __auto_type * suspensionDelegate = [[MTRPerControllerStorageTestsSuspensionDelegate alloc] initWithExpectation:suspendedExpectation expectedSuspensionState:YES]; + [controller addDeviceControllerDelegate:suspensionDelegate queue:queue]; + + XCTestExpectation * browseStoppedExpectation = [self expectationWithDescription:@"Operational browse has stopped"]; + MTRSetLogCallback(MTRLogTypeProgress, ^(MTRLogType type, NSString * moduleName, NSString * message) { + if ([message containsString:@"stopping persistent operational browse"]) { + [browseStoppedExpectation fulfill]; + } + }); + [controller suspend]; XCTAssertTrue(controller.suspended); @@ -1723,7 +1758,7 @@ - (void)test013_suspendDevices [toggle2Expectation fulfill]; }]; - [self waitForExpectations:@[ becameUnreachableExpectation, toggle2Expectation ] timeout:kTimeoutInSeconds]; + [self waitForExpectations:@[ becameUnreachableExpectation, toggle2Expectation, suspendedExpectation, browseStoppedExpectation ] timeout:kTimeoutInSeconds]; XCTestExpectation * newSubscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up again"]; XCTestExpectation * newReachableExpectation = [self expectationWithDescription:@"Device became reachable again"]; @@ -1735,10 +1770,23 @@ - (void)test013_suspendDevices [newSubscriptionExpectation fulfill]; }; + XCTestExpectation * resumedExpectation = [self expectationWithDescription:@"Controller has been resumed"]; + suspensionDelegate.expectation = resumedExpectation; + suspensionDelegate.expectedSuspensionState = NO; + + XCTestExpectation * browseRestartedExpectation = [self expectationWithDescription:@"Operational browse has re-started"]; + MTRSetLogCallback(MTRLogTypeProgress, ^(MTRLogType type, NSString * moduleName, NSString * message) { + if ([message containsString:@"trying to start persistent operational browse"]) { + [browseRestartedExpectation fulfill]; + } + }); + [controller resume]; XCTAssertFalse(controller.suspended); - [self waitForExpectations:@[ newSubscriptionExpectation, newReachableExpectation ] timeout:kSubscriptionTimeoutInSeconds]; + [self waitForExpectations:@[ newSubscriptionExpectation, newReachableExpectation, resumedExpectation, browseRestartedExpectation ] timeout:kSubscriptionTimeoutInSeconds]; + + MTRSetLogCallback(MTRLogTypeProgress, nil); // Test that sending a command works again. Clear the delegate's onReportEnd // first, so reports from the command don't trigger it. diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index b4a8195b8e0c52..5947ae7dd36490 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -1,7 +1,7 @@ #!/bin/bash -e # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,15 +67,23 @@ for define in "${xcode_defines[@]}"; do done # Forward C/C++ flags (OTHER_C*FLAGS) -declare -a target_cflags=() read -r -a target_cflags_c <<<"$OTHER_CFLAGS" read -r -a target_cflags_cc <<<"$OTHER_CPLUSPLUSFLAGS" # Handle target OS and arch declare target_arch= declare target_cpu= -declare target_cflags= +declare -a target_cflags=() declare current_arch="$(uname -m)" +declare deployment_target="$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX" +declare deployment_variant= +if [[ "$IS_ZIPPERED" == YES ]]; then + if [[ "$CLANG_TARGET_TRIPLE_VARIANTS" != *-apple-* ]]; then + echo "Unable to determine target variant for zippered build" >&2 + exit 1 + fi + deployment_variant="${CLANG_TARGET_TRIPLE_VARIANTS/*-apple-/}" +fi read -r -a archs <<<"$ARCHS" for arch in "${archs[@]}"; do @@ -86,7 +94,8 @@ for arch in "${archs[@]}"; do *) target_cpu="$arch" ;; esac fi - target_cflags+=(-arch "$arch") + [[ "${#archs[@]}" -gt 1 ]] && target_cflags+=(-arch "$arch") + [[ -n "$deployment_variant" ]] && target_cflags+=(-target-variant "$arch-apple-$deployment_variant") done # Translate other options @@ -108,7 +117,7 @@ declare -a args=( 'enable_fuzz_test_targets=false' "target_cpu=\"$target_cpu\"" "mac_target_arch=\"$target_arch\"" - "mac_deployment_target=\"$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX\"" + "mac_deployment_target=\"$deployment_target\"" "target_defines=$(format_gn_list "${target_defines[@]}")" "target_cflags=$(format_gn_list "${target_cflags[@]}")" "target_cflags_c=$(format_gn_list "${target_cflags_c[@]}")" diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index f4b5fbdc41789c..87fdfad76a531c 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -640,18 +640,18 @@ #endif /** - * CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING + * CHIP_DEVICE_CONFIG_EXT_ADVERTISING * * Optional configuration to enable Extended Announcement Duration up to 48h. * Should be used together with extending CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS past 15 minutes. * Disabled by default. */ -#ifndef CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING 0 +#ifndef CHIP_DEVICE_CONFIG_EXT_ADVERTISING +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING 0 #endif -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING /** * CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS @@ -735,18 +735,18 @@ static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE * Time in seconds that a factory new device will advertise commissionable node discovery. */ #ifndef CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING /** * By default, the extended announcement, when enabled, starts its extended advertising 15 mins * after the standard slow advertisement. Time at which the default discovery time would close the * commissioning window and stop the BLE. - * Therefore, when CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING is enabled bump the default Discovery timeout + * Therefore, when CHIP_DEVICE_CONFIG_EXT_ADVERTISING is enabled bump the default Discovery timeout * to the maximum allowed by the spec. 48h. */ #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (60 * 60 * 48) #else #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (15 * 60) -#endif // CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#endif // CHIP_DEVICE_CONFIG_EXT_ADVERTISING #endif // CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS /** diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 8936cc19c4f76d..7827f5a8c335f2 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1667,6 +1667,22 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC 2 #endif +/** + * @def CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS + * + * @brief + * Maximum number of ICD clients. Based on this number, platforms that utilize the + * PSA Crypto API should reserve key slot range. + * + * @note + * For platforms that utilize the PSA Crypto API, this configuration is used to + * compute the number of PSA key slots. It should remain unchanged during the device's lifetime, + * as alterations may lead to issues with backwards compatibility. + */ +#ifndef CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS +#define CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS 256 +#endif + /** * @def CHIP_CONFIG_ICD_MAXIMUM_CHECK_IN_BACKOFF * diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index dc4f380c262fb5..81ee804035d4ab 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -152,9 +152,9 @@ #define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART #ifdef CONFIG_ENABLE_BLE_EXT_ANNOUNCEMENT -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING CONFIG_ENABLE_BLE_EXT_ANNOUNCEMENT +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING CONFIG_ENABLE_BLE_EXT_ANNOUNCEMENT #else -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING 0 +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING 0 #endif // Options for background chip task diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index d4d90f45362dbe..db3ade84d0234b 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -281,12 +281,12 @@ void BLEManagerImpl::BleAdvTimeoutHandler(System::Layer *, void *) BLEMgrImpl().mFlags.Set(Flags::kFastAdvertisingEnabled, 0); BLEMgrImpl().mFlags.Set(Flags::kAdvertisingRefreshNeeded, 1); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING BLEMgrImpl().mFlags.Clear(Flags::kExtAdvertisingEnabled); BLEMgrImpl().StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS); #endif } -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING else { ChipLogProgress(DeviceLayer, "bleAdv Timeout : Start extended advertisement"); @@ -1066,7 +1066,7 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) ExitNow(); } -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING // Check for extended advertisement interval and redact VID/PID if past the initial period. if (mFlags.Has(Flags::kExtAdvertisingEnabled)) { @@ -1671,7 +1671,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) } else { -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (!mFlags.Has(Flags::kExtAdvertisingEnabled)) { adv_params.itvl_min = CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index e2070c6978ea70..4ef45f88ea60fa 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -61,7 +61,7 @@ static constexpr System::Clock::Timeout kNewConnectionScanTimeout = System::Cloc static constexpr System::Clock::Timeout kConnectTimeout = System::Clock::Seconds16(20); static constexpr System::Clock::Timeout kFastAdvertiseTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING // The CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS specifies the transition time // starting from advertisement commencement. Since the extended advertisement timer is started after // the fast-to-slow transition, we have to subtract the time spent in fast advertising. @@ -584,7 +584,7 @@ void BLEManagerImpl::DriveBLEState() // Setup service data for advertising. auto serviceDataFlags = BluezAdvertisement::kServiceDataNone; -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (mFlags.Has(Flags::kExtAdvertisingEnabled)) serviceDataFlags |= BluezAdvertisement::kServiceDataExtendedAnnouncement; #endif @@ -667,7 +667,7 @@ BluezAdvertisement::AdvertisingIntervals BLEManagerImpl::GetAdvertisingIntervals { if (mFlags.Has(Flags::kFastAdvertisingEnabled)) return { CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN, CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX }; -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (mFlags.Has(Flags::kExtAdvertisingEnabled)) return { CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN, CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX }; #endif @@ -682,7 +682,7 @@ void BLEManagerImpl::HandleAdvertisingTimer(chip::System::Layer *, void * appSta { ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start slow advertisement"); self->_SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING self->mFlags.Clear(Flags::kExtAdvertisingEnabled); DeviceLayer::SystemLayer().StartTimer(kSlowAdvertiseTimeout, HandleAdvertisingTimer, self); } diff --git a/src/platform/Linux/bluez/BluezAdvertisement.cpp b/src/platform/Linux/bluez/BluezAdvertisement.cpp index c68d601d241cd0..859c1bf64fa07b 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.cpp +++ b/src/platform/Linux/bluez/BluezAdvertisement.cpp @@ -161,7 +161,7 @@ CHIP_ERROR BluezAdvertisement::SetupServiceData(ServiceDataFlags aFlags) deviceInfo.SetAdditionalDataFlag(true); #endif -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (aFlags & kServiceDataExtendedAnnouncement) { deviceInfo.SetExtendedAnnouncementFlag(true); diff --git a/src/platform/NuttX/BLEManagerImpl.cpp b/src/platform/NuttX/BLEManagerImpl.cpp index f28308dd86fc6a..6672b5d4bdd295 100644 --- a/src/platform/NuttX/BLEManagerImpl.cpp +++ b/src/platform/NuttX/BLEManagerImpl.cpp @@ -60,7 +60,7 @@ static constexpr System::Clock::Timeout kNewConnectionScanTimeout = System::Cloc static constexpr System::Clock::Timeout kConnectTimeout = System::Clock::Seconds16(20); static constexpr System::Clock::Timeout kFastAdvertiseTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING // The CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS specifies the transition time // starting from advertisement commencement. Since the extended advertisement timer is started after // the fast-to-slow transition, we have to subtract the time spent in fast advertising. @@ -593,7 +593,7 @@ void BLEManagerImpl::DriveBLEState() // Setup service data for advertising. auto serviceDataFlags = BluezAdvertisement::kServiceDataNone; -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (mFlags.Has(Flags::kExtAdvertisingEnabled)) serviceDataFlags |= BluezAdvertisement::kServiceDataExtendedAnnouncement; #endif @@ -662,7 +662,7 @@ BluezAdvertisement::AdvertisingIntervals BLEManagerImpl::GetAdvertisingIntervals { if (mFlags.Has(Flags::kFastAdvertisingEnabled)) return { CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN, CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX }; -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (mFlags.Has(Flags::kExtAdvertisingEnabled)) return { CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN, CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX }; #endif @@ -677,7 +677,7 @@ void BLEManagerImpl::HandleAdvertisingTimer(chip::System::Layer *, void * appSta { ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start slow advertisement"); self->_SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING self->mFlags.Clear(Flags::kExtAdvertisingEnabled); DeviceLayer::SystemLayer().StartTimer(kSlowAdvertiseTimeout, HandleAdvertisingTimer, self); } diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp index 7af097195c6e27..49751da62479e3 100644 --- a/src/platform/Zephyr/BLEManagerImpl.cpp +++ b/src/platform/Zephyr/BLEManagerImpl.cpp @@ -295,7 +295,7 @@ inline CHIP_ERROR BLEManagerImpl::PrepareAdvertisingRequest() Encoding::LittleEndian::Put16(serviceData.uuid, UUID16_CHIPoBLEService.val); ReturnErrorOnFailure(ConfigurationMgr().GetBLEDeviceIdentificationInfo(serviceData.deviceIdInfo)); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (mFlags.Has(Flags::kExtendedAdvertisingEnabled)) { serviceData.deviceIdInfo.SetVendorId(DEVICE_HANDLE_NULL); @@ -316,7 +316,7 @@ inline CHIP_ERROR BLEManagerImpl::PrepareAdvertisingRequest() mAdvertisingRequest.minInterval = CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN; mAdvertisingRequest.maxInterval = CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX; } -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING else if (mFlags.Has(Flags::kExtendedAdvertisingEnabled)) { mAdvertisingRequest.minInterval = CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN; @@ -421,7 +421,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising() System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME), HandleSlowBLEAdvertisementInterval, this); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING // Start timer to schedule start of the extended advertising DeviceLayer::SystemLayer().StartTimer( System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS), @@ -443,7 +443,7 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising() mFlags.Clear(Flags::kAdvertising); mFlags.Set(Flags::kFastAdvertisingEnabled, true); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING mFlags.Clear(Flags::kExtendedAdvertisingEnabled); #endif diff --git a/src/platform/Zephyr/CHIPDevicePlatformConfig.h b/src/platform/Zephyr/CHIPDevicePlatformConfig.h index 687e743444b9d9..3c855a74374668 100644 --- a/src/platform/Zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/Zephyr/CHIPDevicePlatformConfig.h @@ -166,7 +166,7 @@ #endif // CONFIG_CHIP_EXTENDED_DISCOVERY #ifdef CONFIG_CHIP_BLE_EXT_ADVERTISING -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING 1 +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING 1 #endif // CONFIG_CHIP_BLE_EXT_ADVERTISING #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (CONFIG_CHIP_BLE_ADVERTISING_DURATION * 60) diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index c05dfb11845605..486a48cc074af2 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -242,7 +242,7 @@ #endif // CONFIG_CHIP_EXTENDED_DISCOVERY #ifdef CONFIG_CHIP_BLE_EXT_ADVERTISING -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING 1 +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING 1 #endif // CONFIG_CHIP_BLE_EXT_ADVERTISING #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (CONFIG_CHIP_BLE_ADVERTISING_DURATION * 60) diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index 096bc3426c5fe3..7355d1a1834acb 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -59,6 +59,10 @@ #define CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE 0x30000 #endif // CHIP_CONFIG_CRYPTO_PSA_KEY_ID_BASE +#ifndef CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END +#define CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END 0x3FFFF +#endif // CHIP_CONFIG_CRYPTO_PSA_KEY_ID_END + // ==================== General Configuration Overrides ==================== #ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS @@ -142,6 +146,10 @@ #endif // CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC #endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC +#ifndef CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS +#define CHIP_CONFIG_CRYPTO_PSA_ICD_MAX_CLIENTS 256 +#endif + #ifndef CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER #ifdef CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER #define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER diff --git a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp b/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp index 249b51b7681c22..c26a7da59b9483 100644 --- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp +++ b/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp @@ -205,6 +205,11 @@ CHIP_ERROR OTAImageProcessorImpl::RegisterProcessor(uint32_t tag, OTATlvProcesso return CHIP_NO_ERROR; } +void OTAImageProcessorImpl::SetRebootDelaySec(uint16_t rebootDelay) +{ + mDelayBeforeRebootSec = rebootDelay; +} + void OTAImageProcessorImpl::HandleAbort(intptr_t context) { ChipLogError(SoftwareUpdate, "OTA was aborted"); diff --git a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h b/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h index a30677037ea7f4..9a862a716b957f 100644 --- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h +++ b/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h @@ -73,6 +73,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface CHIP_ERROR SelectProcessor(ByteSpan & block); CHIP_ERROR RegisterProcessor(uint32_t tag, OTATlvProcessor * processor); Optional & GetBackupProvider() { return mBackupProviderLocation; } + void SetRebootDelaySec(uint16_t rebootDelay); static void FetchNextData(uint32_t context); static OTAImageProcessorImpl & GetDefaultInstance(); @@ -109,6 +110,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface OTADataAccumulator mAccumulator; std::map mProcessorMap; Optional mBackupProviderLocation; + uint16_t mDelayBeforeRebootSec = 0; }; } // namespace chip diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp index 9a52321e48fce8..3c1e39b041b4e2 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp @@ -103,6 +103,32 @@ void PlatformManagerImpl::CleanReset() HAL_ResetMCU(); } +void PlatformManagerImpl::ScheduleResetInIdle(void) +{ + resetInIdle = true; +} + +bool PlatformManagerImpl::GetResetInIdleValue(void) +{ + return resetInIdle; +} + +extern "C" void initiateResetInIdle(void) +{ + PlatformMgr().Shutdown(); + PlatformMgrImpl().ScheduleResetInIdle(); +} + +extern "C" void scheduleResetInIdle(void) +{ + PlatformMgrImpl().ScheduleResetInIdle(); +} + +extern "C" bool getResetInIdleValue(void) +{ + return PlatformMgrImpl().GetResetInIdleValue(); +} + static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { otError otErr = otPlatEntropyGet(output, (uint16_t) len); diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h index ae1ef0ad3eb25f..588790823cdd57 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h @@ -53,6 +53,8 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener CHIP_ERROR ServiceInit(void); void CleanReset(); void StopBLEConnectivity() {} + void ScheduleResetInIdle(void); + bool GetResetInIdleValue(void); private: // ===== Methods that implement the PlatformManager abstract interface. @@ -68,6 +70,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp mStartTime = System::Clock::kZero; + bool resetInIdle = false; static PlatformManagerImpl sInstance; using Internal::GenericPlatformManagerImpl_FreeRTOS::PostEventFromISR; diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index 010d72ebb887eb..d8c58a93685c21 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -155,7 +155,7 @@ #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25 -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING SL_MATTER_BLE_EXTENDED_ADV +#define CHIP_DEVICE_CONFIG_EXT_ADVERTISING SL_MATTER_BLE_EXTENDED_ADV /* ICD Configuration Defines diff --git a/src/platform/silabs/efr32/BLEManagerImpl.cpp b/src/platform/silabs/efr32/BLEManagerImpl.cpp index e29e34e31af16e..ef553bffa152a1 100644 --- a/src/platform/silabs/efr32/BLEManagerImpl.cpp +++ b/src/platform/silabs/efr32/BLEManagerImpl.cpp @@ -449,7 +449,7 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) advData[index++] = ShortUUID_CHIPoBLEService[0]; // AD value advData[index++] = ShortUUID_CHIPoBLEService[1]; -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING // Check for extended advertisement interval and redact VID/PID if past the initial period. if (mFlags.Has(Flags::kExtAdvertisingEnabled)) { @@ -553,7 +553,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) } else { -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING if (!mFlags.Has(Flags::kExtAdvertisingEnabled)) { interval_min = CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; @@ -993,12 +993,12 @@ void BLEManagerImpl::BleAdvTimeoutHandler(void * arg) ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start slow advertisement"); BLEMgrImpl().mFlags.Set(Flags::kAdvertising); BLEMgr().SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising); -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING BLEMgrImpl().mFlags.Clear(Flags::kExtAdvertisingEnabled); BLEMgrImpl().StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS); #endif } -#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#if CHIP_DEVICE_CONFIG_EXT_ADVERTISING else { ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start extended advertisement"); diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index 053b30cc8619f4..a99ac5ea2908f9 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -23,8 +23,10 @@ #include +#include #if SILABS_LOG_ENABLED #include "silabs_utils.h" + #endif // SILABS_LOG_ENABLED // TODO add includes ? @@ -49,6 +51,14 @@ 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 }; +#else +#define SL_LED_COUNT SL_SI91x_LED_COUNT +uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LED0_PIN, SL_LED_LED1_PIN }; +#endif namespace chip { namespace DeviceLayer { @@ -100,9 +110,8 @@ void SilabsPlatform::InitLed(void) CHIP_ERROR SilabsPlatform::SetLed(bool state, uint8_t led) { - // TODO add range check - (state) ? sl_si91x_led_set(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN) - : sl_si91x_led_clear(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN); + VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); + (state) ? sl_si91x_led_set(ledPinArray[led]) : sl_si91x_led_clear(ledPinArray[led]); return CHIP_NO_ERROR; } @@ -114,8 +123,8 @@ bool SilabsPlatform::GetLedState(uint8_t led) CHIP_ERROR SilabsPlatform::ToggleLed(uint8_t led) { - // TODO add range check - sl_si91x_led_toggle(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN); + VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); + sl_si91x_led_toggle(ledPinArray[led]); return CHIP_NO_ERROR; } #endif // ENABLE_WSTK_LEDS diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index eb983a16e07401..fb837adf5750e9 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -61,7 +61,8 @@ def pics_TC_DEM_2_10(self): def steps_TC_DEM_2_10(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the FeatureMap", "Verify that the DUT response contains the FeatureMap attribute. Store the value as FeatureMap."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index 3175508d056cb5..b180da13d2a7b4 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -61,7 +61,8 @@ def pics_TC_DEM_2_2(self): def steps_TC_DEM_2_2(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify PowerAdjustment is supported."), TestStep("3", "Set up a subscription to all DeviceEnergyManagement cluster events"), diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index d462c390596449..69b44cc730e439 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -54,7 +54,8 @@ def pics_TC_DEM_2_3(self): def steps_TC_DEM_2_3(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify StartTimeAdjustment feature is supported on the cluster. Verify PowerForecastReporting or StateForecastReporting feature is supported on the cluster."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 734712099e8798..d611172cb93235 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -55,7 +55,8 @@ def pics_TC_DEM_2_4(self): def steps_TC_DEM_2_4(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify Pausable feature is supported on the cluster. Verify PowerForecastReporting or StateForecastReporting feature is supported on the cluster."), TestStep("3", "Set up a subscription to all DeviceEnergyManagement cluster events"), diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index 38bac00f32cfdf..0a5547fd4af428 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -59,7 +59,8 @@ def pics_TC_DEM_2_5(self): def steps_TC_DEM_2_5(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify ForecastAdjustment feature is supported on the cluster. Verify PowerForecastReporting feature is supported on the cluster. Verify StateForecastReporting feature is not supported on the cluster."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index c05a80c6c3909a..012ff88d26337e 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -59,7 +59,8 @@ def pics_TC_DEM_2_6(self): def steps_TC_DEM_2_6(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify ForecastAdjustment feature is supported on the cluster. Verify StateForecastReporting feature is supported on the cluster. Verify PowerForecastReporting feature is not supported on the cluster."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index b45643868a6e71..b693f6e6464654 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -59,7 +59,8 @@ def pics_TC_DEM_2_7(self): def steps_TC_DEM_2_7(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify ConstraintBasedAdjustment feature is supported on the cluster. Verify PowerForecastReporting feature is supported on the cluster. Verify StateForecastReporting feature is not supported on the cluster."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index 1b1a2a31537098..a54baca2e2df6b 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -59,7 +59,8 @@ def pics_TC_DEM_2_8(self): def steps_TC_DEM_2_8(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify ConstraintBasedAdjustment feature is supported on the cluster. Verify StateForecastReporting feature is supported on the cluster. Verify PowerForecastReporting feature is not supported on the cluster."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 3acc4b7a517ece..935a04064d9ed6 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -58,7 +58,8 @@ def pics_TC_DEM_2_9(self): def steps_TC_DEM_2_9(self) -> list[TestStep]: """Execute the test steps.""" steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the _FeatureMap_ attribute", "Verify that the DUT response contains the _FeatureMap_ attribute. Verify one of PowerForecastReporting or StateForecastReporting is supported but not both."), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index b2591fa4a5d206..152f08de269348 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -52,7 +52,8 @@ def pics_TC_EEVSE_2_2(self): def steps_TC_EEVSE_2_2(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EEVSE.TESTEVENTTRIGGER for Basic Functionality Test Event", diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 8de0ebef13e8a2..d3c3c46ea2284b 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -52,7 +52,8 @@ def pics_TC_EEVSE_2_3(self): def steps_TC_EEVSE_2_3(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EEVSE.TESTEVENTTRIGGER for Basic Functionality Test Event", diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index ee8dbae5fa43a2..c7e855bf233e51 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -50,7 +50,8 @@ def pics_TC_EEVSE_2_4(self): def steps_TC_EEVSE_2_4(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EEVSE.TESTEVENTTRIGGER for Basic Functionality Test Event", diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 3096f013dde8af..5e057f78082cf9 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -50,7 +50,8 @@ def pics_TC_EEVSE_2_5(self): def steps_TC_EEVSE_2_5(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EEVSE.TESTEVENTTRIGGER for Basic Functionality Test Event", diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index 4567f96c3e466a..575d64cd3cbb67 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -52,7 +52,8 @@ def pics_TC_EEVSE_2_6(self): def steps_TC_EEVSE_2_6(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "TH reads from the DUT the FeatureMap", "Verify that the DUT response contains the FeatureMap attribute. Store the value as FeatureMap."), TestStep("3", "Set up a subscription to all EnergyEVSE cluster events"), diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index df5d2821ece9e4..9d520f165d7aca 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -50,7 +50,8 @@ def pics_TC_EWATERHTR_2_1(self): def steps_TC_EWATERHTR_2_1(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)."), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test).", + is_commissioning=True), TestStep("2", "TH reads from the DUT the FeatureMap attribute.", "Verify that the DUT response contains the FeatureMap attribute. Store the value as FeatureMap."), TestStep("3", "TH reads from the DUT the HeaterTypes attribute.", diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 8c96e52d4524c8..49c0fdc2deeb30 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -52,7 +52,8 @@ def pics_TC_EWATERHTR_2_2(self): def steps_TC_EWATERHTR_2_2(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "Set up a subscription to all WaterHeaterManagement cluster events"), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index e39257134b3db5..f502dfac182bce 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -49,7 +49,8 @@ def pics_TC_EWATERHTR_2_3(self): def steps_TC_EWATERHTR_2_3(self) -> list[TestStep]: steps = [ - TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"), + TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)", + is_commissioning=True), TestStep("2", "Set up a subscription to all WaterHeaterManagement cluster events"), TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster", "Value has to be 1 (True)"), diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 67a7a16ea5290d..b2916c5914e38a 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -101,6 +101,16 @@ def get_available_scenario(self, presetTypes: list, presetScenarioCounts: map): return availableScenarios[0] return None + def make_preset(self, presetScenario, coolSetpoint, heatSetpoint, presetHandle=NullValue, name=None, builtIn=False): + preset = cluster.Structs.PresetStruct(presetHandle=presetHandle, presetScenario=presetScenario, builtIn=builtIn) + if self.check_pics("TSTAT.S.F00"): + preset.heatingSetpoint = heatSetpoint + if self.check_pics("TSTAT.S.F01"): + preset.coolingSetpoint = coolSetpoint + if name is not None: + preset.name = name + return preset + async def write_presets(self, endpoint, presets, @@ -255,13 +265,29 @@ async def test_TC_TSTAT_4_2(self): presetTypes = [] presetScenarioCounts = {} numberOfPresetsSupported = 0 - minHeatSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MinHeatSetpointLimit) - maxHeatSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MaxHeatSetpointLimit) - minCoolSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MinCoolSetpointLimit) - maxCoolSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MaxCoolSetpointLimit) + minHeatSetpointLimit = 700 + maxHeatSetpointLimit = 3000 + minCoolSetpointLimit = 1600 + maxCoolSetpointLimit = 3200 + + supportsHeat = self.check_pics("TSTAT.S.F00") + supportsCool = self.check_pics("TSTAT.S.F01") + supportsOccupancy = self.check_pics("TSTAT.S.F02") + + occupied = True - asserts.assert_true(minHeatSetpointLimit < maxHeatSetpointLimit, "Heat setpoint range invalid") - asserts.assert_true(minCoolSetpointLimit < maxCoolSetpointLimit, "Cool setpoint range invalid") + if supportsHeat: + minHeatSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MinHeatSetpointLimit) + maxHeatSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MaxHeatSetpointLimit) + asserts.assert_true(minHeatSetpointLimit < maxHeatSetpointLimit, "Heat setpoint range invalid") + + if supportsCool: + minCoolSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MinCoolSetpointLimit) + maxCoolSetpointLimit = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.MaxCoolSetpointLimit) + asserts.assert_true(minCoolSetpointLimit < maxCoolSetpointLimit, "Cool setpoint range invalid") + + if supportsOccupancy: + occupied = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.Occupancy) & 1 heatSetpoint = minHeatSetpointLimit + ((maxHeatSetpointLimit - minHeatSetpointLimit) / 2) coolSetpoint = minCoolSetpointLimit + ((maxCoolSetpointLimit - minCoolSetpointLimit) / 2) @@ -296,8 +322,7 @@ async def test_TC_TSTAT_4_2(self): for preset in test_presets: preset.builtIn = NullValue - test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=availableScenario, - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + test_presets.append(self.make_preset(availableScenario, coolSetpoint, heatSetpoint)) await self.send_atomic_request_begin_command() @@ -334,8 +359,7 @@ async def test_TC_TSTAT_4_2(self): if len(builtInPresets) > 0: builtInPresets[0].builtIn = NullValue - test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=availableScenario, - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + test_presets.append(self.make_preset(availableScenario, coolSetpoint, heatSetpoint)) # Send the AtomicRequest begin command await self.send_atomic_request_begin_command() @@ -415,7 +439,16 @@ async def test_TC_TSTAT_4_2(self): "Couldn't run test step 6 since there were no non-built-in presets to activate and delete") # Write the occupied cooling setpoint to a different value - await self.write_single_attribute(attribute_value=cluster.Attributes.OccupiedCoolingSetpoint(2300), endpoint_id=endpoint) + if occupied: + if supportsHeat: + await self.write_single_attribute(attribute_value=cluster.Attributes.OccupiedHeatingSetpoint(heatSetpoint+1), endpoint_id=endpoint) + elif supportsCool: + await self.write_single_attribute(attribute_value=cluster.Attributes.OccupiedCoolingSetpoint(coolSetpoint+1), endpoint_id=endpoint) + else: + if supportsHeat: + await self.write_single_attribute(attribute_value=cluster.Attributes.UnoccupiedHeatingSetpoint(heatSetpoint+1), endpoint_id=endpoint) + elif supportsCool: + await self.write_single_attribute(attribute_value=cluster.Attributes.UnoccupiedCoolingSetpoint(coolSetpoint+1), endpoint_id=endpoint) activePresetHandle = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.ActivePresetHandle) logger.info(f"Rx'd ActivePresetHandle: {activePresetHandle}") @@ -456,8 +489,7 @@ async def test_TC_TSTAT_4_2(self): await self.send_atomic_request_begin_command() # Write to the presets attribute after adding a preset with builtIn set to True - test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=availableScenario, - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=True)) + test_presets.append(self.make_preset(availableScenario, coolSetpoint, heatSetpoint, builtIn=True)) status = await self.write_presets(endpoint=endpoint, presets=test_presets, expected_status=Status.ConstraintError) @@ -475,8 +507,8 @@ async def test_TC_TSTAT_4_2(self): # Write to the presets attribute after adding a preset with a preset handle that doesn't exist in Presets attribute test_presets = copy.deepcopy(current_presets) - test_presets.append(cluster.Structs.PresetStruct(presetHandle=random.randbytes(16), presetScenario=cluster.Enums.PresetScenarioEnum.kWake, - name="Wake", coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=True)) + test_presets.append(self.make_preset(cluster.Enums.PresetScenarioEnum.kWake, coolSetpoint, + heatSetpoint, presetHandle=random.randbytes(16), name="Wake", builtIn=True)) status = await self.write_presets(endpoint=endpoint, presets=test_presets, expected_status=Status.NotFound) @@ -497,8 +529,8 @@ async def test_TC_TSTAT_4_2(self): await self.send_atomic_request_begin_command() # Write to the presets attribute after adding a duplicate preset - test_presets.append(cluster.Structs.PresetStruct( - presetHandle=duplicatePreset.presetHandle, presetScenario=availableScenario, coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + test_presets.append(self.make_preset(availableScenario, coolSetpoint, + heatSetpoint, presetHandle=duplicatePreset.presetHandle)) await self.write_presets(endpoint=endpoint, presets=test_presets, expected_status=Status.ConstraintError) @@ -540,8 +572,7 @@ async def test_TC_TSTAT_4_2(self): presets_without_name_support = list(preset for preset in test_presets if preset.presetScenario in availableScenarios) if len(presets_without_name_support) == 0 and len(availableScenarios) > 0: - new_preset = cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=availableScenarios[0], - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=True) + new_preset = self.make_preset(availableScenarios[0], coolSetpoint, heatSetpoint, builtIn=True) test_presets.append(new_preset) presets_without_name_support = [new_preset] @@ -570,8 +601,7 @@ async def test_TC_TSTAT_4_2(self): # Write to the presets attribute with a new valid preset added test_presets = copy.deepcopy(current_presets) - test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=availableScenario, - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + test_presets.append(self.make_preset(availableScenario, coolSetpoint, heatSetpoint)) # Send the AtomicRequest begin command await self.send_atomic_request_begin_command() @@ -630,8 +660,7 @@ async def test_TC_TSTAT_4_2(self): presetScenario for presetScenario in cluster.Enums.PresetScenarioEnum if presetScenario not in supportedScenarios) if len(unavailableScenarios) > 0: test_presets = current_presets.copy() - test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=unavailableScenarios[0], - name="Preset", coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + test_presets.append(self.make_preset(unavailableScenarios[0], coolSetpoint, heatSetpoint, name="Preset")) # Send the AtomicRequest begin command await self.send_atomic_request_begin_command() @@ -664,8 +693,7 @@ async def test_TC_TSTAT_4_2(self): presetsAddedForScenario = presetsAddedForScenario + 1 while presetsAddedForScenario < presetType.numberOfPresets: - testPresets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=scenario, - coolingSetpoint=coolSetpoint, heatingSetpoint=heatSetpoint, builtIn=False)) + testPresets.append(self.make_preset(scenario, coolSetpoint, heatSetpoint)) presetsAddedForScenario = presetsAddedForScenario + 1 # Send the AtomicRequest begin command diff --git a/src/test_driver/nrfconnect/prj.conf b/src/test_driver/nrfconnect/prj.conf index 8c9c4433d56086..97b7787fe93ac8 100644 --- a/src/test_driver/nrfconnect/prj.conf +++ b/src/test_driver/nrfconnect/prj.conf @@ -76,6 +76,8 @@ CONFIG_STD_CPP17=y CONFIG_CHIP=y CONFIG_CHIP_CRYPTO_PSA=y CONFIG_CHIP_BUILD_TESTS=y +CONFIG_CHIP_ICD_LIT_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_ENABLE_READ_CLIENT=y CONFIG_CHIP_DEVICE_VENDOR_ID=65521 CONFIG_CHIP_DEVICE_PRODUCT_ID=32768 diff --git a/src/test_driver/tizen/BUILD.gn b/src/test_driver/tizen/BUILD.gn index 5374fa75ed82a6..541f2abb7ceb48 100644 --- a/src/test_driver/tizen/BUILD.gn +++ b/src/test_driver/tizen/BUILD.gn @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +pool("console") { + depth = 1 +} + group("check") { testonly = true deps = [ diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index e9eab1ba308bcb..67428f518cae68 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -60,8 +60,8 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/emdrv/nvm3/inc", "${efr32_sdk_root}/platform/emdrv/common/inc", "${efr32_sdk_root}/platform/service/device_init/inc", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/config", + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen", + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/config", "${chip_root}/src/platform/silabs/rs911x", "${chip_root}/src/platform/silabs/wifi", @@ -132,7 +132,7 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/service/sleeptimer/inc", "${efr32_sdk_root}/platform/service/sleeptimer/config", "${efr32_sdk_root}/platform/service/sleeptimer/src", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/inc", + "${sdk_support_root}/matter/si91x/support/inc", "${efr32_sdk_root}/platform/service/iostream/inc", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/inc", @@ -685,11 +685,11 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_button_instances.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_led_instances.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_ulp_timer_init.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/hal/rsi_hal_mcu_m4.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", @@ -707,7 +707,7 @@ template("siwx917_sdk") { # STARTUP FILES "${efr32_sdk_root}/platform/service/iostream/src/sl_iostream.c", "${efr32_sdk_root}/platform/service/iostream/src/sl_iostream_rtt.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/src/startup_common_RS1xxxx.c", + "${sdk_support_root}/matter/si91x/support/src/startup_common_RS1xxxx.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c", # OTA @@ -759,8 +759,8 @@ template("siwx917_sdk") { if (chip_enable_icd_server) { sources += [ - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c", + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_power_manager_handler.c", + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_power_manager_wakeup_handler.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/sl_si91x_m4_ps.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/src/sl_si91x_power_manager.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/src/sli_si91x_power_manager.c", diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index e313f2dc9663da..c3e993cea4aad3 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit e313f2dc9663da1ee4488eceba17dbff038f6a63 +Subproject commit c3e993cea4aad32adc178fe487afb66822f0b42d diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 087ccc9d892916..7e4f3fff9bf567 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -62,7 +62,7 @@ if (silabs_board == "") { assert(silabs_board != "", "silabs_board must be specified") # Si917 WIFI board ---------- -if (silabs_board == "BRD4338A") { +if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" wifi_soc = true diff --git a/third_party/tizen/tizen_sdk.gni b/third_party/tizen/tizen_sdk.gni index 7f711c693ea599..888b4660611221 100644 --- a/third_party/tizen/tizen_sdk.gni +++ b/third_party/tizen/tizen_sdk.gni @@ -250,6 +250,9 @@ template("tizen_qemu_run") { args += [ "--virtio-net" ] } + # Use console pool to print QEMU output in real-time. + pool = "//:console" + script = tizen_qemu } }