diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 97d375cd8e26f6..e01126cf92f958 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -8,7 +8,6 @@ 21 22 AAAA -aabbccddeeff aarch abcdef abfb @@ -510,7 +509,6 @@ ffeebaefa FFF fffe fffff -fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA Fi filepath fini @@ -589,6 +587,7 @@ hciattach hciconfig hdlc HKDF +HMAC hoc homebrew hostapd @@ -620,6 +619,8 @@ IlluminanceMeasurement IM imager imagetool +ImageURI +imageUri img Impl ImplClass @@ -1392,7 +1393,6 @@ xAAAA xab xaver xb -xBEEF xbef xc xcd @@ -1400,9 +1400,6 @@ Xcode xcodeproj xcworkspace xd -xDEAD -xDEADBEEF -xdeadbeefcafe xds xdsdfu xEA @@ -1420,15 +1417,8 @@ xFF xFFF xFFFF xfffff -xFFFFFFFD -xffffffffe -xfffffffff -xffffffffffff -xffffffffffffXXXX xtensa xwayland -XXXX -XXXXXXXX xyz xz xzvf @@ -1439,7 +1429,6 @@ YNJV Yocto yoctoproject YourFolder -yWsC zapt zaptool ZCL diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cd03466a359eda..7a09c2c13cc2aa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,10 +52,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -126,7 +127,6 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 @@ -135,6 +135,8 @@ jobs: # uses: github/codeql-action/init@v1 # with: # languages: "cpp" + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -255,10 +257,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -286,7 +289,6 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 @@ -295,6 +297,8 @@ jobs: # uses: github/codeql-action/init@v1 # with: # languages: "cpp" + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform darwin - name: Setup Environment run: brew install openssl pkg-config - name: Try to ensure the directory for diagnostic log collection exists diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index 1a17cd8b747cb4..bfd5ae6c0cb0ed 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -53,10 +53,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Get cirque cache key id: cirque-key diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 9635deb5a1a8ff..e36b5b6cabf187 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -37,10 +37,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform darwin - name: Setup Environment run: brew install openssl pkg-config python@3.9 - name: Fix pkgconfig link diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index fb3041de2a2637..25c69fa64cc159 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -41,9 +41,10 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform ameba - name: Build example Ameba All Clusters App run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'ameba-*' build" diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index f9010b89ed4e3b..e91451fa89dd1b 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -43,10 +43,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform cc13x2_26x2 - name: Set up environment for size reports if: ${{ !env.ACT }} env: @@ -98,6 +99,13 @@ jobs: cc13x2_26x2 LP_CC2652R7 pump-controller-app \ out/artifacts/cc13x2x7_26x2x7-pump-controller/chip-LP_CC2652R7-pump-controller-example.out \ /tmp/bloat_reports/ + - name: Get All Clusters App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x2_26x2 LP_CC2652R7 all-clusters-app \ + out/artifacts/cc13x2x7_26x2x7-all-clusters/chip-LP_CC2652R7-all-clusters-example.out \ + /tmp/bloat_reports/ - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-cyw30739.yaml b/.github/workflows/examples-cyw30739.yaml index 979d6c66db12e1..0c2c45f75bb4e7 100644 --- a/.github/workflows/examples-cyw30739.yaml +++ b/.github/workflows/examples-cyw30739.yaml @@ -40,10 +40,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform cyw30739 - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index e51905bf3be69b..74f6f95010a6bb 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -44,10 +44,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform efr32 - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index cf1e35be8a2d83..4dab98b599f63f 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -42,10 +42,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform esp32 - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -127,10 +128,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform esp32 - name: Bootstrap timeout-minutes: 10 diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 5ae45be76bc6d5..9859dd4bef01a9 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -40,10 +40,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform p6 - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 91ca49a9482b03..ab9b655f5a95a5 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -43,10 +43,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform k32w0 - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index e8d54c89dbce20..9df01637436893 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -41,10 +41,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -64,7 +65,7 @@ jobs: .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - name: Build Some samples - timeout-minutes: 20 + timeout-minutes: 45 run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 1db324083dc0b5..0641af3ffe33d7 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -39,10 +39,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Build App timeout-minutes: 30 diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 19b076fad3b5c8..5c5e0ac65039e7 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -44,10 +44,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 3fea27e287a92a..3a90d8656cd2b0 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -47,10 +47,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform mbed - name: Detect changed paths uses: dorny/paths-filter@v2 diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 3bab89a42947c4..f2d1c5ee108c62 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.5.58 + image: connectedhomeip/chip-build-nrf-platform:0.5.64 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -44,10 +44,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform nrfconnect - name: Detect changed paths uses: dorny/paths-filter@v2 id: changed_paths diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index dc63cba81e7fe5..9d325a3c5a6b31 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -43,10 +43,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform qpg - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -66,12 +67,12 @@ jobs: .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - name: Build QPG6105 example apps - timeout-minutes: 5 + timeout-minutes: 20 run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target-glob 'qpg6105-{lock,light,shell,persistent-storage}' \ + --target-glob 'qpg-{lock,light,shell,persistent-storage}' \ build \ --copy-artifacts-to out/artifacts \ " diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index fe15cb6ad116d9..84213f751cb705 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -42,10 +42,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform telink - name: Set up environment for size reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 1b3a0994e7fbff..3aa66fb7e75015 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -44,9 +44,10 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform tizen - name: Build example Tizen lighting app run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'tizen-*' build" diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 0e3388aa302ae9..5b8fc27dbec24e 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -44,10 +44,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform esp32 - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index b3c6c3c3e787db..ff85a43708f7c6 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -44,10 +44,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform android - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7e764363b75b92..c326514306903b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -53,10 +53,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -136,10 +137,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform darwin - name: Setup Environment # coreutils for stdbuf run: brew install openssl pkg-config coreutils @@ -187,7 +189,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ - --target-skip-glob '{TestGroupMessaging,TestUserLabelCluster}' \ + --target-skip-glob '{TestGroupMessaging}' \ run \ --iterations 1 \ --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ @@ -240,8 +242,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - with: - submodules: true + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. @@ -268,6 +270,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target linux-x64-all-clusters-${BUILD_VARIANT} \ + --target linux-x64-python-bindings \ build \ --copy-artifacts-to objdir-clone \ " @@ -311,8 +314,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - with: - submodules: true + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform darwin - name: Setup Environment # coreutils for stdbuf run: brew install openssl pkg-config coreutils diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index f112c6af536a2e..45d391d43fc30b 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -48,10 +48,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Bootstrap timeout-minutes: 10 run: | diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 28fc0d986ae38c..d4eb56cbf98ee3 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -41,10 +41,11 @@ jobs: with: action: actions/checkout@v3 with: | - submodules: true token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux - name: Setup ZAP timeout-minutes: 10 run: | diff --git a/.gitmodules b/.gitmodules index 82d6d04b944a6a..7fadeb79ec8fcf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,6 +26,7 @@ path = examples/common/m5stack-tft/repo url = https://github.com/jeremyjh/ESP32_TFT_library.git branch = master + platforms = esp32 [submodule "pigweed"] path = third_party/pigweed/repo url = https://github.com/google/pigweed.git @@ -38,14 +39,17 @@ path = third_party/ot-br-posix/repo url = https://github.com/openthread/ot-br-posix.git branch = main + platforms = linux [submodule "bluez"] path = third_party/bluez/repo url = https://github.com/bluez/bluez.git branch = master + platforms = linux [submodule "cirque"] path = third_party/cirque/repo url = https://github.com/openweave/cirque.git branch = master + platforms = linux [submodule "nanopb"] path = third_party/nanopb/repo url = https://github.com/nanopb/nanopb.git @@ -54,6 +58,7 @@ path = third_party/qpg_sdk/repo url = https://github.com/Qorvo/qpg-connectedhomeip branch = master + platforms = qpg [submodule "zap"] path = third_party/zap/repo url = https://github.com/project-chip/zap.git @@ -62,103 +67,134 @@ path = third_party/freertos/repo url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git branch = V10.3.1-kernel-only + platforms = ameba,cc13x2_26x2,bl602,efr32,esp32,k32w0,p6,qpg [submodule "efr32_sdk"] path = third_party/efr32_sdk/repo url = https://github.com/SiliconLabs/sdk_support.git branch = master + platforms = efr32 [submodule "simw-top-mini"] path = third_party/simw-top-mini/repo url = https://github.com/NXP/plug-and-trust.git branch = int/CHIPSE_Release + platforms = k32w0 [submodule "third_party/openthread/ot-nxp"] path = third_party/openthread/ot-nxp url = https://github.com/openthread/ot-nxp.git + platforms = k32w0 [submodule "third_party/openthread/ot-qorvo"] path = third_party/openthread/ot-qorvo url = https://github.com/openthread/ot-qorvo.git + platforms = qpg [submodule "third_party/openthread/ot-efr32"] path = third_party/openthread/ot-efr32 url = https://github.com/openthread/ot-efr32.git + platforms = efr32 [submodule "third_party/openthread/ot-ifx"] path = third_party/openthread/ot-ifx url = https://github.com/Infineon/ot-ifx-release.git branch = cyw30739 + platforms = cyw30739 [submodule "third_party/mbed-os/repo"] path = third_party/mbed-os/repo url = https://github.com/ARMmbed/mbed-os.git branch = master + platforms = mbed [submodule "third_party/mbed-os-posix-socket/repo"] path = third_party/mbed-os-posix-socket/repo url = https://github.com/ARMmbed/mbed-os-posix-socket.git branch = main + platforms = mbed [submodule "mbed-os-cypress-capsense-button"] path = third_party/mbed-os-cypress-capsense-button/repo url = https://github.com/ARMmbed/mbed-os-cypress-capsense-button.git branch = main + platforms = mbed [submodule "p6/abstraction-rtos"] path = third_party/p6/p6_sdk/libs/abstraction-rtos url = https://github.com/Infineon/abstraction-rtos + platforms = p6 [submodule "p6/bluetooth-freertos"] path = third_party/p6/p6_sdk/libs/bluetooth-freertos url = https://github.com/Infineon/bluetooth-freertos branch = v2.X + platforms = p6 [submodule "p6/btstack"] path = third_party/p6/p6_sdk/libs/btstack url = https://github.com/Infineon/btstack + platforms = p6 [submodule "p6/clib-support"] path = third_party/p6/p6_sdk/libs/clib-support url = https://github.com/Infineon/clib-support + platforms = p6 [submodule "p6/connectivity-utilities"] path = third_party/p6/p6_sdk/libs/connectivity-utilities url = https://github.com/Infineon/connectivity-utilities + platforms = p6 [submodule "p6/core-lib"] path = third_party/p6/p6_sdk/libs/core-lib url = https://github.com/Infineon/core-lib + platforms = p6 [submodule "p6/core-make"] path = third_party/p6/p6_sdk/libs/core-make url = https://github.com/Infineon/core-make + platforms = p6 [submodule "p6/kv-store"] path = third_party/p6/p6_sdk/libs/kv-store url = https://github.com/Infineon/kv-store + platforms = p6 [submodule "p6/mtb-hal-cat1"] path = third_party/p6/p6_sdk/libs/mtb-hal-cat1 url = https://github.com/Infineon/mtb-hal-cat1 + platforms = p6 [submodule "p6/mtb-pdl-cat1"] path = third_party/p6/p6_sdk/libs/mtb-pdl-cat1 url = https://github.com/Infineon/mtb-pdl-cat1 + platforms = p6 [submodule "p6/psoc6cm0p"] path = third_party/p6/p6_sdk/libs/psoc6cm0p url = https://github.com/Infineon/psoc6cm0p + platforms = p6 [submodule "p6/whd-bsp-integration"] path = third_party/p6/p6_sdk/libs/whd-bsp-integration url = https://github.com/Infineon/whd-bsp-integration + platforms = p6 [submodule "p6/wifi-connection-manager"] path = third_party/p6/p6_sdk/libs/wifi-connection-manager url = https://github.com/Infineon/wifi-connection-manager + platforms = p6 [submodule "p6/wifi-host-driver"] path = third_party/p6/p6_sdk/libs/wifi-host-driver url = https://github.com/Infineon/wifi-host-driver + platforms = p6 [submodule "p6/wifi-mw-core"] path = third_party/p6/p6_sdk/libs/wifi-mw-core url = https://github.com/Infineon/wifi-mw-core + platforms = p6 [submodule "p6/TARGET_CY8CKIT-062S2-43012"] path = third_party/p6/p6_sdk/libs/TARGET_CY8CKIT-062S2-43012 url = https://github.com/Infineon/TARGET_CY8CKIT-062S2-43012 + platforms = p6 [submodule "p6/freertos"] path = third_party/p6/p6_sdk/libs/freertos url = https://github.com/Infineon/freertos + platforms = p6 [submodule "p6/retarget-io"] path = third_party/p6/p6_sdk/libs/retarget-io url = https://github.com/Infineon/retarget-io + platforms = p6 [submodule "p6/mbedtls"] path = third_party/p6/p6_sdk/libs/mbedtls url = https://github.com/ARMmbed/mbedtls + platforms = p6 [submodule "p6/secure-sockets"] path = third_party/p6/p6_sdk/libs/secure-sockets url = https://github.com/Infineon/secure-sockets + platforms = p6 [submodule "p6/recipe-make-cat1a"] path = third_party/p6/p6_sdk/libs/recipe-make-cat1a url = https://github.com/Infineon/recipe-make-cat1a + platforms = p6 [submodule "third_party/pybind11/repo"] path = third_party/pybind11/repo url = https://github.com/pybind/pybind11 @@ -166,44 +202,56 @@ [submodule "p6/lwip"] path = third_party/p6/p6_sdk/libs/lwip url = https://github.com/lwip-tcpip/lwip.git + platforms = p6 [submodule "third_party/jsoncpp/repo"] path = third_party/jsoncpp/repo url = https://github.com/open-source-parsers/jsoncpp.git [submodule "cyw30739_sdk/30739A0"] path = third_party/cyw30739_sdk/repos/30739A0 url = https://github.com/Infineon/30739A0.git + platforms = cyw30739 [submodule "cyw30739_sdk/include"] path = third_party/cyw30739_sdk/repos/btsdk-include url = https://github.com/Infineon/btsdk-include.git + platforms = cyw30739 [submodule "cyw30739_sdk/target"] path = third_party/cyw30739_sdk/repos/CYW930739M2EVB-01 url = https://github.com/Infineon/TARGET_CYW930739M2EVB-01.git + platforms = cyw30739 [submodule "cyw30739_sdk/tools"] path = third_party/cyw30739_sdk/repos/btsdk-tools url = https://github.com/Infineon/btsdk-tools.git + platforms = cyw30739 [submodule "third_party/p6/p6_sdk/libs/anycloud-ota"] path = third_party/p6/p6_sdk/libs/anycloud-ota url = https://github.com/Infineon/anycloud-ota + platforms = p6 [submodule "third_party/mbed-mcu-boot/repo"] path = third_party/mbed-mcu-boot/repo url = https://github.com/ATmobica/mcuboot.git + platforms = mbed [submodule "perfetto"] path = third_party/perfetto/repo url = https://github.com/google/perfetto [submodule "p6/serial-flash"] path = third_party/p6/p6_sdk/libs/serial-flash url = https://github.com/Infineon/serial-flash + platforms = p6 [submodule "third_party/telink_sdk/repo"] path = third_party/telink_sdk/repo url = https://github.com/rikorsev/telink_b91_ble_sdk + platforms = telink [submodule "ti_simplelink_sdk"] path = third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx url = https://github.com/TexasInstruments/cc13xx_cc26xx_sdk.git branch = main + platforms = cc13x2_26x2 [submodule "third_party/efr32_sdk/wiseconnect-wifi-bt-sdk"] path = third_party/efr32_sdk/wiseconnect-wifi-bt-sdk url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk + platforms = efr32 [submodule "third_party/bouffalolab/bl602"] path = third_party/bouffalolab/bl602_sdk/repo url = https://github.com/bouffalolab/bl_iot_sdk_matter.git branch = bl602_release + platforms = bl602 diff --git a/.spellcheck.yml b/.spellcheck.yml index a6c56411bcc5a6..225ab2ed951c8f 100644 --- a/.spellcheck.yml +++ b/.spellcheck.yml @@ -12,12 +12,53 @@ # See the License for the specific language governing permissions and # limitations under the License. +# To run locally: +# Prerequisits (only once): +# +# apt-get install aspell aspell-en +# pip install pyspelling +# +# Actual run: +# +# pyspelling pyspelling --config .spellcheck.yml + matrix: - name: markdown dictionary: wordlists: - .github/.wordlist.txt pipeline: + # See https://facelessuser.github.io/pyspelling/configuration/#pipeline + # and https://facelessuser.github.io/pyspelling/filters/context/ + + # context-aware logic: we have a LOT of code examples in markdown, + # avoid trying to spellcheck code. + - pyspelling.filters.context: + context_visible_first: true + escapes: \\[\\`~] + delimiters: + # Ignore multiline content between fences (fences can have 3 or more back ticks) + # ``` + # content + # ``` + # + # Allows language marker (since github allows it) like: + # ```python + # content + # ``` + - open: '(?s)^(?P *`{3,})[a-z]*$' + close: '^(?P=open)$' + # Ignore text between inline back ticks + - open: '(?P`+)' + close: '(?P=open)' + # Ignore URL in hyperlinks [title](url) + - open: '\[[^]]*\]\(' + close: '\)' + # Ignore code markers + - open: '' + close: '' + + # converts markdown to HTML - pyspelling.filters.markdown: sources: - '**/*.md|!third_party/**|!examples/common/**/repo/**' diff --git a/BUILD.gn b/BUILD.gn index 6ddfb3dc4d78c8..d8661c6701b335 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -253,6 +253,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { # Build the cc13x2x7_26x2x7 lock app example. enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds + # Build the cc13x2x7_26x2x7 all-clusters app example. + enable_cc13x2x7_26x2x7_all_clusters_app_build = enable_ti_simplelink_builds + # Build the efr32 lock app example. enable_efr32_lock_app_build = enable_efr32_builds @@ -353,6 +356,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { } } + if (enable_cc13x2x7_26x2x7_all_clusters_app_build) { + group("cc13x2x7_26x2x7_all_clusters_app") { + deps = [ "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7(${chip_root}/config/cc13x2_26x2/toolchain:cc13x2x7_26x2x7_all_clusters_app)" ] + } + } + if (enable_standalone_shell_build) { group("standalone_shell") { deps = @@ -539,6 +548,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (enable_cc13x2x7_26x2x7_lock_app_build) { deps += [ ":cc13x2x7_26x2x7_lock_app" ] } + if (enable_cc13x2x7_26x2x7_all_clusters_app_build) { + deps += [ ":cc13x2x7_26x2x7_all_clusters_app" ] + } } group("check") { diff --git a/config/cc13x2_26x2/toolchain/BUILD.gn b/config/cc13x2_26x2/toolchain/BUILD.gn index 9b89e2e8cdb854..5655b6579f0469 100644 --- a/config/cc13x2_26x2/toolchain/BUILD.gn +++ b/config/cc13x2_26x2/toolchain/BUILD.gn @@ -22,4 +22,10 @@ arm_toolchain("cc13x2x7_26x2x7_lock_app") { current_os = "freertos" import("${chip_root}/examples/lock-app/cc13x2x7_26x2x7/args.gni") } + arm_toolchain("cc13x2x7_26x2x7_all_clusters_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni") + } + } } diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 199d80ad28ddf5..db2603b8b47ba3 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -103,6 +103,10 @@ if (CONFIG_ENABLE_CHIP_SHELL) chip_gn_arg_append("chip_build_libshell" "true") endif() +if (CONFIG_IDF_TARGET_ESP32H2) + chip_gn_arg_append("chip_enable_wifi" "false") +endif() + if (CONFIG_OPENTHREAD_ENABLED) chip_gn_arg_append("chip_enable_openthread" "true") endif() diff --git a/config/nrfconnect/.nrfconnect-recommended-revision b/config/nrfconnect/.nrfconnect-recommended-revision index ba1e8bf0bd53b5..64f70a191193e6 100644 --- a/config/nrfconnect/.nrfconnect-recommended-revision +++ b/config/nrfconnect/.nrfconnect-recommended-revision @@ -1 +1 @@ -v1.9.1 +5ea8f7fa91d7315fcc6cd9eb3aa74f9640d0abac diff --git a/config/qpg/chip-gn/.gn b/config/qpg/chip-gn/.gn index 4773cbf0166c44..04b98b1160198d 100644 --- a/config/qpg/chip-gn/.gn +++ b/config/qpg/chip-gn/.gn @@ -19,7 +19,9 @@ import("//build_overrides/chip.gni") buildconfig = "//build/config/BUILDCONFIG.gn" # CHIP uses angle bracket includes. -check_system_includes = true +# DISABLED since CI failed on PR 17352 +# Build error out for unused/unavailble include file (IPAddress.h : ) +check_system_includes = false default_args = { target_cpu = "arm" diff --git a/docs/api/device_runner.md b/docs/api/device_runner.md index 3b621eb8e70675..db9c5993eff6d8 100644 --- a/docs/api/device_runner.md +++ b/docs/api/device_runner.md @@ -99,5 +99,5 @@ enable reusing tests between different devices. The TSG is targeting the following platforms/boards for early bringup: - Nordic nRF52 board -- SiLabs XXXX board -- Espressif ESP32 XXXX board +- SiLabs `XXXX` board +- Espressif ESP32 `XXXX` board diff --git a/docs/discussion/lwip_ipv6.md b/docs/discussion/lwip_ipv6.md index adaabe5ddfcac2..674be43e227a16 100644 --- a/docs/discussion/lwip_ipv6.md +++ b/docs/discussion/lwip_ipv6.md @@ -27,8 +27,8 @@ addresses for communication to nodes on the same network (wifi or thread). When there is more than one netif in the system (ex. loopback, softAP, STA), the link local address needs more information to determine which link the address is local to. This is normally added as the link local scope and can be seen on -addresses ex. FE80::xxxx:xxxx:xxxx:xxxx%, where the identifies -the netif (something like %wlan0 or %eno1 etc.). +addresses ex. `FE80::xxxx:xxxx:xxxx:xxxx%`, where the identifies +the netif (something like `%wlan0` or `%eno1` etc.). Without this indicator, the link local address can only be resolved if there is one netif. LwIP will also allow a direct address match to the netif source @@ -122,7 +122,7 @@ Instead, it might be better to build this into the ICMP layer itself. LwIP's DNS handling isn’t great and breaks down when the router supports IPv4/IPv6. There is a single list of DNS servers, DHCP, SLAAC and DHCPv6 all update the list without locks. Basically, whatever wrote to the list last gets -to set the list. Although there is handling for IP type (requesting A or AAAA +to set the list. Although there is handling for IP type (requesting A or `AAAA` records), there isn’t handling to specify an IPv6 or IPv4 server specifically, which can be challenging since not all servers serve all record types. diff --git a/docs/examples/discussion/PID_allocation_for_example_apps.md b/docs/examples/discussion/PID_allocation_for_example_apps.md index 09960b31d25f87..18e71a20698964 100644 --- a/docs/examples/discussion/PID_allocation_for_example_apps.md +++ b/docs/examples/discussion/PID_allocation_for_example_apps.md @@ -3,34 +3,34 @@ Unless specifically overridden by the platform, example apps in this SDK use the Example credentials implementation in `DeviceAttestationCredsExample.cpp`. -The SDK holds example certificates for VID '0xFFF1' and any PID in -'0x8000-0x801F'. The device VID and PID supplied by the basic information +The SDK holds example certificates for VID `0xFFF1` and any PID in +`0x8000-0x801F`. The device VID and PID supplied by the basic information cluster must correspond to the VID/PID given in the certificate for the device to pass verification. Certificates are selected using the value in CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID. The vendor ID for every example app is the -same because they are all signed by the same PAI (vendor id '0xFFF1'). +same because they are all signed by the same PAI (vendor id `0xFFF1`). In order to allow some differentiation between the various example apps, each app is assigned a PID from the list below: -| App | PID | -| ----------------------- | ------ | -| All Clusters | 0x8001 | -| Bridge | 0x8002 | -| Door Lock | 0x8003 | -| Light switch | 0x8004 | -| Lighting | 0x8005 | -| Lock | 0x8006 | -| OTA provider | 0x8007 | -| OTA requestor | 0x8008 | -| Persistent Storage | 0x8009 | -| Pigweed | 0x800B | -| Pump | 0x800A | -| Pump Controller | 0x8011 | -| Shell | 0x8012 | -| Temperature measurement | 0x800D | -| Thermostat | 0x800E | -| TV | 0x800F | -| Window | 0x8010 | +| App | PID | +| ----------------------- | -------- | +| All Clusters | `0x8001` | +| Bridge | `0x8002` | +| Door Lock | `0x8003` | +| Light switch | `0x8004` | +| Lighting | `0x8005` | +| Lock | `0x8006` | +| OTA provider | `0x8007` | +| OTA requestor | `0x8008` | +| Persistent Storage | `0x8009` | +| Pigweed | `0x800B` | +| Pump | `0x800A` | +| Pump Controller | `0x8011` | +| Shell | `0x8012` | +| Temperature measurement | `0x800D` | +| Thermostat | `0x800E` | +| TV | `0x800F` | +| Window | `0x8010` | diff --git a/docs/guides/BUILDING.md b/docs/guides/BUILDING.md index 5c700760de476e..94bc989484fcb8 100644 --- a/docs/guides/BUILDING.md +++ b/docs/guides/BUILDING.md @@ -182,7 +182,7 @@ To run all tests, run: ninja -C out/host check ``` -To run only the tests in src/inet/tests, you can run: +To run only the tests in `src/inet/tests`, you can run: ``` ninja -C out/host src/inet/tests:tests_run diff --git a/docs/guides/matter-repl.md b/docs/guides/matter-repl.md index 89655045887095..f5c9214d2c652b 100644 --- a/docs/guides/matter-repl.md +++ b/docs/guides/matter-repl.md @@ -149,9 +149,7 @@ cloud-hosted playground. The following icon is present at the top of applicable guides that can be launched into the playground: - -drawing - +![Launch playground icon](https://i.ibb.co/hR3yWsC/launch-playground.png")

## Guides diff --git a/docs/guides/mbedos_add_new_target.md b/docs/guides/mbedos_add_new_target.md index 92e38a8eb27ac6..07d34bb3705690 100644 --- a/docs/guides/mbedos_add_new_target.md +++ b/docs/guides/mbedos_add_new_target.md @@ -1,6 +1,4 @@ -

- ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)

Mbed-OS add new hardware target

diff --git a/docs/guides/mbedos_commissioning.md b/docs/guides/mbedos_commissioning.md index 773960246dcf93..19e19d2a3d5dc6 100644 --- a/docs/guides/mbedos_commissioning.md +++ b/docs/guides/mbedos_commissioning.md @@ -1,6 +1,4 @@ -

- ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)

Matter Arm Mbed OS provisioning guide

@@ -67,7 +65,9 @@ After building, install the application by completing the following steps: 1. Install the Android Debug Bridge (adb) package by running the following command: + ``` $ sudo apt install android-tools-adb + ``` 2. Enable **USB debugging** on your smartphone. See the [Configure on-device developer options](https://developer.android.com/studio/debug/dev-options) @@ -94,7 +94,9 @@ complete the following steps: accessory device. You can use **mbed-tools** for this purpose ([mbed-tools](https://github.com/ARMmbed/mbed-tools)): + ``` mbed-tools sterm -p /dev/ttyACM0 -b 115200 -e off + ``` To start the rendezvous, CHIPTool must get the commissioning information from the Matter device. The data payload is encoded within a QR code and is printed @@ -104,8 +106,10 @@ to the UART console. - Find a message similar to the following one in the application logs: + ``` [INFO][CHIP]: [SVR]Copy/paste the below URL in a browser to see the QR Code: [INFO][CHIP]: [SVR]https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AYNJV7VSC00CMVH7SR00 + ``` - Open URL from the console to display the QR in a web browser. diff --git a/docs/guides/mbedos_platform_overview.md b/docs/guides/mbedos_platform_overview.md index 7252f992369422..95a1a3ee67f0c7 100644 --- a/docs/guides/mbedos_platform_overview.md +++ b/docs/guides/mbedos_platform_overview.md @@ -1,6 +1,4 @@ -

-ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png) # Mbed-OS platform overview @@ -11,9 +9,7 @@ Mbed-OS 6. The following diagram shows a simplified structure of a Matter application which runs on the top of the Mbed-OS. -

- matter_mbedos_overview_simplified -

+![matter_mbedos_overview_simplified](images/matter_mbedos_overview_simplified.png) # ARM Mbed-OS diff --git a/docs/guides/nrfconnect_android_commissioning.md b/docs/guides/nrfconnect_android_commissioning.md index b6260873b968d7..f24a12ddeb0394 100644 --- a/docs/guides/nrfconnect_android_commissioning.md +++ b/docs/guides/nrfconnect_android_commissioning.md @@ -111,7 +111,9 @@ After building, install the application by completing the following steps: 1. Install the Android Debug Bridge (adb) package by running the following command: - $ sudo apt install android-tools-adb + ``` + sudo apt install android-tools-adb + ``` 2. Enable **USB debugging** on the smartphone. See the [Configure on-device developer options](https://developer.android.com/studio/debug/dev-options) @@ -122,7 +124,9 @@ After building, install the application by completing the following steps: 5. Run the following command to install the application, with _chip-dir_ replaced with the path to the Matter source directory: - $ adb install -r chip-dir/src/android/CHIPTool/app/build/outputs/apk/debug/app-debug.apk + ``` + adb install -r chip-dir/src/android/CHIPTool/app/build/outputs/apk/debug/app-debug.apk + ``` 6. Navigate to settings on your smartphone and grant **Camera** and **Location** permissions to CHIPTool. diff --git a/docs/guides/nrfconnect_examples_cli.md b/docs/guides/nrfconnect_examples_cli.md index eed5e14e95cbd3..07871a5750a041 100644 --- a/docs/guides/nrfconnect_examples_cli.md +++ b/docs/guides/nrfconnect_examples_cli.md @@ -10,10 +10,12 @@ To access the CLI console, use a serial terminal emulator of your choice, like Minicom or GNU Screen. Use the baud rate set to `115200`. For example, to start using the CLI console with Minicom, run the following -command with _/dev/ttyACM0_ replaced with the device node name of your +command with `/dev/ttyACM0` replaced with the device node name of your development kit: - $ minicom -D /dev/ttyACM0 -b 115200 + ``` + minicom -D /dev/ttyACM0 -b 115200 + ``` When you reboot the kit, you will see the boot logs in the console, similar to the following messages: diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/guides/nrfconnect_examples_configuration.md index b0d94ae84540d4..236008b740f6c4 100644 --- a/docs/guides/nrfconnect_examples_configuration.md +++ b/docs/guides/nrfconnect_examples_configuration.md @@ -34,12 +34,16 @@ Complete the following steps: directory, with _build-target_ replaced with the build target name of the kit, for example _nrf52840dk_nrf52840_: - $ west build -b build-target + ``` + west build -b build-target + ``` 2. Run the terminal-based interface called menuconfig by typing the following command: - $ west build -t menuconfig + ``` + west build -t menuconfig + ``` The menuconfig terminal window appears, in which you can navigate using arrow keys and other keys, based on the description at the bottom of the @@ -93,7 +97,9 @@ that you rebuild your application after editing them by typing the following command in the example directory, with _build-target_ replaced with the build target name of the kit, for example _nrf52840dk_nrf52840_: - $ west build -b build-target + ``` + west build -b build-target + ```
diff --git a/docs/guides/nrfconnect_examples_software_update.md b/docs/guides/nrfconnect_examples_software_update.md index 50180d20ef451a..588f69aff7d9b9 100644 --- a/docs/guides/nrfconnect_examples_software_update.md +++ b/docs/guides/nrfconnect_examples_software_update.md @@ -31,11 +31,15 @@ To test the DFU over Matter, you need to complete the following steps: 1. Navigate to the CHIP root directory. 2. Build the OTA Provider application for Linux: - $ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/provider chip_config_network_layer_ble=false + ``` + scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/provider chip_config_network_layer_ble=false + ``` 3. Build chip-tool for Linux: - $ scripts/examples/gn_build_example.sh examples/chip-tool out/chiptool 'chip_mdns="platform"' + ``` + scripts/examples/gn_build_example.sh examples/chip-tool out/chiptool 'chip_mdns="platform"' + ``` 4. Run OTA Provider application with _matter.ota_ replaced with the path to the Matter OTA image which you wish to provide to the Matter device. Note that @@ -49,7 +53,9 @@ To test the DFU over Matter, you need to complete the following steps: 5. Commission the OTA Provider into the Matter network using Node Id 1: - $ ./out/chiptool/chip-tool pairing onnetwork 1 20202021 + ``` + ./out/chiptool/chip-tool pairing onnetwork 1 20202021 + ``` 6. Use the OTBR web interface to form a new Thread network using the default network settings. @@ -58,19 +64,25 @@ To test the DFU over Matter, you need to complete the following steps: Operational Dataset. It can be retrieved from the OTBR in case you have changed the default network settings when forming the network. - $ ./out/chiptool/chip-tool pairing ble-thread 2 hex:000300000f02081111111122222222051000112233445566778899aabbccddeeff01021234 20202021 3840 + ``` + ./out/chiptool/chip-tool pairing ble-thread 2 hex:000300000f02081111111122222222051000112233445566778899aabbccddeeff01021234 20202021 3840 + ``` 8. Configure the Matter device with the default OTA Provider by running the following command. The last two arguments are Requestor Node Id and Requestor Endpoint Id, respectively: - $ ./out/chiptool/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"fabricIndex": 1, "providerNodeID": 1, "endpoint": 0}]' 2 0 + ``` + ./out/chiptool/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"fabricIndex": 1, "providerNodeID": 1, "endpoint": 0}]' 2 0 + ``` 9. Configure the OTA Provider with the access control list (ACL) that grants _Operate_ privileges to all nodes in the fabric. This is necessary to allow the nodes to send cluster commands to the OTA Provider: - $ ./out/chiptool/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 + ``` + ./out/chiptool/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 + ``` 10. Initiate the DFU procedure in one of the following ways: @@ -79,14 +91,18 @@ To test the DFU over Matter, you need to complete the following steps: option, which enables Matter shell commands, run the following command on the device shell: - $ matter ota query + ``` + matter ota query + ``` - Otherwise, use chip-tool to send the Announce OTA Provider command to the device. The numeric arguments are Provider Node Id, Provider Vendor Id, Announcement Reason, Provider Endpoint Id, Requestor Node Id and Requestor Endpoint Id, respectively. - $ ./out/chiptool/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 + ``` + ./out/chiptool/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 + ``` Once the device is made aware of the OTA Provider node, it automatically queries the OTA Provider for a new firmware image. @@ -154,7 +170,9 @@ Complete the following steps to perform DFU using mcumgr: 4. Upload the application firmware image to the device by running the following command in your example directory: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/app_update.bin -n 0 -w 1 + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/app_update.bin -n 0 -w 1 + ``` The operation can take a few minutes. Wait until the progress bar reaches 100%. @@ -162,12 +180,15 @@ Complete the following steps to perform DFU using mcumgr: 5. Obtain the list of images present in the device memory by running following command: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image list + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image list + ``` The displayed output contains the old image in slot 0 that is currently active and the new image in slot 1, which is not active yet (flags field empty): + ``` Images: image=0 slot=0 version: 0.0.0 @@ -180,16 +201,20 @@ Complete the following steps to perform DFU using mcumgr: flags: hash: cbd58fc3821e749d3abfb00b3069f98c078824735f1b2a333e8a1579971e7de1 Split status: N/A (0) + ``` 6. Swap the firmware images by calling the following method with `image-hash` replaced by the image present in the slot 1 hash (for example, `cbd58fc3821e749d3abfb00b3069f98c078824735f1b2a333e8a1579971e7de1`): - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image test image-hash + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image test image-hash + ``` You can observe that the `flags:` field in the image for slot 1 changes value to `pending`: + ``` Images: image=0 slot=0 version: 0.0.0 @@ -202,6 +227,7 @@ Complete the following steps to perform DFU using mcumgr: flags: pending hash: cbd58fc3821e749d3abfb00b3069f98c078824735f1b2a333e8a1579971e7de1 Split status: N/A (0) + ``` > **_NOTE:_** If you are using the nRF5340DK board, that supports multi-image > device firmware upgrade, complete Steps 7-9. If not using one, go straight to @@ -210,7 +236,9 @@ Complete the following steps to perform DFU using mcumgr: 7. Upload the network core firmware image to the device by running the following command in your example directory: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/net_core_app_update.bin -n 1 -w 1 + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/net_core_app_update.bin -n 1 -w 1 + ``` The operation can take a few minutes. Wait until the progress bar reaches 100%. @@ -218,13 +246,16 @@ Complete the following steps to perform DFU using mcumgr: 8. Obtain the list of images present in the device memory by running following command: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image list + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image list + ``` The displayed output contains the old application image in slot 0 that is currently active, the new application image in slot 1 in pending state, and the new network image which is in slot 1 and not active yet (flags field empty): + ``` Images: image=0 slot=0 version: 0.0.0 @@ -242,16 +273,20 @@ Complete the following steps to perform DFU using mcumgr: flags: hash: d9e31e73cb7a959c26411250c2b3028f3510ae88a4549ae3f2f097c3e7530f48 Split status: N/A (0) + ``` 9. Swap the firmware images by calling the following method with `image-hash` replaced by the image present in the slot 1 hash (for example, `d9e31e73cb7a959c26411250c2b3028f3510ae88a4549ae3f2f097c3e7530f48`): - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image test image-hash + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image test image-hash + ``` You can observe that the `flags:` field in the image for slot 1 changes value to `pending`: + ``` Images: image=0 slot=0 version: 0.0.0 @@ -269,21 +304,26 @@ Complete the following steps to perform DFU using mcumgr: flags: pending hash: d9e31e73cb7a959c26411250c2b3028f3510ae88a4549ae3f2f097c3e7530f48 Split status: N/A (0) + ``` 10. Reset the device with the following command to let the bootloader swap images: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' reset + ``` + sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' reset + ``` The device is reset and the following notifications appear in its console: + ``` *** Booting Zephyr OS build zephyr-v2.5.0-1101-ga9d3aef65424 *** I: Starting bootloader I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1 I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3 I: Boot source: none I: Swap type: test + ``` Swapping operation can take some time, and after it completes, the new firmware is booted. diff --git a/docs/guides/nxp_imx8m_linux_examples.md b/docs/guides/nxp_imx8m_linux_examples.md index ffda37fbbe318b..bd8d47994a51cd 100644 --- a/docs/guides/nxp_imx8m_linux_examples.md +++ b/docs/guides/nxp_imx8m_linux_examples.md @@ -45,23 +45,29 @@ to be generated. This document is tested with the i.MX Yocto 5.10.35_2.0.0 release. Run the commands below to download this release: - $ mkdir ~/bin - $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo - $ chmod a+x ~/bin/repo - $ export PATH=${PATH}:~/bin - - $ mkdir yocto # this directory will be the top directory of the Yocto source code - $ cd yocto - $ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml - $ repo sync + ``` + mkdir ~/bin + curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo + chmod a+x ~/bin/repo + export PATH=${PATH}:~/bin + ``` + + ``` + mkdir yocto # this directory will be the top directory of the Yocto source code + cd yocto + repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml + repo sync + ``` To build the Yocto Project, some packages need to be installed. The list of packages required are: - $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ - build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ - xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \ - pylint3 xterm + ``` + sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ + build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ + xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \ + pylint3 xterm + ``` More information about the downloaded Yocto release can be found in the corresponding i.MX Yocto Project User’s Guide which can be found at @@ -70,8 +76,10 @@ to be generated. Change the current directory to the top directory of the Yocto source code and execute the commands below to generate the Yocto SDK: - $ MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland - $ bitbake imx-image-core -c populate_sdk + ``` + MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland + bitbake imx-image-core -c populate_sdk + ``` After the execution of the previous two commands, the SDK installation file can be found at tmp/deploy/sdk as a shell script. With the test environment @@ -82,9 +90,11 @@ to be generated. Change the current directory to the top directory of the Yocto source code and execute the commands below to generate the Yocto SD card image: - $ MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland - $ echo "IMAGE_INSTALL_append += \"libavahi-client\"" >> conf/local.conf - $ bitbake imx-image-core + ``` + MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland + echo "IMAGE_INSTALL_append += \"libavahi-client\"" >> conf/local.conf + bitbake imx-image-core + ``` The Yocto image can be found at tmp/deploy/images/imx8mmevk/imx-image-core-imx8mmevk.wic.bz2. The `bzip2` @@ -97,49 +107,57 @@ to be generated. represents a microSD card connected to the host machine with a USB adapter, however the output device name may vary. - $ bzip2 -d imx-image-core-imx8mmevk-20210812084502.rootfs.wic.bz2 - $ sudo dd if=imx-image-core-imx8mmevk-20210812084502.rootfs.wic of=/dev/sdc bs=4M conv=fsync + ``` + bzip2 -d imx-image-core-imx8mmevk-20210812084502.rootfs.wic.bz2 + sudo dd if=imx-image-core-imx8mmevk-20210812084502.rootfs.wic of=/dev/sdc bs=4M conv=fsync + ``` - Install the NXP Yocto SDK and set toolchain environment variables. Execute the SDK installation file with root permission. - $ sudo tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-full-cortexa53-crypto-imx8mmevk-toolchain-5.10-hardknott.sh + ``` + sudo tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-full-cortexa53-crypto-imx8mmevk-toolchain-5.10-hardknott.sh + ``` After the Yocto SDK is installed on the host machine, an environment setup script is also generated, and there are prompt lines telling the user to source the script each time when using the SDK in a new shell, for example: - $ . /opt/fsl-imx-xwayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux + ``` + . /opt/fsl-imx-xwayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux + ``` - Build the example application: Assuming that the working directory has been changed the CHIP Linux Examples code, all the other steps are the same. + ``` # If the all-clusters example is to be built - $ cd ~/connectedhomeip/examples/all-clusters-app/linux + cd ~/connectedhomeip/examples/all-clusters-app/linux # If the lighting example is to be built - $ cd ~/connectedhomeip/examples/lighting-app/linux + cd ~/connectedhomeip/examples/lighting-app/linux # If the thermostat example is to be built - $ cd ~/connectedhomeip/examples/thermostat/linux - - $ git submodule update --init - $ source third_party/connectedhomeip/scripts/activate.sh - $ PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s \"' - $ PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR} \ - PKG_CONFIG_LIBDIR=${PKG_CONFIG_PATH} \ - gn gen out/aarch64 --args="target_os=\"linux\" target_cpu=\"arm64\" arm_arch=\"armv8-a\" - import(\"//build_overrides/build.gni\") - target_cflags=[ \"--sysroot=${SDKTARGETSYSROOT}\", \"${PLATFORM_CFLAGS}\" ] - target_ldflags = [ \"--sysroot=${SDKTARGETSYSROOT}\" ] - custom_toolchain=\"\${build_root}/toolchain/custom\" - target_cc=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc\" - target_cxx=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++\" - target_ar=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-ar\"" - $ ninja -C out/aarch64 + cd ~/connectedhomeip/examples/thermostat/linux + + git submodule update --init + source third_party/connectedhomeip/scripts/activate.sh + PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s \"' + PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR} \ + PKG_CONFIG_LIBDIR=${PKG_CONFIG_PATH} \ + gn gen out/aarch64 --args="target_os=\"linux\" target_cpu=\"arm64\" arm_arch=\"armv8-a\" + import(\"//build_overrides/build.gni\") + target_cflags=[ \"--sysroot=${SDKTARGETSYSROOT}\", \"${PLATFORM_CFLAGS}\" ] + target_ldflags = [ \"--sysroot=${SDKTARGETSYSROOT}\" ] + custom_toolchain=\"\${build_root}/toolchain/custom\" + target_cc=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc\" + target_cxx=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++\" + target_ar=\"${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-ar\"" + ninja -C out/aarch64 + ``` The executable file is built under out/aarch64, it can be executed on the **i.MX 8M Mini EVK** which running the Yocto image previously generated as @@ -229,31 +247,39 @@ Thermostat-app is used as an example below. - Initialize the BT device on the **i.MX 8M Mini EVK** board - $ modprobe moal mod_para=nxp/wifi_mod_para.conf # Load the Wi-Fi/BT firmware - $ hciattach /dev/ttymxc0 any 115200 flow # Initialize the BT device + ``` + modprobe moal mod_para=nxp/wifi_mod_para.conf # Load the Wi-Fi/BT firmware + hciattach /dev/ttymxc0 any 115200 flow # Initialize the BT device + ``` - Find the Bluetooth device id for **i.MX 8M Mini EVK** by executing the command below. The number following string `hci` is the Bluetooth device id, `0` in this example. + ``` $ hciconfig hci0: Type: Primary Bus: USB BD Address: 00:1A:7D:DA:71:13 ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING RX bytes:73311 acl:1527 sco:0 events:3023 errors:0 TX bytes:48805 acl:1459 sco:0 commands:704 errors:0 + ``` - Run the Linux Example App - $ /home/root/thermostat-app --ble-device 0 --wifi # The bluetooth device used is hci0 and support wifi network + ``` + /home/root/thermostat-app --ble-device 0 --wifi # The bluetooth device used is hci0 and support wifi network + ``` - Run [ChipDeviceController](../../src/controller/python) on the controller device to communicate with **i.MX 8M Mini EVK** running the example. + ``` $ sudo out/python_env/bin/chip-device-ctrl # execute the tool chip-device-ctrl > connect -ble 3840 20202021 8889 # connect to i.MX 8M Mini EVK chip-device-ctrl > zcl Thermostat SetpointRaiseLower 8889 1 0 mode=1 amount=10 # send command to i.MX 8M Mini EVK via BLE + ``` (Note that the last two commands `connect -ble 3840 20202021 8889` and `zcl Thermostat SetpointRaiseLower 8889 1 0 mode=1 amount=10` are Python diff --git a/docs/guides/nxp_k32w_android_commissioning.md b/docs/guides/nxp_k32w_android_commissioning.md index 93ec768876b2de..f52ab2efe89c3d 100644 --- a/docs/guides/nxp_k32w_android_commissioning.md +++ b/docs/guides/nxp_k32w_android_commissioning.md @@ -88,19 +88,27 @@ the RCP firmware onto an K32W061 DK6: 1. Clone the OpenThread repository into the current directory (we recommand using commit ced158e65a00dd5394c04548b7b187d3a3f11eef): - $ git clone https://github.com/openthread/openthread.git + ``` + git clone https://github.com/openthread/openthread.git + ``` 2. Enter the _openthread_ directory: - $ cd openthread + ``` + cd openthread + ``` 3. Install OpenThread dependencies: - $ ./script/bootstrap + ``` + ./script/bootstrap + ``` 4. Set up the build environment: - $ ./bootstrap + ``` + ./bootstrap + ``` 5. Build OpenThread for the K32W061 DK6: @@ -130,10 +138,13 @@ To make your PC work as a Thread Border Router, complete the following tasks: - Install the required package: - $ sudo apt-get install hostapd + ``` + sudo apt-get install hostapd + ``` - Configure hostapd (create new file and add content): + ``` $ sudo vim /etc/hostapd/hostapd.conf interface=wlan0 @@ -150,69 +161,88 @@ To make your PC work as a Thread Border Router, complete the following tasks: wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP + ``` - We need to tell hostapd to use our config file by editing the main hostapd configuration file. Change the line that starts with - #DAEMON_CONF (remember to remove #): - \$ sudo vim /etc/default/hostapd + #DAEMON_CONF (remember to remove #): + + ``` + $ sudo vim /etc/default/hostapd DAEMON_CONF="/etc/hostapd/hostapd.conf" + ``` - Start hostapd: - $ sudo systemctl unmask hostapd - $ sudo systemctl enable hostapd + ``` + sudo systemctl unmask hostapd + sudo systemctl enable hostapd + ``` 3. Configure Dnsmasq - Install the required package: - $ sudo apt-get install dnsmasq + ``` + sudo apt-get install dnsmasq + ``` - Make a backup of the default config file: - $ sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.org + ``` + sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.org + ``` - Set the DHCP range: + ``` $ sudo vim /etc/dnsmasq.conf interface=wlan0 dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h + ``` - On System startup, dnsmasq will not wait for wlan0 interface to initialize and will fail. We need to tell systemd to launch it after networks get ready, so we will modify dnsmasq service file by specifying the initialization order under the _After=_ and _Wants=_ sections: + ``` $ sudo vim /lib/systemd/system/dnsmasq.service [Unit] ... After=... network-online.target Wants=... network-online.target + ``` - Force systemd to avoid using port 53 (used by dnsmasqd service): + ``` $ sudo vim /etc/systemd/resolved.conf DNSStubListener=no + ``` 4. Configure static IP for the Wi-Fi AP interface - Modify the cloud-init file and add content to it (use spaces, not tabs, USE THE ): + ``` $ sudo vim /etc/netplan/50-cloud-init.yaml wlan0: dhcp4: false addresses: - 192.168.4.1/24 + ``` - The final configuration file should like like this (pay attention to the spacing used): + ``` network: version: 2 ethernets: @@ -223,17 +253,22 @@ To make your PC work as a Thread Border Router, complete the following tasks: dhcp4: false addresses: - 192.168.4.1/24 + ``` 5) Set up RADVD - Install required package: - \$ sudo apt-get install radvd + ``` + sudo apt-get install radvd + ``` - - Configure RADVD for distributing the prefix _fd11:33_::/64 to the + - Configure RADVD for distributing the prefix `_fd11:33_::/64` to the devices connected to the AP, while announcing them that is also has a - route to _fd11:22::/64_ - \$ sudo vim /etc/radvd.conf + route to `_fd11:22::/64_` + + ``` + $ sudo vim /etc/radvd.conf interface wlan0 { AdvManagedFlag on; @@ -248,32 +283,40 @@ To make your PC work as a Thread Border Router, complete the following tasks: route fd11:22::/64 { }; }; + ``` - Enable radvd service: - $ sudo chmod u=rw,g=r,o=r /etc/radvd.conf - $ sudo systemctl enable - radvd.service + + ``` + sudo chmod u=rw,g=r,o=r /etc/radvd.conf + sudo systemctl enable radvd.service + ``` 6. Configure routing: - Create a configuration file for setting the routing behavior (forward between Thread and Wi-Fi AP interfaces): + ``` $ sudo vim configurations.sh #!/bin/bash sudo iptables -A FORWARD -i wlan0 -o wpan0 -j ACCEPT sudo iptables -A FORWARD -i wpan0 -o wlan0 -j ACCEPT + ``` - Set the executable bit for the above file: - $ sudo chmod +x configurations.sh + ``` + sudo chmod +x configurations.sh + ``` - Configure the above script to be run each time the PC is restarted using a systemd service configuration (change the path for _ExecStart_): + ``` $ sudo vim /etc/systemd/system/br.service [Unit] @@ -286,12 +329,14 @@ To make your PC work as a Thread Border Router, complete the following tasks: [Install] WantedBy=multi-user.target - + ``` - Then run: - $ sudo systemctl daemon-reload - $ sudo systemctl enable br.service + ``` + sudo systemctl daemon-reload + sudo systemctl enable br.service + ``` 7. As a quick checkpoint, restart the PC and make sure that the mobile phone can connect to the _OT-BR_ AP (password: 12345678). Also, check that it gets @@ -299,10 +344,12 @@ To make your PC work as a Thread Border Router, complete the following tasks: with the prefix _fd11:33::/64_. Commands for debugging possible issues with the services: - $ sudo service hostapd status - $ sudo service dnsmasq status - $ sudo service radvd status - $ sudo service br status + ``` + sudo service hostapd status + sudo service dnsmasq status + sudo service radvd status + sudo service br status + ```
@@ -332,7 +379,9 @@ After building, install the application by completing the following steps: 1. Install the Android Debug Bridge (adb) package by running the following command: - $ sudo apt install android-tools-adb + ``` + sudo apt install android-tools-adb + ``` 2. Enable _USB debugging_ on the smartphone. See the [Configure on-device developer options](https://developer.android.com/studio/debug/dev-options) @@ -343,7 +392,9 @@ After building, install the application by completing the following steps: 5. Run the following command to install the application, with _chip-dir_ replaced with the path to the CHIP source directory: - $ adb install -r chip-dir/src/android/CHIPTool/app/build/outputs/apk/debug/app-debug.apk + ``` + adb install -r chip-dir/src/android/CHIPTool/app/build/outputs/apk/debug/app-debug.apk + ``` 6. Navigate to settings on your smartphone and grant _Camera_ and _Location_ permissions to CHIPTool. @@ -371,7 +422,9 @@ CHIPTool is now ready to be used for commissioning. 5. In case you ever want to reset these parameters issue this command from the border router shell: - $ sudo ot-ctl factoryreset + ``` + sudo ot-ctl factoryreset + ``` 6. Info: For debugging the Border Router, _ot-ctl_ offers an entry point to [Thread CLI Commands](https://github.com/openthread/openthread/blob/master/src/cli/README.md). @@ -379,11 +432,15 @@ CHIPTool is now ready to be used for commissioning. 7. In case there is any issue with the Web GUI check the logs on the Border Router side / restart the daemon: - $ sudo service otbr-web status + ``` + sudo service otbr-web status + ``` In case the status is not _leader_ then restart the service: - $ sudo service otbr-web restart + ``` + sudo service otbr-web restart + ``` ## Preparing accessory device @@ -402,8 +459,10 @@ To prepare the accessory device for commissioning, complete the following steps: the device. 4. Find a message similar to the following one in the application logs: + ``` I: 666[SVR] Copy/paste the below URL in a browser to see the QR Code: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=CH%3AI34DV%2A-00%200C9SS0 + ``` 5. Open the URL in a web browser to have the commissioning QR code generated. diff --git a/docs/guides/openthread_rcp_nrf_dongle.md b/docs/guides/openthread_rcp_nrf_dongle.md index f772529cd238cf..4f682f139897ef 100644 --- a/docs/guides/openthread_rcp_nrf_dongle.md +++ b/docs/guides/openthread_rcp_nrf_dongle.md @@ -18,15 +18,21 @@ nRF52840 Dongle: 1. Clone the OpenThread nRF528xx platform repository into the current directory: - $ git clone --recursive https://github.com/openthread/ot-nrf528xx.git + ``` + git clone --recursive https://github.com/openthread/ot-nrf528xx.git + ``` 2. Enter the _ot-nrf528xx_ directory: - $ cd ot-nrf528xx + ``` + cd ot-nrf528xx + ``` 3. Install OpenThread dependencies: - $ ./script/bootstrap + ``` + ./script/bootstrap + ``` 4. Build OpenThread for the nRF52840 Dongle: @@ -36,18 +42,24 @@ nRF52840 Dongle: 5. Convert the RCP image to the `.hex` format: - $ arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex + ``` + arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex + ``` 6. Install [nRF Util](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Util): - $ python3 -m pip install -U nrfutil + ``` + python3 -m pip install -U nrfutil + ``` 7. Generate the RCP firmware package: - $ nrfutil pkg generate --hw-version 52 --sd-req=0x00 \ + ``` + nrfutil pkg generate --hw-version 52 --sd-req=0x00 \ --application build/bin/ot-rcp.hex \ --application-version 1 build/bin/ot-rcp.zip + ``` 8. Connect the nRF52840 Dongle to the USB port. @@ -55,7 +67,9 @@ nRF52840 Dongle: LED on the dongle starts blinking. 10. To install the RCP firmware package onto the dongle, run the following - command, with _/dev/ttyACM0_ replaced with the device node name of your + command, with `/dev/ttyACM0` replaced with the device node name of your nRF52840 Dongle: - $ nrfutil dfu usb-serial -pkg build/bin/ot-rcp.zip -p /dev/ttyACM0 + ``` + nrfutil dfu usb-serial -pkg build/bin/ot-rcp.zip -p /dev/ttyACM0 + ``` diff --git a/docs/guides/silabs_efr32_software_update.md b/docs/guides/silabs_efr32_software_update.md index 29660f133f6708..53f46d1220208c 100644 --- a/docs/guides/silabs_efr32_software_update.md +++ b/docs/guides/silabs_efr32_software_update.md @@ -14,15 +14,23 @@ all of the EFR32 example applications. - On a Linux or Darwin platform build the chip-tool and the ota-provider-app as follows: + ``` scripts/examples/gn_build_example.sh examples/chip-tool out/ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false + ``` - Build or download the Gecko Bootloader binary. Bootloader should be built - with the Gecko SDK version 3.2.1 or earlier, type "external SPI" configured - with a single slot of at least 1000 KB. Pre-built binaries should be + with the Gecko SDK version 3.2.1 or earlier. For the bootloader using the + external flash select the "external SPI" bootloader type configured with a + single slot of at least 1000 KB. For the bootloader using the internal flash + (supported on MG24 boards only) select the "internal storage" bootloader + type. Follow the instructions in "UG266: Silicon Labs Gecko Bootloader + User’s Guide". Pre-built binaries for some configurations should be available in + ``` third_party/efr32_sdk/repo/platform/bootloader/sample-apps/bootloader-storage-spiflash-single + ``` - Using the commander tool upload the bootloader to the device running the application. @@ -30,35 +38,47 @@ all of the EFR32 example applications. - Create a bootable image file (using the Lighting application image as an example): + ``` commander gbl create chip-efr32-lighting-example.gbl --app chip-efr32-lighting-example.s37 + ``` - Create the Matter OTA file from the bootable image file: + ``` ./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 1 -vs "1.0" -da sha256 chip-efr32-lighting-example.gbl chip-efr32-lighting-example.ota + ``` - In a terminal start the Provider app passing to it the path to the Matter OTA file created in the previous step: + ``` rm -r /tmp/chip_* ./out/debug/chip-ota-provider-app -f chip-efr32-lighting-example.ota + ``` - In a separate terminal run the chip-tool commands to provision the Provider: - ./out/chip-tool pairing onnetwork 1 20202021 - ./out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 + ``` + ./out/chip-tool pairing onnetwork 1 20202021 + ./out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 + ``` - If the application device had been previously commissioned hold Button 0 for six seconds to factory-reset the device. - In the chip-tool terminal enter: - ./out/chip-tool pairing ble-thread 2 hex: 20202021 3840 + ``` + ./out/chip-tool pairing ble-thread 2 hex: 20202021 3840 + ``` where operationalDataset is obtained from the OpenThread Border Router. - Once the commissioning process completes enter: - ./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 + ``` + ./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 + ``` - The application device will connect to the Provider and start the image download. Once the image is downloaded the device will reboot into the diff --git a/docs/guides/ti_platform_overview.md b/docs/guides/ti_platform_overview.md index 37a8e065232810..50d96f361963ee 100644 --- a/docs/guides/ti_platform_overview.md +++ b/docs/guides/ti_platform_overview.md @@ -6,9 +6,7 @@ Incorporated SimpleLink SDK. The following diagram is a simplified representation of a Matter application which built on the TI Platform. -

- matter_ti_overview_simplified -

+![matter_ti_overview_simplified](images/matter_ti_overview_simplified.png) ## Texas Instruments SimpleLink SDK 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 05f4d076176097..11b4eca86aa54f 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 @@ -46,7 +46,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute int16u clusterRevision = 65533; } @@ -101,9 +104,9 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster ApplicationBasic = 1293 { @@ -185,6 +188,11 @@ server cluster BarrierControl = 259 { } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -204,8 +212,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -215,9 +223,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -456,17 +465,17 @@ server cluster ColorControl = 768 { readonly attribute int16u primary6X = 40; readonly attribute int16u primary6Y = 41; readonly attribute int8u primary6Intensity = 42; - attribute int16u whitePointX = 48; - attribute int16u whitePointY = 49; - attribute int16u colorPointRX = 50; - attribute int16u colorPointRY = 51; - attribute int8u colorPointRIntensity = 52; - attribute int16u colorPointGX = 54; - attribute int16u colorPointGY = 55; - attribute int8u colorPointGIntensity = 56; - attribute int16u colorPointBX = 58; - attribute int16u colorPointBY = 59; - attribute int8u colorPointBIntensity = 60; + attribute access(write: manage) int16u whitePointX = 48; + attribute access(write: manage) int16u whitePointY = 49; + attribute access(write: manage) int16u colorPointRX = 50; + attribute access(write: manage) int16u colorPointRY = 51; + attribute access(write: manage) int8u colorPointRIntensity = 52; + attribute access(write: manage) int16u colorPointGX = 54; + attribute access(write: manage) int16u colorPointGY = 55; + attribute access(write: manage) int8u colorPointGIntensity = 56; + attribute access(write: manage) int16u colorPointBX = 58; + attribute access(write: manage) int16u colorPointBY = 59; + attribute access(write: manage) int8u colorPointBIntensity = 60; readonly attribute int16u enhancedCurrentHue = 16384; readonly attribute enum8 enhancedColorMode = 16385; readonly attribute int8u colorLoopActive = 16386; @@ -478,7 +487,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMin = 16395; readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1156,9 +1165,9 @@ server cluster DoorLock = 257 { readonly attribute DlLockType lockType = 1; readonly attribute boolean actuatorEnabled = 2; readonly attribute nullable DlDoorState doorState = 3; - attribute int32u doorOpenEvents = 4; - attribute int32u doorClosedEvents = 5; - attribute int16u openPeriod = 6; + attribute access(write: manage) int32u doorOpenEvents = 4; + attribute access(write: manage) int32u doorClosedEvents = 5; + attribute access(write: manage) int16u openPeriod = 6; readonly attribute int16u numberOfTotalUsersSupported = 17; readonly attribute int16u numberOfPINUsersSupported = 18; readonly attribute int16u numberOfRFIDUsersSupported = 19; @@ -1170,18 +1179,18 @@ server cluster DoorLock = 257 { readonly attribute int8u maxRFIDCodeLength = 25; readonly attribute int8u minRFIDCodeLength = 26; readonly attribute DlCredentialRuleMask credentialRulesSupport = 27; - attribute char_string<3> language = 33; - attribute int32u autoRelockTime = 35; - attribute int8u soundVolume = 36; - attribute DlOperatingMode operatingMode = 37; + attribute access(write: manage) char_string<3> language = 33; + attribute access(write: manage) int32u autoRelockTime = 35; + attribute access(write: manage) int8u soundVolume = 36; + attribute access(write: manage) DlOperatingMode operatingMode = 37; readonly attribute DlSupportedOperatingModes supportedOperatingModes = 38; readonly attribute DlDefaultConfigurationRegister defaultConfigurationRegister = 39; - attribute boolean enableOneTouchLocking = 41; - attribute boolean enableInsideStatusLED = 42; - attribute boolean enablePrivacyModeButton = 43; - attribute int8u wrongCodeEntryLimit = 48; - attribute int8u userCodeTemporaryDisableTime = 49; - attribute boolean requirePINforRemoteOperation = 51; + attribute access(write: manage) boolean enableOneTouchLocking = 41; + attribute access(write: manage) boolean enableInsideStatusLED = 42; + attribute access(write: manage) boolean enablePrivacyModeButton = 43; + attribute access(write: administer) int8u wrongCodeEntryLimit = 48; + attribute access(write: administer) int8u userCodeTemporaryDisableTime = 49; + attribute access(write: administer) boolean requirePINforRemoteOperation = 51; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1255,12 +1264,12 @@ server cluster DoorLock = 257 { timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1; - timed command SetUser(SetUserRequest): DefaultSuccess = 26; - command GetUser(GetUserRequest): GetUserResponse = 27; - timed command ClearUser(ClearUserRequest): DefaultSuccess = 29; - timed command SetCredential(SetCredentialRequest): SetCredentialResponse = 34; - command GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; - timed command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; + timed command access(invoke: administer) SetUser(SetUserRequest): DefaultSuccess = 26; + command access(invoke: administer) GetUser(GetUserRequest): GetUserResponse = 27; + timed command access(invoke: administer) ClearUser(ClearUserRequest): DefaultSuccess = 29; + timed command access(invoke: administer) SetCredential(SetCredentialRequest): SetCredentialResponse = 34; + command access(invoke: administer) GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; + timed command access(invoke: administer) ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; } server cluster ElectricalMeasurement = 2820 { @@ -1308,8 +1317,59 @@ server cluster EthernetNetworkDiagnostics = 55 { } server cluster FanControl = 514 { + enum FanMode : ENUM8 { + kOff = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kOn = 4; + kAuto = 5; + kSmart = 6; + } + + enum FanModeSequence : ENUM8 { + kOffLowMedHigh = 0; + kOffLowHigh = 1; + kOffLowMedHighAuto = 2; + kOffLowHighAuto = 3; + kOffOnAuto = 4; + kOffOn = 5; + } + + bitmap FanControlFeature : BITMAP32 { + kMultiSpeed = 0x1; + kAuto = 0x2; + kRocking = 0x4; + kWind = 0x8; + } + + bitmap RockSupportMask : BITMAP8 { + kRockLeftRight = 0x1; + kRockUpDown = 0x2; + kRockRound = 0x4; + } + + bitmap WindSettingMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + + bitmap WindSupportMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + attribute enum8 fanMode = 0; attribute enum8 fanModeSequence = 1; + attribute int8u percentSetting = 2; + readonly attribute int8u percentCurrent = 3; + readonly attribute int8u speedMax = 4; + attribute int8u speedSetting = 5; + readonly attribute int8u speedCurrent = 6; + readonly attribute bitmap8 rockSupport = 7; + attribute bitmap8 rockSetting = 8; + readonly attribute bitmap8 windSupport = 9; + attribute bitmap8 windSetting = 10; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -1346,7 +1406,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -1380,9 +1440,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -1506,7 +1566,7 @@ server cluster GroupKeyManagement = 63 { nullable epoch_us epochStartTime2 = 7; } - attribute GroupKeyMapStruct groupKeyMap[] = 0; + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; readonly attribute GroupInfoMapStruct groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; @@ -1536,10 +1596,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster Groups = 4 { @@ -1589,12 +1649,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command AddGroup(AddGroupRequest): AddGroupResponse = 0; + command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command RemoveAllGroups(): DefaultSuccess = 4; - command AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster IasZone = 1280 { @@ -1704,9 +1764,9 @@ server cluster Identify = 3 { INT16U timeout = 0; } - command Identify(IdentifyRequest): DefaultSuccess = 0; - command IdentifyQuery(): IdentifyQueryResponse = 1; - command TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) IdentifyQuery(): IdentifyQueryResponse = 1; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } server cluster IlluminanceMeasurement = 1024 { @@ -1858,7 +1918,7 @@ server cluster LevelControl = 8 { attribute nullable int16u onTransitionTime = 18; attribute nullable int16u offTransitionTime = 19; attribute nullable int8u defaultMoveRate = 20; - attribute nullable int8u startUpCurrentLevel = 16384; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -2079,14 +2139,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -2141,12 +2201,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } client cluster OtaSoftwareUpdateProvider = 41 { @@ -2313,7 +2373,7 @@ server cluster OnOff = 6 { readonly attribute boolean globalSceneControl = 16384; attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; - attribute nullable OnOffStartUpOnOff startUpOnOff = 16387; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -2371,7 +2431,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -2440,15 +2500,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } server cluster PowerSource = 47 { @@ -2757,11 +2817,11 @@ server cluster Scenes = 5 { INT8U sceneList[] = 4; } - command AddScene(AddSceneRequest): AddSceneResponse = 0; + command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; command RecallScene(RecallSceneRequest): DefaultSuccess = 5; command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } @@ -3227,13 +3287,13 @@ server cluster Thermostat = 513 { readonly attribute int16s absMaxCoolSetpointLimit = 6; attribute int16s occupiedCoolingSetpoint = 17; attribute int16s occupiedHeatingSetpoint = 18; - attribute int16s minHeatSetpointLimit = 21; - attribute int16s maxHeatSetpointLimit = 22; - attribute int16s minCoolSetpointLimit = 23; - attribute int16s maxCoolSetpointLimit = 24; - attribute int8s minSetpointDeadBand = 25; - attribute ThermostatControlSequence controlSequenceOfOperation = 27; - attribute enum8 systemMode = 28; + attribute access(write: manage) int16s minHeatSetpointLimit = 21; + attribute access(write: manage) int16s maxHeatSetpointLimit = 22; + attribute access(write: manage) int16s minCoolSetpointLimit = 23; + attribute access(write: manage) int16s maxCoolSetpointLimit = 24; + attribute access(write: manage) int8s minSetpointDeadBand = 25; + attribute access(write: manage) ThermostatControlSequence controlSequenceOfOperation = 27; + attribute access(write: manage) enum8 systemMode = 28; readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; @@ -3243,8 +3303,8 @@ server cluster Thermostat = 513 { server cluster ThermostatUserInterfaceConfiguration = 516 { attribute enum8 temperatureDisplayMode = 0; - attribute enum8 keypadLockout = 1; - attribute enum8 scheduleProgrammingVisibility = 2; + attribute access(write: manage) enum8 keypadLockout = 1; + attribute access(write: manage) enum8 scheduleProgrammingVisibility = 2; readonly attribute int16u clusterRevision = 65533; } @@ -3445,7 +3505,7 @@ server cluster UnitLocalization = 45 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } @@ -3622,7 +3682,7 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitLift = 17; readonly attribute int16u installedOpenLimitTilt = 18; readonly attribute int16u installedClosedLimitTilt = 19; - attribute bitmap8 mode = 23; + attribute access(write: manage) bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 85119254e0922b..b97fd74762a3ed 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 @@ -219,7 +219,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -293,7 +293,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -376,7 +376,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -526,7 +526,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -577,7 +577,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -618,7 +618,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -776,7 +776,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -862,7 +862,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -888,7 +888,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -929,7 +929,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -986,6 +986,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1323,6 +1368,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1383,7 +1443,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1456,7 +1516,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1922,7 +1982,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2063,7 +2123,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2138,7 +2198,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2339,7 +2399,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2384,7 +2444,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2530,7 +2590,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2565,7 +2625,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2666,7 +2726,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3671,7 +3731,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3706,7 +3766,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3942,7 +4002,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3977,7 +4037,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4153,7 +4213,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4179,7 +4239,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4250,7 +4310,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4301,7 +4361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4372,7 +4432,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4471,7 +4531,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4620,7 +4680,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4679,7 +4739,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4782,7 +4842,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4927,7 +4987,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5358,7 +5418,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5401,7 +5461,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5487,7 +5547,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5626,7 +5686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6402,7 +6462,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6428,7 +6488,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6529,7 +6589,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6555,7 +6615,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6641,7 +6701,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6779,7 +6839,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6850,7 +6910,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7054,7 +7114,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7374,7 +7434,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7573,7 +7633,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7647,7 +7707,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7730,7 +7790,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7880,7 +7940,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7955,7 +8015,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8495,7 +8555,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "50", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8611,7 +8671,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8682,7 +8742,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8708,7 +8768,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8794,7 +8854,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8820,7 +8880,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8861,7 +8921,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9346,6 +9406,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9398,7 +9473,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9433,7 +9508,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9459,7 +9534,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9485,7 +9560,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9730,7 +9805,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9818,7 +9893,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9893,7 +9968,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10079,7 +10154,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10105,7 +10180,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10191,7 +10266,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10217,7 +10292,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10273,7 +10348,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10299,7 +10374,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10340,7 +10415,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10760,7 +10835,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -11501,7 +11576,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -11938,7 +12013,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12024,7 +12099,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12050,7 +12125,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12451,7 +12526,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12518,7 +12593,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12876,7 +12951,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12912,7 +12987,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x05", + "defaultValue": "0x00", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12933,6 +13008,141 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "percent setting", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "percent current", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed max", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed setting", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed current", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock support", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock setting", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind support", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind setting", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -13002,7 +13212,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13028,7 +13238,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -13099,7 +13309,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -13278,7 +13488,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14125,7 +14335,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14226,7 +14436,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14252,7 +14462,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14338,7 +14548,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14364,7 +14574,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14480,7 +14690,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14506,7 +14716,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14592,7 +14802,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14730,7 +14940,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14801,7 +15011,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14980,7 +15190,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15081,7 +15291,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15124,7 +15334,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15225,7 +15435,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15260,7 +15470,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15346,7 +15556,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15453,7 +15663,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15614,7 +15824,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15673,7 +15883,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15759,7 +15969,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15794,7 +16004,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15820,7 +16030,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15855,7 +16065,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15881,7 +16091,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15924,7 +16134,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15980,7 +16190,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16023,7 +16233,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16079,7 +16289,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16114,7 +16324,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16170,7 +16380,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16196,7 +16406,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16327,7 +16537,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16362,7 +16572,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16388,7 +16598,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -16559,7 +16769,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -17895,7 +18105,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -18288,7 +18498,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -18362,7 +18572,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -18445,7 +18655,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -18595,7 +18805,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -18646,7 +18856,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19334,6 +19544,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -19386,7 +19611,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19817,7 +20042,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19860,7 +20085,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19946,7 +20171,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -20085,7 +20310,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -20861,7 +21086,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -20887,7 +21112,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -20973,7 +21198,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -20999,7 +21224,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -21070,7 +21295,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index 0b333950067ca7..3c51bc43cabda9 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -26,19 +26,27 @@ The CHIP demo application is supported on - Pull docker image: + ``` $ docker pull connectedhomeip/chip-build-ameba:latest + ``` - Run docker container: + ``` $ docker run -it -v ${CHIP_DIR}:/root/chip connectedhomeip/chip-build-ameba:latest + ``` - Setup build environment: + ``` $ source ./scripts/bootstrap.sh + ``` - To build the demo application: + ``` $ ./scripts/build/build_examples.py --target ameba-amebad-all-clusters build + ``` The output image files are stored in `out/ameba-amebad-all-clusters/asdk/image` folder. @@ -67,7 +75,7 @@ There are two commissioning modes supported by Ameba platform: - Set `chip_config_network_layer_ble = true` -2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h" +2. In `connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h` - Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1` @@ -79,11 +87,11 @@ There are two commissioning modes supported by Ameba platform: ### IP mode -1. In "connectedhomeip/config/ameba/args.gni" +1. In `connectedhomeip/config/ameba/args.gni` - Set `chip_config_network_layer_ble = false` -2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h" +2. In `connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h` - Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0` @@ -103,17 +111,21 @@ to be On or Off. - Via [Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool#using-the-client-to-send-matter-commands) + ``` $ ./chip-tool onoff on ${NODE_ID_TO_ASSIGN} 1 $ ./chip-tool onoff off ${NODE_ID_TO_ASSIGN} 1 + ``` ## Running RPC Console - Connect a USB-TTL Adapter as shown below + ``` Ameba USB-TTL A19 TX A18 RX GND GND + ``` - Build the [chip-rpc console](https://github.com/project-chip/connectedhomeip/tree/master/examples/common/pigweed/rpc_console) @@ -123,13 +135,19 @@ to be On or Off. also created in the output folder: out/debug/chip_rpc_console_wheels. To install the wheel files without rebuilding: + ``` $ pip3 install out/debug/chip_rpc_console_wheels/*.whl + ``` - Launch the chip-rpc console after resetting Ameba board + ``` $ chip-console --device /dev/tty -b 115200 + ``` - Get and Set lighting directly using the RPC console + ```python rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + ``` diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/.gn @@ -0,0 +1,28 @@ +# 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") +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn new file mode 100644 index 00000000000000..7a74881a44d55d --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn @@ -0,0 +1,127 @@ +# 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") +import("//build_overrides/chip.gni") +import("//build_overrides/openthread.gni") +import("//build_overrides/ti_simplelink_sdk.gni") + +import("${build_root}/config/defaults.gni") + +import("${chip_root}/src/platform/device.gni") + +import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") +import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") + +assert(current_os == "freertos") + +project_dir = "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7" + +ti_simplelink_sdk("sdk") { + include_dirs = [ "${project_dir}/main/include" ] + + defines = [] + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } +} + +ti_sysconfig("sysconfig") { + sources = [ "${project_dir}/chip.syscfg" ] + + outputs = [ + "ti_radio_config.c", + "ti_radio_config.h", + "ti_drivers_config.c", + "ti_drivers_config.h", + "ti_ble_config.c", + "ti_ble_config.h", + "ti_dmm_application_policy.c", + "ti_dmm_application_policy.h", + + # disabled until upstream generation is aligned + #"tiop_config.h", + #"tiop_config.c", + + # not traditional source files + #"ti_utils_build_linker.cmd.genlibs", + #"syscfg_c.rov.xs", + #"ti_utils_runtime_model.gv", + #"ti_utils_runtime_Makefile", + #"ti_ble_app_config.opt", + #"ti_build_config.opt", + ] + + public_configs = [ ":sdk_dmm_config" ] + + cflags = [ + "-Wno-comment", + "@" + rebase_path("${target_gen_dir}/sysconfig/ti_ble_app_config.opt", + root_build_dir), + "@" + rebase_path("${target_gen_dir}/sysconfig/ti_build_config.opt", + root_build_dir), + ] +} + +ti_simplelink_executable("all-clusters-app") { + output_name = "chip-${ti_simplelink_board}-all-clusters-example.out" + + sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", + "${project_dir}/main/AppTask.cpp", + "${project_dir}/main/ClusterManager.cpp", + "${project_dir}/main/Globals.cpp", + "${project_dir}/main/ZclCallbacks.cpp", + "${project_dir}/main/main.cpp", + ] + + deps = [ + ":sdk", + ":sysconfig", + "${chip_root}/examples/all-clusters-app/all-clusters-common", + "${chip_root}/src/lib", + ] + + if (chip_openthread_ftd) { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } + + include_dirs = [ + "${project_dir}", + "${project_dir}/main", + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + ] + + cflags = [ + "-Wno-implicit-fallthrough", + "-Wno-sign-compare", + "-Wconversion", + ] + + output_dir = root_out_dir +} + +group("cc13x2x7_26x2x7") { + deps = [ ":all-clusters-app" ] +} + +group("default") { + deps = [ ":cc13x2x7_26x2x7" ] +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/README.md b/examples/all-clusters-app/cc13x2x7_26x2x7/README.md new file mode 100644 index 00000000000000..fd2d0ee9c07cbb --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/README.md @@ -0,0 +1,245 @@ +# Matter CC1352 CC2652 All-clusters Example Application + +An example application showing the use of [Matter][matter] on the Texas +Instruments CC13XX_26XX family of Wireless MCUs. + +--- + +- [Matter CC1352 CC2652 All Clusters Example Application](#matter-cc1352-cc2652-all-clusters-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Preparation](#preparation) + - [Compilation](#compilation) + - [Programming](#programming) + - [Code Composer Studio](#code-composer-studio) + - [UniFlash](#uniflash) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Example](#running-the-example) + - [Provisioning](#provisioning) + - [Bluetooth LE Advertising](#bluetooth-le-advertising) + - [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous) + - [Matter Remote Commands](#matter-remote-commands) + - [TI Support](#ti-support) + +--- + +## Introduction + +![CC1352R1_LAUNCHXL](doc/images/cc1352r1_launchxl.jpg) + +The CC13XX_26XX all clusters example application provides the basis to query and +run commands for all currently implemented Matter clusters. This uses the +open-source Matter implementation and the Texas Instruments SimpleLink™ CC13XX +and CC26XX software development kit. + +This example is enabled to build for CC2652R7 devices. + +The all-clusters example is intended to serve both as a means to explore the +workings of Matter, as well as a template for creating real products based on +the Texas Instruments devices. + +## Device UI + +This example application has a simple User Interface to depict the state of the +various Matter clusters and the attribute changes associated with them. The user +LEDs on the LaunchPad are used for the onoff, levelcontrol and identify clusters +to provide a working demonstration of the cluster attribute changes. The Green +LED is used to represent attribute changes to endpoint 1 while the Red LED is +used to represent changes to endpoint 2. + +Short presses (less than 1000ms) of the user buttons are used currently unused +in the all-clusters application, but stubs are provided. + +Long presses (greater than 1000ms) of the user buttons are used for controlling +BLE advertisements. The left button (`BTN-1`) is used to disable advertisements +if they are enabled. The Right button (`BTN-2`) is used to enable +advertisements. + +## Building + +### Preparation + +Some initial setup is necessary for preparing the build environment. This +section will need to be done when migrating to new versions of the SDK. This +guide assumes that the environment is linux based, and recommends Ubuntu 20.04. + +- Download and install [SysConfig][sysconfig] ([recommended + version][sysconfig_recommended]). This can be done simply with the following + commands. + + ``` + $ cd ~ + $ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run + $ chmod +x sysconfig-1.11.0_2225-setup.run + $ ./sysconfig-1.11.0_2225-setup.run + ``` + +- Run the bootstrap script to setup the build environment. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/bootstrap.sh + + ``` + +### Compilation + +It is necessary to activate the environment in every new shell. Then run GN and +Ninja to build the executable. + +- Activate the build environment with the repository activate script. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/activate.sh + + ``` + +- Run the build to produce a default executable. By default on Linux both the + TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's + home directory, and you must provide the absolute path to them. For example + `/home/username/ti/sysconfig_1.11.0`. On Windows the default directory is + `C:\ti`. Take note of this install path, as it will be used in the next + step. + + ``` + $ cd ~/connectedhomeip/examples/all-clusters-app/cc13x2x7_26x2x7 + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.11.0\"" + $ ninja -C out/debug + + ``` + +## Programming + +Loading the built image onto a LaunchPad is supported through two methods; +Uniflash and Code Composer Studio (CCS). UniFlash can be used to load the image. +Code Composer Studio can be used to load the image and debug the source code. + +### Code Composer Studio + +Programming with CCS will allow for a full debug environment within the IDE. +This is accomplished by creating a target connection to the XDS110 debugger and +starting a project-less debug session. The CCS IDE will attempt to find the +source files on the local machine based on the debug information embedded within +the ELF. CCS may prompt you to find the source code if the image was built on +another machine or the source code is located in a different location than is +recorded within the ELF. + +Download and install [Code Composer Studio][ccs]. + +First open CCS and create a new workspace. + +Create a target connection (sometimes called the CCXML) for your target SoC and +debugger as described in the [Manual Method][ccs_manual_method] section of the +CCS User's Guide. + +Next initiate a project-less debug session as described in the [Manual +Launch][ccs_manual_launch] section of the CCS User's Guide. + +CCS should switch to the debug view described in the [After +Launch][ccs_after_launch] section of the User's Guide. The SoC core will likely +be disconnected and symbols will not be loaded. Connect to the core as described +in the [Debug View][ccs_debug_view] section of the User's Guide. Once the core +is connected, use the `Load` button on the toolbar to load the ELF image. + +Note that the default configuration of the CCXML uses 2-wire cJTAG instead of +the full 4-wire JTAG connection to match the default jumper configuration of the +LaunchPad. + +### UniFlash + +Uniflash is Texas Instrument's uniform programming tool for embedded processors. +This will allow you to erase, flash, and inspect the SoC without setting up a +debugging environment. + +Download and install [UniFlash][uniflash]. + +First open UniFlash. Debug probes connected to the computer will usually be +displayed under the Detected Devices due to the automatic device detection +feature. If your device does not show up in this view it my be disconnected, or +you may have to create a New Configuration. If you already have a CCXML for your +SoC and debug connection you can use that in the section at the bottom. Once +your device is selected, click the `Start` button within the section to launch +the session. + +Select the ELF image to load on the device with the `Browse` button. This file +is placed in the `out/debug` folder by this guide and ends with the `*.out` file +extension. + +Finally click the `Load Image` button to load the executable image onto the +device. You should be able to see the log output over the XDS110 User UART. + +Note that programming the device through JTAG sets the Halt-in-Boot flag and may +cause issues when performing a software reset. This flag can be reset by +power-cycling the LaunchPad. + +## Viewing Logging Output + +By default the log output will be sent to the Application/User UART. Open a +terminal emulator to that port to see the output with the following options: + +| Parameter | Value | +| ------------ | -------- | +| Speed (baud) | `115200` | +| Data bits | `8` | +| Stop bits | `1` | +| Parity | `None` | +| Flow control | `None` | + +## Running the Example + +Once a device has been flashed with this example, it can now join and operate in +an existing Thread network. The following sections assume that a Thread network +is already active, and has at least one [OpenThread Border +Router][ot_border_router_setup]. + +For insight into what other components are needed to run this example, please +refer to our [Matter Getting Started Guide][matter-e2e-faq]. + +### Provisioning + +Interacting with the application begins by enabling BLE advertisements and then +pairing the device into a Thread network. + +#### Bluetooth LE Advertising + +To provision this example onto a Thread network, the device must be discoverable +over Bluetooth LE. BLE advertising is started by long pressing the right button +(greater than 1000ms), labeled `BTN-2` on the silkscreen. Once the device is +fully provisioned, BLE advertising will stop. + +#### Bluetooth LE Rendezvous + +Pairing this application with `ble-thread` can be done with any of the enabled +[CHIP Controller](../../../src/controller/README.md) applications. Use the +information printed on the console to aide in pairing the device. The controller +application can also be used to control the example app with the cluster +commands. + +## TI Support + +For technical support, please consider creating a post on TI's [E2E forum][e2e]. +Additionally, we welcome any feedback. + +[matter]: https://github.com/project-chip/connectedhomeip +[ccs]: https://www.ti.com/tool/CCSTUDIO +[ccs_after_launch]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#after-launch +[ccs_debug_view]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#debug-view +[ccs_manual_launch]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-launch +[ccs_manual_method]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-method +[cc1352r1_launchxl]: https://www.ti.com/tool/LAUNCHXL-CC1352R1 +[e2e]: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread +[matter-e2e-faq]: + https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1082428/faq-cc2652r7-matter----getting-started-guide +[sysconfig]: https://www.ti.com/tool/SYSCONFIG +[sysconfig_recommended]: + https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run +[ti_thread_dnd]: + https://www.ti.com/wireless-connectivity/thread/design-development.html +[ot_border_router_setup]: https://openthread.io/guides/border-router/build +[uniflash]: https://www.ti.com/tool/download/UNIFLASH diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni new file mode 100644 index 00000000000000..3e93cef8d30ef7 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni @@ -0,0 +1,46 @@ +# 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}/examples/platform/cc13x2_26x2/args.gni") + +ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain") +ti_simplelink_sysconfig_target = + get_label_info(":sysconfig", "label_no_toolchain") + +ti_simplelink_board = "LP_CC2652R7" + +# Size Optimizations +# use -Os instead of -Og, LWIP release build +is_debug = false + +#optimize_for_size=true +chip_enable_ota_requestor = true + +# Disable FTD Build for all-clusters app to save Flash +chip_openthread_ftd = false + +# Disable CHIP Logging +#chip_progress_logging = false + +# Dsiable verbose logs for all-clusters app to save Flash +chip_detail_logging = false +chip_automation_logging = false + +# BLE options +chip_config_network_layer_ble = true + +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/build_overrides b/examples/all-clusters-app/cc13x2x7_26x2x7/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/chip.syscfg b/examples/all-clusters-app/cc13x2x7_26x2x7/chip.syscfg new file mode 100644 index 00000000000000..c1419eaf6d22bb --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/chip.syscfg @@ -0,0 +1,195 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * 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. + */ + + +/* Modules */ +var AESCCM = scripting.addModule("/ti/drivers/AESCCM"); +var AESECB = scripting.addModule("/ti/drivers/AESECB"); +var Button = scripting.addModule("/ti/drivers/apps/Button"); +var LED = scripting.addModule("/ti/drivers/apps/LED"); +var NVS = scripting.addModule("/ti/drivers/NVS"); +var RF = scripting.addModule("/ti/drivers/RF"); +var RFDesign = scripting.addModule("ti/devices/radioconfig/rfdesign"); +var RTOS = scripting.addModule("/ti/drivers/RTOS"); +var TRNG = scripting.addModule("/ti/drivers/TRNG"); +var Thread = scripting.addModule("/ti/thread/thread"); +var SHA2 = scripting.addModule("/ti/drivers/SHA2"); +var UART = scripting.addModule("/ti/drivers/UART"); +var ble = scripting.addModule("/ti/ble5stack/ble"); +var dmm = scripting.addModule("/ti/dmm/dmm"); +var AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); +var ECDH = scripting.addModule("/ti/drivers/ECDH"); + +/* Instances */ +var AESCCM1 = AESCCM.addInstance(); +var AESECB1 = AESECB.addInstance(); +var AESECB2 = AESECB.addInstance(); +var Button1 = Button.addInstance(); +var Button2 = Button.addInstance(); +var NVS1 = NVS.addInstance(); +var NVS2 = NVS.addInstance(); +var SHA21 = SHA2.addInstance(); +var LED1 = LED.addInstance(); +var LED2 = LED.addInstance(); +var TRNG1 = TRNG.addInstance(); +var TRNG2 = TRNG.addInstance(); +var TRNG3 = TRNG.addInstance(); +var UART1 = UART.addInstance(); +var AESCTRDRBG1 = AESCTRDRBG.addInstance(); +var ECDH1 = ECDH.addInstance(); + +AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; +AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0"; + +AESCCM1.$name = "CONFIG_AESCCM0"; + +AESECB1.$name = "CONFIG_AESECB0"; +AESECB2.$name = "CONFIG_AESECB_1"; + +ECDH1.$name = "CONFIG_ECDH0"; + +/* RTOS */ +RTOS.name = "FreeRTOS"; + +/* Left Button */ +Button1.$name = "CONFIG_BTN_LEFT"; +Button1.$hardware = system.deviceData.board.components["BTN-1"]; +Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; +Button1.gpioPin.pull = "Pull Up"; +Button1.gpioPin.interruptTrigger = "Falling Edge"; + +/* Left Button */ +Button2.$name = "CONFIG_BTN_RIGHT"; +Button2.$hardware = system.deviceData.board.components["BTN-2"]; +Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; +Button2.gpioPin.pull = "Pull Up"; +Button2.gpioPin.interruptTrigger = "Falling Edge"; + +/* ======== CCFG ======== */ +var CCFG = scripting.addModule("/ti/devices/CCFG"); +const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings; +for(var setting in ccfgSettings) +{ + CCFG[setting] = ccfgSettings[setting]; +} + +// Disable CCFG generation, this is added by the BIM project +CCFG.enableCodeGeneration = false; + +/* NVS */ +NVS1.$name = "CONFIG_NVSINTERNAL"; + +NVS1.internalFlash.regionBase = 0xAA000; +NVS1.internalFlash.regionSize = 0x4000; + +NVS2.$name = "CONFIG_NVSEXTERNAL"; +NVS2.nvsType = "External"; // NVS Region Type +NVS2.$hardware = system.deviceData.board.components.MX25R8035F; + +/* RF */ +/* if an antenna component exists, assign it to the rf instance */ +if (system.deviceData.board && system.deviceData.board.components.RF) { + RF.$hardware = system.deviceData.board.components.RF; +} + +const rfDesignSettings = system.getScript("/ti/common/lprf_rf_design_settings.js").rfDesignSettings; +for(var setting in rfDesignSettings) +{ + RFDesign[setting] = rfDesignSettings[setting]; +} + +/* Red LED */ +LED1.$name = "CONFIG_LED_RED"; +LED1.$hardware = system.deviceData.board.components.LED_RED; +LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; +LED1.gpioPin.mode = "Output"; +LED1.gpioPin.callbackFunction = ""; + +/* Green LED */ +LED2.$name = "CONFIG_LED_GREEN"; +LED2.$hardware = system.deviceData.board.components.LED_GREEN; +LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; +LED2.gpioPin.mode = "Output"; +LED2.gpioPin.callbackFunction = ""; + +/* Debug UART */ +UART1.$hardware = system.deviceData.board.components.XDS110UART; +UART1.$name = "CONFIG_UART_DEBUG"; + +/* TRNG */ +TRNG1.$name = "CONFIG_TRNG_0"; +TRNG2.$name = "CONFIG_TRNG_1"; +TRNG3.$name = "CONFIG_TRNG_APP"; + +RTOS.name = "FreeRTOS"; + +/* BLE */ +ble.addressMode = "ADDRMODE_RP_WITH_PUBLIC_ID"; +ble.maxConnNum = 1; +ble.numOfAdvSets = 1; +ble.lockProject = true; +ble.oneLibSizeOpt = true; +ble.maxPDUSize = 255; +ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; +ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; +ble.connUpdateParamsPeripheral.reqMinConnInt = 30; +ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; + +ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; +ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; +ble.advSet1.advParam1.primIntMin = 100; +ble.advSet1.advParam1.primIntMax = 200; + +/* DMM */ +dmm.project = "ti_thread_thermostat_remote_display"; +dmm.stackRoles = ["blePeripheral","threadFTD"]; +dmm.lockStackRoles = true; +dmm.numApplicationStates = 10; +dmm.applicationState0 = "ANY"; +dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; +dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; +dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; +dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; +dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; +dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; +dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; +dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; +dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; +dmm.policyArray.create(4); +dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; +dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; +dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; +dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; +dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; +dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; +dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; +dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; +dmm.policyArray[1].blePeripheral.weight = 25; +dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; +dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; +dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; +dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; +dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; +dmm.policyArray[2].threadFTD.weight = 30; +dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; +dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; +dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; +dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; +dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; +dmm.policyArray[3].threadFTD.weight = 1; diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp new file mode 100644 index 00000000000000..34ea307063019f --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -0,0 +1,387 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * 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 "AppConfig.h" +#include "AppEvent.h" +#include +#include + +#include "FreeRTOS.h" +#include "Globals.h" +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef AUTO_PRINT_METRICS +#include +#endif +#include + +#include +#include + +/* syscfg */ +#include + +#define APP_TASK_STACK_SIZE (5000) +#define APP_TASK_PRIORITY 4 +#define APP_EVENT_QUEUE_SIZE 10 + +using namespace ::chip; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + +static TaskHandle_t sAppTaskHandle; +static QueueHandle_t sAppEventQueue; + +static Button_Handle sAppLeftHandle; +static Button_Handle sAppRightHandle; + +AppTask AppTask::sAppTask; + +static DefaultOTARequestor sRequestorCore; +static DefaultOTARequestorStorage sRequestorStorage; +static DefaultOTARequestorDriver sRequestorUser; +static BDXDownloader sDownloader; +static OTAImageProcessorImpl sImageProcessor; + +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; + +void InitializeOTARequestor(void) +{ + // Initialize and interconnect the Requestor and Image Processor objects + SetRequestorInstance(&sRequestorCore); + + sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage()); + sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader); + sImageProcessor.SetOTADownloader(&sDownloader); + sDownloader.SetImageProcessorDelegate(&sImageProcessor); + sRequestorUser.Init(&sRequestorCore, &sImageProcessor); +} + +#ifdef AUTO_PRINT_METRICS +static void printMetrics(void) +{ + chip::DeviceLayer::ThreadMetrics *threadMetricsOut, *currThread; + uint64_t heapFree, heapUsed; + + DiagnosticDataProviderImpl::GetDefaultInstance().GetCurrentHeapUsed(heapUsed); + DiagnosticDataProviderImpl::GetDefaultInstance().GetCurrentHeapFree(heapFree); + DiagnosticDataProviderImpl::GetDefaultInstance().GetThreadMetrics(&threadMetricsOut); + + PLAT_LOG("Heap Metrics\n Heap Free: %d Heap Used: %d", (uint32_t) heapFree, (uint32_t) heapUsed); + + PLAT_LOG("Thread Metrics\n"); + + currThread = threadMetricsOut; + while (currThread) + { + PLAT_LOG("Task Name: %s ID: %d Stack Free Min: %d", currThread->name, (uint32_t) currThread->id, + (uint32_t) currThread->stackFreeMinimum); + + currThread = currThread->Next; + } + + DiagnosticDataProviderImpl::GetDefaultInstance().ReleaseThreadMetrics(threadMetricsOut); +} +#endif + +void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kSessionEstablished: { + if (event->SessionEstablished.IsCommissioner) + { + PLAT_LOG("Commissioning session established"); + } + } + break; + + case DeviceEventType::kCHIPoBLEConnectionEstablished: + PLAT_LOG("CHIPoBLE connection established"); + break; + + case DeviceEventType::kCHIPoBLEConnectionClosed: + PLAT_LOG("CHIPoBLE disconnected"); + break; + + case DeviceEventType::kCommissioningComplete: + PLAT_LOG("Commissioning complete"); + break; + } + +#ifdef AUTO_PRINT_METRICS + printMetrics(); +#endif +} + +int AppTask::StartAppTask() +{ + int ret = 0; + + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + PLAT_LOG("Failed to allocate app event queue"); + while (1) + ; + } + + // Start App task. + if (xTaskCreate(AppTaskMain, "APP", APP_TASK_STACK_SIZE / sizeof(StackType_t), NULL, APP_TASK_PRIORITY, &sAppTaskHandle) != + pdPASS) + { + PLAT_LOG("Failed to create app task"); + while (1) + ; + } + return ret; +} + +int AppTask::Init() +{ + LED_Params ledParams; + Button_Params buttonParams; + + cc13x2_26x2LogInit(); + + // Initialize LEDs + PLAT_LOG("Initialize LEDs"); + LED_init(); + + LED_Params_init(&ledParams); // default PWM LED + sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams); + LED_setOff(sAppRedHandle); + + LED_Params_init(&ledParams); // default PWM LED + sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams); + LED_setOff(sAppGreenHandle); + + // Initialize buttons + PLAT_LOG("Initialize buttons"); + Button_init(); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams); + Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams); + Button_setCallback(sAppRightHandle, ButtonRightEventHandler); + + // Init Chip memory management before the stack + Platform::MemoryInit(); + + CHIP_ERROR ret = PlatformMgr().InitChipStack(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("PlatformMgr().InitChipStack() failed"); + while (1) + ; + } + + ret = ThreadStackMgr().InitThreadStack(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ThreadStackMgr().InitThreadStack() failed"); + while (1) + ; + } + + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed"); + while (1) + ; + } + + ret = PlatformMgr().StartEventLoopTask(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("PlatformMgr().StartEventLoopTask() failed"); + while (1) + ; + } + + ret = ThreadStackMgrImpl().StartThreadTask(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ThreadStackMgr().StartThreadTask() failed"); + while (1) + ; + } + + // Init ZCL Data Model and start server + PLAT_LOG("Initialize Server"); + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + chip::Server::GetInstance().Init(initParams); + + ConfigurationMgr().LogDeviceConfig(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + + // We only have network commissioning on endpoint 0. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); + + // Register a function to receive events from the CHIP device layer. Note that calls to + // this function will happen on the CHIP event loop thread, not the app_main thread. + PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr)); + + InitializeOTARequestor(); + + // QR code will be used with CHIP Tool + PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE)); + + return 0; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + sAppTask.Init(); + + while (1) + { + /* Task pend until we have stuff to do */ + if (xQueueReceive(sAppEventQueue, &event, portMAX_DELAY) == pdTRUE) + { + sAppTask.DispatchEvent(&event); + } + } +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (xQueueSend(sAppEventQueue, aEvent, 0) != pdPASS) + { + /* Failed to post the message */ + } +} + +void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events) +{ + AppEvent event; + event.Type = AppEvent::kEventType_ButtonLeft; + + if (events & Button_EV_CLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; + } + else if (events & Button_EV_LONGCLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + } + // button callbacks are in ISR context + if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) + { + /* Failed to post the message */ + } +} + +void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask events) +{ + AppEvent event; + event.Type = AppEvent::kEventType_ButtonRight; + + if (events & Button_EV_CLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; + } + else if (events & Button_EV_LONGCLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + } + // button callbacks are in ISR context + if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) + { + /* Failed to post the message */ + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + switch (aEvent->Type) + { + case AppEvent::kEventType_ButtonLeft: + if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) + { + } + else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) + { + // Disable BLE advertisements + if (ConnectivityMgr().IsBLEAdvertisingEnabled()) + { + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + PLAT_LOG("Disabled BLE Advertisements"); + } + } + break; + + case AppEvent::kEventType_ButtonRight: + if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) + { + } + else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) + { + // Enable BLE advertisements + if (!ConnectivityMgr().IsBLEAdvertisingEnabled()) + { + if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) + { + PLAT_LOG("Enabled BLE Advertisement"); + } + else + { + PLAT_LOG("OpenBasicCommissioningWindow() failed"); + } + } + } + break; + + case AppEvent::kEventType_AppEvent: + if (NULL != aEvent->Handler) + { + aEvent->Handler(aEvent); + } + break; + + case AppEvent::kEventType_None: + default: + break; + } +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp new file mode 100644 index 00000000000000..7fd0d0cc6f748b --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp @@ -0,0 +1,138 @@ + +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "ClusterManager.h" +#include "Globals.h" +#include +#include +#include +#include +#include +#include +#include + +#ifdef AUTO_PRINT_METRICS +#include +#endif + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; +using namespace ::chip::app::Clusters; + +constexpr uint32_t kIdentifyTimerDelayMS = 250; +constexpr uint32_t kIdentifyTimerDelayPerSec = 4; +ClusterManager ClusterManager::sCluster; + +#define ENDPOINT_ID_0 (0) +#define ENDPOINT_ID_1 (1) +#define ENDPOINT_ID_2 (2) + +void ClusterManager::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + VerifyOrExit(attributeId == ZCL_ON_OFF_ATTRIBUTE_ID, PLAT_LOG("Unhandled Attribute ID: '0x%04x", attributeId)); + VerifyOrExit(endpointId == ENDPOINT_ID_1 || endpointId == ENDPOINT_ID_2, + PLAT_LOG("Unexpected EndPoint ID: `0x%02x'", endpointId)); + + // At this point we can assume that value points to a bool value. + mEndpointOnOffState[endpointId - 1] = *value; + endpointId == ENDPOINT_ID_1 ? LED_write(sAppGreenHandle, *value) : LED_write(sAppRedHandle, *value); + +exit: + return; +} + +void ClusterManager::OnLevelControlAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + bool onOffState = mEndpointOnOffState[endpointId - 1]; + uint8_t brightness = onOffState ? *value : 0; + + VerifyOrExit(brightness > 0, PLAT_LOG("Brightness set to 0, ignoring")); + VerifyOrExit(attributeId == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, PLAT_LOG("Unhandled Attribute ID: '0x%04x", attributeId)); + VerifyOrExit(endpointId == ENDPOINT_ID_1 || endpointId == ENDPOINT_ID_2, + PLAT_LOG("Unexpected EndPoint ID: `0x%02x'", endpointId)); + + if (brightness > LED_BRIGHTNESS_MAX) + { + brightness = LED_BRIGHTNESS_MAX; + } + + endpointId == ENDPOINT_ID_1 ? LED_setOn(sAppGreenHandle, brightness) : LED_setOn(sAppRedHandle, brightness); + +exit: + return; +} + +void ClusterManager::OnColorControlAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + VerifyOrExit(attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID || + attributeId == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + PLAT_LOG("Unhandled AttributeId ID: '0x%04x", attributeId)); + VerifyOrExit(endpointId == ENDPOINT_ID_1 || endpointId == ENDPOINT_ID_2, + PLAT_LOG("Unexpected EndPoint ID: `0x%02x'", endpointId)); + + if (endpointId == ENDPOINT_ID_1) + { + uint8_t hue, saturation; + if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) + { + hue = *value; + /* Read Current Saturation value when Attribute change callback for HUE Attribute */ + ColorControl::Attributes::CurrentSaturation::Get(endpointId, &saturation); + } + else + { + saturation = *value; + /* Read Current Hue value when Attribute change callback for SATURATION Attribute */ + ColorControl::Attributes::CurrentHue::Get(endpointId, &hue); + } + PLAT_LOG("Color Control triggered: Hue: %d Saturation: %d", hue, saturation); + } +exit: + return; +} + +void ClusterManager::OnIdentifyPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint16_t size, + uint8_t * value) +{ + if (attributeId == Identify::Attributes::IdentifyTime::Id && size == 2) + { + uint16_t identifyTime; + memcpy(&identifyTime, value, size); + if (identifyTime) + { + // Currently we have no separate indicator LEDs on each endpoints. + // We are using LED1 for endpoint 0,1 and LED2 for endpoint 2 + if (endpointId == ENDPOINT_ID_2) + { + LED_startBlinking(sAppGreenHandle, kIdentifyTimerDelayMS, identifyTime * kIdentifyTimerDelayPerSec); + } + else + { + LED_startBlinking(sAppRedHandle, kIdentifyTimerDelayMS, identifyTime * kIdentifyTimerDelayPerSec); + } + } + else + { + bool onOffState; + endpointId == ENDPOINT_ID_0 ? onOffState = mEndpointOnOffState[0] : onOffState = mEndpointOnOffState[endpointId - 1]; + endpointId == ENDPOINT_ID_2 ? LED_write(sAppRedHandle, onOffState) : LED_write(sAppGreenHandle, onOffState); + } + } +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/Globals.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/Globals.cpp new file mode 100644 index 00000000000000..01a945e1a33d12 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/Globals.cpp @@ -0,0 +1,22 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Globals.h" + +LED_Handle sAppRedHandle; +LED_Handle sAppGreenHandle; diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp new file mode 100644 index 00000000000000..7c6dac030d5a72 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright 2021, Cypress Semiconductor Corporation (an Infineon company) + * + * 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 + * This file implements the handler for data model messages. + */ + +#include "AppConfig.h" +#include "Globals.h" +#include + +#include "ClusterManager.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, + uint16_t size, uint8_t * value) +{ + EndpointId endpoint = attributePath.mEndpointId; + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + PLAT_LOG("MatterPostAttributeChangeCallback - Cluster ID: " ChipLogFormatMEI + ", EndPoint ID: '0x%02x', Attribute ID: " ChipLogFormatMEI, + ChipLogValueMEI(clusterId), endpoint, ChipLogValueMEI(attributeId)); + + switch (clusterId) + { + case OnOff::Id: + ClusterMgr().OnOnOffPostAttributeChangeCallback(endpoint, attributeId, value); + break; + + case Identify::Id: + ClusterMgr().OnIdentifyPostAttributeChangeCallback(endpoint, attributeId, size, value); + break; + + case LevelControl::Id: + ClusterMgr().OnLevelControlAttributeChangeCallback(endpoint, attributeId, value); + break; + + case ColorControl::Id: + ClusterMgr().OnColorControlAttributeChangeCallback(endpoint, attributeId, value); + break; + default: + PLAT_LOG("Unhandled cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + break; + } +} +/** @brief OnOff Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + */ +void emberAfOnOffClusterInitCallback(EndpointId endpoint) +{ + // TODO: implement any additional Cluster Server init actions +} + +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) +{ + emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); + return true; +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppConfig.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppConfig.h new file mode 100644 index 00000000000000..f7302b6efd10cd --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppConfig.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_CONFIG_H +#define APP_CONFIG_H + +#endif // APP_CONFIG_H diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppEvent.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppEvent.h new file mode 100644 index 00000000000000..ad9e93ee3ad1a5 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppEvent.h @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) 2018 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. + */ + +#ifndef APP_EVENT_H +#define APP_EVENT_H + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventType + { + kEventType_None = 0, + kEventType_ButtonLeft, + kEventType_ButtonRight, + kEventType_AppEvent, + }; + + enum AppEventButtonType + { + kAppEventButtonType_None = 0, + kAppEventButtonType_Clicked, + kAppEventButtonType_LongClicked, + }; + + enum AppEventType Type; + + union + { + struct + { + enum AppEventButtonType Type; + } ButtonEvent; + + struct + { + void * Context; + } BoltLockEvent; + }; + + EventHandler Handler; +}; + +#endif // APP_EVENT_H diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppTask.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppTask.h new file mode 100644 index 00000000000000..002e1b3f70557c --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/AppTask.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_TASK_H +#define APP_TASK_H + +#include +#include + +#include "FreeRTOS.h" +#include "semphr.h" +#include "task.h" + +#include "AppEvent.h" + +#include + +class AppTask +{ +public: + int StartAppTask(); + static void AppTaskMain(void * pvParameter); + + void PostEvent(const AppEvent * event); + +private: + friend AppTask & GetAppTask(void); + + int Init(); + + void DispatchEvent(AppEvent * event); + + static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events); + static void ButtonRightEventHandler(Button_Handle handle, Button_EventMask events); + static void TimerEventHandler(void * p_context); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_FactoryReset, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} + +#endif // APP_TASK_H diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..5c62f09065ff40 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @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. + * + */ + +#ifndef CHIP_PROJECT_CONFIG_H +#define CHIP_PROJECT_CONFIG_H + +#if BUILD_RELEASE // release build +// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds +#endif // BUILD_RELEASE + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +// 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" + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8006: example lock app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006 + +/** + * 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 1 + +/** + * 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 "1.0d1" +#endif +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for CHIP-over-BLE (CHIPOBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote CHIP Time service + * using the CHIP Time Sync protocol. + */ +//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + * + * Enable the OpenThread SRP client to allow for CHIP device discovery. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#endif // CHIP_PROJECT_CONFIG_H diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/ClusterManager.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/ClusterManager.h new file mode 100644 index 00000000000000..1599ef1ef19264 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/ClusterManager.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright 2021, Cypress Semiconductor Corporation (an Infineon company) + * 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 ClusterManager.h + * + * Declarations for the ClusterManager callbacks for this application + * + **/ + +#pragma once + +#include +#include +#include + +class ClusterManager +{ +public: + void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnLevelControlAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnColorControlAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint16_t size, + uint8_t * value); + +private: + friend ClusterManager & ClusterMgr(void); + bool mEndpointOnOffState[2]; + static ClusterManager sCluster; +}; + +inline ClusterManager & ClusterMgr(void) +{ + return ClusterManager::sCluster; +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/Globals.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/Globals.h new file mode 100644 index 00000000000000..43f9362e0341b9 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/Globals.h @@ -0,0 +1,35 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +// Logging +#ifdef __cplusplus +extern "C" { +#endif + +int cc13x2_26x2LogInit(void); +void cc13x2_26x2Log(const char * aFormat, ...); +#define PLAT_LOG(...) cc13x2_26x2Log(__VA_ARGS__); + +#ifdef __cplusplus +} +#endif +extern LED_Handle sAppRedHandle; +extern LED_Handle sAppGreenHandle; diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h new file mode 100644 index 00000000000000..30f5633cc3bc7f --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h @@ -0,0 +1,29 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Overrides to default OpenThread configuration. + * + */ + +#pragma once + +// Use the TI-supplied default platform configuration for remainder +#include "openthread-core-cc13x2_26x2-config.h" diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp new file mode 100644 index 00000000000000..b432b8da888b34 --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp @@ -0,0 +1,97 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * + * 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 + +#include + +#include +#include + +#include + +/* Driver Header files */ +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#define TOTAL_ICALL_HEAP_SIZE (58000) + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; + +__attribute__((section(".heap"))) uint8_t GlobalHeapZoneBuffer[TOTAL_ICALL_HEAP_SIZE]; +uint32_t heapSize = TOTAL_ICALL_HEAP_SIZE; + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +extern "C" void vApplicationStackOverflowHook(void) +{ + while (1) + { + ; + } +} + +// ================================================================================ +// Main Code +// ================================================================================ +int main(void) +{ + Board_init(); + bpool((void *) GlobalHeapZoneBuffer, TOTAL_ICALL_HEAP_SIZE); + + GPIO_init(); + + NVS_init(); + + UART_init(); + + ECDH_init(); + + ECDSA_init(); + + AESECB_init(); + + SHA2_init(); + + int ret = GetAppTask().StartAppTask(); + if (ret != 0) + { + // can't log until the kernel is started + // PLAT_LOG("GetAppTask().StartAppTask() failed"); + while (1) + ; + } + + vTaskStartScheduler(); + + // Should never get here. + while (1) + ; +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/third_party/connectedhomeip b/examples/all-clusters-app/cc13x2x7_26x2x7/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 9af884bd7fabfd..db3efc69e652c2 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -32,6 +32,20 @@ the [M5Stack](http://m5stack.com), and the Note: M5Stack Core 2 display is not supported in the tft component, while other functionality can still work fine. +## VCP Drivers + +Some users might have to install the +[VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) +before the device shows up on `/dev/tty`. + +In addition, if the following error is encountered during M5Stack flashing, the +[CH9102 VCP driver](https://docs.m5stack.com/en/download) would also need to be +installed: + +``` +Failed to write to target RAM (result was 01070000) +``` + ## Building the Example Application Building the example application requires the use of the Espressif ESP32 IoT @@ -44,6 +58,7 @@ step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout [v4.4 release](https://github.com/espressif/esp-idf/releases/tag/v4.4) + ``` $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git @@ -52,9 +67,11 @@ step. To install these components manually, follow these steps: $ git submodule update --init $ ./install.sh $ . ./export.sh + ``` To update an existing esp-idf toolchain to v4.4: + ``` $ cd ~/tools/esp-idf $ git fetch origin $ git checkout v4.4 @@ -63,36 +80,47 @@ step. To install these components manually, follow these steps: $ git clean -fdx $ ./install.sh $ . ./export.sh + ``` - Install ninja-build + ``` $ sudo apt-get install ninja-build + ``` Currently building in VSCode _and_ deploying from native is not supported, so make sure the IDF_PATH has been exported(See the manual setup steps above). - Setting up the environment + ``` $ cd ${HOME}/tools/esp-idf $ ./install.sh $ . ./export.sh $ cd {path-to-connectedhomeip} + ``` To download and install packages. + ``` $ source ./scripts/bootstrap.sh $ source ./scripts/activate.sh + ``` If packages are already installed then simply activate them. + ``` $ source ./scripts/activate.sh + ``` - Target Set To set IDF target, run set-target with one of the commands. - $ idf.py set-target esp32 - $ idf.py set-target esp32c3 + ``` + $ idf.py set-target esp32 + $ idf.py set-target esp32c3 + ``` - Configuration Options @@ -101,8 +129,10 @@ demo application. To build a specific configuration (as an example `m5stack`): + ``` $ rm sdkconfig $ idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig_m5stack.defaults' build + ``` Note: If using a specific device configuration, it is highly recommended to start off with one of the defaults and customize on top of that. Certain @@ -111,7 +141,9 @@ To build a specific configuration (as an example `m5stack`): To customize the configuration, run menuconfig. + ``` $ idf.py menuconfig + ``` Select ESP32 based `Device Type` through `Demo`->`Device Type`. The device types that are currently supported include `ESP32-DevKitC` (default), @@ -119,7 +151,9 @@ that are currently supported include `ESP32-DevKitC` (default), - To build the demo application. + ``` $ idf.py build + ``` - After building the application, to flash it outside of VSCode, connect your device via USB. Then run the following command to flash the demo application @@ -131,11 +165,9 @@ that are currently supported include `ESP32-DevKitC` (default), devices this is labeled in the [functional description diagram](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html#functional-description). + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor - - Note: Some users might have to install the - [VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) - before the device shows up on `/dev/tty`. + ``` - Quit the monitor by hitting `Ctrl+]`. @@ -144,7 +176,9 @@ that are currently supported include `ESP32-DevKitC` (default), - If desired, the monitor can be run again like so: + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART monitor + ``` ## Commissioning and cluster control @@ -153,26 +187,32 @@ Commissioning can be carried out using WiFi or BLE. 1. Set the `Rendezvous Mode` for commissioning using menuconfig; the default Rendezvous mode is BLE. - $ idf.py menuconfig + ``` + $ idf.py menuconfig + ``` Select the Rendezvous Mode via `Demo -> Rendezvous Mode`. NOTE: to avoid build error `undefined reference to 'chip::DevelopmentCerts::kDacPublicKey'`, set VID to -0xFFF1 and PID in range 0x8000..0x8005. +`0xFFF1` and PID in range `0x8000..0x8005`. `idf.py menuconfig -> Component config -> CHIP Device Layer -> Device Identification Options` 2. Now flash the device with the same command as before. (Use the right `/dev` device) + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor + ``` 3. The device should boot up. When device connects to your network, you will see a log like this on the device console. + ``` I (5524) chip[DL]: SYSTEM_EVENT_STA_GOT_IP I (5524) chip[DL]: IPv4 address changed on WiFi station interface: ... + ``` 4. Use [python based device controller](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python) @@ -187,7 +227,9 @@ NOTE: to avoid build error Note: The ESP32 does not support 5GHz networks. Also, the Device will persist your network configuration. To erase it, simply run. + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART erase_flash + ``` - Once ESP32 is up and running, we need to set up a device controller to perform commissioning and cluster control. @@ -224,7 +266,9 @@ remote device, as well as the network credentials to use. The command below uses the default values hard-coded into the debug versions of the ESP32 all-clusters-app to commission it onto a Wi-Fi network: + ``` $ ./out/debug/chip-tool pairing ble-wifi 12344321 ${SSID} ${PASSWORD} 20202021 3840 + ``` Parameters: @@ -239,7 +283,9 @@ Parameters: To use the Client to send Matter commands, run the built executable and pass it the target cluster name, the target command name as well as an endpoint id. + ``` $ ./out/debug/chip-tool onoff on 12344321 1 + ``` The client will send a single command packet and then exit. @@ -256,17 +302,19 @@ Usage: - First set IDF target, run set-target with one of the commands. + ``` $ idf.py set-target esp32 $ idf.py set-target esp32c3 + ``` - Execute below sequence of commands -``` + ``` $ export ESPPORT=/dev/tty.SLAB_USBtoUART $ idf.py build $ idf.py flashing_script $ python ${app_name}.flash.py -``` + ``` ### Note @@ -285,28 +333,36 @@ actual effect of the commands. You can use the rpc default config to setup everything correctly for RPCs: + ``` $ export SDKCONFIG_DEFAULTS=$PROJECT_ROOT/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults $ rm sdkconfig $ idf.py fullclean + ``` Alternatively, Enable RPCs in the build using menuconfig: - Enable the RPC library and Disable ENABLE_CHIP_SHELL + ``` Component config → CHIP Core → General Options → Enable Pigweed PRC library Component config → CHIP Core → General Options → Disable CHIP Shell + ``` - Ensure the UART is correctly configured for your board, for m5stack: + ``` PW RPC Debug channel → UART port number → 0 PW RPC Debug channel → UART communication speed → 115200 PW RPC Debug channel → UART RXD pin number → 3 PW RPC Debug channel → UART TXD pin number → 1 + ``` After configuring you can build and flash normally: + ``` $ idf.py build $ idf.py flash + ``` After flashing a build with RPCs enabled you can use the rpc console to send commands to the device. @@ -315,15 +371,19 @@ Build or install the [rpc console](../../common/pigweed/rpc_console/README.md) Start the console + ``` chip-console --device /dev/ttyUSB0 + ``` From within the console you can then invoke rpcs: + ```python rpcs.chip.rpc.WiFi.Connect(ssid=b"MySSID", secret=b"MyPASSWORD") rpcs.chip.rpc.WiFi.GetIP6Address() rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + ``` ## Device Tracing diff --git a/examples/all-clusters-app/linux/README.md b/examples/all-clusters-app/linux/README.md index d029d6eff5f14d..d0ce8dba69774d 100644 --- a/examples/all-clusters-app/linux/README.md +++ b/examples/all-clusters-app/linux/README.md @@ -8,13 +8,17 @@ This example supports compilation with libfuzzer enabled. To compile with libfuzzer enabled on Mac, run: - $ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang build" +``` +$ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang build" +``` at the top level of the Matter tree. Similarly, to compile on Linux run: - $ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-x64-all-clusters-no-ble-asan-libfuzzer-clang build" +``` +$ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-x64-all-clusters-no-ble-asan-libfuzzer-clang build" +``` ### Running libfuzzer-enabled binaries @@ -22,19 +26,25 @@ Similarly, to compile on Linux run: To run the resulting binary with no particular inputs do: - $ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing +``` +$ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing +``` or - $ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing +``` +$ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing +``` If this crashes, it will output the input that caused the crash in a variety of formats, looking something like this: - 0xe,0x0,0xf1,0xb1,0xf1,0xf1,0xf1,0xf1,0xed,0x73,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc1,0x0,0x0,0x0,0x0,0x0,0x5c,0xf3,0x25,0x0,0x0,0x0,0x0,0x0, - \016\000\361\261\361\361\361\361\355s\007\000\000\000\000\000\000\000\301\000\000\000\000\000\\\363%\000\000\000\000\000 - artifact_prefix='./'; Test unit written to ./crash-c9fd2434ccf4a33a7f49765dcc519e1fd529a8e5 - Base64: DgDxsfHx8fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA= +``` +0xe,0x0,0xf1,0xb1,0xf1,0xf1,0xf1,0xf1,0xed,0x73,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc1,0x0,0x0,0x0,0x0,0x0,0x5c,0xf3,0x25,0x0,0x0,0x0,0x0,0x0, +\016\000\361\261\361\361\361\361\355s\007\000\000\000\000\000\000\000\301\000\000\000\000\000\\\363%\000\000\000\000\000 +artifact_prefix='./'; Test unit written to ./crash-c9fd2434ccf4a33a7f49765dcc519e1fd529a8e5 +Base64: DgDxsfHx8fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA= +``` Note that this creates a file holding the input that caused the crash. @@ -44,11 +54,15 @@ To run the binary with a specific input, place the input bytes in a file (which a crashing run of the fuzzer does automatically). If `$(INPUT_FILE)` is the name of that file, then run: - $ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing $(INPUT_FILE) +``` +$ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing $(INPUT_FILE) +``` or - $ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing $(INPUT_FILE) +``` +$ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app-fuzzing $(INPUT_FILE) +``` #### Additional execution options. diff --git a/examples/all-clusters-app/linux/args.gni b/examples/all-clusters-app/linux/args.gni index 311ddab32d5fe5..703c3576d66c19 100644 --- a/examples/all-clusters-app/linux/args.gni +++ b/examples/all-clusters-app/linux/args.gni @@ -15,3 +15,11 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/all-clusters-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..b6c15f4c98230e --- /dev/null +++ b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @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 + +// include the CHIPProjectConfig from config/standalone +#include + +// Allows app options (ports) to be configured on launch of app +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 diff --git a/examples/all-clusters-app/mbed/README.md b/examples/all-clusters-app/mbed/README.md index 547d9436f90d79..a08a96a9af6433 100644 --- a/examples/all-clusters-app/mbed/README.md +++ b/examples/all-clusters-app/mbed/README.md @@ -1,6 +1,4 @@ -

- ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)

Matter Arm Mbed OS All Clusters Example Application

@@ -210,13 +208,17 @@ open a terminal session and connect to the serial port of the device. You can use **mbed-tools** for this purpose ([mbed-tools](https://github.com/ARMmbed/mbed-tools)): + ``` mbed-tools sterm -p /dev/ttyACM0 -b 115200 -e off + ``` After device reset these lines should be visible: + ``` [INFO][CHIP]: [-]Mbed all-clusters-app example application start ... [INFO][CHIP]: [-]Mbed all-clusters-app example application run + ``` The all-clusters-app application launched correctly and you can follow traces in the terminal. @@ -229,9 +231,9 @@ within a WiFi network. ## Supported devices -| Manufacturer | Hardware platform | Build target | Platform image | Status | Platform components | -| ----------------------------------------------------- | ------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Cypress
Semiconductor](https://www.cypress.com/) | [CY8CPROTO-062-4343W](https://os.mbed.com/platforms/CY8CPROTO-062-4343W/) | `CY8CPROTO_062_4343W` |
CY8CPROTO-062-4343WCY8CPROTO-062-4343W
| :heavy_check_mark: |
LEDs
  • Board has only one usable LED (LED4) which corresponds to USER LED from UI.
Buttons
  • Unused
Slider
  • Unused
| +| Manufacturer | Hardware platform | Build target | Platform image | Status | Platform components | +| ----------------------------------------------------- | ------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------ | :----------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Cypress
Semiconductor](https://www.cypress.com/) | [CY8CPROTO-062-4343W](https://os.mbed.com/platforms/CY8CPROTO-062-4343W/) | `CY8CPROTO_062_4343W` | ![CY8CPROTO-062-4343W](https://os.mbed.com/media/cache/platforms/p6_wifi-bt_proto.png.250x250_q85.jpg) | :heavy_check_mark: |
LEDs
  • Board has only one usable LED (LED4) which corresponds to USER LED from UI.
Buttons
  • Unused
Slider
  • Unused
| #### Notes diff --git a/examples/all-clusters-app/nrfconnect/Kconfig b/examples/all-clusters-app/nrfconnect/Kconfig index 176fd68f573c21..9fcdb41ab33208 100644 --- a/examples/all-clusters-app/nrfconnect/Kconfig +++ b/examples/all-clusters-app/nrfconnect/Kconfig @@ -22,6 +22,6 @@ config STATE_LEDS Use LEDs to render the current state of the device such as the progress of commissioning of the device into a network or the factory reset initiation. -rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/all-clusters-app/nrfconnect/README.md b/examples/all-clusters-app/nrfconnect/README.md index 4c6f144fbba787..29ca4bcb7e4648 100644 --- a/examples/all-clusters-app/nrfconnect/README.md +++ b/examples/all-clusters-app/nrfconnect/README.md @@ -4,10 +4,8 @@ The nRF All Clusters Example Application implements various ZCL clusters populated on three endpoints. You can use this example as a reference for creating your own application. -

- Nordic Semiconductor logo - nRF52840 DK -

+![Nordic Smiconductor logo](../../platform/nrfconnect/doc/images/Logo_RGB_H-small.png) +![nRF52840 DK](../../platform/nrfconnect/doc/images/nRF52840-DK-small.png) The example is based on [Matter](https://github.com/project-chip/connectedhomeip) and Nordic diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 94693a40b99a50..e9ee4a43db871d 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -39,6 +39,10 @@ #include #include +using namespace ::chip; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 #define APP_EVENT_QUEUE_SIZE 10 @@ -52,6 +56,8 @@ static LEDWidget sStatusLED; static UnusedLedsWrapper<3> sUnusedLeds{ { DK_LED2, DK_LED3, DK_LED4 } }; static k_timer sFunctionTimer; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; + namespace LedConsts { constexpr uint32_t kBlinkRate_ms{ 500 }; namespace StatusLed { @@ -67,10 +73,6 @@ constexpr uint32_t kOff_ms{ 950 }; } // namespace StatusLed } // namespace LedConsts -using namespace ::chip; -using namespace ::chip::Credentials; -using namespace ::chip::DeviceLayer; - CHIP_ERROR AppTask::Init() { // Initialize CHIP stack @@ -137,6 +139,8 @@ CHIP_ERROR AppTask::Init() #if CONFIG_CHIP_OTA_REQUESTOR InitBasicOTARequestor(); #endif + // We only have network commissioning on endpoint 0. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); diff --git a/examples/all-clusters-app/p6/README.md b/examples/all-clusters-app/p6/README.md index 95b82a4cd147e9..25b8e53b04d697 100644 --- a/examples/all-clusters-app/p6/README.md +++ b/examples/all-clusters-app/p6/README.md @@ -39,21 +39,29 @@ will then join the network. tools. - Install some additional tools (likely already present for Matter - developers): \$ sudo apt install gcc g++ clang ninja-build python - python3-venv libssl-dev libavahi-client-dev libglib2.0-dev git cmake - python3-pip + developers): + + ``` + sudo apt install gcc g++ clang ninja-build python \ + python3-venv libssl-dev libavahi-client-dev libglib2.0-dev git cmake \ + python3-pip + ``` - Supported hardware: [CY8CKIT-062S2-43012](https://www.cypress.com/CY8CKIT-062S2-43012) * Build the example application: + ``` $ ./scripts/examples/gn_p6_example.sh ./examples/all-clusters-app/p6 out/clusters_app_p6 + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip $ rm -rf out/ + ``` @@ -65,8 +73,10 @@ will then join the network. - On the command line: + ``` $ cd ~/connectedhomeip $ python3 out/clusters_app_p6/chip-p6-clusters-example.flash.py + ``` @@ -83,12 +93,16 @@ perform commissioning and cluster control. - Set up python controller. + ``` $ cd {path-to-connectedhomeip} $ ./scripts/examples/gn_build_example.sh examples/chip-tool out/debug + ``` - Execute the controller. + ``` $ ./out/debug/chip-tool + ``` @@ -97,6 +111,7 @@ perform commissioning and cluster control. Run the built executable and pass it the discriminator and pairing code of the remote device, as well as the network credentials to use. + ``` $ ./out/debug/chip-tool pairing ble-wifi 1234 ${SSID} ${PASSWORD} 20202021 3840 Parameters: @@ -105,6 +120,7 @@ remote device, as well as the network credentials to use. 3. Node ID: 1234 (you can assign any node id) 4. SSID : Wi-Fi SSID 5. PASSWORD : Wi-Fi Password + ``` @@ -113,6 +129,8 @@ remote device, as well as the network credentials to use. Raspberry Pi 4 BLE connection issues can be avoided by running the following commands. These power cycle the BlueTooth hardware and disable BR/EDR mode. - $ sudo btmgmt -i hci0 power off - $ sudo btmgmt -i hci0 bredr off - $ sudo btmgmt -i hci0 power on + ``` + sudo btmgmt -i hci0 power off + sudo btmgmt -i hci0 bredr off + sudo btmgmt -i hci0 power on + ``` diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 4ba541c2affe58..028fe4bd0fff14 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -46,7 +46,7 @@ client cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ client cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ client cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -108,7 +111,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -116,7 +119,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -124,8 +127,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -160,12 +166,17 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -185,8 +196,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -196,9 +207,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -296,7 +308,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -330,9 +342,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -456,7 +468,7 @@ server cluster LevelControl = 8 { attribute nullable int16u onTransitionTime = 18; attribute nullable int16u offTransitionTime = 19; attribute nullable int8u defaultMoveRate = 20; - attribute nullable int8u startUpCurrentLevel = 16384; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -583,14 +595,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -645,12 +657,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } server cluster OnOff = 6 { @@ -720,7 +732,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -789,15 +801,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } server cluster SoftwareDiagnostics = 52 { @@ -1054,7 +1066,7 @@ server cluster UnitLocalization = 45 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 0439c3b088c085..78e0962044a416 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -54,7 +54,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -140,7 +140,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -213,6 +213,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -565,6 +610,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -838,7 +898,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -979,7 +1039,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1054,7 +1114,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1117,7 +1177,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1222,7 +1282,7 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1255,7 +1315,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1300,7 +1360,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1446,7 +1506,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1481,7 +1541,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1582,7 +1642,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2568,7 +2628,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2594,7 +2654,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2830,7 +2890,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2865,7 +2925,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3041,7 +3101,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3092,7 +3152,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3163,7 +3223,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3262,7 +3322,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3328,7 +3388,7 @@ "reportableChange": 0 }, { - "name": "fabrics list", + "name": "Fabrics", "code": 1, "mfgCode": null, "side": "server", @@ -3411,7 +3471,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3689,7 +3749,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3763,7 +3823,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3846,7 +3906,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3996,7 +4056,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4047,7 +4107,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4870,6 +4930,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4905,7 +4980,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4991,7 +5066,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5017,7 +5092,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5040,7 +5115,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5058,7 +5133,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/bridge-app/esp32/README.md b/examples/bridge-app/esp32/README.md index 12ca5f4160fead..a0751afeb023f4 100644 --- a/examples/bridge-app/esp32/README.md +++ b/examples/bridge-app/esp32/README.md @@ -88,6 +88,7 @@ step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout [v4.4 release](https://github.com/espressif/esp-idf/releases/tag/v4.4) + ``` $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git @@ -95,29 +96,38 @@ step. To install these components manually, follow these steps: $ git checkout v4.4 $ git submodule update --init $ ./install.sh + ``` - Install ninja-build + ``` $ sudo apt-get install ninja-build + ``` Currently building in VSCode _and_ deploying from native is not supported, so make sure the IDF_PATH has been exported(See the manual setup steps above). - Setting up the environment + ``` $ cd ${HOME}/tools/esp-idf $ ./install.sh $ . ./export.sh $ cd {path-to-connectedhomeip} + ``` To download and install packages. + ``` $ source ./scripts/bootstrap.sh $ source ./scripts/activate.sh + ``` If packages are already installed then simply activate them. + ``` $ source ./scripts/activate.sh + ``` - Configuration Options @@ -127,7 +137,9 @@ make sure the IDF_PATH has been exported(See the manual setup steps above). - To build the demo application. + ``` $ idf.py build + ``` - After building the application, to flash it outside of VSCode, connect your device via USB. Then run the following command to flash the demo application @@ -138,7 +150,9 @@ make sure the IDF_PATH has been exported(See the manual setup steps above). before flashing. For ESP32-DevKitC devices this is labeled in the [functional description diagram](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html#functional-description). + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor + ``` Note: Some users might have to install the [VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) @@ -151,7 +165,9 @@ make sure the IDF_PATH has been exported(See the manual setup steps above). - If desired, the monitor can be run again like so: + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART monitor + ``` ## Commissioning and cluster control @@ -160,20 +176,26 @@ Commissioning can be carried out using WiFi or BLE. 1. Set the `Rendezvous Mode` for commissioning using menuconfig; the default Rendezvous mode is BLE. + ``` $ idf.py menuconfig + ``` Select the Rendezvous Mode via `Demo -> Rendezvous Mode`. 2. Now flash the device with the same command as before. (Use the right `/dev` device) - $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor + ``` + $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor + ``` 3. The device should boot up. When device connects to your network, you will see a log like this on the device console. - I (5524) chip[DL]: SYSTEM_EVENT_STA_GOT_IP - I (5524) chip[DL]: IPv4 address changed on WiFi station interface: ... + ``` + I (5524) chip[DL]: SYSTEM_EVENT_STA_GOT_IP + I (5524) chip[DL]: IPv4 address changed on WiFi station interface: ... + ``` 4. Use [python based device controller](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python) @@ -188,7 +210,9 @@ Select the Rendezvous Mode via `Demo -> Rendezvous Mode`. Note: The ESP32 does not support 5GHz networks. Also, the Device will persist your network configuration. To erase it, simply run. + ``` $ idf.py -p /dev/tty.SLAB_USBtoUART erase_flash + ``` - Once ESP32 is up and running, we need to set up a device controller to perform commissioning and cluster control. @@ -225,7 +249,9 @@ remote device, as well as the network credentials to use. The command below uses the default values hard-coded into the debug versions of the ESP32 all-clusters-app to commission it onto a Wi-Fi network: + ``` $ ./out/debug/chip-tool pairing ble-wifi 12344321 ${SSID} ${PASSWORD} 20202021 3840 + ``` Parameters: @@ -240,6 +266,8 @@ Parameters: To use the Client to send Matter commands, run the built executable and pass it the target cluster name, the target command name as well as an endpoint id. + ``` $ ./out/debug/chip-tool onoff on 12344321 2 + ``` The client will send a single command packet and then exit. diff --git a/examples/bridge-app/linux/README.md b/examples/bridge-app/linux/README.md index 5ff4087b7d89c0..9960be56f504a3 100644 --- a/examples/bridge-app/linux/README.md +++ b/examples/bridge-app/linux/README.md @@ -112,20 +112,26 @@ value/label pair `"room"`/`[light name]`. - Install tool chain + ``` $ sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev ninja-build python3-venv python3-dev unzip + ``` - Build the example application: + ``` $ cd ~/connectedhomeip/examples/bridge-app/linux $ git submodule update --init $ source third_party/connectedhomeip/scripts/activate.sh $ gn gen out/debug $ ninja -C out/debug + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip/examples/bridge-app/linux $ rm -rf out/ + ``` @@ -151,6 +157,7 @@ value/label pair `"room"`/`[light name]`. number after `hci` is the bluetooth device number, `1` in this example. + ``` $ hciconfig hci1: Type: Primary Bus: USB BD Address: 00:1A:7D:AA:BB:CC ACL MTU: 310:10 SCO MTU: 64:8 @@ -163,13 +170,16 @@ value/label pair `"room"`/`[light name]`. UP RUNNING PSCAN ISCAN RX bytes:8609495 acl:14 sco:0 events:217484 errors:0 TX bytes:92185 acl:20 sco:0 commands:5259 errors:0 + ``` - Run Linux Bridge Example App + ``` $ cd ~/connectedhomeip/examples/bridge-app/linux $ sudo out/debug/chip-bridge-app --ble-device [bluetooth device number] # In this example, the device we want to use is hci1 $ sudo out/debug/chip-bridge-app --ble-device 1 + ``` - Test the device using ChipDeviceController on your laptop / workstation etc. diff --git a/examples/chef/devices/lighting-app.zap b/examples/chef/devices/lighting-app.zap index 45cead288789fa..742a280aacbe1b 100644 --- a/examples/chef/devices/lighting-app.zap +++ b/examples/chef/devices/lighting-app.zap @@ -71,7 +71,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -121,7 +121,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -196,7 +196,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -270,7 +270,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -353,7 +353,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -503,7 +503,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -554,7 +554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -595,7 +595,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -621,7 +621,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -677,7 +677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -994,6 +994,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1346,6 +1391,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1406,7 +1466,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1479,7 +1539,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1894,7 +1954,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2020,7 +2080,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2095,7 +2155,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2281,7 +2341,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2326,7 +2386,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2472,7 +2532,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2507,7 +2567,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2608,7 +2668,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2643,7 +2703,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3629,7 +3689,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3664,7 +3724,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3900,7 +3960,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3935,7 +3995,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4111,7 +4171,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4182,7 +4242,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4253,7 +4313,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4352,7 +4412,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4501,7 +4561,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4808,7 +4868,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4873,7 +4933,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4948,7 +5008,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5022,7 +5082,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5129,7 +5189,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5279,7 +5339,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5354,7 +5414,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5794,11 +5854,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5809,11 +5869,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5824,11 +5884,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6297,6 +6357,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6485,7 +6560,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6856,7 +6931,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6882,7 +6957,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6953,7 +7028,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6983,6 +7058,5 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm index 3cf75f6e7fa0c0..67bed2b270961c 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm @@ -34,20 +34,39 @@ CHIPToolKeypair * nocSigner = [[CHIPToolKeypair alloc] init]; storage = [[CHIPToolPersistentStorageDelegate alloc] init]; - mController = [CHIPDeviceController sharedController]; - if (mController == nil) { - ChipLogError(chipTool, "Controller is nil"); + auto factory = [MatterControllerFactory sharedInstance]; + if (factory == nil) { + ChipLogError(chipTool, "Controller factory is nil"); return CHIP_ERROR_INTERNAL; } - [mController setListenPort:kListenPort]; - [mController setKeyValueStoreManagerPath:"/tmp/chip_kvs_darwin"]; + auto params = [[MatterControllerFactoryParams alloc] initWithStorage:storage]; + params.port = @(kListenPort); + params.startServer = YES; + params.kvsPath = @("/tmp/chip_kvs_darwin"); + + if ([factory startup:params] == NO) { + ChipLogError(chipTool, "Controller factory startup failed"); + return CHIP_ERROR_INTERNAL; + } ReturnLogErrorOnFailure([nocSigner createOrLoadKeys:storage]); ipk = [nocSigner getIPK]; - if (![mController startup:storage vendorId:chip::VendorId::TestVendor1 nocSigner:nocSigner ipk:ipk paaCerts:nil]) { + auto controllerParams = [[CHIPDeviceControllerStartupParams alloc] initWithKeypair:nocSigner]; + controllerParams.vendorId = chip::VendorId::TestVendor1; + controllerParams.fabricId = 1; + controllerParams.ipk = ipk; + + // We're not sure whether we're creating a new fabric or using an + // existing one, so just try both. + mController = [factory startControllerOnExistingFabric:controllerParams]; + if (mController == nil) { + // Maybe we didn't have this fabric yet. + mController = [factory startControllerOnNewFabric:controllerParams]; + } + if (mController == nil) { ChipLogError(chipTool, "Controller startup failure."); return CHIP_ERROR_INTERNAL; } @@ -63,11 +82,9 @@ CHIP_ERROR CHIPCommandBridge::ShutdownCommissioner() { ChipLogProgress(chipTool, "Shutting down controller"); - BOOL result = [CurrentCommissioner() shutdown]; - if (!result) { - ChipLogError(chipTool, "Unable to shut down controller"); - return CHIP_ERROR_INTERNAL; - } + [CurrentCommissioner() shutdown]; + + [[MatterControllerFactory sharedInstance] shutdown]; return CHIP_NO_ERROR; } diff --git a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h index 1a2d93dbe107d7..f1a03e750fe70a 100644 --- a/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h +++ b/examples/chip-tool-darwin/commands/tests/TestCommandBridge.h @@ -82,7 +82,7 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public void WaitForCommissionee(chip::NodeId nodeId) { - CHIPDeviceController * controller = [CHIPDeviceController sharedController]; + CHIPDeviceController * controller = CurrentCommissioner(); VerifyOrReturn(controller != nil, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); [controller getConnectedDevice:nodeId diff --git a/examples/chip-tool/README.md b/examples/chip-tool/README.md index b825b5b307612b..8911d648f06d28 100644 --- a/examples/chip-tool/README.md +++ b/examples/chip-tool/README.md @@ -67,40 +67,52 @@ remote device, as well as the network credentials to use. The command below uses the default values hard-coded into the debug versions of the ESP32 all-clusters-app to commission it onto a Wi-Fi network: + ``` $ chip-tool pairing ble-wifi ${NODE_ID_TO_ASSIGN} ${SSID} ${PASSWORD} 20202021 3840 + ``` where: -- \${NODE_ID_TO_ASSIGN} (which must be a decimal number or a 0x-prefixed hex +- \${NODE_ID_TO_ASSIGN} (which must be a decimal number or a `0x`-prefixed hex number) is the node id to assign to the node being commissioned. -- \${SSID} is the Wi-Fi SSID either as a string, or in the form hex:XXXXXXXX +- \${SSID} is the Wi-Fi SSID either as a string, or in the form `hex:XXXXXXXX` where the bytes of the SSID are encoded as two-digit hex numbers. - \${PASSWORD} is the Wi-Fi password, again either as a string or as hex data For example: + ``` $ chip-tool pairing ble-wifi 0x11 xyz secret 20202021 3840 + ``` or equivalently: + ``` $ chip-tool pairing ble-wifi 17 hex:787980 hex:736563726574 20202021 3840 + ``` #### Pair a device over IP The command below will discover devices and try to pair with the first one it discovers using the provided setup code. + ``` $ chip-tool pairing onnetwork ${NODE_ID_TO_ASSIGN} 20202021 + ``` The command below will discover devices with long discriminator 3840 and try to pair with the first one it discovers using the provided setup code. + ``` $ chip-tool pairing onnetwork-long ${NODE_ID_TO_ASSIGN} 20202021 3840 + ``` The command below will discover devices based on the given QR code (which devices log when they start up) and try to pair with the first one it discovers. + ``` $ chip-tool pairing qrcode ${NODE_ID_TO_ASSIGN} MT:####### + ``` In all these cases, the device will be assigned node id `${NODE_ID_TO_ASSIGN}` (which must be a decimal number or a 0x-prefixed hex number). @@ -117,11 +129,15 @@ Attestation Verification. It will also discover devices with long discriminator 3840 and try to pair with the first one it discovers using the provided setup code. + ``` $ chip-tool pairing onnetwork-long ${NODE_ID_TO_ASSIGN} 20202021 3840 --paa-trust-store-path path/to/PAAs + ``` ### Forget the currently-commissioned device + ``` $ chip-tool pairing unpair + ``` ## Using the Client to Send Matter Commands @@ -130,7 +146,9 @@ the target cluster name, the target command name as well as an endpoint id. The endpoint id must be between 1 and 240. + ``` $ chip-tool onoff on 1 + ``` The client will send a single command packet and then exit. @@ -167,35 +185,45 @@ must be configured appropriately. To configure the client please use the groupsettings option + ``` $ chip-tool groupsettings + ``` A group with a valid encryption key needs to be set. The groupid and the encryption key must match the one configured on the end device. To add a group + ``` $ chip-tool groupsettings add-group TestName 0x1010 + ``` To add a keyset + ``` $ chip-tool groupsettings add-keyset 0xAAAA 0 0x000000000021dfe0 hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf + ``` Take note that the epoch key must be in hex form with the 'hex:' prefix Finally to bind the keyset to the group + ``` $ chip-tool groupsettings bind-keyset 0x1010 0xAAAA + ``` ## Using the Client to Send Group (Multicast) Matter Commands To use the Client to send Matter commands, run the built executable and pass it the target cluster name, the target command name, the Group Id in Node Id form -(0xffffffffffffXXXX) and an unused endpoint Id. Take note that Only commands and -attributes write can be send with Group Id. +(`0xffffffffffffXXXX`) and an unused endpoint Id. Take note that Only commands +and attributes write can be send with Group Id. E.G. sending to group Id 0x0025 + ``` $ chip-tool onoff on 0xffffffffffff0025 1 + ``` The client will send a single multicast command packet and then exit. @@ -204,7 +232,9 @@ The client will send a single multicast command packet and then exit. To get the list of supported clusters, run the built executable without any arguments. + ``` $ chip-tool + ``` Example output: @@ -236,25 +266,33 @@ Usage: To get the list of commands for a specific cluster, run the built executable with the target cluster name. + ``` $ chip-tool onoff + ``` ### How to get the list of supported attributes for a specific cluster To the the list of attributes for a specific cluster, run the built executable with the target cluster name and the `read` command name. + ``` $ chip-tool onoff read + ``` ### How to get the list of parameters for a command To get the list of parameters for a specific command, run the built executable with the target cluster name and the target command name + ``` $ chip-tool onoff on + ``` ### Run a test suite against a paired peer device + ``` $ chip-tool tests Test_TC_OO_1_1 + ``` ## Using the Client for Setup Payload @@ -263,26 +301,36 @@ with the target cluster name and the target command name To parse a setup code, run the built executable with the `payload` cluster name and the `parse-setup-payload` command + ``` $ chip-tool payload parse-setup-payload code + ``` #### QR Code + ``` $ chip-tool payload parse-setup-payload "MT:#####" + ``` #### QR Code with optional Vendor Info + ``` $ chip-tool payload parse-setup-payload "MT:#####" + ``` #### Manual Setup Code + ``` $ chip-tool payload parse-setup-payload "#####" + ``` # Using the Client for Additional Data Payload To parse an additional data payload, run the built executable with the `payload` cluster name and the `parse-additional-data-payload` command + ``` $ chip-tool payload parse-additional-data-payload "#####" + ``` # Command Reference diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index f7924101520a50..1a1b3cc9a576de 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -325,9 +325,9 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f chip::MutableByteSpan rcacSpan(rcac.Get(), chip::Controller::kMaxCHIPDERCertLength); ReturnLogErrorOnFailure(ephemeralKey.Initialize()); - ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain(mCommissionerStorage.GetLocalNodeId(), fabricId, - mCommissionerStorage.GetCommissionerCATs(), - ephemeralKey, rcacSpan, icacSpan, nocSpan)); + chip::NodeId nodeId = mCommissionerNodeId.ValueOr(mCommissionerStorage.GetLocalNodeId()); + ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain( + nodeId, fabricId, mCommissionerStorage.GetCommissionerCATs(), ephemeralKey, rcacSpan, icacSpan, nocSpan)); commissionerParams.operationalKeypair = &ephemeralKey; commissionerParams.controllerRCAC = rcacSpan; commissionerParams.controllerICAC = icacSpan; diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 49e82a1d1407a3..c15b39588bafb4 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -61,6 +61,7 @@ class CHIPCommand : public Command { AddArgument("paa-trust-store-path", &mPaaTrustStorePath); AddArgument("commissioner-name", &mCommissionerName); + AddArgument("commissioner-nodeid", 0, UINT64_MAX, &mCommissionerNodeId); #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED AddArgument("trace_file", &mTraceFile); AddArgument("trace_log", 0, 1, &mTraceLog); @@ -116,6 +117,7 @@ class CHIPCommand : public Command chip::FabricId CurrentCommissionerId(); static std::map> mCommissioners; chip::Optional mCommissionerName; + chip::Optional mCommissionerNodeId; chip::Optional mBleAdapterId; chip::Optional mPaaTrustStorePath; diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 36cd8b785ac4f1..aed75cd215b068 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -32,7 +32,17 @@ CHIP_ERROR TestCommand::RunCommand() CHIP_ERROR TestCommand::WaitForCommissionee(chip::NodeId nodeId) { - CurrentCommissioner().ReleaseOperationalDevice(nodeId); + chip::FabricIndex fabricIndex; + + ReturnErrorOnFailure(CurrentCommissioner().GetFabricIndex(&fabricIndex)); + + // + // There's a chance the commissionee may have rebooted before this call here as part of a test flow + // or is just starting out fresh outright. Let's make sure we're not re-using any cached CASE sessions + // that will now be stale and mismatched with the peer, causing subsequent interactions to fail. + // + CurrentCommissioner().SessionMgr()->ExpireAllPairings(nodeId, fabricIndex); + return CurrentCommissioner().GetConnectedDevice(nodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } @@ -62,9 +72,9 @@ void TestCommand::Exit(std::string message) SetCommandExitStatus(CHIP_ERROR_INTERNAL); } -void TestCommand::ThrowFailureResponse() +void TestCommand::ThrowFailureResponse(CHIP_ERROR error) { - Exit("Expecting success response but got a failure response"); + Exit(std::string("Expecting success response but got a failure response: ") + chip::ErrorStr(error)); } void TestCommand::ThrowSuccessResponse() diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index 848f285ecab875..07f3ebc939f85d 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -80,7 +80,7 @@ class TestCommand : public CHIPCommand, chip::Controller::DeviceCommissioner & GetCurrentCommissioner() override { return CurrentCommissioner(); }; void Exit(std::string message) override; - void ThrowFailureResponse(); + void ThrowFailureResponse(CHIP_ERROR error); void ThrowSuccessResponse(); chip::Callback::Callback mOnDeviceConnectedCallback; diff --git a/examples/chip-tool/templates/tests/partials/test_cluster.zapt b/examples/chip-tool/templates/tests/partials/test_cluster.zapt index 35149bc8043574..a46961a68c5359 100644 --- a/examples/chip-tool/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/tests/partials/test_cluster.zapt @@ -341,7 +341,7 @@ class {{filename}}Suite: public TestCommand {{#unless async}}NextTest();{{/unless}} {{/if}} {{else}} - {{#if optional}}(status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : {{/if}}ThrowFailureResponse(); + {{#if optional}}(status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : {{/if}}ThrowFailureResponse(error); {{/if}} } diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 0a45f1b68e16b3..911d50623efe9b 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -145,7 +145,6 @@ function getManualTests() 'Test_TC_MF_1_2', 'Test_TC_MF_1_3', 'Test_TC_MF_1_5', - 'Test_TC_MF_1_6', 'Test_TC_MF_1_7', 'Test_TC_MF_1_8', 'Test_TC_MF_1_9', @@ -423,6 +422,7 @@ function getTests() const MultipleFabrics = [ 'Test_TC_MF_1_4', + 'Test_TC_MF_1_6', ]; const OnOff = [ diff --git a/examples/common/pigweed/rpc_console/README.md b/examples/common/pigweed/rpc_console/README.md index 7ba3a4117294b8..09226c2eec1ceb 100644 --- a/examples/common/pigweed/rpc_console/README.md +++ b/examples/common/pigweed/rpc_console/README.md @@ -18,34 +18,47 @@ files required for CHIP. If this is the first time using the checkout the environment must first be bootstrapped to install all dependencies. + ``` $ source /scripts/bootstrap.sh + ``` If bootstrap has previously been run, then simply activate. + ``` $ source /scripts/activate.sh + ``` The python console is built and installed in the venv using gn: + ``` $ cd /examples/common/pigweed/rpc_console $ gn gen out/debug $ ninja -C out/debug + ``` After building the output directory also contains a folder (chip_rpc_console_wheels), with all the wheels required for the tool. These can be used to install the console without needing the sdk. Simply install all the wheels in the folder: + + ``` $ cd /examples/common/pigweed/rpc_console/out/debug $ pip install chip_rpc_console_wheels/*.whl + ``` ## Running To start the console provide the path to the device, for example: + ``` $ chip-console --device /dev/ttyUSB0 + ``` Note that `chip-console` is an entry point for chip_rpc.console and could also be run with `python -m chip_rpc.console`. An example RPC command: + ```python $ rpcs.chip.rpc.Device.GetDeviceInfo() + ``` diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index 099ed2d60765f2..c35b866c4388fa 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -46,7 +46,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -98,12 +101,17 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -123,8 +131,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -134,9 +142,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -576,16 +585,16 @@ server cluster DoorLock = 257 { readonly attribute int8u maxRFIDCodeLength = 25; readonly attribute int8u minRFIDCodeLength = 26; readonly attribute DlCredentialRuleMask credentialRulesSupport = 27; - attribute char_string<3> language = 33; - attribute int32u autoRelockTime = 35; - attribute int8u soundVolume = 36; - attribute DlOperatingMode operatingMode = 37; + attribute access(write: manage) char_string<3> language = 33; + attribute access(write: manage) int32u autoRelockTime = 35; + attribute access(write: manage) int8u soundVolume = 36; + attribute access(write: manage) DlOperatingMode operatingMode = 37; readonly attribute DlSupportedOperatingModes supportedOperatingModes = 38; - attribute boolean enableOneTouchLocking = 41; - attribute boolean enablePrivacyModeButton = 43; - attribute int8u wrongCodeEntryLimit = 48; - attribute int8u userCodeTemporaryDisableTime = 49; - attribute boolean requirePINforRemoteOperation = 51; + attribute access(write: manage) boolean enableOneTouchLocking = 41; + attribute access(write: manage) boolean enablePrivacyModeButton = 43; + attribute access(write: administer) int8u wrongCodeEntryLimit = 48; + attribute access(write: administer) int8u userCodeTemporaryDisableTime = 49; + attribute access(write: administer) boolean requirePINforRemoteOperation = 51; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -715,18 +724,18 @@ server cluster DoorLock = 257 { timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1; - command SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11; - command GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12; - command ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13; - command SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14; - command GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15; - command ClearYearDaySchedule(ClearYearDayScheduleRequest): DefaultSuccess = 16; - timed command SetUser(SetUserRequest): DefaultSuccess = 26; - command GetUser(GetUserRequest): GetUserResponse = 27; - timed command ClearUser(ClearUserRequest): DefaultSuccess = 29; - timed command SetCredential(SetCredentialRequest): SetCredentialResponse = 34; - command GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; - timed command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; + command access(invoke: administer) SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11; + command access(invoke: administer) GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12; + command access(invoke: administer) ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13; + command access(invoke: administer) SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14; + command access(invoke: administer) GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15; + command access(invoke: administer) ClearYearDaySchedule(ClearYearDayScheduleRequest): DefaultSuccess = 16; + timed command access(invoke: administer) SetUser(SetUserRequest): DefaultSuccess = 26; + command access(invoke: administer) GetUser(GetUserRequest): GetUserResponse = 27; + timed command access(invoke: administer) ClearUser(ClearUserRequest): DefaultSuccess = 29; + timed command access(invoke: administer) SetCredential(SetCredentialRequest): SetCredentialResponse = 34; + command access(invoke: administer) GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; + timed command access(invoke: administer) ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; } server cluster EthernetNetworkDiagnostics = 55 { @@ -780,7 +789,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -814,9 +823,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -980,14 +989,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1042,12 +1051,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } server cluster OperationalCredentials = 62 { @@ -1079,7 +1088,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -1148,15 +1157,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } server cluster PowerSource = 47 { @@ -1442,7 +1451,7 @@ server cluster TimeFormatLocalization = 44 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.zap b/examples/door-lock-app/door-lock-common/door-lock-app.zap index 2774f0555b732d..20163134582d21 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.zap +++ b/examples/door-lock-app/door-lock-common/door-lock-app.zap @@ -136,7 +136,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -177,7 +177,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -345,7 +345,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -419,7 +419,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -502,7 +502,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -652,7 +652,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -703,7 +703,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -744,7 +744,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -787,7 +787,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -822,7 +822,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1007,6 +1007,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1359,6 +1404,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1794,7 +1854,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1935,7 +1995,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2010,7 +2070,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2073,7 +2133,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2196,7 +2256,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2241,7 +2301,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2387,7 +2447,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2422,7 +2482,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2523,7 +2583,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2549,7 +2609,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3535,7 +3595,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3561,7 +3621,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3797,7 +3857,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3832,7 +3892,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4008,7 +4068,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4059,7 +4119,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4130,7 +4190,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4229,7 +4289,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4295,7 +4355,7 @@ "reportableChange": 0 }, { - "name": "fabrics list", + "name": "Fabrics", "code": 1, "mfgCode": null, "side": "server", @@ -4378,7 +4438,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4506,7 +4566,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4577,7 +4637,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4693,7 +4753,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4734,7 +4794,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4902,7 +4962,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4976,7 +5036,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5059,7 +5119,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5209,7 +5269,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5260,7 +5320,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5402,7 +5462,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5458,7 +5518,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5501,7 +5561,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5536,7 +5596,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5976,6 +6036,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6295,7 +6370,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7034,7 +7109,7 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7067,7 +7142,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7093,7 +7168,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7164,7 +7239,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/ipv6only-app/esp32/README.md b/examples/ipv6only-app/esp32/README.md index 0bc7ef61eef976..ad7f47c8295cc9 100644 --- a/examples/ipv6only-app/esp32/README.md +++ b/examples/ipv6only-app/esp32/README.md @@ -23,6 +23,7 @@ step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout [v4.4 release](https://github.com/espressif/esp-idf/releases/tag/v4.4) + ``` $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git @@ -30,10 +31,13 @@ step. To install these components manually, follow these steps: $ git checkout v4.4 $ git submodule update --init $ ./install.sh + ``` - Install ninja-build + ``` $ sudo apt-get install ninja-build + ``` ### To build the application, follow these steps: @@ -42,29 +46,39 @@ make sure the IDF_PATH has been exported(See the manual setup steps above). - Setting up the environment + ``` $ cd ${HOME}/tools/esp-idf $ ./install.sh $ . ./export.sh $ cd {path-to-connectedhomeip} + ``` To download and install packages. + ``` $ source ./scripts/bootstrap.sh $ source ./scripts/activate.sh + ``` If packages are already installed then simply activate them. + ``` $ source ./scripts/activate.sh + ``` - Select IDF Target + ``` $ idf.py set-target esp32(or esp32c3) + ``` - Configuration Options To choose from the different configuration options, run menuconfig + ``` $ idf.py menuconfig + ``` This example uses UART0 for serial communication. You can change this through `PW RPC Example Configuration`. As a result, the console has been shifted to UART1 @@ -84,7 +98,9 @@ make sure the IDF_PATH has been exported(See the manual setup steps above). before flashing. For ESP32-DevKitC devices this is labeled in the [functional description diagram](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html#functional-description). + ``` $ idf.py flash -p /dev/tty.SLAB_USBtoUART + ``` Note: Some users might have to install the [VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) @@ -96,10 +112,13 @@ Build or install the [rpc console](../../common/pigweed/rpc_console/README.md) Start the console: + ``` $ chip-console --device /dev/ttyUSB0 -b 115200 + ``` An example flow of performing a scan, connecting, and getting the IPv6 address: + ``` scan = rpcs.chip.rpc.WiFi.StartScan(pw_rpc_timeout_s=5) ap = next(filter(lambda a: b"SSID\000" in a.ssid, next(scan.responses()).aps)) @@ -107,3 +126,4 @@ An example flow of performing a scan, connecting, and getting the IPv6 address: rpcs.chip.rpc.WiFi.Connect(connect, pw_rpc_timeout_s=10) rpcs.chip.rpc.WiFi.GetIP6Address() + ``` diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index a6c4c28ed0ace5..fe365d19079581 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -46,7 +46,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -98,12 +101,17 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -123,8 +131,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -134,9 +142,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -243,7 +252,7 @@ client cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMin = 16395; readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; readonly attribute int16u clusterRevision = 65533; request struct MoveToHueRequest { @@ -485,7 +494,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -519,9 +528,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -645,7 +654,7 @@ server cluster GroupKeyManagement = 63 { nullable epoch_us epochStartTime2 = 7; } - attribute GroupKeyMapStruct groupKeyMap[] = 0; + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; readonly attribute GroupInfoMapStruct groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; @@ -675,10 +684,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster Groups = 4 { @@ -728,12 +737,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command AddGroup(AddGroupRequest): AddGroupResponse = 0; + command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command RemoveAllGroups(): DefaultSuccess = 4; - command AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } client cluster Identify = 3 { @@ -806,9 +815,9 @@ server cluster Identify = 3 { INT16U timeout = 0; } - command Identify(IdentifyRequest): DefaultSuccess = 0; - command IdentifyQuery(): IdentifyQueryResponse = 1; - command TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) IdentifyQuery(): IdentifyQueryResponse = 1; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } server cluster LocalizationConfiguration = 43 { @@ -880,14 +889,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -942,12 +951,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } client cluster OtaSoftwareUpdateProvider = 41 { @@ -1118,7 +1127,7 @@ client cluster OnOff = 6 { readonly attribute boolean globalSceneControl = 16384; attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; - attribute nullable OnOffStartUpOnOff startUpOnOff = 16387; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1157,7 +1166,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -1226,15 +1235,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } client cluster Scenes = 5 { @@ -1333,11 +1342,11 @@ client cluster Scenes = 5 { INT8U sceneList[] = 4; } - command AddScene(AddSceneRequest): AddSceneResponse = 0; + command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; command RecallScene(RecallSceneRequest): DefaultSuccess = 5; command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } @@ -1579,7 +1588,7 @@ server cluster TimeFormatLocalization = 44 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index bac270a35287c3..bad600ad864ede 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -196,7 +196,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -270,7 +270,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -353,7 +353,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -503,7 +503,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -554,7 +554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -595,7 +595,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -621,7 +621,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -677,7 +677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -949,7 +949,7 @@ "commands": [], "attributes": [ { - "name": "binding list", + "name": "Binding", "code": 0, "mfgCode": null, "side": "server", @@ -958,7 +958,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1059,6 +1059,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1426,6 +1471,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1486,7 +1546,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1559,7 +1619,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1893,7 +1953,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2034,7 +2094,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2109,7 +2169,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2295,7 +2355,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2340,7 +2400,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2486,7 +2546,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2521,7 +2581,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2622,7 +2682,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2657,7 +2717,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3643,7 +3703,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3678,7 +3738,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3914,7 +3974,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3949,7 +4009,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4125,7 +4185,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4196,7 +4256,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4267,7 +4327,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4366,7 +4426,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4432,7 +4492,7 @@ "reportableChange": 0 }, { - "name": "fabrics list", + "name": "Fabrics", "code": 1, "mfgCode": null, "side": "server", @@ -4515,7 +4575,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5022,7 +5082,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5156,7 +5216,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5278,7 +5338,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5473,7 +5533,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5563,7 +5623,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6252,7 +6312,7 @@ "commands": [], "attributes": [ { - "name": "binding list", + "name": "Binding", "code": 0, "mfgCode": null, "side": "server", @@ -6261,7 +6321,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6633,6 +6693,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6836,7 +6911,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7207,7 +7282,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7233,7 +7308,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7304,7 +7379,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/light-switch-app/nrfconnect/Kconfig b/examples/light-switch-app/nrfconnect/Kconfig index 59e94a75c47b31..8b4d87b0a956f0 100644 --- a/examples/light-switch-app/nrfconnect/Kconfig +++ b/examples/light-switch-app/nrfconnect/Kconfig @@ -23,6 +23,6 @@ config STATE_LEDS the device into a network or the factory reset initiation. Note that setting this option to 'n' does not disable the LED indicating the state of the simulated bolt. -rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index 9643dce1a8ef4b..f1d7d8b0064f38 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -18,7 +18,6 @@ #include "AppTask.h" #include "AppConfig.h" -#include "BindingHandler.h" #include "LEDWidget.h" #include "LightSwitch.h" #include "ThreadUtil.h" diff --git a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp index c94801ed1730f7..54cce9924887fd 100644 --- a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp +++ b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp @@ -35,17 +35,54 @@ void BindingHandler::Init() DeviceLayer::PlatformMgr().ScheduleWork(InitInternal); } +void BindingHandler::OnInvokeCommandFailure(DeviceProxy * aDevice, BindingData & aBindingData, CHIP_ERROR aError) +{ + CHIP_ERROR error; + + if (aError == CHIP_ERROR_TIMEOUT && !BindingHandler::GetInstance().mCaseSessionRecovered) + { + LOG_INF("Response timeout for invoked command, trying to recover CASE session."); + if (!aDevice) + return; + + // Release current CASE session. + error = aDevice->Disconnect(); + + if (CHIP_NO_ERROR != error) + { + LOG_ERR("Disconnecting from CASE session failed due to: %" CHIP_ERROR_FORMAT, error.Format()); + return; + } + + // Set flag to not try recover session multiple times. + BindingHandler::GetInstance().mCaseSessionRecovered = true; + + // Establish new CASE session and retrasmit command that was not applied. + error = BindingManager::GetInstance().NotifyBoundClusterChanged(aBindingData.EndpointId, aBindingData.ClusterId, + static_cast(&aBindingData)); + } + else + { + LOG_ERR("Binding command was not applied! Reason: %" CHIP_ERROR_FORMAT, aError.Format()); + } +} + void BindingHandler::OnOffProcessCommand(CommandId aCommandId, const EmberBindingTableEntry & aBinding, DeviceProxy * aDevice, void * aContext) { - CHIP_ERROR ret = CHIP_NO_ERROR; + CHIP_ERROR ret = CHIP_NO_ERROR; + BindingData * data = reinterpret_cast(aContext); auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { LOG_DBG("Binding command applied successfully!"); + + // If session was recovered and communication works, reset flag to the initial state. + if (BindingHandler::GetInstance().mCaseSessionRecovered) + BindingHandler::GetInstance().mCaseSessionRecovered = false; }; - auto onFailure = [](CHIP_ERROR error) { - LOG_INF("Binding command was not applied! Reason: %" CHIP_ERROR_FORMAT, error.Format()); + auto onFailure = [aDevice, dataRef = *data](CHIP_ERROR aError) mutable { + BindingHandler::OnInvokeCommandFailure(aDevice, dataRef, aError); }; switch (aCommandId) @@ -105,12 +142,18 @@ void BindingHandler::OnOffProcessCommand(CommandId aCommandId, const EmberBindin void BindingHandler::LevelControlProcessCommand(CommandId aCommandId, const EmberBindingTableEntry & aBinding, DeviceProxy * aDevice, void * aContext) { + BindingData * data = reinterpret_cast(aContext); + auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { LOG_DBG("Binding command applied successfully!"); + + // If session was recovered and communication works, reset flag to the initial state. + if (BindingHandler::GetInstance().mCaseSessionRecovered) + BindingHandler::GetInstance().mCaseSessionRecovered = false; }; - auto onFailure = [](CHIP_ERROR error) { - LOG_INF("Binding command was not applied! Reason: %" CHIP_ERROR_FORMAT, error.Format()); + auto onFailure = [aDevice, dataRef = *data](CHIP_ERROR aError) mutable { + BindingHandler::OnInvokeCommandFailure(aDevice, dataRef, aError); }; CHIP_ERROR ret = CHIP_NO_ERROR; @@ -119,7 +162,6 @@ void BindingHandler::LevelControlProcessCommand(CommandId aCommandId, const Embe { case Clusters::LevelControl::Commands::MoveToLevel::Id: { Clusters::LevelControl::Commands::MoveToLevel::Type moveToLevelCommand; - BindingData * data = reinterpret_cast(aContext); moveToLevelCommand.level = data->Value; if (aDevice) { @@ -192,7 +234,7 @@ void BindingHandler::InitInternal(intptr_t aArg) } BindingManager::GetInstance().RegisterBoundDeviceChangedHandler(LightSwitchChangedHandler); - PrintBindingTable(); + BindingHandler::GetInstance().PrintBindingTable(); } bool BindingHandler::IsGroupBound() diff --git a/examples/light-switch-app/nrfconnect/main/LightSwitch.cpp b/examples/light-switch-app/nrfconnect/main/LightSwitch.cpp index 275dcdceccf1f4..7420d8f5254feb 100644 --- a/examples/light-switch-app/nrfconnect/main/LightSwitch.cpp +++ b/examples/light-switch-app/nrfconnect/main/LightSwitch.cpp @@ -29,7 +29,7 @@ using namespace chip::app; void LightSwitch::Init(chip::EndpointId aLightSwitchEndpoint) { - BindingHandler::Init(); + BindingHandler::GetInstance().Init(); mLightSwitchEndpoint = aLightSwitchEndpoint; } @@ -55,7 +55,7 @@ void LightSwitch::InitiateActionSwitch(Action mAction) Platform::Delete(data); return; } - data->IsGroup = BindingHandler::IsGroupBound(); + data->IsGroup = BindingHandler::GetInstance().IsGroupBound(); DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::SwitchWorkerHandler, reinterpret_cast(data)); Platform::Delete(data); } @@ -77,7 +77,7 @@ void LightSwitch::DimmerChangeBrightness() sBrightness = 0; } data->Value = (uint8_t) sBrightness; - data->IsGroup = BindingHandler::IsGroupBound(); + data->IsGroup = BindingHandler::GetInstance().IsGroupBound(); DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::SwitchWorkerHandler, reinterpret_cast(data)); Platform::Delete(data); } diff --git a/examples/light-switch-app/nrfconnect/main/ShellCommands.cpp b/examples/light-switch-app/nrfconnect/main/ShellCommands.cpp index 4dc0a3db58258c..235b9f9aedb336 100644 --- a/examples/light-switch-app/nrfconnect/main/ShellCommands.cpp +++ b/examples/light-switch-app/nrfconnect/main/ShellCommands.cpp @@ -55,7 +55,7 @@ static CHIP_ERROR SwitchCommandHandler(int argc, char ** argv) static CHIP_ERROR TableCommandHelper(int argc, char ** argv) { - BindingHandler::PrintBindingTable(); + BindingHandler::GetInstance().PrintBindingTable(); return CHIP_NO_ERROR; } diff --git a/examples/light-switch-app/nrfconnect/main/include/BindingHandler.h b/examples/light-switch-app/nrfconnect/main/include/BindingHandler.h index 02aed9d7aedc49..fcd2d4fa8288b3 100644 --- a/examples/light-switch-app/nrfconnect/main/include/BindingHandler.h +++ b/examples/light-switch-app/nrfconnect/main/include/BindingHandler.h @@ -28,11 +28,6 @@ class BindingHandler { public: - static void Init(); - static void SwitchWorkerHandler(intptr_t); - static void PrintBindingTable(); - static bool IsGroupBound(); - struct BindingData { chip::EndpointId EndpointId; @@ -42,9 +37,24 @@ class BindingHandler bool IsGroup{ false }; }; + void Init(); + void PrintBindingTable(); + bool IsGroupBound(); + + static void SwitchWorkerHandler(intptr_t); + static void OnInvokeCommandFailure(chip::DeviceProxy * aDevice, BindingData & aBindingData, CHIP_ERROR aError); + + static BindingHandler & GetInstance() + { + static BindingHandler sBindingHandler; + return sBindingHandler; + } + private: static void OnOffProcessCommand(chip::CommandId, const EmberBindingTableEntry &, chip::DeviceProxy *, void *); static void LevelControlProcessCommand(chip::CommandId, const EmberBindingTableEntry &, chip::DeviceProxy *, void *); static void LightSwitchChangedHandler(const EmberBindingTableEntry &, chip::DeviceProxy *, void *); static void InitInternal(intptr_t); + + bool mCaseSessionRecovered = false; }; diff --git a/examples/lighting-app/bouffalolab/bl602/README.md b/examples/lighting-app/bouffalolab/bl602/README.md index b11e98aa1ed29d..8cb3295646a644 100644 --- a/examples/lighting-app/bouffalolab/bl602/README.md +++ b/examples/lighting-app/bouffalolab/bl602/README.md @@ -14,12 +14,16 @@ Generated files + ``` connectedhomeip/out/lighting_app_bl602/chip-bl602-lighting-example.bin + ``` - To delete generated executable, libraries and object files use: - $ cd ~/connectedhomeip/ - $ rm -rf out/ + ``` + $ cd ~/connectedhomeip/ + $ rm -rf out/ + ``` ## Flash @@ -32,19 +36,24 @@ commissioning and cluster control. - Set up python controller. + ``` $ cd {path-to-connectedhomeip} $ ./scripts/build_python.sh -m platform + ``` - Execute the controller. + ``` $ source ./out/python_env/bin/activate $ chip-device-ctrl + ``` ### Commissioning over BLE - Establish the secure session over BLE. BLE is the default mode in the application and is configurable through menuconfig. + ``` - chip-device-ctrl > ble-scan - chip-device-ctrl > set-pairing-wifi-credential TESTSSID P455W4RD - chip-device-ctrl > connect -ble 3904 20202021 135246 @@ -58,6 +67,7 @@ commissioning and cluster control. We have chosen a random node ID which is 135246. 4. TESTSSID : Wi-Fi SSID 5. P455W4RD : Wi-Fi Password + ``` ### Cluster control diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index cb36dca4ec8cc1..c6ce2b4fc1089a 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -254,6 +254,7 @@ efr32_executable("lighting_app") { "PW_RPC_LIGHTING_SERVICE=1", "PW_RPC_OTCLI_SERVICE=1", "PW_RPC_THREAD_SERVICE=1", + "PW_RPC_TRACING_SERVICE=1", ] sources += [ @@ -266,6 +267,9 @@ efr32_executable("lighting_app") { deps += [ "$dir_pw_hdlc:rpc_channel_output", "$dir_pw_stream:sys_io_stream", + "$dir_pw_trace", + "$dir_pw_trace_tokenized", + "$dir_pw_trace_tokenized:trace_rpc_service", "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", diff --git a/examples/lighting-app/efr32/README.md b/examples/lighting-app/efr32/README.md index a4e45a380c07af..79c2831ad3dff4 100644 --- a/examples/lighting-app/efr32/README.md +++ b/examples/lighting-app/efr32/README.md @@ -13,6 +13,7 @@ An example showing the use of CHIP on the Silicon Labs EFR32 MG12. - [Running the Complete Example](#running-the-complete-example) - [Notes](#notes) - [Running RPC console](#running-rpc-console) + - [Device Tracing](#device-tracing) - [Memory settings](#memory-settings) - [OTA Software Update](#ota-software-update) @@ -53,9 +54,9 @@ Silicon Labs platform. - Install some additional tools(likely already present for CHIP developers): -#Linux \$ sudo apt-get install git libwebkitgtk-1.0-0 ninja-build +#Linux `sudo apt-get install git libwebkitgtk-1.0-0 ninja-build` -#Mac OS X \$ brew install ninja +#Mac OS X `brew install ninja` - Supported hardware: @@ -79,55 +80,73 @@ Silicon Labs platform. * Build the example application: + ``` cd ~/connectedhomeip ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32/ ./out/lighting-app BRD4161A + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip $ rm -rf ./out/ + ``` OR use GN/Ninja directly + ``` $ cd ~/connectedhomeip/examples/lighting-app/efr32 $ git submodule update --init $ source third_party/connectedhomeip/scripts/activate.sh $ export EFR32_BOARD=BRD4161A $ gn gen out/debug $ ninja -C out/debug + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip/examples/lighting-app/efr32 $ rm -rf out/ + ``` * Build the example as Sleepy End Device (SED) + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32/ ./out/lighting-app_SED BRD4161A --sed + ``` or use gn as previously mentioned but adding the following arguments: + ``` $ gn gen out/debug '--args=efr32_board="BRD4161A" enable_sleepy_device=true chip_openthread_ftd=false' + ``` -* Build the example with pigweed RCP +* Build the example with pigweed RPC + ``` $ ./scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_rpc BRD4161A 'import("//with_pw_rpc.gni")' + ``` or use GN/Ninja Directly + ``` $ cd ~/connectedhomeip/examples/lighting-app/efr32 $ git submodule update --init $ source third_party/connectedhomeip/scripts/activate.sh $ export EFR32_BOARD=BRD4161A $ gn gen out/debug --args='import("//with_pw_rpc.gni")' $ ninja -C out/debug + ``` [Running Pigweed RPC console](#running-pigweed-rpc-console) For more build options, help is provided when running the build script without arguments + ``` ./scripts/examples/gn_efr32_example.sh + ``` @@ -135,8 +154,10 @@ arguments - On the command line: + ``` $ cd ~/connectedhomeip/examples/lighting-app/efr32 $ python3 out/debug/chip-efr32-lighting-example.flash.py + ``` - Or with the Ozone debugger, just load the .out file. @@ -164,14 +185,18 @@ after flashing the .out file. * Install the J-Link software + ``` $ cd ~/Downloads $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + ``` * In Linux, grant the logged in user the ability to talk to the development hardware via the linux tty device (/dev/ttyACMx) by adding them to the dialout group. + ``` $ sudo usermod -a -G dialout ${USER} + ``` Once the above is complete, log output can be viewed using the JLinkExe tool in combination with JLinkRTTClient as follows: @@ -180,15 +205,21 @@ combination with JLinkRTTClient as follows: For MG12 use: + ``` $ JLinkExe -device EFR32MG12PXXXF1024 -if JTAG -speed 4000 -autoconnect 1 + ``` For MG21 use: + ``` $ JLinkExe -device EFR32MG21AXXXF1024 -if SWD -speed 4000 -autoconnect 1 + ``` - In a second terminal, run the JLinkRTTClient to view logs: + ``` $ JLinkRTTClient + ``` @@ -272,12 +303,12 @@ combination with JLinkRTTClient as follows: need to add a static ipv6 addresses on both device and then an ipv6 route to the border router on your PC -#On Border Router: \$ sudo ip addr add dev 2002::2/64 +#On Border Router: `sudo ip addr add dev 2002::2/64` -#On PC(Linux): \$ sudo ip addr add dev 2002::1/64 +#On PC(Linux): `sudo ip addr add dev 2002::1/64` -#Add Ipv6 route on PC(Linux) \$ sudo ip route add /64 -via 2002::2 +#Add Ipv6 route on PC(Linux) +`sudo ip route add /64 via 2002::2` @@ -302,6 +333,18 @@ via 2002::2 `rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5))` +## Device Tracing + +Device tracing is available to analyze the device performance. To turn on +tracing, build with RPC enabled. See Build the example with pigweed RPC. + +Obtain tracing json file. + +``` + $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -d {PORT} -o {OUTPUT_FILE} \ + -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto +``` + ## Memory settings While most of the RAM usage in CHIP is static, allowing easier debugging and @@ -341,27 +384,35 @@ passed to the build scripts. ### Disabling logging -chip_progress_logging, chip_detail_logging, chip_automation_logging +`chip_progress_logging, chip_detail_logging, chip_automation_logging` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + ``` ### Debug build / release build -is_debug +`is_debug` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + ``` ### Disabling LCD -show_qr_code +`show_qr_code` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" + ``` ### KVS maximum entry count -kvs_max_entries +`kvs_max_entries` + ``` Set the maximum Kvs entries that can be stored in NVM (Default 75) Thresholds: 30 <= kvs_max_entries <= 255 $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A kvs_max_entries=50 + ``` diff --git a/examples/lighting-app/efr32/with_pw_rpc.gni b/examples/lighting-app/efr32/with_pw_rpc.gni index 3922567d5b071a..c705b92b12f6fd 100644 --- a/examples/lighting-app/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/efr32/with_pw_rpc.gni @@ -23,5 +23,9 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true +chip_build_pw_trace_lib = true cpp_standard = "gnu++17" + +# Light app on EFR enables tracing server +pw_trace_BACKEND = "$dir_pw_trace_tokenized" diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 0f6ef30f13a53e..7830bcc39c7641 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -46,7 +46,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -98,12 +101,17 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -123,8 +131,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -134,9 +142,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -230,7 +239,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMin = 16395; readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -499,7 +508,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -533,9 +542,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -659,7 +668,7 @@ server cluster GroupKeyManagement = 63 { nullable epoch_us epochStartTime2 = 7; } - attribute GroupKeyMapStruct groupKeyMap[] = 0; + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; readonly attribute GroupInfoMapStruct groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; @@ -689,10 +698,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster Groups = 4 { @@ -742,12 +751,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command AddGroup(AddGroupRequest): AddGroupResponse = 0; + command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command RemoveAllGroups(): DefaultSuccess = 4; - command AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Identify = 3 { @@ -790,9 +799,9 @@ server cluster Identify = 3 { INT16U timeout = 0; } - command Identify(IdentifyRequest): DefaultSuccess = 0; - command IdentifyQuery(): IdentifyQueryResponse = 1; - command TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) IdentifyQuery(): IdentifyQueryResponse = 1; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } server cluster LevelControl = 8 { @@ -825,7 +834,7 @@ server cluster LevelControl = 8 { attribute nullable int16u onTransitionTime = 18; attribute nullable int16u offTransitionTime = 19; attribute nullable int8u defaultMoveRate = 20; - attribute nullable int8u startUpCurrentLevel = 16384; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -952,14 +961,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1014,12 +1023,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } client cluster OtaSoftwareUpdateProvider = 41 { @@ -1197,7 +1206,7 @@ server cluster OnOff = 6 { readonly attribute boolean globalSceneControl = 16384; attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; - attribute nullable OnOffStartUpOnOff startUpOnOff = 16387; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -1249,7 +1258,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -1318,15 +1327,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } server cluster SoftwareDiagnostics = 52 { @@ -1566,7 +1575,7 @@ server cluster TimeFormatLocalization = 44 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 68458fe969457f..df2a191e7bb3a4 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -196,7 +196,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -270,7 +270,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -353,7 +353,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -503,7 +503,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -554,7 +554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -595,7 +595,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -621,7 +621,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -677,7 +677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -994,6 +994,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1346,6 +1391,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1406,7 +1466,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1479,7 +1539,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1894,7 +1954,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2035,7 +2095,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2110,7 +2170,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2296,7 +2356,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2341,7 +2401,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2487,7 +2547,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2522,7 +2582,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2623,7 +2683,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2658,7 +2718,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3644,7 +3704,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3679,7 +3739,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3915,7 +3975,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3950,7 +4010,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4126,7 +4186,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4197,7 +4257,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4268,7 +4328,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4367,7 +4427,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4516,7 +4576,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4963,7 +5023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5037,7 +5097,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5144,7 +5204,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5294,7 +5354,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5369,7 +5429,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5782,7 +5842,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "50", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6312,6 +6372,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6500,7 +6575,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6692,7 +6767,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6707,7 +6782,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6722,7 +6797,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6737,7 +6812,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6752,7 +6827,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6767,7 +6842,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6782,7 +6857,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6797,7 +6872,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6812,7 +6887,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6827,7 +6902,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6842,7 +6917,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6857,7 +6932,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6872,7 +6947,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6887,7 +6962,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6902,7 +6977,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6917,7 +6992,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6932,7 +7007,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6947,7 +7022,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6962,7 +7037,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6977,7 +7052,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -6992,7 +7067,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7007,7 +7082,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7022,7 +7097,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7037,7 +7112,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7052,7 +7127,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7067,7 +7142,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7082,7 +7157,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7097,7 +7172,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7112,7 +7187,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7303,11 +7378,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7318,11 +7393,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7333,11 +7408,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7392,7 +7467,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7463,7 +7538,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7493,6 +7568,5 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/mbed/README.md b/examples/lighting-app/mbed/README.md index 8c39ce7b772414..02a41c085e68d9 100644 --- a/examples/lighting-app/mbed/README.md +++ b/examples/lighting-app/mbed/README.md @@ -1,6 +1,4 @@ -

- ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)

Matter Arm Mbed OS Lighting Example Application

@@ -87,7 +85,9 @@ the network. Before building the example, check out the Matter repository and sync submodules using the following command: + ``` $ git submodule update --init + ``` Building the example application requires the use of **ARM Mbed-OS** sources and the **arm-none-gnu-eabi** toolchain. @@ -223,13 +223,17 @@ open a terminal session and connect to the serial port of the device. You can use **mbed-tools** for this purpose ([mbed-tools](https://github.com/ARMmbed/mbed-tools)): + ``` mbed-tools sterm -p /dev/ttyACM0 -b 115200 -e off + ``` After device reset these lines should be visible: + ``` [INFO][CHIP]: [-]Mbed lighting-app example application start ... [INFO][CHIP]: [-]Mbed lighting-app example application run + ``` The lighting-app application launched correctly and you can follow traces in the terminal. @@ -266,24 +270,34 @@ parameters as arguments: Example: + ``` chip-console -d /dev/ttyUSB0 -b 115200 -o /tmp/pw_rpc.out + ``` To control the lighting type the following command, where you define if 'on' state is true or false: + ``` In [1]: rpcs.chip.rpc.Lighting.Set(on=True) + ``` The response from the device should be: + ``` Out[1]: (Status.OK, pw.protobuf.Empty()) + ``` To check the lighting state type the following command: + ``` In [1]: rpcs.chip.rpc.Lighting.Get() + ``` The response from the device should contain the current lighting state: + ``` Out[1]: Status.OK, chip.rpc.LightingState(on=True)) + ``` For more details about RPC console and supported services visit [CHIP RPC console](../../common/pigweed/rpc_console/README.md). diff --git a/examples/lighting-app/nrfconnect/Kconfig b/examples/lighting-app/nrfconnect/Kconfig index d862fc1d2ace52..94a99f971ac195 100644 --- a/examples/lighting-app/nrfconnect/Kconfig +++ b/examples/lighting-app/nrfconnect/Kconfig @@ -15,6 +15,6 @@ # mainmenu "Matter nRF Connect Lighting Example Application" -rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/lighting-app/nrfconnect/README.md b/examples/lighting-app/nrfconnect/README.md index e2e4c4ae5b88c4..ff8013e360ad93 100644 --- a/examples/lighting-app/nrfconnect/README.md +++ b/examples/lighting-app/nrfconnect/README.md @@ -5,10 +5,8 @@ dimmable light bulb. It uses buttons to test changing the lighting and device states and LEDs to show the state of these changes. You can use this example as a reference for creating your own application. -

- Nordic Semiconductor logo - nRF52840 DK -

+![Nordic Smiconductor logo](../../platform/nrfconnect/doc/images/Logo_RGB_H-small.png) +![nRF52840 DK](../../platform/nrfconnect/doc/images/nRF52840-DK-small.png) The example is based on [Matter](https://github.com/project-chip/connectedhomeip) and Nordic @@ -265,7 +263,9 @@ NFC. Before building the example, check out the Matter repository and sync submodules using the following command: + ``` $ git submodule update --init + ``` The example requires a specific revision of the nRF Connect SDK. You can either install it along with the related tools directly on your system or use a Docker @@ -283,18 +283,24 @@ To use the Docker container for setup, complete the following steps: 1. If you do not have the nRF Connect SDK installed yet, create a directory for it by running the following command: + ``` $ mkdir ~/nrfconnect + ``` 2. Download the latest version of the nRF Connect SDK Docker image by running the following command: + ``` $ docker pull nordicsemi/nrfconnect-chip + ``` 3. Start Docker with the downloaded image by running the following command, customized to your needs as described below: + ``` $ docker run --rm -it -e RUNAS=$(id -u) -v ~/nrfconnect:/var/ncs -v ~/connectedhomeip:/var/chip \ -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" nordicsemi/nrfconnect-chip + ``` In this command: @@ -314,8 +320,10 @@ To use the Docker container for setup, complete the following steps: 4. Update the nRF Connect SDK to the most recent supported revision, by running the following command: + ``` $ cd /var/chip $ python3 scripts/setup/nrfconnect/update_ncs.py --update + ``` Now you can proceed with the [Building](#building) instruction. @@ -342,16 +350,20 @@ To use the native shell for setup, complete the following steps: nRF Connect SDK installation directory, and _toolchain-dir_ with the path to GNU Arm Embedded Toolchain. + ``` $ source nrfconnect-dir/zephyr/zephyr-env.sh $ export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb $ export GNUARMEMB_TOOLCHAIN_PATH=toolchain-dir + ``` 4. Update the nRF Connect SDK to the most recent supported revision by running the following command (replace _matter-dir_ with the path to Matter repository directory): + ``` $ cd matter-dir $ python3 scripts/setup/nrfconnect/update_ncs.py --update + ``` Now you can proceed with the [Building](#building) instruction. @@ -366,13 +378,17 @@ environment: 1. Navigate to the example's directory: + ``` $ cd examples/lighting-app/nrfconnect + ``` 2. Run the following command to build the example, with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own, for example `nrf52840dk_nrf52840`: - $ west build -b build-target + ``` + $ west build -b build-target + ``` You only need to specify the build target on the first build. See [Requirements](#requirements) for the build target names of compatible kits. @@ -385,14 +401,18 @@ If you're planning to build the example for a different kit or make changes to the configuration, remove all build artifacts before building. To do so, use the following command: + ``` $ rm -r build + ``` ### Building with release configuration To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: + ``` $ west build -b build-target -- -DCONF_FILE=prj_release.conf + ``` Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -405,7 +425,9 @@ host computer. To build the example with the RPC server, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own: + ``` $ west build -b build-target -- -DOVERLAY_CONFIG=rpc.overlay + ``` ### Building with Device Firmware Upgrade support @@ -415,13 +437,17 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): + ``` $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y + ``` To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): + ``` $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf + ``` > **Note**: > @@ -470,7 +496,9 @@ using the menuconfig utility. To open the menuconfig utility, run the following command from the example directory: + ``` $ west build -b build-target -t menuconfig + ``` Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -527,7 +555,9 @@ the nRF52840 Dongle. To flash the application to the device, use the west tool and run the following command from the example directory: + ``` $ west flash --erase + ``` If you have multiple development kits connected, west will prompt you to pick the correct one. @@ -535,7 +565,9 @@ the correct one. To debug the application on target, run the following command from the example directory: + ``` $ west debug + ``` @@ -575,13 +607,17 @@ Build or install the [rpc console](../../common/pigweed/rpc_console/README.md) Start the console + ``` $ chip-console --device /dev/ttyUSB0 + ``` From within the console you can then invoke rpcs: + ```python rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + ``` ## Device Tracing diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 93600227de7325..525fb27cbb635a 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -128,14 +128,6 @@ */ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) -/** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC - * - * Set these defines to 1 if NFC Commissioning is needed - */ -#define CONFIG_CHIP_NFC_COMMISSIONING 1 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 - /** * @def CHIP_CONFIG_MAX_FABRICS * diff --git a/examples/lighting-app/qpg/.gn b/examples/lighting-app/qpg/.gn index 3d48789e30ab3d..198384815a0384 100644 --- a/examples/lighting-app/qpg/.gn +++ b/examples/lighting-app/qpg/.gn @@ -17,8 +17,9 @@ 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 +# DISABLED since CI failed on PR 17352 +# Build error out for unused/unavailble include file (IPAddress.h : ) +check_system_includes = false default_args = { target_cpu = "arm" diff --git a/examples/lock-app/efr32/README.md b/examples/lock-app/efr32/README.md index 61c53124287916..ab1fe655e5a037 100644 --- a/examples/lock-app/efr32/README.md +++ b/examples/lock-app/efr32/README.md @@ -52,9 +52,9 @@ Silicon Labs platform. - Install some additional tools(likely already present for CHIP developers): -#Linux \$ sudo apt-get install git libwebkitgtk-1.0-0 ninja-build +#Linux `sudo apt-get install git libwebkitgtk-1.0-0 ninja-build` -#Mac OS X \$ brew install ninja +#Mac OS X `brew install ninja` - Supported hardware: @@ -78,55 +78,73 @@ Silicon Labs platform. * Build the example application: + ``` cd ~/connectedhomeip ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/efr32/ ./out/lock_app BRD4161A + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip $ rm -rf ./out/ + ``` OR use GN/Ninja directly + ``` $ cd ~/connectedhomeip/examples/lock-app/efr32 $ git submodule update --init $ source third_party/connectedhomeip/scripts/activate.sh $ export EFR32_BOARD=BRD4161A $ gn gen out/debug --args="efr32_sdk_root=\"${EFR32_SDK_ROOT}\" efr32_board=\"${EFR32_BOARD}\"" $ ninja -C out/debug + ``` - To delete generated executable, libraries and object files use: + ``` $ cd ~/connectedhomeip/examples/lock-app/efr32 $ rm -rf out/ + ``` * Build the example as Sleepy End Device (SED) + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32/ ./out/lighting-app_SED BRD4161A --sed + ``` or use gn as previously mentioned but adding the following arguments: + ``` $ gn gen out/debug '--args=efr32_board="BRD4161A" enable_sleepy_device=true chip_openthread_ftd=false' + ``` * Build the example with pigweed RCP + ``` $ ./scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_rpc BRD4161A 'import("//with_pw_rpc.gni")' + ``` or use GN/Ninja Directly + ``` $ cd ~/connectedhomeip/examples/lock-app/efr32 $ git submodule update --init $ source third_party/connectedhomeip/scripts/activate.sh $ export EFR32_BOARD=BRD4161A $ gn gen out/debug --args='import("//with_pw_rpc.gni")' $ ninja -C out/debug + ``` [Running Pigweed RPC console](#running-pigweed-rpc-console) For more build options, help is provided when running the build script without arguments + ``` ./scripts/examples/gn_efr32_example.sh + ``` @@ -134,8 +152,10 @@ arguments - On the command line: + ``` $ cd ~/connectedhomeip/examples/lock-app/efr32 $ python3 out/debug/chip-efr32-lock-example.flash.py + ``` - Or with the Ozone debugger, just load the .out file. @@ -163,14 +183,18 @@ after flashing the .out file. * Install the J-Link software + ``` $ cd ~/Downloads $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + ``` * In Linux, grant the logged in user the ability to talk to the development hardware via the linux tty device (/dev/ttyACMx) by adding them to the dialout group. + ``` $ sudo usermod -a -G dialout ${USER} + ``` Once the above is complete, log output can be viewed using the JLinkExe tool in combination with JLinkRTTClient as follows: @@ -179,15 +203,21 @@ combination with JLinkRTTClient as follows: For MG12 use: + ``` $ JLinkExe -device EFR32MG12PXXXF1024 -if JTAG -speed 4000 -autoconnect 1 + ``` For MG21 use: + ``` $ JLinkExe -device EFR32MG21AXXXF1024 -if SWD -speed 4000 -autoconnect 1 + ``` - In a second terminal, run the JLinkRTTClient to view logs: + ``` $ JLinkRTTClient + ``` @@ -306,27 +336,35 @@ features can easily be toggled on or off. Here is a short list of options : ### Disabling logging -chip_progress_logging, chip_detail_logging, chip_automation_logging +`chip_progress_logging, chip_detail_logging, chip_automation_logging` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + ``` ### Debug build / release build -is_debug +`is_debug` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false" + ``` ### Disabling LCD -show_qr_code +`show_qr_code` + ``` $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false" + ``` ### KVS maximum entry count -kvs_max_entries +`kvs_max_entries` + ``` Set the maximum Kvs entries that can be stored in NVM (Default 75) Thresholds: 30 <= kvs_max_entries <= 255 $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A kvs_max_entries=50 + ``` diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index d9d7260b1a33bc..85f8d7b0963d93 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -60,6 +60,7 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" PRIV_REQUIRES bt chip QRCode) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) @@ -172,6 +173,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" PRIV_REQUIRES chip QRCode bt) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index bd304867b07333..e8e32e7890098d 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -46,7 +46,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -54,7 +54,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -62,8 +62,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -98,12 +101,17 @@ server cluster AdministratorCommissioning = 60 { INT16U commissioningTimeout = 0; } - timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command RevokeCommissioning(): DefaultSuccess = 2; + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } server cluster Basic = 40 { + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + critical event StartUp = 0 { INT32U softwareVersion = 0; } @@ -123,8 +131,8 @@ server cluster Basic = 40 { readonly attribute vendor_id vendorID = 2; readonly attribute char_string<32> productName = 3; readonly attribute int16u productID = 4; - attribute char_string<32> nodeLabel = 5; - attribute char_string<2> location = 6; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; readonly attribute int16u hardwareVersion = 7; readonly attribute char_string<64> hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; @@ -134,9 +142,10 @@ server cluster Basic = 40 { readonly attribute long_char_string<256> productURL = 13; readonly attribute char_string<64> productLabel = 14; readonly attribute char_string<32> serialNumber = 15; - attribute boolean localConfigDisabled = 16; + attribute access(write: manage) boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute int16u clusterRevision = 65533; } @@ -183,6 +192,533 @@ server cluster DiagnosticLogs = 50 { command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; } +server cluster DoorLock = 257 { + enum DlAlarmCode : ENUM8 { + kLockJammed = 0; + kLockFactoryReset = 1; + kLockRadioPowerCycled = 3; + kWrongCodeEntryLimit = 4; + kFrontEsceutcheonRemoved = 5; + kDoorForcedOpen = 6; + kDoorAjar = 7; + kForcedUser = 8; + } + + enum DlCredentialRule : ENUM8 { + kSingle = 0; + kDouble = 1; + kTri = 2; + } + + enum DlCredentialType : ENUM8 { + kProgrammingPIN = 0; + kPin = 1; + kRfid = 2; + kFingerprint = 3; + kFingerVein = 4; + kFace = 5; + } + + enum DlDataOperationType : ENUM8 { + kAdd = 0; + kClear = 1; + kModify = 2; + } + + enum DlDoorState : ENUM8 { + kDoorOpen = 0; + kDoorClosed = 1; + kDoorJammed = 2; + kDoorForcedOpen = 3; + kDoorUnspecifiedError = 4; + kDoorAjar = 5; + } + + enum DlLockDataType : ENUM8 { + kUnspecified = 0; + kProgrammingCode = 1; + kUserIndex = 2; + kWeekDaySchedule = 3; + kYearDaySchedule = 4; + kHolidaySchedule = 5; + kPin = 6; + kRfid = 7; + kFingerprint = 8; + } + + enum DlLockOperationType : ENUM8 { + kLock = 0; + kUnlock = 1; + kNonAccessUserEvent = 2; + kForcedUserEvent = 3; + } + + enum DlLockState : ENUM8 { + kNotFullyLocked = 0; + kLocked = 1; + kUnlocked = 2; + } + + enum DlLockType : ENUM8 { + kDeadBolt = 0; + kMagnetic = 1; + kOther = 2; + kMortise = 3; + kRim = 4; + kLatchBolt = 5; + kCylindricalLock = 6; + kTubularLock = 7; + kInterconnectedLock = 8; + kDeadLatch = 9; + kDoorFurniture = 10; + } + + enum DlOperatingMode : ENUM8 { + kNormal = 0; + kVacation = 1; + kPrivacy = 2; + kNoRemoteLockUnlock = 3; + kPassage = 4; + } + + enum DlOperationError : ENUM8 { + kUnspecified = 0; + kInvalidCredential = 1; + kDisabledUserDenied = 2; + kRestricted = 3; + kInsufficientBattery = 4; + } + + enum DlOperationSource : ENUM8 { + kUnspecified = 0; + kManual = 1; + kProprietaryRemote = 2; + kKeypad = 3; + kAuto = 4; + kButton = 5; + kSchedule = 6; + kRemote = 7; + kRfid = 8; + kBiometric = 9; + } + + enum DlStatus : ENUM8 { + kSuccess = 0; + kFailure = 1; + kDuplicate = 2; + kOccupied = 3; + kInvalidField = 133; + kNotFound = 139; + } + + enum DlUserStatus : ENUM8 { + kAvailable = 0; + kOccupiedEnabled = 1; + kOccupiedDisabled = 3; + } + + enum DlUserType : ENUM8 { + kUnrestrictedUser = 0; + kYearDayScheduleUser = 1; + kWeekDayScheduleUser = 2; + kProgrammingUser = 3; + kNonAccessUser = 4; + kForcedUser = 5; + kDisposableUser = 6; + kExpiringUser = 7; + kScheduleRestrictedUser = 8; + kRemoteOnlyUser = 9; + } + + enum DoorLockOperationEventCode : ENUM8 { + kUnknownOrMfgSpecific = 0; + kLock = 1; + kUnlock = 2; + kLockInvalidPinOrId = 3; + kLockInvalidSchedule = 4; + kUnlockInvalidPinOrId = 5; + kUnlockInvalidSchedule = 6; + kOneTouchLock = 7; + kKeyLock = 8; + kKeyUnlock = 9; + kAutoLock = 10; + kScheduleLock = 11; + kScheduleUnlock = 12; + kManualLock = 13; + kManualUnlock = 14; + } + + enum DoorLockProgrammingEventCode : ENUM8 { + kUnknownOrMfgSpecific = 0; + kMasterCodeChanged = 1; + kPinAdded = 2; + kPinDeleted = 3; + kPinChanged = 4; + kIdAdded = 5; + kIdDeleted = 6; + } + + enum DoorLockSetPinOrIdStatus : ENUM8 { + kSuccess = 0; + kGeneralFailure = 1; + kMemoryFull = 2; + kDuplicateCodeError = 3; + } + + enum DoorLockUserStatus : ENUM8 { + kAvailable = 0; + kOccupiedEnabled = 1; + kOccupiedDisabled = 3; + kNotSupported = 255; + } + + enum DoorLockUserType : ENUM8 { + kUnrestricted = 0; + kYearDayScheduleUser = 1; + kWeekDayScheduleUser = 2; + kMasterUser = 3; + kNonAccessUser = 4; + kNotSupported = 255; + } + + bitmap DlAlarmMask : BITMAP16 { + kLockingMechanismJammed = 0x1; + kLockResetToFactoryDefaults = 0x2; + kReserved = 0x4; + kRFModulePowerCycled = 0x8; + kWrongCodeEntryLimit = 0x10; + kFrontEscutcheonRemovedFromMain = 0x20; + kForcedDoorOpenUnderDoorLockedCondition = 0x40; + } + + bitmap DlCredentialRuleMask : BITMAP8 { + kSingle = 0x1; + kDual = 0x2; + kTri = 0x4; + } + + bitmap DlCredentialRulesSupport : BITMAP8 { + kSingle = 0x1; + kDual = 0x2; + kTri = 0x4; + } + + bitmap DlDaysMaskMap : BITMAP8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + } + + bitmap DlDefaultConfigurationRegister : BITMAP16 { + kEnableLocalProgrammingEnabled = 0x1; + kKeypadInterfaceDefaultAccessEnabled = 0x2; + kRemoteInterfaceDefaultAccessIsEnabled = 0x4; + kSoundEnabled = 0x20; + kAutoRelockTimeSet = 0x40; + kLEDSettingsSet = 0x80; + } + + bitmap DlKeypadOperationEventMask : BITMAP16 { + kUnknown = 0x1; + kLock = 0x2; + kUnlock = 0x4; + kLockInvalidPIN = 0x8; + kLockInvalidSchedule = 0x10; + kUnlockInvalidCode = 0x20; + kUnlockInvalidSchedule = 0x40; + kNonAccessUserOpEvent = 0x80; + } + + bitmap DlKeypadProgrammingEventMask : BITMAP16 { + kUnknown = 0x1; + kProgrammingPINChanged = 0x2; + kPINAdded = 0x4; + kPINCleared = 0x8; + kPINChanged = 0x10; + } + + bitmap DlLocalProgrammingFeatures : BITMAP8 { + kAddUsersCredentialsSchedulesLocally = 0x1; + kModifyUsersCredentialsSchedulesLocally = 0x2; + kClearUsersCredentialsSchedulesLocally = 0x4; + kAdjustLockSettingsLocally = 0x8; + } + + bitmap DlManualOperationEventMask : BITMAP16 { + kUnknown = 0x1; + kThumbturnLock = 0x2; + kThumbturnUnlock = 0x4; + kOneTouchLock = 0x8; + kKeyLock = 0x10; + kKeyUnlock = 0x20; + kAutoLock = 0x40; + kScheduleLock = 0x80; + kScheduleUnlock = 0x100; + kManualLock = 0x200; + kManualUnlock = 0x400; + } + + bitmap DlRFIDOperationEventMask : BITMAP16 { + kUnknown = 0x1; + kLock = 0x2; + kUnlock = 0x4; + kLockInvalidRFID = 0x8; + kLockInvalidSchedule = 0x10; + kUnlockInvalidRFID = 0x20; + kUnlockInvalidSchedule = 0x40; + } + + bitmap DlRFIDProgrammingEventMask : BITMAP16 { + kUnknown = 0x1; + kRFIDCodeAdded = 0x20; + kRFIDCodeCleared = 0x40; + } + + bitmap DlRemoteOperationEventMask : BITMAP16 { + kUnknown = 0x1; + kLock = 0x2; + kUnlock = 0x4; + kLockInvalidCode = 0x8; + kLockInvalidSchedule = 0x10; + kUnlockInvalidCode = 0x20; + kUnlockInvalidSchedule = 0x40; + } + + bitmap DlRemoteProgrammingEventMask : BITMAP16 { + kUnknown = 0x1; + kProgrammingPINChanged = 0x2; + kPINAdded = 0x4; + kPINCleared = 0x8; + kPINChanged = 0x10; + kRFIDCodeAdded = 0x20; + kRFIDCodeCleared = 0x40; + } + + bitmap DlSupportedOperatingModes : BITMAP16 { + kNormal = 0x1; + kVacation = 0x2; + kPrivacy = 0x4; + kNoRemoteLockUnlock = 0x8; + kPassage = 0x10; + } + + bitmap DoorLockDayOfWeek : BITMAP8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + } + + bitmap DoorLockFeature : BITMAP32 { + kPINCredentials = 0x1; + kRFIDCredentials = 0x2; + kFingerCredentials = 0x4; + kLogging = 0x8; + kAccessSchedules = 0x10; + kDoorPositionSensor = 0x20; + kFaceCredentials = 0x40; + kCredentialsOTA = 0x80; + kUsersManagement = 0x100; + kNotifications = 0x200; + } + + struct DlCredential { + DlCredentialType credentialType = 0; + INT16U credentialIndex = 1; + } + + critical event DoorLockAlarm = 0 { + DlAlarmCode alarmCode = 0; + } + + critical event DoorStateChange = 1 { + DlDoorState doorState = 0; + } + + critical event LockOperation = 2 { + DlLockOperationType lockOperationType = 0; + DlOperationSource operationSource = 1; + nullable INT16U userIndex = 2; + nullable fabric_idx fabricIndex = 3; + nullable NODE_ID sourceNode = 4; + optional nullable DlCredential credentials[] = 5; + } + + critical event LockOperationError = 3 { + DlLockOperationType lockOperationType = 0; + DlOperationSource operationSource = 1; + DlOperationError operationError = 2; + nullable INT16U userIndex = 3; + nullable fabric_idx fabricIndex = 4; + nullable NODE_ID sourceNode = 5; + optional nullable DlCredential credentials[] = 6; + } + + info event LockUserChange = 4 { + DlLockDataType lockDataType = 0; + DlDataOperationType dataOperationType = 1; + DlOperationSource operationSource = 2; + nullable INT16U userIndex = 3; + nullable fabric_idx fabricIndex = 4; + nullable NODE_ID sourceNode = 5; + nullable INT16U dataIndex = 6; + } + + readonly attribute nullable DlLockState lockState = 0; + readonly attribute DlLockType lockType = 1; + readonly attribute nullable DlDoorState doorState = 3; + attribute access(write: manage) int32u autoRelockTime = 35; + attribute access(write: administer) boolean requirePINforRemoteOperation = 51; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct LockDoorRequest { + optional OCTET_STRING pinCode = 0; + } + + request struct UnlockDoorRequest { + optional OCTET_STRING pinCode = 0; + } + + request struct SetWeekDayScheduleRequest { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + DlDaysMaskMap daysMask = 2; + INT8U startHour = 3; + INT8U startMinute = 4; + INT8U endHour = 5; + INT8U endMinute = 6; + } + + request struct GetWeekDayScheduleRequest { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + } + + request struct ClearWeekDayScheduleRequest { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + } + + request struct SetYearDayScheduleRequest { + INT8U yearDayIndex = 0; + INT16U userIndex = 1; + epoch_s localStartTime = 2; + epoch_s localEndTime = 3; + } + + request struct GetYearDayScheduleRequest { + INT8U yearDayIndex = 0; + INT16U userIndex = 1; + } + + request struct ClearYearDayScheduleRequest { + INT8U yearDayIndex = 0; + INT16U userIndex = 1; + } + + request struct SetUserRequest { + DlDataOperationType operationType = 0; + INT16U userIndex = 1; + nullable CHAR_STRING userName = 2; + nullable INT32U userUniqueId = 3; + nullable DlUserStatus userStatus = 4; + nullable DlUserType userType = 5; + nullable DlCredentialRule credentialRule = 6; + } + + request struct GetUserRequest { + INT16U userIndex = 0; + } + + request struct ClearUserRequest { + INT16U userIndex = 0; + } + + request struct SetCredentialRequest { + DlDataOperationType operationType = 0; + DlCredential credential = 1; + LONG_OCTET_STRING credentialData = 2; + nullable INT16U userIndex = 3; + nullable DlUserStatus userStatus = 4; + nullable DlUserType userType = 5; + } + + request struct GetCredentialStatusRequest { + DlCredential credential = 0; + } + + request struct ClearCredentialRequest { + nullable DlCredential credential = 0; + } + + response struct GetWeekDayScheduleResponse { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + DlStatus status = 2; + optional DlDaysMaskMap daysMask = 3; + optional INT8U startHour = 4; + optional INT8U startMinute = 5; + optional INT8U endHour = 6; + optional INT8U endMinute = 7; + } + + response struct GetYearDayScheduleResponse { + INT8U yearDayIndex = 0; + INT16U userIndex = 1; + DlStatus status = 2; + optional epoch_s localStartTime = 3; + optional epoch_s localEndTime = 4; + } + + response struct GetUserResponse { + INT16U userIndex = 0; + nullable CHAR_STRING userName = 1; + nullable INT32U userUniqueId = 2; + nullable DlUserStatus userStatus = 3; + nullable DlUserType userType = 4; + nullable DlCredentialRule credentialRule = 5; + nullable DlCredential credentials[] = 6; + nullable fabric_idx creatorFabricIndex = 7; + nullable fabric_idx lastModifiedFabricIndex = 8; + nullable INT16U nextUserIndex = 9; + } + + response struct SetCredentialResponse { + DlStatus status = 0; + nullable INT16U userIndex = 1; + nullable INT16U nextCredentialIndex = 2; + } + + response struct GetCredentialStatusResponse { + boolean credentialExists = 0; + nullable INT16U userIndex = 1; + nullable INT16U nextCredentialIndex = 2; + } + + timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; + timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1; + command access(invoke: administer) SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11; + command access(invoke: administer) GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12; + command access(invoke: administer) ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13; + command access(invoke: administer) SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14; + command access(invoke: administer) GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15; + command access(invoke: administer) ClearYearDaySchedule(ClearYearDayScheduleRequest): DefaultSuccess = 16; + timed command access(invoke: administer) SetUser(SetUserRequest): DefaultSuccess = 26; + command access(invoke: administer) GetUser(GetUserRequest): GetUserResponse = 27; + timed command access(invoke: administer) ClearUser(ClearUserRequest): DefaultSuccess = 29; + timed command access(invoke: administer) SetCredential(SetCredentialRequest): SetCredentialResponse = 34; + command access(invoke: administer) GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; + timed command access(invoke: administer) ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; +} + server cluster EthernetNetworkDiagnostics = 55 { enum PHYRateType : ENUM8 { k10m = 0; @@ -236,7 +772,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute RegulatoryLocationType regulatoryConfig = 2; readonly attribute RegulatoryLocationType locationCapability = 3; @@ -270,9 +806,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralDiagnostics = 51 { @@ -436,14 +972,14 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int8u maxNetworks = 0; - readonly attribute NetworkInfo networks[] = 1; + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfo networks[] = 1; readonly attribute int8u scanMaxTimeSeconds = 2; readonly attribute int8u connectMaxTimeSeconds = 3; - attribute boolean interfaceEnabled = 4; - readonly attribute nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute nullable octet_string<32> lastNetworkID = 6; - readonly attribute nullable int32s lastConnectErrorValue = 7; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -498,12 +1034,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } client cluster OtaSoftwareUpdateProvider = 41 { @@ -674,7 +1210,7 @@ server cluster OnOff = 6 { readonly attribute boolean globalSceneControl = 16384; attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; - attribute nullable OnOffStartUpOnOff startUpOnOff = 16387; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -712,7 +1248,7 @@ server cluster OperationalCredentials = 62 { fabric_idx fabricIndex = 254; } - readonly attribute NOCStruct NOCs[] = 0; + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -781,15 +1317,15 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; - command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12; } server cluster PowerSource = 47 { @@ -1079,7 +1615,7 @@ server cluster TimeFormatLocalization = 44 { } server cluster UserLabel = 65 { - attribute LabelStruct labelList[] = 0; + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute int16u clusterRevision = 65533; } @@ -1173,6 +1709,7 @@ endpoint 0 { endpoint 1 { server cluster Descriptor; + server cluster DoorLock; server cluster OnOff; server cluster PowerSource; } diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 9a1eae4ee71905..e08b316fe5e0ad 100755 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -136,7 +136,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -177,7 +177,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -345,7 +345,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -419,7 +419,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -502,7 +502,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -652,7 +652,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -703,7 +703,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -744,7 +744,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -787,7 +787,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -822,7 +822,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -991,6 +991,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1343,6 +1388,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1403,7 +1463,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1443,11 +1503,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1462,7 +1522,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1476,7 +1536,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1594,7 +1654,7 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2053,7 +2113,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2194,7 +2254,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2269,7 +2329,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2332,7 +2392,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2455,7 +2515,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2500,7 +2560,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2646,7 +2706,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2681,7 +2741,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2782,7 +2842,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2817,7 +2877,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3803,7 +3863,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3838,7 +3898,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4074,7 +4134,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4109,7 +4169,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4285,7 +4345,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4336,7 +4396,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4407,7 +4467,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4506,7 +4566,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4572,7 +4632,7 @@ "reportableChange": 0 }, { - "name": "fabrics list", + "name": "Fabrics", "code": 1, "mfgCode": null, "side": "server", @@ -4655,7 +4715,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4783,7 +4843,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4854,7 +4914,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4970,7 +5030,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5011,7 +5071,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5179,7 +5239,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5253,7 +5313,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5336,7 +5396,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5486,7 +5546,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5537,7 +5597,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5679,7 +5739,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5735,7 +5795,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5778,7 +5838,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5813,7 +5873,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6253,6 +6313,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6442,13 +6517,126 @@ ] }, { - "name": "Occupancy Sensing", - "code": 1030, + "name": "Door Lock", + "code": 257, "mfgCode": null, - "define": "OCCUPANCY_SENSING_CLUSTER", + "define": "DOOR_LOCK_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "LockDoor", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UnlockDoor", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetWeekDaySchedule", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetWeekDaySchedule", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ClearWeekDaySchedule", + "code": 13, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "SetYearDaySchedule", + "code": 14, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetYearDaySchedule", + "code": 15, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ClearYearDaySchedule", + "code": 16, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "SetUser", + "code": 26, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetUser", + "code": 27, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ClearUser", + "code": 29, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "SetCredential", + "code": 34, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetCredentialStatus", + "code": 36, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ClearCredential", + "code": 38, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -6459,7 +6647,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6468,21 +6656,819 @@ ] }, { - "name": "Occupancy Sensing", - "code": 1030, + "name": "Door Lock", + "code": 257, "mfgCode": null, - "define": "OCCUPANCY_SENSING_CLUSTER", + "define": "DOOR_LOCK_CLUSTER", "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ + "enabled": 1, + "commands": [ { - "name": "occupancy", - "code": 0, + "name": "GetWeekDayScheduleResponse", + "code": 12, "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetYearDayScheduleResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetUserResponse", + "code": 28, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "SetCredentialResponse", + "code": 35, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetCredentialStatusResponse", + "code": 37, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "LockState", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LockType", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActuatorEnabled", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DoorState", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DoorOpenEvents", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorClosedEvents", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OpenPeriod", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfLogRecordsSupported", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfTotalUsersSupported", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPINUsersSupported", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfRFIDUsersSupported", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfWeekDaySchedulesSupportedPerUser", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfYearDaySchedulesSupportedPerUser", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfHolidaySchedulesSupported", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPINCodeLength", + "code": 23, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "8", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinPINCodeLength", + "code": 24, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxRFIDCodeLength", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "20", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinRFIDCodeLength", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CredentialRulesSupport", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableLogging", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Language", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LEDSettings", + "code": 34, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AutoRelockTime", + "code": 35, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "60", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoundVolume", + "code": 36, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperatingMode", + "code": 37, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedOperatingModes", + "code": 38, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFF6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultConfigurationRegister", + "code": 39, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableLocalProgramming", + "code": 40, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableOneTouchLocking", + "code": 41, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EnableInsideStatusLED", + "code": 42, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnablePrivacyModeButton", + "code": 43, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalProgrammingFeatures", + "code": 44, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WrongCodeEntryLimit", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UserCodeTemporaryDisableTime", + "code": 49, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SendPINOverTheAir", + "code": 50, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RequirePINforRemoteOperation", + "code": 51, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ExpiringUserTimeout", + "code": 53, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AlarmMask", + "code": 64, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "KeypadOperationEventMask", + "code": 65, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemoteOperationEventMask", + "code": 66, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ManualOperationEventMask", + "code": 67, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RFIDOperationEventMask", + "code": 68, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "KeypadProgrammingEventMask", + "code": 69, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemoteProgrammingEventMask", + "code": 70, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RFIDProgrammingEventMask", + "code": 71, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "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", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6530,7 +7516,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lock-app/mbed/README.md b/examples/lock-app/mbed/README.md index 7f6db4d2886c4a..cc48cebeb68ae9 100644 --- a/examples/lock-app/mbed/README.md +++ b/examples/lock-app/mbed/README.md @@ -1,6 +1,4 @@ -

- ARM Mbed-OS logo -

+![ARM Mbed-OS logo](https://raw.githubusercontent.com/ARMmbed/mbed-os/master/logo.png)

Matter Arm Mbed OS Lock Example Application

diff --git a/examples/lock-app/nrfconnect/Kconfig b/examples/lock-app/nrfconnect/Kconfig index ccf45058d8fca3..ddfeff16127be7 100644 --- a/examples/lock-app/nrfconnect/Kconfig +++ b/examples/lock-app/nrfconnect/Kconfig @@ -23,6 +23,6 @@ config STATE_LEDS the device into a network or the factory reset initiation. Note that setting this option to 'n' does not disable the LED indicating the state of the simulated bolt. -rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 8259ae1bbf635d..16ab053b7244cc 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -45,6 +45,7 @@ using namespace ::chip; using namespace ::chip::app; +using namespace ::chip::app::Clusters::DoorLock; using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; @@ -549,11 +550,12 @@ void AppTask::DispatchEvent(AppEvent * aEvent) void AppTask::UpdateClusterState() { - // write the new on/off value - EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kLockEndpointId, !BoltLockMgr().IsUnlocked()); - + EmberAfStatus status; + LOG_INF("Updating door lock state"); + status = Clusters::DoorLock::Attributes::LockState::Set( + kLockEndpointId, BoltLockMgr().IsUnlocked() ? DlLockState::kUnlocked : DlLockState::kLocked); if (status != EMBER_ZCL_STATUS_SUCCESS) { - LOG_ERR("Updating on/off %x", status); + LOG_ERR("Updating door lock state %x", status); } } diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp index 5ce622e1e8c123..d9a65ff918f2d8 100644 --- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp @@ -19,39 +19,46 @@ #include "AppTask.h" #include "BoltLockManager.h" -#include +#include #include #include -#include +#include using namespace ::chip; using namespace ::chip::app::Clusters; +using namespace ::chip::app::Clusters::DoorLock; -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, - uint16_t size, uint8_t * value) +LOG_MODULE_DECLARE(app, CONFIG_MATTER_LOG_LEVEL); + +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) { - if (attributePath.mClusterId == OnOff::Id && attributePath.mAttributeId == OnOff::Attributes::OnOff::Id) - { - BoltLockMgr().InitiateAction(0, *value ? BoltLockManager::LOCK_ACTION : BoltLockManager::UNLOCK_ACTION); - } + LOG_INF("Locking"); + BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); + return true; } -/** @brief OnOff Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - * TODO Issue #3841 - * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster - * attributes to the default value. - * The logic here expects something similar to the deprecated Plugins callback - * emberAfPluginOnOffClusterServerPostInitCallback. - * - */ -void emberAfOnOffClusterInitCallback(EndpointId endpoint) +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, + DlOperationError & err) { + LOG_INF("Unlocking"); + BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); + return true; +} + +void emberAfDoorLockClusterInitCallback(EndpointId endpoint) +{ + DoorLockServer::Instance().InitServer(endpoint); + EmberAfStatus status = DoorLock::Attributes::LockType::Set(endpoint, DlLockType::kDeadBolt); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + LOG_ERR("Updating type %x", status); + } + // Set FeatureMap to 0, defaults is + //(kUsersManagement|kAccessSchedules|kRFIDCredentials|kPINCredentials) 0x113 + status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + LOG_ERR("Updating type %x", status); + } GetAppTask().UpdateClusterState(); } diff --git a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn index 54fb8e0017490a..744bbeb839e402 100644 --- a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn @@ -21,6 +21,8 @@ import("${chip_root}/third_party/simw-top-mini/simw_config.gni") import("${k32w0_sdk_build_root}/k32w0_executable.gni") import("${k32w0_sdk_build_root}/k32w0_sdk.gni") +import("${chip_root}/src/crypto/crypto.gni") + assert(current_os == "freertos") k32w0_platform_dir = "${chip_root}/examples/platform/nxp/k32w/k32w0" @@ -44,6 +46,10 @@ k32w0_sdk("sdk") { "${k32w0_platform_dir}/util/include", ] + if (chip_with_se05x == 1) { + include_dirs += [ "${chip_root}/examples/platform/nxp/se05x" ] + } + defines = [] if (is_debug) { defines += [ "BUILD_RELEASE=0" ] diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 688a563932b9d6..58a0ade248740e 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -128,14 +128,6 @@ */ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) -/** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC - * - * Set these defines to 1 if NFC Commissioning is needed - */ -#define CONFIG_CHIP_NFC_COMMISSIONING 1 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 - /** * @def CHIP_CONFIG_MAX_FABRICS * diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 837c18b4d210ff..ffb3a268d38ee4 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -38,6 +38,13 @@ #include "LEDWidget.h" #include "app_config.h" +#if CHIP_CRYPTO_HSM +#include +#endif +#ifdef ENABLE_HSM_DEVICE_ATTESTATION +#include "DeviceAttestationSe05xCredsExample.h" +#endif + constexpr uint32_t kFactoryResetTriggerTimeout = 6000; constexpr uint8_t kAppEventQueueSize = 10; @@ -87,7 +94,11 @@ CHIP_ERROR AppTask::Init() PlatformMgr().ScheduleWork(InitServer, 0); // Initialize device attestation config +#ifdef ENABLE_HSM_DEVICE_ATTESTATION + SetDeviceAttestationCredentialsProvider(Examples::GetExampleSe05xDACProvider()); +#else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); +#endif // QR code will be used with CHIP Tool PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); diff --git a/examples/lock-app/qpg/.gn b/examples/lock-app/qpg/.gn index 3d48789e30ab3d..198384815a0384 100644 --- a/examples/lock-app/qpg/.gn +++ b/examples/lock-app/qpg/.gn @@ -17,8 +17,9 @@ 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 +# DISABLED since CI failed on PR 17352 +# Build error out for unused/unavailble include file (IPAddress.h : ) +check_system_includes = false default_args = { target_cpu = "arm" diff --git a/examples/log-source-app/linux/main.cpp b/examples/log-source-app/linux/main.cpp index ba30742d356b30..9443a946e1a871 100644 --- a/examples/log-source-app/linux/main.cpp +++ b/examples/log-source-app/linux/main.cpp @@ -63,7 +63,7 @@ DiagnosticLogsCommandHandler & GetLogProvider() return LogProvider; } -void LoggingCallback(const char * module, uint8_t category, const char * msg, va_list args) +void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, const char * msg, va_list args) { // Print the log on console for debug va_list argsCopy; @@ -75,7 +75,9 @@ void LoggingCallback(const char * module, uint8_t category, const char * msg, va char buffer2[kMaxLogMessageLength]; int s1 = vsnprintf(buffer1, sizeof(buffer1), msg, args); int s2 = snprintf(buffer2, sizeof(buffer2), "%s:%.*s", module, s1, buffer1); - GetLogProvider().PushLog(chip::ByteSpan(reinterpret_cast(buffer2), s2)); + + size_t len = chip::CanCastTo(s2) ? static_cast(s2) : SIZE_MAX; + GetLogProvider().PushLog(chip::ByteSpan(reinterpret_cast(buffer2), len)); } int main(int argc, char * argv[]) diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 98965a1c7276e0..0b13c89d19b97c 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -41,7 +41,7 @@ server cluster AccessControl = 31 { fabric_idx fabricIndex = 254; } - info event AccessControlEntryChanged = 0 { + info event access(read: administer) AccessControlEntryChanged = 0 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -49,7 +49,7 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - info event AccessControlExtensionChanged = 1 { + info event access(read: administer) AccessControlExtensionChanged = 1 { nullable node_id adminNodeID = 1; nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; @@ -57,8 +57,11 @@ server cluster AccessControl = 31 { fabric_idx adminFabricIndex = 254; } - attribute AccessControlEntry acl[] = 0; - attribute ExtensionEntry extension[] = 1; + attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0; + attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; readonly attribute attrib_id attributeList[] = 65531; readonly attribute int16u clusterRevision = 65533; } @@ -141,7 +144,7 @@ server cluster GeneralCommissioning = 48 { INT16U failSafeExpiryLengthSeconds = 0; } - attribute int64u breadcrumb = 0; + attribute access(write: administer) int64u breadcrumb = 0; readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; readonly attribute boolean supportsConcurrentConnection = 4; readonly attribute int16u clusterRevision = 65533; @@ -172,9 +175,9 @@ server cluster GeneralCommissioning = 48 { CHAR_STRING debugText = 1; } - command ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command CommissioningComplete(): CommissioningCompleteResponse = 4; + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -289,12 +292,12 @@ server cluster NetworkCommissioning = 49 { nullable INT32S errorValue = 2; } - command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; } server cluster OperationalCredentials = 62 { @@ -378,13 +381,13 @@ server cluster OperationalCredentials = 62 { optional CHAR_STRING debugText = 2; } - command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command CSRRequest(CSRRequestRequest): CSRResponse = 4; - command AddNOC(AddNOCRequest): NOCResponse = 6; - command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; } diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index c9159251c164e0..7e6ba462098778 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -71,7 +71,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -121,7 +121,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -196,7 +196,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -270,7 +270,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -353,7 +353,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -503,7 +503,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -554,7 +554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -595,7 +595,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -784,6 +784,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -1136,6 +1181,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1196,7 +1256,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1292,7 +1352,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1367,7 +1427,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1418,7 +1478,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1539,7 +1599,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1590,7 +1650,7 @@ ], "attributes": [ { - "name": "fabrics list", + "name": "Fabrics", "code": 1, "mfgCode": null, "side": "server", @@ -1658,7 +1718,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1869,7 +1929,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2300,7 +2360,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2343,7 +2403,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2429,7 +2489,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2568,7 +2628,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3344,7 +3404,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3370,7 +3430,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3441,7 +3501,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "4", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/ota-provider-app/linux/README.md b/examples/ota-provider-app/linux/README.md index 5eff4f0532f938..af21d26be9e773 100644 --- a/examples/ota-provider-app/linux/README.md +++ b/examples/ota-provider-app/linux/README.md @@ -18,6 +18,7 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c | -a, --applyUpdateAction \ | Value for the Action field in the first ApplyUpdateResponse.
For all subsequent responses, the value of proceed will be used. | | -c, --userConsentNeeded | If supplied, value of the UserConsentNeeded field in the QueryImageResponse is set to true. This is only applicable if value of the RequestorCanConsent field in QueryImage Command is true.
Otherwise, value of the UserConsentNeeded field is false. | | -f, --filepath \ | Path to a file containing an OTA image | +| -i, --imageUri \ | Value for the ImageURI field in the QueryImageResponse. If none is supplied, a valid URI is generated. | | -o, --otaImageList \ | Path to a file containing a list of OTA images | | -p, --delayedApplyActionTimeSec \