diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c33b5913d62d1c..f64fd0a27f68fc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -53,8 +53,16 @@ RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/resty RUN chmod +x /home/$USERNAME/bin/restyle-path RUN chown -R $USERNAME:$USERNAME /home/$USERNAME RUN echo "PATH=/home/$USERNAME/bin:${PATH}" >> /home/$USERNAME/.bashrc + # $USERNAME needs to own the esp-idf and tools for the examples to build RUN chown -R $USERNAME:$USERNAME /opt/espressif/esp-idf RUN chown -R $USERNAME:$USERNAME /opt/espressif/tools + # $USERNAME needs to own west configuration to build nRF Connect examples -RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/.west +RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/ + +# allow read/write access to header and libraries +RUN chown -R $USERNAME:$USERNAME /opt/ubuntu-21.04-aarch64-sysroot/usr/ + +# allow licenses to be accepted +RUN chown -R $USERNAME:$USERNAME /opt/android/sdk diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml index b25df22401c6b6..02d970ced79050 100644 --- a/.github/workflows/docker_img.yaml +++ b/.github/workflows/docker_img.yaml @@ -31,8 +31,24 @@ jobs: strategy: fail-fast: false matrix: - # TODO: Enables "-crosscompile" and "-vscode" images - img: ["", "-android", "-cirque", "-doxygen", "-efr32", "-esp32", "-esp32-qemu", "-infineon", "-k32w", "-mbed-os", "-nrf-platform", "-telink", "-tizen"] + img: + - "" + - "-ameba" + - "-android" + - "-cirque" + - "-crosscompile" + - "-doxygen" + - "-efr32" + - "-esp32" + - "-esp32-qemu" + - "-infineon" + - "-k32w" + - "-mbed-os" + - "-nrf-platform" + - "-telink" + - "-tizen" + # NOTE: vscode image consumes ~52 GB disk space but GitHub-hosted runners provide ~10 GB free disk space(https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) + #- "-vscode" steps: - name: Checkout uses: actions/checkout@v2 @@ -43,6 +59,7 @@ jobs: - name: Scan for vulnerabilities uses: crazy-max/docker-scan-action@master with: - image: connectedhomeip/chip-build${{ matrix.img }}:0.5.33 + # NOTE: This task validates the images built previously with latest tag + image: connectedhomeip/chip-build${{ matrix.img }}:latest annotations: true diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index b7ef9c604c8032..59ad6edd93fa2a 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -61,18 +61,23 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Build example EFR32 Lock App for BRD4161A - timeout-minutes: 10 + + - name: Build some BRD4161A variants + timeout-minutes: 30 run: | - scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_debug BRD4161A - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A lock-app \ - out/lock_app_debug/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/ - - name: Build example EFR32 Lighting App for BRD4161A - timeout-minutes: 10 + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target-glob '*-brd4161a-{lock,light,unit-test}' \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare bloat report for light app run: | - scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug BRD4161A - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A lighting-app \ - out/lighting_app_debug/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4161A lighting-app \ + out/efr32-brd4161a-light/chip-efr32-lighting-example.out \ + /tmp/bloat_reports/ - name: Build example EFR32 Lighting App for BRD4161A with RPCs timeout-minutes: 10 run: | diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index de651be3d54ad9..ec6188e77c222a 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -61,7 +61,12 @@ jobs: timeout-minutes: 10 run: | scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-lock' build" + "scripts/build/build_examples.py \ + --enable-flashbundle --no-log-timestamps \ + --target infineon-p6-lock \ + build \ + --copy-artifacts-to out/artifacts \ + " .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ p6 default lock-app \ out/infineon-p6-lock/chip-p6-lock-example.out @@ -69,7 +74,12 @@ jobs: timeout-minutes: 10 run: | scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-all-clusters' build" + "scripts/build/build_examples.py \ + --enable-flashbundle --no-log-timestamps \ + --target infineon-p6-all-clusters \ + build \ + --copy-artifacts-to out/artifacts \ + " .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ p6 default all-clusters-app \ out/infineon-p6-all-clusters/chip-p6-clusters-example.out @@ -77,7 +87,12 @@ jobs: timeout-minutes: 10 run: | scripts/run_in_build_env.sh \ - "scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-light' build" + "scripts/build/build_examples.py \ + --enable-flashbundle --no-log-timestamps \ + --target infineon-p6-light \ + build \ + --copy-artifacts-to out/artifacts \ + " .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ p6 default light-app \ out/infineon-p6-light/chip-p6-lighting-example.out diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml new file mode 100644 index 00000000000000..7cb4f26b83b755 --- /dev/null +++ b/.github/workflows/examples-linux-arm.yaml @@ -0,0 +1,92 @@ +# 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. + +name: Build example - Linux ARM + +on: + push: + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +jobs: + arm_crosscompile: + name: Linux ARM Cross compile + timeout-minutes: 70 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build-crosscompile:0.5.33 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + + - name: Set up environment for size reports + if: ${{ !env.ACT }} + env: + GH_CONTEXT: ${{ toJson(github) }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v2 + if: ${{ always() }} && ${{ !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log + - name: Build Some samples + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-arm64-all-clusters \ + --target linux-arm64-chip-tool-ipv6only \ + --target linux-arm64-minmdns \ + --target linux-arm64-thermostat-no-ble \ + build \ + " + - name: Bloat report - chip-tool + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 chip-tool-ipv6only \ + out/linux-arm64-chip-tool-ipv6only/chip-tool \ + /tmp/bloat_reports/ + - name: Bloat report - thermostat + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 thermostat-no-ble \ + out/linux-arm64-thermostat-no-ble/thermostat-app \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,Linux-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }} + path: | + /tmp/bloat_reports/ diff --git a/.pullapprove.yml b/.pullapprove.yml index 8c7a7d14db8ed5..f9da0a4be5ab3b 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -96,14 +96,14 @@ groups: teams: [reviewers-comcast] reviews: request: 10 - # shared-reviewers-espressif: - # type: optional - # conditions: - # - files.include('*') - # reviewers: - # teams: [reviewers-espressif] - # reviews: - # request: 10 + shared-reviewers-espressif: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-espressif] + reviews: + request: 10 shared-reviewers-google: type: optional conditions: @@ -112,14 +112,14 @@ groups: teams: [reviewers-google] reviews: request: 10 - # shared-reviewers-lg: - # type: optional - # conditions: - # - files.include('*') - # reviewers: - # teams: [reviewers-lg] - # reviews: - # request: 10 + shared-reviewers-lg: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-lg] + reviews: + request: 10 shared-reviewers-nordic: type: optional conditions: @@ -144,14 +144,14 @@ groups: teams: [reviewers-silabs] reviews: request: 10 -# shared-reviewers-tcl: -# type: optional -# conditions: -# - files.include('*') -# reviewers: -# teams: [reviewers-tcl] -# reviews: -# request: 1 + shared-reviewers-tcl: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-tcl] + reviews: + request: 1 ############################################################ # Base Required Reviewers @@ -164,7 +164,7 @@ groups: requests. type: required requirements: - - len(groups.approved.include('shared-reviewers-*')) >= 3 + - len(groups.approved.include('shared-reviewers-*')) >= 2 reviews: required: 0 labels: diff --git a/BUILD.gn b/BUILD.gn index fb27e5768c16c5..d3a9503530e5a0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -65,7 +65,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { deps = [ "${chip_root}/src/app", "${chip_root}/src/ble", - "${chip_root}/src/channel", "${chip_root}/src/controller", "${chip_root}/src/credentials", "${chip_root}/src/crypto", diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index d45d7f365de625..e405201395f065 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -99,6 +99,10 @@ if (CONFIG_OPENTHREAD_ENABLED) chip_gn_arg_append("chip_enable_openthread" "true") endif() +if (CONFIG_OPENTHREAD_FTD) + chip_gn_arg_append("chip_openthread_ftd" "true") +endif() + if (CONFIG_ENABLE_OTA_REQUESTOR) chip_gn_arg_append("chip_enable_ota_requestor" "true") endif() diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 4852fefa702fe2..4f9ce318cba0df 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -193,6 +193,7 @@ chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) chip_gn_arg_bool ("chip_logging" CONFIG_LOG) chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) chip_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 384e66ace0bc90..97a48df76807df 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -194,6 +194,7 @@ chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONF chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}") chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) 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 bab478a413c638..135c7c567aaf16 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 @@ -233,7 +233,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddGroupResponse", @@ -979,7 +979,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -994,7 +994,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -1047,32 +1047,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -1382,14 +1357,14 @@ "mfgCode": null, "define": "OTA_PROVIDER_CLUSTER", "side": "client", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "QueryImage", "code": 0, "mfgCode": null, "source": "client", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -1397,7 +1372,7 @@ "code": 1, "mfgCode": null, "source": "client", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -1405,7 +1380,7 @@ "code": 2, "mfgCode": null, "source": "client", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], @@ -1415,12 +1390,12 @@ "code": 65533, "mfgCode": null, "side": "client", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0001", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4348,174 +4323,6 @@ "source": "client", "incoming": 1, "outgoing": 1 - }, - { - "name": "UnlockWithTimeout", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLogRecord", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetPINCode", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetPINCode", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearPINCode", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllPINCodes", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetWeekDaySchedule", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetWeekDaySchedule", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearWeekDaySchedule", - "code": 13, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetYearDaySchedule", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetYearDaySchedule", - "code": 15, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearYearDaySchedule", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetHolidaySchedule", - "code": 17, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetHolidaySchedule", - "code": 18, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearHolidaySchedule", - "code": 19, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetUserType", - "code": 20, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetUserType", - "code": 21, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRFIDCode", - "code": 22, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetRFIDCode", - "code": 23, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearRFIDCode", - "code": 24, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllRFIDCodes", - "code": 25, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 } ], "attributes": [ @@ -8482,32 +8289,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -9878,178 +9660,58 @@ "outgoing": 1 }, { - "name": "UnlockWithTimeout", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLogRecord", - "code": 4, + "name": "SetUser", + "code": 26, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "SetPINCode", - "code": 5, + "name": "GetUser", + "code": 27, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "GetPINCode", - "code": 6, + "name": "ClearUser", + "code": 29, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "ClearPINCode", - "code": 7, + "name": "SetCredential", + "code": 34, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "ClearAllPINCodes", - "code": 8, + "name": "GetCredentialStatus", + "code": 36, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "SetWeekDaySchedule", - "code": 11, + "name": "ClearCredential", + "code": 38, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 - }, + "outgoing": 0 + } + ], + "attributes": [ { - "name": "GetWeekDaySchedule", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearWeekDaySchedule", - "code": 13, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetYearDaySchedule", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetYearDaySchedule", - "code": 15, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearYearDaySchedule", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetHolidaySchedule", - "code": 17, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetHolidaySchedule", - "code": 18, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearHolidaySchedule", - "code": 19, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetUserType", - "code": 20, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetUserType", - "code": 21, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRFIDCode", - "code": 22, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetRFIDCode", - "code": 23, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearRFIDCode", - "code": 24, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllRFIDCodes", - "code": 25, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, + "name": "ClusterRevision", + "code": 65533, "mfgCode": null, "side": "client", "included": 1, @@ -10073,32 +9735,24 @@ "enabled": 1, "commands": [ { - "name": "GetLogRecordResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetPINCodeResponse", - "code": 6, + "name": "GetUserResponse", + "code": 28, "mfgCode": null, "source": "server", "incoming": 0, "outgoing": 1 }, { - "name": "GetWeekDayScheduleResponse", - "code": 12, + "name": "SetCredentialResponse", + "code": 35, "mfgCode": null, "source": "server", "incoming": 0, "outgoing": 1 }, { - "name": "GetYearDayScheduleResponse", - "code": 15, + "name": "GetCredentialStatusResponse", + "code": 37, "mfgCode": null, "source": "server", "incoming": 0, @@ -10156,7 +9810,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10167,375 +9821,210 @@ "reportableChange": 0 }, { - "name": "NumberOfLogRecordsSupported", - "code": 16, + "name": "NumberOfTotalUsersSupported", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "10", "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "EnableLogging", - "code": 32, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Language", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "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": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "AutoRelockTime", - "code": 35, + "name": "NumberOfPINUsersSupported", + "code": 18, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "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, + "defaultValue": "10", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "OperatingMode", - "code": 37, + "name": "MaxPINCodeLength", + "code": 23, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "6", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SupportedOperatingModes", - "code": 38, + "name": "MinPINCodeLength", + "code": 24, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFF6", + "defaultValue": "6", "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "DefaultConfigurationRegister", - "code": 39, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "EnableLocalProgramming", - "code": 40, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "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": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "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": "WrongCodeEntryLimit", - "code": 48, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "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": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SendPINOverTheAir", - "code": 50, + "name": "CredentialRulesSupport", + "code": 27, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "RequirePINforRemoteOperation", - "code": 51, + "name": "Language", + "code": 33, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "en", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "AlarmMask", - "code": 64, + "name": "AutoRelockTime", + "code": 35, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "60", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "KeypadOperationEventMask", - "code": 65, + "name": "SoundVolume", + "code": 36, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RemoteOperationEventMask", - "code": 66, + "name": "OperatingMode", + "code": 37, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "ManualOperationEventMask", - "code": 67, + "name": "SupportedOperatingModes", + "code": 38, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "0xFFF6", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "RFIDOperationEventMask", - "code": 68, + "name": "EnableOneTouchLocking", + "code": 41, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "KeypadProgrammingEventMask", - "code": 69, + "name": "EnablePrivacyModeButton", + "code": 43, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RemoteProgrammingEventMask", - "code": 70, + "name": "WrongCodeEntryLimit", + "code": 48, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "RFIDProgrammingEventMask", - "code": 71, + "name": "UserCodeTemporaryDisableTime", + "code": 49, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "10", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -15443,16 +14932,16 @@ "outgoing": 0 }, { - "name": "TestEmitTestEventRequest", - "code": 20, + "name": "TestSimpleOptionalArgumentRequest", + "code": 19, "mfgCode": null, "source": "client", "incoming": 1, "outgoing": 0 }, { - "name": "TestSimpleOptionalArgumentRequest", - "code": 19, + "name": "TestEmitTestEventRequest", + "code": 20, "mfgCode": null, "source": "client", "incoming": 1, @@ -17129,7 +16618,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddGroupResponse", @@ -17874,32 +17363,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -18106,174 +17570,6 @@ "source": "client", "incoming": 1, "outgoing": 1 - }, - { - "name": "UnlockWithTimeout", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLogRecord", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetPINCode", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetPINCode", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearPINCode", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllPINCodes", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetWeekDaySchedule", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetWeekDaySchedule", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearWeekDaySchedule", - "code": 13, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetYearDaySchedule", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetYearDaySchedule", - "code": 15, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearYearDaySchedule", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetHolidaySchedule", - "code": 17, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetHolidaySchedule", - "code": 18, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearHolidaySchedule", - "code": 19, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetUserType", - "code": 20, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetUserType", - "code": 21, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRFIDCode", - "code": 22, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetRFIDCode", - "code": 23, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearRFIDCode", - "code": 24, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllRFIDCodes", - "code": 25, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 } ], "attributes": [ @@ -20163,4 +19459,4 @@ "deviceIdentifier": 22 } ] -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp index 3860c772891b74..5ff6b6713d4ed3 100644 --- a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp @@ -27,7 +27,7 @@ #include "CHIPDeviceManager.h" #include #include -#include +#include #include #include #include @@ -161,7 +161,7 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI return; } -bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj) +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); return true; diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 41e092378c7f5a..4bf496e7dc895d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -60,19 +60,19 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/tv-channel-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index edccd2b899e960..a32f077e21cfc0 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -35,7 +35,7 @@ #include "route_hook/esp_route_hook.h" #include #include -#include +#include #include #include #include @@ -254,7 +254,7 @@ void DeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpointI } #endif -bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj) +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); return true; diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index d6d8cf49d51aeb..9c9126002c0604 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -363,7 +363,7 @@ class MdnsDebugListModel : public ActionListModel private: void DoReinit() { - CHIP_ERROR err = Dnssd::ServiceAdvertiser::Instance().Init(&DeviceLayer::InetLayer()); + CHIP_ERROR err = Dnssd::ServiceAdvertiser::Instance().Init(DeviceLayer::UDPEndPointManager()); if (err != CHIP_NO_ERROR) { ESP_LOGE(TAG, "Error initializing: %s", err.AsString()); diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index 4c3048e3225a71..3c8d5faa5a8e39 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -16,13 +16,13 @@ * limitations under the License. */ -#include +#include #include #include #include "AppMain.h" -bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj) +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); return true; diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index c255084468381a..a11fcf8c50f501 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -101,10 +101,7 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/color-control-server/color-control-server.cpp ${APP_CLUSTERS}/content-launch-server/content-launch-server.cpp ${APP_CLUSTERS}/descriptor/descriptor.cpp - ${APP_CLUSTERS}/door-lock-server/door-lock-server-core.cpp - ${APP_CLUSTERS}/door-lock-server/door-lock-server-logging.cpp - ${APP_CLUSTERS}/door-lock-server/door-lock-server-schedule.cpp - ${APP_CLUSTERS}/door-lock-server/door-lock-server-user.cpp + ${APP_CLUSTERS}/door-lock-server/door-lock-server.cpp ${APP_CLUSTERS}/general-commissioning-server/general-commissioning-server.cpp ${APP_CLUSTERS}/groups-server/groups-server.cpp ${APP_CLUSTERS}/ias-zone-server/ias-zone-server.cpp @@ -127,15 +124,15 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/test-cluster-server/test-cluster-server.cpp ${APP_CLUSTERS}/occupancy-sensor-server/occupancy-sensor-server.cpp ${APP_CLUSTERS}/diagnostic-logs-server/diagnostic-logs-server.cpp - ${APP_CLUSTERS}/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp - ${APP_CLUSTERS}/software_diagnostics_server/software_diagnostics_server.cpp - ${APP_CLUSTERS}/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp - ${APP_CLUSTERS}/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp + ${APP_CLUSTERS}/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp + ${APP_CLUSTERS}/software-diagnostics-server/software-diagnostics-server.cpp + ${APP_CLUSTERS}/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp + ${APP_CLUSTERS}/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp ${APP_CLUSTERS}/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp ${APP_CLUSTERS}/administrator-commissioning-server/administrator-commissioning-server.cpp ${APP_CLUSTERS}/identify-server/identify-server.cpp ${APP_CLUSTERS}/window-covering-server/window-covering-server.cpp - ${APP_CLUSTERS}/general_diagnostics_server/general_diagnostics_server.cpp + ${APP_CLUSTERS}/general-diagnostics-server/general-diagnostics-server.cpp ${APP_CLUSTERS}/power-source-configuration-server/power-source-configuration-server.cpp ) diff --git a/examples/all-clusters-app/p6/src/ClusterManager.cpp b/examples/all-clusters-app/p6/src/ClusterManager.cpp index 9a0f2fcd8afbb8..4d550f8c4fdaf8 100644 --- a/examples/all-clusters-app/p6/src/ClusterManager.cpp +++ b/examples/all-clusters-app/p6/src/ClusterManager.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index f718d005201fb8..d79505ff658b98 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -29,11 +29,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index c78ea55662db76..0ac0324703f36a 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -16,6 +16,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/lib/core/core.gni") assert(chip_build_tools) @@ -68,5 +69,13 @@ executable("chip-tool") { "${chip_root}/zzz_generated/chip-tool", ] + if (chip_enable_transport_trace) { + deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ] + } + output_dir = root_out_dir } + +group("default") { + deps = [ ":chip-tool" ] +} diff --git a/examples/chip-tool/README.md b/examples/chip-tool/README.md index 61a23a6209a8af..cbe544a80291fc 100644 --- a/examples/chip-tool/README.md +++ b/examples/chip-tool/README.md @@ -29,6 +29,28 @@ scripts/examples/gn_build_example.sh examples/chip-tool SOME-PATH/ which puts the binary at `SOME-PATH/chip-tool`. +### Building with message tracing + +Message tracing allows capture of the secure messages which can be used for test +automation. + +``` +gn gen out/with_trace/ --args='import("//with_pw_trace.gni")' +ninja -C out/with_trace chip-tool +``` + +This enables tracing and adds additional flags to chip-tool to control where the +traces should go: + +- --trace_file Outputs trace data to the specified file. +- --trace_log Outputs trace data to the chip log stream. + +For example: + +``` +out/with_trace/chip-tool --trace_file trace.log pairing +``` + ## Using the Client to commission a device In order to send commands to a device, it must be commissioned with the client. diff --git a/examples/chip-tool/commands/common/Commands.cpp b/examples/chip-tool/commands/common/Commands.cpp index 555c03a1133071..f289c4ef52fba9 100644 --- a/examples/chip-tool/commands/common/Commands.cpp +++ b/examples/chip-tool/commands/common/Commands.cpp @@ -26,6 +26,79 @@ #include #include +#include + +#include + +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED +#include "TraceHandlers.h" +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + +namespace { + +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED +enum +{ + kOptionTraceFile = 0x1000, + kOptionTraceLog, +}; + +bool HandleTraceOptions(const char * program, chip::ArgParser::OptionSet * options, int identifier, const char * name, + const char * value) +{ + switch (identifier) + { + case kOptionTraceLog: + chip::trace::SetTraceStream(new chip::trace::TraceStreamLog()); + return true; + case kOptionTraceFile: + chip::trace::SetTraceStream(new chip::trace::TraceStreamFile(value)); + return true; + default: + chip::ArgParser::PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", program, name); + return false; + } +} + +chip::ArgParser::OptionDef traceCmdLineOptionDefs[] = { { "trace_file", chip::ArgParser::kArgumentRequired, kOptionTraceFile }, + { "trace_log", chip::ArgParser::kNoArgument, kOptionTraceLog }, + {} }; + +const char * traceOptionHelp = " --trace_file \n" + " Output trace data to the specified file.\n" + " --trace_log\n" + " Output trace data to the log stream.\n" + "\n"; +chip::ArgParser::OptionSet traceCmdLineOptions = { HandleTraceOptions, traceCmdLineOptionDefs, "TRACE OPTIONS", traceOptionHelp }; +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + +const char * kAppName = "chip-tool"; +const char * kUsage = "Usage: chip-tool [options] cluster command_name [param1] [param2]"; +const char * kVersion = nullptr; // Unknown +const char * kDescription = "A command line tool that uses Matter to send messages to a Matter server."; +chip::ArgParser::HelpOptions helpOptions(kAppName, kUsage, kVersion, kDescription); + +chip::ArgParser::OptionSet * allOptions[] = { +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + &traceCmdLineOptions, +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + &helpOptions, nullptr +}; + +int gPositionalArgc = 0; +char ** gPositionalArgv = nullptr; +const char * gProgramName = nullptr; + +bool GetPositionalArgs(const char * prog, int argc, char * argv[]) +{ + gProgramName = prog; + gPositionalArgc = argc; + gPositionalArgv = argv; + return true; +} + +} // namespace + void Commands::Register(const char * clusterName, commands_list commandsList) { for (auto & command : commandsList) @@ -46,71 +119,81 @@ int Commands::Run(int argc, char ** argv) chip::Logging::SetLogFilter(mStorage.GetLoggingLevel()); - err = RunCommand(argc, argv); + VerifyOrExit(chip::ArgParser::ParseArgs("chip-tool", argc, argv, allOptions, GetPositionalArgs), + ChipLogError(chipTool, "Error parsing arguments")); + +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + chip::trace::InitTrace(); +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + + err = RunCommand(); VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(chipTool, "Run command failure: %s", chip::ErrorStr(err))); exit: +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + chip::trace::DeInitTrace(); +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED return (err == CHIP_NO_ERROR) ? EXIT_SUCCESS : EXIT_FAILURE; } -CHIP_ERROR Commands::RunCommand(int argc, char ** argv) +CHIP_ERROR Commands::RunCommand() { std::map::iterator cluster; Command * command = nullptr; - if (argc <= 1) + if (gPositionalArgc <= 0) { ChipLogError(chipTool, "Missing cluster name"); - ShowClusters(argv[0]); + ShowClusters(gProgramName); return CHIP_ERROR_INVALID_ARGUMENT; } - cluster = GetCluster(argv[1]); + cluster = GetCluster(gPositionalArgv[0]); if (cluster == mClusters.end()) { - ChipLogError(chipTool, "Unknown cluster: %s", argv[1]); - ShowClusters(argv[0]); + ChipLogError(chipTool, "Unknown cluster: %s", gPositionalArgv[1]); + ShowClusters(gProgramName); return CHIP_ERROR_INVALID_ARGUMENT; } - if (argc <= 2) + if (gPositionalArgc <= 1) { ChipLogError(chipTool, "Missing command name"); - ShowCluster(argv[0], argv[1], cluster->second); + ShowCluster(gProgramName, gPositionalArgv[0], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } - if (!IsGlobalCommand(argv[2])) + if (!IsGlobalCommand(gPositionalArgv[1])) { - command = GetCommand(cluster->second, argv[2]); + command = GetCommand(cluster->second, gPositionalArgv[1]); if (command == nullptr) { - ChipLogError(chipTool, "Unknown command: %s", argv[2]); - ShowCluster(argv[0], argv[1], cluster->second); + ChipLogError(chipTool, "Unknown command: %s", gPositionalArgv[1]); + ShowCluster(gProgramName, gPositionalArgv[0], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } } else { - if (argc <= 3) + if (gPositionalArgc <= 2) { ChipLogError(chipTool, "Missing attribute name"); - ShowClusterAttributes(argv[0], argv[1], argv[2], cluster->second); + ShowClusterAttributes(gProgramName, gPositionalArgv[0], gPositionalArgv[1], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } - command = GetGlobalCommand(cluster->second, argv[2], argv[3]); + command = GetGlobalCommand(cluster->second, gPositionalArgv[1], gPositionalArgv[2]); if (command == nullptr) { - ChipLogError(chipTool, "Unknown attribute: %s", argv[3]); - ShowClusterAttributes(argv[0], argv[1], argv[2], cluster->second); + ChipLogError(chipTool, "Unknown attribute: %s", gPositionalArgv[2]); + ShowClusterAttributes(gProgramName, gPositionalArgv[0], gPositionalArgv[1], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } } - if (!command->InitArguments(argc - 3, &argv[3])) + if (!command->InitArguments(gPositionalArgc - 2, &gPositionalArgv[2])) { - ShowCommand(argv[0], argv[1], command); + ShowCommand(gProgramName, gPositionalArgv[0], command); return CHIP_ERROR_INVALID_ARGUMENT; } diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h index 90dabbe33f6dc7..2196eaf1ce5f02 100644 --- a/examples/chip-tool/commands/common/Commands.h +++ b/examples/chip-tool/commands/common/Commands.h @@ -31,7 +31,8 @@ class Commands int Run(int argc, char ** argv); private: - CHIP_ERROR RunCommand(int argc, char ** argv); + CHIP_ERROR RunCommand(); + std::map::iterator GetCluster(std::string clusterName); Command * GetCommand(CommandsVector & commands, std::string commandName); Command * GetGlobalCommand(CommandsVector & commands, std::string commandName, std::string attributeName); diff --git a/examples/chip-tool/commands/discover/Commands.h b/examples/chip-tool/commands/discover/Commands.h index cbcdf2e27bd938..4a74a3a4d0e8c7 100644 --- a/examples/chip-tool/commands/discover/Commands.h +++ b/examples/chip-tool/commands/discover/Commands.h @@ -32,7 +32,7 @@ class Resolve : public DiscoverCommand, public chip::Dnssd::ResolverDelegate /////////// DiscoverCommand Interface ///////// CHIP_ERROR RunCommand(NodeId remoteId, uint64_t fabricId) override { - ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(&chip::DeviceLayer::InetLayer())); + ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(chip::DeviceLayer::UDPEndPointManager())); chip::Dnssd::Resolver::Instance().SetResolverDelegate(this); ChipLogProgress(chipTool, "Dnssd: Searching for NodeId: %" PRIx64 " FabricId: %" PRIx64 " ...", remoteId, fabricId); return chip::Dnssd::Resolver::Instance().ResolveNodeId(chip::PeerId().SetNodeId(remoteId).SetCompressedFabricId(fabricId), diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 78fd416bb433e4..52b80012429e8f 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -182,9 +182,9 @@ static void OnDefaultSuccessResponse(void * context) command->SetCommandExitStatus(CHIP_NO_ERROR); } -static void OnDefaultFailureResponse(void * context, uint8_t status) +static void OnDefaultFailure(void * context, EmberAfStatus status) { - ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status); + ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", chip::to_underlying(status)); ModelCommand * command = static_cast(context); command->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -195,81 +195,6 @@ static void OnDefaultSuccess(void * context, const chip::app::DataModel::NullObj OnDefaultSuccessResponse(context); }; -static void OnDefaultFailure(void * context, EmberAfStatus status) -{ - OnDefaultFailureResponse(context, status); -}; - -static void OnBooleanAttributeReport(void * context, bool value) -{ - ChipLogProgress(chipTool, "Boolean attribute Response: %d", value); -} - -static void OnInt8uAttributeReport(void * context, uint8_t value) -{ - ChipLogProgress(chipTool, "Int8u attribute Response: %" PRIu8, value); -} - -static void OnInt16uAttributeReport(void * context, uint16_t value) -{ - ChipLogProgress(chipTool, "Int16u attribute Response: %" PRIu16, value); -} - -static void OnInt32uAttributeReport(void * context, uint32_t value) -{ - ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value); -} - -static void OnInt64uAttributeReport(void * context, uint64_t value) -{ - ChipLogProgress(chipTool, "Int64u attribute Response: %" PRIu64, value); -} - -static void OnInt8sAttributeReport(void * context, int8_t value) -{ - ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value); -} - -static void OnInt16sAttributeReport(void * context, int16_t value) -{ - ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value); -} - -static void OnInt32sAttributeReport(void * context, int32_t value) -{ - ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value); -} - -static void OnInt64sAttributeReport(void * context, int64_t value) -{ - ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value); -} - -static void OnFloatAttributeReport(void * context, float value) -{ - ChipLogProgress(chipTool, "Float attribute Response: %f", value); -} - -static void OnDoubleAttributeReport(void * context, double value) -{ - ChipLogProgress(chipTool, "Double attribute Response: %f", value); -} - -static void OnOctetStringAttributeReport(void * context, const chip::ByteSpan value) -{ - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; - if (CHIP_NO_ERROR == chip::Encoding::BytesToUppercaseHexString(value.data(), value.size(), &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) { - ChipLogProgress(chipTool, "OctetString attribute Response: %s", buffer); - } else { - ChipLogProgress(chipTool, "OctetString attribute Response len: %zu", value.size()); - } -} - -static void OnCharStringAttributeReport(void * context, const chip::CharSpan value) -{ - ChipLogProgress(chipTool, "CharString attribute Response: %.*s", static_cast(value.size()), value.data()); -} - template static void OnGeneralAttributeResponse(void * context, const char * label, T value) { @@ -430,7 +355,6 @@ private: {{/unless}} {{/if}} {{#if isReportableAttribute}} -{{#unless isList}} class Report{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}: public ModelCommand { public: @@ -445,10 +369,6 @@ public: ~Report{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}() { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override @@ -458,10 +378,8 @@ public: chip::Controller::{{asUpperCamelCase parent.name}}Cluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttribute{{asUpperCamelCase name}}(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttribute{{asUpperCamelCase name}}(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeAttribute(this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -469,17 +387,17 @@ public: return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } + static void OnValueReport(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} value) + { + LogValue("{{asUpperCamelCase parent.name}}.{{asUpperCamelCase name}} report", 0, value); + } + private: - chip::Callback::Callback * onSuccessCallback = new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback<{{chipCallback.name}}AttributeCallback> * onReportCallback = new chip::Callback::Callback<{{chipCallback.name}}AttributeCallback>(On{{chipCallback.name}}AttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; -{{/unless}} {{/if}} {{/unless}} {{/chip_server_cluster_attributes}} diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 498f8e4a115063..8581f50eca6bba 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -60,77 +60,69 @@ class {{filename}}: public TestCommand {{/chip_tests_item_response_parameters}} {{/chip_tests_items}} - {{#*inline "failureCallback"}}mOnFailureCallback_{{index}}{{/inline}} - {{#*inline "successCallback"}}mOnSuccessCallback_{{index}}{{/inline}} - - {{#if isGroupCommand}} - {{#*inline "doneCallback"}}mOnDoneCallback_{{index}}{{/inline}} + {{~#*inline "subscribeDataCallback"}} + mTest_{{parent.filename}}_{{attribute}}_Reported + {{/inline}} + {{#*inline "subscribeDataCallbackType"}} + Test_{{parent.filename}}_{{attribute}}_ReportCallback + {{/inline}} + {{#chip_tests_items}} + {{#if allocateSubscribeDataCallback}} + typedef void (*{{> subscribeDataCallbackType}})(void * context, {{zapTypeToDecodableClusterObjectType attributeObject.type ns=parent.cluster isArgument=true}} value); + {{> subscribeDataCallbackType}} {{> subscribeDataCallback}} = nullptr; {{/if}} + {{/chip_tests_items}} - {{#*inline "failureResponse"}}OnFailureCallback_{{index}}{{/inline}} - {{#*inline "successResponse"}}OnSuccessCallback_{{index}}{{/inline}} - - {{#*inline "doneResponse"}}OnDoneCallback_{{index}}{{/inline}} + {{#*inline "failureResponse"}}OnFailureResponse_{{index}}{{/inline}} + {{#*inline "successResponse"}}OnSuccessResponse_{{index}}{{/inline}} + {{#*inline "subscriptionEstablished"}}OnSubscriptionEstablishedResponse_{{index}}{{/inline}} + {{#*inline "doneResponse"}}OnDoneResponse_{{index}}{{/inline}} - {{#*inline "successArguments"}}void * context{{#chip_tests_item_response_parameters}}, {{zapTypeToDecodableClusterObjectType type ns=parent.cluster isArgument=true}} {{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}{{/inline}} - {{#*inline "failureArguments"}}void * context, uint8_t status{{/inline}} + {{#*inline "staticFailureResponse"}}OnFailureCallback_{{index}}{{/inline}} + {{#*inline "staticSuccessResponse"}}OnSuccessCallback_{{index}}{{/inline}} + {{#*inline "staticSubscriptionEstablished"}}OnSubscriptionEstablished_{{index}}{{/inline}} + {{#*inline "staticDoneResponse"}}OnDoneCallback_{{index}}{{/inline}} - {{#if isGroupCommand}} - {{#*inline "doneArguments"}}void * context{{/inline}} - {{/if}} + {{#*inline "successArguments"}}{{#chip_tests_item_response_parameters}}{{#first}}{{#if ../leadingComma}}, {{/if}}{{/first}} {{zapTypeToDecodableClusterObjectType type ns=parent.cluster isArgument=true}} {{asLowerCamelCase name}}{{#not_last}}, {{/not_last}}{{/chip_tests_item_response_parameters}}{{/inline}} + {{#*inline "failureArguments"}}{{#if leadingComma}}, {{/if}}EmberAfStatus status{{/inline}} + {{#*inline "staticSuccessArguments"}}void * context{{> successArguments leadingComma=true}}{{/inline}} + {{#*inline "staticFailureArguments"}}void * context{{> failureArguments leadingComma=true}}{{/inline}} + {{#*inline "staticDoneArguments"}}void * context{{/inline}} + {{#*inline "doneArguments"}}{{/inline}} - {{#chip_tests_items}} - {{#unless (isTestOnlyCluster cluster)}} - {{#unless isWait}} - {{#unless isCommand}} - {{#unless isWriteAttribute}} - {{#unless isReadAttribute}} - chip::Callback::CallbackfailureArguments}})> {{>failureCallback}} { {{>failureResponse}}, this }; - chip::Callback::CallbacksuccessArguments}})> {{>successCallback}} { {{>successResponse}}, this }; - {{/unless}} - {{/unless}} - {{/unless}} - {{/unless}} - {{/unless}} - {{/chip_tests_items}} + {{#*inline "staticSubscriptionEstablishedArguments"}}void * context{{/inline}} + {{#*inline "subscriptionEstablishedArguments"}}{{/inline}} {{#chip_tests_items}} {{#unless (isTestOnlyCluster cluster)}} {{#unless isWait}} {{#unless isCommand}} {{#if isWriteAttribute}} - static void {{>failureResponse}}(void * context, EmberAfStatus status) - { - (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(chip::to_underlying(status)); - } - - {{#if isGroupCommand}} - static void {{>doneResponse}}(void * context) - { - (static_cast<{{filename}} *>(context))->OnDoneResponse_{{index}}(); - - } + {{#if isGroupCommand}} + static void {{>staticDoneResponse}}({{>staticDoneArguments}}) + { + (static_cast<{{filename}} *>(context))->{{> doneResponse }}(); + } + {{/if}} {{/if}} - {{else if isReadAttribute}} - static void {{>failureResponse}}(void * context, EmberAfStatus status) + static void {{>staticFailureResponse}}({{>staticFailureArguments}}) { - (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(chip::to_underlying(status)); + (static_cast<{{filename}} *>(context))->{{>failureResponse}}(status); } - {{else}} - static void {{>failureResponse}}({{> failureArguments}}) + + static void {{>staticSuccessResponse}}({{> staticSuccessArguments}}) { - (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(status); + (static_cast<{{filename}} *>(context))->{{>successResponse}}({{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}{{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}); } - {{/if}} - - static void {{>successResponse}}({{> successArguments}}) + {{#if isSubscribeAttribute}} + static void {{> staticSubscriptionEstablished}}({{> staticSubscriptionEstablishedArguments}}) { - (static_cast<{{filename}} *>(context))->OnSuccessResponse_{{index}}({{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}{{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}); + (static_cast<{{filename}} *>(context))->{{> subscriptionEstablished}}(); } + {{/if}} - {{! "isWaitForReport" can be replaced by "async" if there is a mechanism to remove the report handler}} {{#if isWaitForReport}} bool mReceivedReport_{{index}} = false; {{/if}} @@ -164,13 +156,6 @@ class {{filename}}: public TestCommand return CHIP_NO_ERROR; } {{else}} - {{#*inline "failureResponse"}}OnFailureResponse_{{index}}{{/inline}} - {{#*inline "successResponse"}}OnSuccessResponse_{{index}}{{/inline}} - {{#*inline "doneResponse"}}OnDoneResponse_{{index}}{{/inline}} - - {{#*inline "failureArguments"}}uint8_t status{{/inline}} - {{#*inline "successArguments"}}{{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}{{zapTypeToDecodableClusterObjectType type ns=parent.cluster isArgument=true}} {{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}{{/inline}} - {{#*inline "doneArguments"}}{{/inline}} {{#*inline "device"}}mDevices[kIdentity{{asUpperCamelCase identity}}]{{/inline}} CHIP_ERROR {{>testCommand}}() @@ -212,11 +197,11 @@ class {{filename}}: public TestCommand {{/chip_tests_item_parameters}} auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast<{{filename}} *>(context))->OnSuccessResponse_{{index}}({{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}data.{{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}); + (static_cast<{{filename}} *>(context))->{{>successResponse}}({{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}data.{{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(status); + (static_cast<{{filename}} *>(context))->{{>failureResponse}}(status); }; ReturnErrorOnFailure(chip::Controller::{{#if isGroupCommand}}InvokeGroupCommand{{else}}InvokeCommand{{/if}}({{>device}}, this, success, failure, @@ -225,7 +210,6 @@ class {{filename}}: public TestCommand {{> maybeTimedInteractionTimeout }} )); {{> maybeWait }} - {{#unless async}}return CHIP_NO_ERROR;{{/unless}} {{else}} chip::Controller::{{asUpperCamelCase cluster}}ClusterTest cluster; {{#if isGroupCommand}} @@ -240,26 +224,26 @@ class {{filename}}: public TestCommand {{/chip_tests_item_parameters}} {{#if isWriteAttribute}} - {{#*inline "failureResponse"}}OnFailureCallback_{{index}}{{/inline}} - {{#*inline "successResponse"}}OnSuccessCallback_{{index}}{{/inline}} - {{#*inline "doneResponse"}}OnDoneCallback_{{index}}{{/inline}} - ReturnErrorOnFailure(cluster.WriteAttribute({{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument, {{/chip_tests_item_parameters}}this, {{>successResponse}}, {{>failureResponse}} + ReturnErrorOnFailure(cluster.WriteAttribute({{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument, {{/chip_tests_item_parameters}}this, {{>staticSuccessResponse}}, {{>staticFailureResponse}} {{~> maybeTimedInteractionTimeout ~}} - {{~#if isGroupCommand}}, {{>doneResponse}}{{/if~}} + {{~#if isGroupCommand}}, {{>staticDoneResponse}}{{/if~}} )); {{> maybeWait }} - {{#unless async}}return CHIP_NO_ERROR;{{/unless}} {{else if isReadAttribute}} - {{#*inline "failureResponse"}}OnFailureCallback_{{index}}{{/inline}} - {{#*inline "successResponse"}}OnSuccessCallback_{{index}}{{/inline}} - {{#if async}}ReturnErrorOnFailure({{else}}return {{/if}}cluster.ReadAttribute({{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument, {{/chip_tests_item_parameters}}this, {{>successResponse}}, {{>failureResponse}}){{#if async}}){{/if}}; + ReturnErrorOnFailure(cluster.ReadAttribute({{#chip_tests_item_parameters}}{{asLowerCamelCase name}}Argument, {{/chip_tests_item_parameters}}this, {{>staticSuccessResponse}}, {{>staticFailureResponse}})); + {{else if isSubscribeAttribute}} + ReturnErrorOnFailure(cluster.SubscribeAttribute(this, {{>staticSuccessResponse}}, {{>staticFailureResponse}}, minIntervalArgument, maxIntervalArgument, {{>staticSubscriptionEstablished}})); + {{else if isWaitForReport}} + {{> subscribeDataCallback}} = {{> staticSuccessResponse}}; {{else}} - {{~#*inline "commandName"}}{{asUpperCamelCase commandName}}{{#if isAttribute}}Attribute{{asUpperCamelCase attribute}}{{/if}}{{/inline}} - {{#if async}}ReturnErrorOnFailure({{else}}return {{/if}}cluster.{{>commandName}}({{>successCallback}}.Cancel(){{#unless isWaitForReport}}, {{>failureCallback}}.Cancel(){{/unless}}{{#chip_tests_item_parameters}}, {{asLowerCamelCase name}}Argument{{/chip_tests_item_parameters}}){{#if async}}){{/if}}; + UNEXPECTED COMMAND: {{>commandName}} {{/if}} - {{/if}} - {{#if async}}return WaitForMs(0);{{/if}} + {{#if async}} + return WaitForMs(0); + {{else}} + return CHIP_NO_ERROR; + {{/if}} } void {{>failureResponse}}({{>failureArguments}}) @@ -275,6 +259,30 @@ class {{filename}}: public TestCommand {{/if}} } + {{#if isSubscribeAttribute}} + void {{>successResponse}}({{zapTypeToDecodableClusterObjectType attributeObject.type ns=parent.cluster isArgument=true}} value) + { + {{#if response.error}} + ThrowSuccessResponse(); + {{else if response.errorWrongValue}} + ThrowSuccessResponse(); + {{else}} + if ({{> subscribeDataCallback}}) { + auto callback = {{> subscribeDataCallback}}; + {{> subscribeDataCallback}} = nullptr; + callback(this, value); + } + {{/if}} + } + + void {{>subscriptionEstablished}}({{> subscriptionEstablishedArguments}}) + { + {{#if hasWaitForReport}} + VerifyOrReturn(mReceivedReport_{{waitForReport.index}}, Exit("Initial report not received!")); + {{/if}} + {{#unless async}}NextTest();{{/unless}} + } + {{else}} void {{>successResponse}}({{>successArguments}}) { {{~#if response.error}} @@ -282,14 +290,9 @@ class {{filename}}: public TestCommand {{else if response.errorWrongValue}} ThrowSuccessResponse(); {{else}} - {{! This block can be removed if there is a mechanism to remove the report handler}} {{#if isWaitForReport}} - VerifyOrReturn(mReceivedReport_{{index}} == false, ChipLogError(chipTool, "Not Fatal: on report called more than once.")); mReceivedReport_{{index}} = true; {{/if}} - {{#if hasWaitForReport}} - VerifyOrReturn(mReceivedReport_{{waitForReport.index}}, Exit("Initial report not received!")); - {{/if}} {{#chip_tests_item_response_parameters}} {{~#*inline "item"}}{{asLowerCamelCase name}}{{#if isOptional}}.Value(){{/if}}{{/inline}} {{#if hasExpectedValue}} @@ -318,6 +321,7 @@ class {{filename}}: public TestCommand {{#unless async}}NextTest();{{/unless}} {{/if}} } + {{/if}} {{#if isGroupCommand}} void {{>doneResponse}}({{>doneArguments}}) diff --git a/examples/chip-tool/with_pw_trace.gni b/examples/chip-tool/with_pw_trace.gni new file mode 100644 index 00000000000000..e43329163aaa7a --- /dev/null +++ b/examples/chip-tool/with_pw_trace.gni @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# add this gni as import in your build args to use pigweed in the example +# 'import("//with_pw_rpc.gni")' + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +import("//build_overrides/pigweed.gni") + +cpp_standard = "gnu++17" + +pw_trace_BACKEND = "${chip_root}/examples/platform/linux/pw_trace_chip" + +chip_enable_transport_trace = true diff --git a/src/channel/BUILD.gn b/examples/common/tracing/BUILD.gn similarity index 59% rename from src/channel/BUILD.gn rename to examples/common/tracing/BUILD.gn index 84ece73135c323..c05f8695c95251 100644 --- a/src/channel/BUILD.gn +++ b/examples/common/tracing/BUILD.gn @@ -12,27 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") -static_library("channel") { - output_name = "libChannelAPI" +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("$dir_pw_build/target_types.gni") +import("${chip_root}/src/lib/lib.gni") - sources = [ - "Channel.cpp", - "Channel.h", - "ChannelContext.cpp", - "ChannelContext.h", - "Manager.cpp", - "Manager.h", - ] +config("default_config") { + include_dirs = [ "." ] +} - cflags = [ "-Wconversion" ] +source_set("trace_handlers") { + sources = [ "TraceHandlers.cpp" ] - public_deps = [ - "${chip_root}/src/lib/core", - "${chip_root}/src/lib/support", - "${chip_root}/src/messaging", - "${chip_root}/src/platform", - "${chip_root}/src/protocols/secure_channel", + deps = [ + "$dir_pw_trace", + "${chip_root}/src/lib", ] + + public_configs = [ ":default_config" ] } diff --git a/examples/common/tracing/README.md b/examples/common/tracing/README.md new file mode 100644 index 00000000000000..154054bf514163 --- /dev/null +++ b/examples/common/tracing/README.md @@ -0,0 +1,5 @@ +# Trace Handlers + +These are trace message handlers which get registered with pw_trace_chip and +interpret the different CHIP messages to extract the useful information required +for test automation. diff --git a/examples/common/tracing/TraceHandlers.cpp b/examples/common/tracing/TraceHandlers.cpp new file mode 100644 index 00000000000000..5842b3dc87305a --- /dev/null +++ b/examples/common/tracing/TraceHandlers.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021 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 "TraceHandlers.h" + +#include +#include +#include + +#include "pw_trace/trace.h" +#include "pw_trace_chip/trace_chip.h" +#include "transport/TraceMessage.h" +#include + +namespace chip { +namespace trace { + +namespace { + +// Handles the output from the trace handlers. +class TraceOutput +{ +public: + ~TraceOutput() { DeleteStream(); } + + void SetStream(TraceStream * stream) + { + std::lock_guard guard(mLock); + if (mStream) + { + delete mStream; + mStream = nullptr; + } + mStream = stream; + } + + void DeleteStream() { SetStream(nullptr); } + + void Stream(const std::string & tag, const std::string & data) + { + std::lock_guard guard(mLock); + if (mStream) + { + mStream->Stream(tag, data); + } + } + + void Handler(const std::string & label) + { + std::lock_guard guard(mLock); + if (mStream) + { + mStream->Handler(label); + } + } + +private: + std::mutex mLock; + TraceStream * mStream = nullptr; +}; + +TraceOutput output; + +// TODO: Framework this into a registry of handlers for different message types. +bool TraceDefaultHandler(const TraceEventFields & trace) +{ + if (strcmp(trace.dataFormat, kTraceSecureMessageDataFormat) != 0 || trace.dataSize != sizeof(TraceSecureMessageData)) + { + return false; + } + + const TraceSecureMessageData * msg = reinterpret_cast(trace.dataBuffer); + output.Handler("Default"); + output.Stream("ExchangeId", std::to_string(msg->payloadHeader->GetExchangeID())); + output.Stream("MsgType", std::to_string(msg->payloadHeader->GetMessageType())); + output.Stream("MessageCounter", std::to_string(msg->packetHeader->GetMessageCounter())); + output.Stream("PacketSize", std::to_string(msg->packetSize)); + + return true; +} + +} // namespace + +void SetTraceStream(TraceStream * stream) +{ + output.SetStream(stream); +} + +void InitTrace() +{ + RegisterTraceHandler(TraceDefaultHandler); +} + +void DeInitTrace() +{ + UnregisterAllTraceHandlers(); + output.DeleteStream(); +} + +} // namespace trace +} // namespace chip diff --git a/examples/common/tracing/TraceHandlers.h b/examples/common/tracing/TraceHandlers.h new file mode 100644 index 00000000000000..434f253b62a014 --- /dev/null +++ b/examples/common/tracing/TraceHandlers.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include + +namespace chip { +namespace trace { + +class TraceStream +{ +public: + virtual ~TraceStream() = default; + virtual void Stream(const std::string & tag, const std::string & data) = 0; + virtual void Handler(const std::string & label) = 0; +}; + +class TraceStreamLog : public TraceStream +{ +public: + void Stream(const std::string & tag, const std::string & data) override + { + ChipLogAutomation(" %s: %s", tag.data(), data.data()); + } + void Handler(const std::string & label) override { ChipLogAutomation("%s", label.data()); } +}; + +class TraceStreamFile : public TraceStream +{ +public: + TraceStreamFile(const char * fileName) { mFile.open(fileName); } + ~TraceStreamFile() { mFile.close(); } + + void Stream(const std::string & tag, const std::string & data) override + { + if (mFile.is_open()) + { + mFile << " " << tag.data() << ": " << data.data() << "\n"; + mFile.flush(); + } + } + void Handler(const std::string & label) override + { + if (mFile.is_open()) + { + struct timeval tv; + gettimeofday(&tv, nullptr); + mFile << label << " [" << tv.tv_sec << "." << tv.tv_usec << "]\n"; + mFile.flush(); + } + } + +private: + std::ofstream mFile; +}; + +void SetTraceStream(TraceStream * stream); +void InitTrace(); +void DeInitTrace(); + +} // namespace trace +} // namespace chip diff --git a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp index c51bfb33670e18..8f5e45b8dfc882 100755 --- a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp @@ -27,7 +27,7 @@ #include "CHIPDeviceManager.h" #include #include -#include +#include #include #include #include diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 2a2c28cad112ff..a248836a3f7efa 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -22,6 +22,8 @@ import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -70,7 +72,10 @@ efr32_sdk("sdk") { ] if (chip_enable_pw_rpc) { - defines += [ "HAL_VCOM_ENABLE=1" ] + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] } } @@ -81,7 +86,7 @@ efr32_executable("lighting_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.c", + "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/LightingManager.cpp", "src/ZclCallbacks.cpp", @@ -96,10 +101,21 @@ efr32_executable("lighting_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "include" ] defines = [] diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 3061e39359d252..1b73ad66dcea58 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -21,3 +21,4 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" chip_enable_openthread = true +chip_openthread_ftd = true diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index 6e4d3ecb9e791e..778acda0bd3fc9 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -142,8 +142,8 @@ Identify gIdentify = { void OnTriggerOffWithEffect(OnOffEffect * effect) { - uint8_t effectId = effect->mEffectIdentifier; - uint8_t effectVariant = effect->mEffectVariant; + chip::app::Clusters::OnOff::OnOffEffectIdentifier effectId = effect->mEffectIdentifier; + uint8_t effectVariant = effect->mEffectVariant; // Uses print outs until we can support the effects if (effectId == EMBER_ZCL_ON_OFF_EFFECT_IDENTIFIER_DELAYED_ALL_OFF) @@ -178,7 +178,7 @@ void OnTriggerOffWithEffect(OnOffEffect * effect) OnOffEffect gEffect = { chip::EndpointId{ 1 }, OnTriggerOffWithEffect, - static_cast(EMBER_ZCL_ON_OFF_EFFECT_IDENTIFIER_DELAYED_ALL_OFF), + EMBER_ZCL_ON_OFF_EFFECT_IDENTIFIER_DELAYED_ALL_OFF, static_cast(EMBER_ZCL_ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_FADE_TO_OFF_IN_0P8_SECONDS), }; diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp index 1648398333fbf8..943f0993a7af35 100644 --- a/examples/lighting-app/efr32/src/main.cpp +++ b/examples/lighting-app/efr32/src/main.cpp @@ -66,6 +66,10 @@ #include "Rpc.h" #endif +#ifdef ENABLE_CHIP_SHELL +#include "matter_shell.h" +#endif + using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; @@ -177,6 +181,10 @@ int main(void) appError(ret); } +#ifdef ENABLE_CHIP_SHELL + chip::startShellTask(); +#endif + EFR32_LOG("Starting FreeRTOS scheduler"); sl_system_kernel_start(); diff --git a/examples/lighting-app/efr32/with_pw_rpc.gni b/examples/lighting-app/efr32/with_pw_rpc.gni index 3922567d5b071a..d0a8f2c0485f06 100644 --- a/examples/lighting-app/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/efr32/with_pw_rpc.gni @@ -23,5 +23,6 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true +chip_openthread_ftd = true cpp_standard = "gnu++17" diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index de27bb94940a1c..5e45e9b9165dab 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -79,11 +79,11 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/descriptor/descriptor.cpp ${CHIP_ROOT}/src/app/clusters/identify-server/identify-server.cpp ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp - ${CHIP_ROOT}/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp + ${CHIP_ROOT}/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn index 0b19d3f0f21e88..b6592b564d8745 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn @@ -20,6 +20,7 @@ import("${k32w0_sdk_build_root}/k32w0_executable.gni") import("${k32w0_sdk_build_root}/k32w0_sdk.gni") import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") assert(current_os == "freertos") @@ -79,10 +80,20 @@ k32w0_executable("light_app") { "${chip_root}/src/lib", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", - "${openthread_root}:libopenthread-cli-ftd", - "${openthread_root}:libopenthread-ftd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w061-linker.ld" diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 1b2c6b7ab7fb06..b19eec5b3cc5f9 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni") import("//build_overrides/qpg_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") assert(current_os == "freertos") @@ -55,10 +56,20 @@ qpg_executable("lighting_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] include_dirs = [ diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 8a2762230c2e51..365dddc4d0d6e1 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -79,11 +79,11 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/clusters/descriptor/descriptor.cpp ${CHIP_ROOT}/src/app/clusters/identify-server/identify-server.cpp ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp - ${CHIP_ROOT}/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp + ${CHIP_ROOT}/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn index 61bb6c5e89705d..fe6c006de15aeb 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn @@ -19,6 +19,8 @@ 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") @@ -90,9 +92,14 @@ ti_simplelink_executable("lock_app") { ":sysconfig", "${chip_root}/examples/lock-app/lock-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-ftd", ] + 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", diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index d422b6cd6219d8..bb795925df36bf 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -49,13 +49,6 @@ #endif // BUILD_RELEASE -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 1 - /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID * diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index eae91987d71832..534ce5343e2dde 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -17,10 +17,13 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${build_root}/config/defaults.gni") + import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -67,7 +70,10 @@ efr32_sdk("sdk") { ] if (chip_enable_pw_rpc) { - defines += [ "HAL_VCOM_ENABLE=1" ] + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] } } @@ -78,7 +84,7 @@ efr32_executable("lock_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.c", + "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/BoltLockManager.cpp", "src/ZclCallbacks.cpp", @@ -93,10 +99,21 @@ efr32_executable("lock_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "include" ] defines = [] diff --git a/examples/lock-app/efr32/args.gni b/examples/lock-app/efr32/args.gni index 5e298bdae486b6..3ea3fd22b6bd13 100644 --- a/examples/lock-app/efr32/args.gni +++ b/examples/lock-app/efr32/args.gni @@ -19,5 +19,6 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = true +chip_openthread_ftd = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp index 012b1ddd63f162..c92b9e71c8b7d5 100644 --- a/examples/lock-app/efr32/src/main.cpp +++ b/examples/lock-app/efr32/src/main.cpp @@ -52,6 +52,10 @@ #include "Rpc.h" #endif +#ifdef ENABLE_CHIP_SHELL +#include "matter_shell.h" +#endif + #if CHIP_ENABLE_OPENTHREAD #include #include @@ -174,6 +178,10 @@ int main(void) appError(ret); } +#ifdef ENABLE_CHIP_SHELL + chip::startShellTask(); +#endif + EFR32_LOG("Starting FreeRTOS scheduler"); sl_system_kernel_start(); diff --git a/examples/lock-app/efr32/with_pw_rpc.gni b/examples/lock-app/efr32/with_pw_rpc.gni index f9f11473f56d43..eddb9ae4278054 100644 --- a/examples/lock-app/efr32/with_pw_rpc.gni +++ b/examples/lock-app/efr32/with_pw_rpc.gni @@ -24,5 +24,6 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true +chip_openthread_ftd = true cpp_standard = "gnu++17" diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index a0f804c93478aa..8e41d327e0611d 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -48,11 +48,11 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" PRIV_REQUIRES bt chip QRCode) @@ -134,11 +134,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index f0a76116d447f5..9b5929c83219fb 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -77,11 +77,11 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp ${CHIP_ROOT}/src/app/clusters/descriptor/descriptor.cpp ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp - ${CHIP_ROOT}/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp - ${CHIP_ROOT}/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp + ${CHIP_ROOT}/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp diff --git a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn index 83cdf7f186bd3d..54fb8e0017490a 100644 --- a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn @@ -15,6 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/k32w0_sdk.gni") import("//build_overrides/openthread.gni") +import("${chip_root}/src/platform/device.gni") import("${chip_root}/third_party/simw-top-mini/simw_config.gni") import("${k32w0_sdk_build_root}/k32w0_executable.gni") @@ -75,10 +76,20 @@ k32w0_executable("lock_app") { "${chip_root}/third_party/mbedtls:mbedtls", "${chip_root}/third_party/simw-top-mini:se05x", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", - "${openthread_root}:libopenthread-cli-mtd", - "${openthread_root}:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] output_dir = root_out_dir diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index cdd81ca7412820..7b2b57139300a0 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -160,13 +160,6 @@ #define CONFIG_CHIP_NFC_COMMISSIONING 1 #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * E-Lock Demo Application is a Thread SED (Sleepy End Device) - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 - /** * @def CHIP_CONFIG_MAX_DEVICE_ADMINS * diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index bbbf67aa5a6569..08d4f5730ddf58 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni") import("//build_overrides/qpg_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") @@ -55,10 +56,20 @@ qpg_executable("lock_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "${qpg_project_dir}/include", "${examples_plat_dir}", diff --git a/examples/log-source-app/linux/.gn b/examples/log-source-app/linux/.gn new file mode 100644 index 00000000000000..5d1ce757507582 --- /dev/null +++ b/examples/log-source-app/linux/.gn @@ -0,0 +1,25 @@ +# 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 = { + import("//args.gni") +} diff --git a/src/channel/tests/BUILD.gn b/examples/log-source-app/linux/BUILD.gn similarity index 50% rename from src/channel/tests/BUILD.gn rename to examples/log-source-app/linux/BUILD.gn index 1c76824bae93cf..3fa9dc2e1a8c61 100644 --- a/src/channel/tests/BUILD.gn +++ b/examples/log-source-app/linux/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# 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. @@ -14,29 +14,23 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") -import("//build_overrides/nlio.gni") -import("//build_overrides/nlunit_test.gni") -import("${chip_root}/build/chip/chip_test_suite.gni") +executable("chip-log-source-app") { + sources = [ "main.cpp" ] -chip_test_suite("tests") { - output_name = "libChannelAPITests" - - sources = [ "TestChannel.cpp" ] + deps = [ + "${chip_root}/examples/log-source-app/log-source-common", + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/app/server", + "${chip_root}/src/lib", + "${chip_root}/src/protocols/bdx", + ] cflags = [ "-Wconversion" ] - public_deps = [ - "${chip_root}/src/inet/tests:helpers", - "${chip_root}/src/lib/core", - "${chip_root}/src/lib/support", - "${chip_root}/src/messaging", - "${chip_root}/src/protocols", - "${chip_root}/src/transport", - "${chip_root}/src/transport/raw/tests:helpers", - "${nlio_root}:nlio", - "${nlunit_test_root}:nlunit-test", - ] + output_dir = root_out_dir +} - tests = [ "TestChannel" ] +group("linux") { + deps = [ ":chip-log-source-app" ] } diff --git a/examples/log-source-app/linux/README.md b/examples/log-source-app/linux/README.md new file mode 100644 index 00000000000000..c273a089149e21 --- /dev/null +++ b/examples/log-source-app/linux/README.md @@ -0,0 +1,24 @@ +# log-source-app + +This is a reference application that implements an example of an diagnostic log +cluster server. + +## Building + +Suggest doing the following: +`scripts/examples/gn_build_example.sh examples/log-source-app/linux out/debug chip_config_network_layer_ble=false` + +## Usage + +`./log-source-app` + +## Current Features/Limitations + +### Features + +- Redirect logs into the internal buffer, send logs using diagnostic logs + cluster. + +### Limitations: + +- BDX transfer is not implemented yet (TODO) diff --git a/examples/log-source-app/linux/args.gni b/examples/log-source-app/linux/args.gni new file mode 100644 index 00000000000000..311ddab32d5fe5 --- /dev/null +++ b/examples/log-source-app/linux/args.gni @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") diff --git a/examples/log-source-app/linux/build_overrides b/examples/log-source-app/linux/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/log-source-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/log-source-app/linux/main.cpp b/examples/log-source-app/linux/main.cpp new file mode 100644 index 00000000000000..6d8b116859330a --- /dev/null +++ b/examples/log-source-app/linux/main.cpp @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using chip::BitFlags; +using chip::ArgParser::HelpOptions; +using chip::ArgParser::OptionDef; +using chip::ArgParser::OptionSet; +using chip::ArgParser::PrintArgError; +using chip::Messaging::ExchangeManager; + +bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue) +{ + // No option yet + return true; +} + +OptionDef cmdLineOptionsDef[] = { + {}, +}; + +OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" }; + +HelpOptions helpOptions("log-source-app", "Usage: log-source-app [options]", "1.0"); + +OptionSet * allOptions[] = { &cmdLineOptions, &helpOptions, nullptr }; + +static constexpr size_t kMaxLogMessageLength = 512; + +DiagnosticLogsCommandHandler & GetLogProvider() +{ + static DiagnosticLogsCommandHandler LogProvider; + return LogProvider; +} + +void LoggingCallback(const char * module, uint8_t category, const char * msg, va_list args) +{ + // Print the log on console for debug + va_list argsCopy; + va_copy(argsCopy, args); + chip::Logging::Platform::LogV(module, category, msg, argsCopy); + + // Feed the log entry into the internal circular buffer + char buffer1[kMaxLogMessageLength]; + 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)); +} + +int main(int argc, char * argv[]) +{ + if (chip::Platform::MemoryInit() != CHIP_NO_ERROR) + { + fprintf(stderr, "FAILED to initialize memory\n"); + return 1; + } + + chip::Logging::SetLogRedirectCallback(&LoggingCallback); + + if (chip::DeviceLayer::PlatformMgr().InitChipStack() != CHIP_NO_ERROR) + { + fprintf(stderr, "FAILED to initialize chip stack\n"); + return 1; + } + + if (!chip::ArgParser::ParseArgs(argv[0], argc, argv, allOptions)) + { + return 1; + } + + chip::DeviceLayer::ConfigurationMgr().LogDeviceConfig(); + chip::Server::GetInstance().Init(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); + + chip::app::InteractionModelEngine::GetInstance()->RegisterCommandHandler(&GetLogProvider()); + + chip::DeviceLayer::PlatformMgr().RunEventLoop(); + + return 0; +} diff --git a/examples/log-source-app/linux/third_party/connectedhomeip b/examples/log-source-app/linux/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/log-source-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/log-source-app/log-source-common/BUILD.gn b/examples/log-source-app/log-source-common/BUILD.gn new file mode 100644 index 00000000000000..1c434c209fb057 --- /dev/null +++ b/examples/log-source-app/log-source-common/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/src/app/chip_data_model.gni") + +config("config") { + include_dirs = [ ".." ] +} + +chip_data_model("log-source-common") { + zap_file = "log-source-app.zap" + + zap_pregenerated_dir = + "${chip_root}/zzz_generated/log-source-app/zap-generated" + + deps = [ "${chip_root}/src/protocols/bdx" ] + + is_server = true + + public_configs = [ ":config" ] +} 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 new file mode 100644 index 00000000000000..e127482466d363 --- /dev/null +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -0,0 +1,3533 @@ +{ + "featureLevel": 54, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "version": "ZCL Test Data", + "type": "zcl-properties" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "version": "chip-v1", + "type": "gen-templates-json" + } + ], + "endpointTypes": [ + { + "name": "Anonymous Endpoint Type", + "deviceTypeName": "CHIP-All-Clusters-Server", + "deviceTypeCode": 0, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "IdentifyQuery", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "IdentifyQueryResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "identify time", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "name support", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "scene count", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "current scene", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "current group", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "scene valid", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "name support", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "current level", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MfgSpecificPing", + "code": 0, + "mfgCode": 4098, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "InteractionModelVersion", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UserLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfoList", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateWiFiNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddThreadNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateThreadNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnableNetwork", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetwork", + "code": 14, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetLastNetworkCommissioningResult", + "code": 16, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddWiFiNetworkResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "UpdateWiFiNetworkResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "AddThreadNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "UpdateThreadNetworkResponse", + "code": 9, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveNetworkResponse", + "code": 11, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnableNetworkResponse", + "code": 13, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "DisableNetworkResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpCSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpCSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "fabrics list", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "client", + "enabled": 0, + "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": "UnlockWithTimeout", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetLogRecord", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetPin", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetPin", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearPin", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearAllPins", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetWeekdaySchedule", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetWeekdaySchedule", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearWeekdaySchedule", + "code": 13, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetYeardaySchedule", + "code": 14, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetYeardaySchedule", + "code": 15, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearYeardaySchedule", + "code": 16, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetHolidaySchedule", + "code": 17, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetHolidaySchedule", + "code": 18, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearHolidaySchedule", + "code": 19, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetUserType", + "code": 20, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetUserType", + "code": 21, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRfid", + "code": 22, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetRfid", + "code": 23, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearRfid", + "code": 24, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearAllRfids", + "code": 25, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "LockDoorResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UnlockDoorResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "lock state", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "lock type", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "actuator enabled", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "door state", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enable logging", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "language", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "led settings", + "code": 34, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "auto relock time", + "code": 35, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "sound volume", + "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": "operating mode", + "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": "default configuration register", + "code": 39, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enable local programming", + "code": 40, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enable one touch locking", + "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": "enable inside status led", + "code": 42, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enable privacy mode button", + "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": "wrong code entry limit", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "user code temporary disable time", + "code": 49, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "send pin over the air", + "code": 50, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "require pin for rf operation", + "code": 51, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "zigbee security level", + "code": 52, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "alarm mask", + "code": 64, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "keypad operation event mask", + "code": 65, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RF operation event mask", + "code": 66, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "manual operation event mask", + "code": 67, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rfid operation event mask", + "code": 68, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "keypad programming event mask", + "code": 69, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rf programming event mask", + "code": 70, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rfid programming event mask", + "code": 71, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "BarrierControlGoToPercent", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "BarrierControlStop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "barrier moving state", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "barrier safety status", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "barrier capabilities", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "barrier position", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "current hue", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "current saturation", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "remaining time", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "current x", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "current y", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "drift compensation", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "compensation text", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color temperature", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color mode", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color control options", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "number of primaries", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 1 x", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 1 y", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 1 intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 2 x", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 2 y", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 2 intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 3 x", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 3 y", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 3 intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 4 x", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 4 y", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 4 intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 5 x", + "code": 36, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 5 y", + "code": 37, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 5 intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 6 x", + "code": 40, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 6 y", + "code": 41, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 6 intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "white point x", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "white point y", + "code": 49, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r x", + "code": 50, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r y", + "code": 51, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r intensity", + "code": 52, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g x", + "code": 54, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g y", + "code": 55, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g intensity", + "code": 56, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b x", + "code": 58, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b y", + "code": 59, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b intensity", + "code": 60, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enhanced current hue", + "code": 16384, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enhanced color mode", + "code": 16385, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color loop active", + "code": 16386, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color loop direction", + "code": 16387, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color loop time", + "code": 16388, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color capabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color temp physical min", + "code": 16395, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color temp physical max", + "code": 16396, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMP_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMP_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "measured value", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "min measured value", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "max measured value", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "IAS Zone", + "code": 1280, + "mfgCode": null, + "define": "IAS_ZONE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ZoneEnrollResponse", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "IAS Zone", + "code": 1280, + "mfgCode": null, + "define": "IAS_ZONE_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "ZoneStatusChangeNotification", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ZoneEnrollRequest", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "zone state", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "zone type", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "zone status", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IAS CIE address", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Zone ID", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xff", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 0, + "profileId": 598, + "endpointId": 0, + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": null + } + ] +} diff --git a/examples/minimal-mdns/advertiser.cpp b/examples/minimal-mdns/advertiser.cpp index ff267044ac39f8..dc20c195537a7b 100644 --- a/examples/minimal-mdns/advertiser.cpp +++ b/examples/minimal-mdns/advertiser.cpp @@ -255,7 +255,7 @@ int main(int argc, char ** args) return 1; } - if (chip::Dnssd::ServiceAdvertiser::Instance().Init(&DeviceLayer::InetLayer()) != CHIP_NO_ERROR) + if (chip::Dnssd::ServiceAdvertiser::Instance().Init(DeviceLayer::UDPEndPointManager()) != CHIP_NO_ERROR) { fprintf(stderr, "FAILED to start MDNS advertisement\n"); return 1; diff --git a/examples/minimal-mdns/client.cpp b/examples/minimal-mdns/client.cpp index dcfef3f987e40d..246a97252e6009 100644 --- a/examples/minimal-mdns/client.cpp +++ b/examples/minimal-mdns/client.cpp @@ -334,7 +334,7 @@ int main(int argc, char ** args) MdnsExample::AllInterfaces allInterfaces(gOptions.enableIpV4); - err = mdnsServer.Listen(&chip::DeviceLayer::InetLayer(), &allInterfaces, gOptions.listenPort); + err = mdnsServer.Listen(chip::DeviceLayer::UDPEndPointManager(), &allInterfaces, gOptions.listenPort); if (err != CHIP_NO_ERROR) { printf("Server failed to listen on all interfaces: %s\n", chip::ErrorStr(err)); diff --git a/examples/minimal-mdns/server.cpp b/examples/minimal-mdns/server.cpp index 1d310b9618851b..afc84b75261716 100644 --- a/examples/minimal-mdns/server.cpp +++ b/examples/minimal-mdns/server.cpp @@ -258,7 +258,7 @@ int main(int argc, char ** args) { MdnsExample::AllInterfaces allInterfaces(gOptions.enableIpV4); - if (mdnsServer.Listen(&DeviceLayer::InetLayer(), &allInterfaces, gOptions.listenPort) != CHIP_NO_ERROR) + if (mdnsServer.Listen(DeviceLayer::UDPEndPointManager(), &allInterfaces, gOptions.listenPort) != CHIP_NO_ERROR) { printf("Server failed to listen on all interfaces\n"); return 1; diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index 9b4998f94db781..040093f21c460b 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -33,11 +33,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp index 3cc95d329c7b58..70668a011a9535 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp @@ -20,17 +20,24 @@ #include #include +#include #include +#include #include #include #include -#include // For chip::kTestDeviceNodeId +#include #include using chip::ByteSpan; using chip::CharSpan; +using chip::FabricIndex; +using chip::FabricInfo; +using chip::MutableCharSpan; +using chip::NodeId; using chip::Optional; +using chip::Server; using chip::Span; using chip::app::Clusters::OTAProviderDelegate; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; @@ -57,24 +64,6 @@ void GenerateUpdateToken(uint8_t * buf, size_t bufSize) } } -bool GenerateBdxUri(const Span & fileDesignator, Span outUri, size_t availableSize) -{ - static constexpr char bdxPrefix[] = "bdx://"; - chip::NodeId nodeId = chip::kTestDeviceNodeId; // TODO: read this dynamically - size_t nodeIdHexStrLen = sizeof(nodeId) * 2; - size_t expectedLength = strlen(bdxPrefix) + nodeIdHexStrLen + 1 + fileDesignator.size(); - - if (expectedLength >= availableSize) - { - return false; - } - - size_t written = static_cast(snprintf(outUri.data(), availableSize, "%s" ChipLogFormatX64 "/%s", bdxPrefix, - ChipLogValueX64(nodeId), fileDesignator.data())); - - return expectedLength == written; -} - OTAProviderExample::OTAProviderExample() { memset(mOTAFilePath, 0, kFilepathBufLen); @@ -115,9 +104,16 @@ EmberAfStatus OTAProviderExample::HandleQueryImage(chip::app::CommandHandler * c if (strlen(mOTAFilePath)) { + // TODO: This uses the current node as the provider to supply the OTA image. This can be configurable such that the provider + // supplying the response is not the provider supplying the OTA image. + FabricIndex fabricIndex = commandObj->GetExchangeContext()->GetSessionHandle().GetFabricIndex(); + FabricInfo * fabricInfo = Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabricIndex); + NodeId nodeId = fabricInfo->GetPeerId().GetNodeId(); + // Only doing BDX transport for now - GenerateBdxUri(Span(mOTAFilePath, strlen(mOTAFilePath)), Span(uriBuf, 0), kUriMaxLen); - ChipLogDetail(SoftwareUpdate, "generated URI: %s", uriBuf); + MutableCharSpan uri(uriBuf, kUriMaxLen); + chip::bdx::MakeURI(nodeId, CharSpan(mOTAFilePath, strlen(mOTAFilePath)), uri); + ChipLogDetail(SoftwareUpdate, "Generated URI: %.*s", static_cast(uri.size()), uri.data()); } // Set Status for the Query Image Response diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h index 64027d56420f52..3a7fdcf5c7e0c5 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h @@ -18,7 +18,7 @@ #pragma once -#include +#include #include /** diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index 72c8734dab8d02..ff7d14bde7f0e1 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -33,11 +33,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp index fb971ffbdb58a6..ad3d0c814525eb 100644 --- a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp +++ b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp @@ -22,6 +22,8 @@ #include "LinuxOTARequestorDriver.h" +using namespace chip; + // A call into the application logic to give it a chance to allow or stop the Requestor // from proceeding with actual image download. Returning TRUE will allow the download // to proceed, returning FALSE will abort the download process. @@ -32,3 +34,8 @@ bool LinuxOTARequestorDriver::CheckImageDownloadAllowed() // Notify the application that the download is complete and the image can be applied void LinuxOTARequestorDriver::ImageDownloadComplete() {} + +UserConsentAction LinuxOTARequestorDriver::RequestUserConsent() +{ + return ImmediateYes; +} diff --git a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h index c219aa5c679f05..d3c00709ea794b 100644 --- a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h +++ b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h @@ -21,6 +21,8 @@ */ #include "app/clusters/ota-requestor/OTARequestorDriver.h" +namespace chip { + class LinuxOTARequestorDriver : public OTARequestorDriver { @@ -34,5 +36,11 @@ class LinuxOTARequestorDriver : public OTARequestorDriver // Notify the application that the download is complete and the image can be applied void ImageDownloadComplete(); + // Application is directed to complete user consent: either return ImmediateYes/ImmediateNo + // without blocking or return Requested and call OTARequestor::OnUserConsent() later. + virtual UserConsentAction RequestUserConsent(); + // Virtual functions from OTARequestorDriver -- end }; + +} // namespace chip diff --git a/examples/ota-requestor-app/linux/README.md b/examples/ota-requestor-app/linux/README.md index 85a57db881da7d..fed5e9462b264f 100644 --- a/examples/ota-requestor-app/linux/README.md +++ b/examples/ota-requestor-app/linux/README.md @@ -30,7 +30,7 @@ In terminal 2: In terminal 3: ``` -./chip-ota-requestor-app -d ${REQUESTOR_LONG_DISCRIMINATOR} -u ${REQUESTOR_UDP_PORT} -i ${PROVIDER_IP_ADDRESS} -n ${PROVIDER_NODE_ID} -q ${DELAY_QUERY_SECONDS} +./chip-ota-requestor-app -d ${REQUESTOR_LONG_DISCRIMINATOR} -u ${REQUESTOR_UDP_PORT} -n ${PROVIDER_NODE_ID} -f ${PROVIDER_FABRIC_INDEX} -q ${DELAY_QUERY_SECONDS} ``` - `{REQUESTOR_LONG_DISCRIMINATOR}` is the long discriminator specified for the @@ -39,7 +39,10 @@ In terminal 3: for secure connections - `${PROVIDER_IP_ADDRESS}` is the IP address of the ota-provider-app that has been resolved manually -- `${PROVIDER_NODE_ID}` is the node ID of the ota-provider-app assigned above +- `${PROVIDER_NODE_ID}` is the node ID of the ota-provider-app; this is a Test + Mode parameter and should not be used in most scenarios +- `${PROVIDER_FABRIC_INDEX}` is the fabric index of the ota-provider-app; this + is a Test Mode parameter and should not be used in most scenarios - `${DELAY_QUERY_SECONDS}` is the amount of time in seconds to wait before initiating secure session establishment and query for software image diff --git a/examples/ota-requestor-app/linux/main.cpp b/examples/ota-requestor-app/linux/main.cpp index fc004f357376ed..679bbb8434bb52 100644 --- a/examples/ota-requestor-app/linux/main.cpp +++ b/examples/ota-requestor-app/linux/main.cpp @@ -16,7 +16,8 @@ * limitations under the License. */ -#include +#include +#include #include #include #include @@ -30,30 +31,39 @@ using chip::BDXDownloader; using chip::ByteSpan; +using chip::CASEClientPool; using chip::CharSpan; -using chip::DeviceProxy; using chip::EndpointId; using chip::FabricIndex; +using chip::GetRequestorInstance; using chip::LinuxOTAImageProcessor; using chip::NodeId; using chip::OnDeviceConnected; using chip::OnDeviceConnectionFailure; +using chip::OperationalDeviceProxyPool; +using chip::OTADownloader; using chip::OTAImageProcessorParams; +using chip::OTARequestor; using chip::PeerId; using chip::Server; using chip::VendorId; using chip::Callback::Callback; -using chip::Inet::IPAddress; using chip::System::Layer; using chip::Transport::PeerAddress; +using namespace chip; using namespace chip::ArgParser; using namespace chip::Messaging; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; -OTARequestor requestorCore; -LinuxOTARequestorDriver requestorUser; -BDXDownloader downloader; -LinuxOTAImageProcessor imageProcessor; +constexpr size_t kMaxActiveCaseClients = 2; +constexpr size_t kMaxActiveDevices = 8; + +OTARequestor gRequestorCore; +LinuxOTARequestorDriver gRequestorUser; +BDXDownloader gDownloader; +LinuxOTAImageProcessor gImageProcessor; +CASEClientPool gCASEClientPool; +OperationalDeviceProxyPool gDevicePool; bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue); void OnStartDelayTimerHandler(Layer * systemLayer, void * appState); @@ -62,10 +72,8 @@ constexpr uint16_t kOptionProviderNodeId = 'n'; constexpr uint16_t kOptionProviderFabricIndex = 'f'; constexpr uint16_t kOptionUdpPort = 'u'; constexpr uint16_t kOptionDiscriminator = 'd'; -constexpr uint16_t kOptionIPAddress = 'i'; constexpr uint16_t kOptionDelayQuery = 'q'; -const char * ipAddress = NULL; NodeId providerNodeId = 0x0; FabricIndex providerFabricIndex = 1; uint16_t requestorSecurePort = 0; @@ -77,8 +85,6 @@ OptionDef cmdLineOptionsDef[] = { { "providerFabricIndex", chip::ArgParser::kArgumentRequired, kOptionProviderFabricIndex }, { "udpPort", chip::ArgParser::kArgumentRequired, kOptionUdpPort }, { "discriminator", chip::ArgParser::kArgumentRequired, kOptionDiscriminator }, - // TODO: This can be removed once OperationalDeviceProxy can resolve the IP Address from Node ID - { "ipaddress", chip::ArgParser::kArgumentRequired, kOptionIPAddress }, { "delayQuery", chip::ArgParser::kArgumentRequired, kOptionDelayQuery }, {}, }; @@ -95,8 +101,6 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " -d/--discriminator \n" " A 12-bit value used to discern between multiple commissionable CHIP device\n" " advertisements. If none is specified, default value is 3840.\n" - " -i/--ipaddress \n" - " The IP Address of the OTA Provider to connect to. This value must be supplied.\n" " -q/--delayQuery