diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index d7f33d37231f92..9886a40b4d99a9 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -258,6 +258,7 @@ DataFrame dataset datasets dbf +DBG dBm DBUILD dbus @@ -316,6 +317,7 @@ DMM DNS Dnsmasq dnsmasqd +DNSSD DNSStubListener Dockerfile Dockerfiles @@ -650,6 +652,7 @@ MoveToSaturation MoveWithOnOff MPSL MRP +MTD MTU Multiband Multicast @@ -940,6 +943,7 @@ submodules subprocess SubscribeResponse SubscriptionId +subtype sudo svg SVR @@ -978,6 +982,7 @@ testws texinfo textboxes TFT +threadOperationalDataset ThreadStackManager ThreadStackManagerImpl Thunderboard @@ -988,6 +993,7 @@ TLV tmp tngvndl TODO +tokenized toolchain toolchains topologies diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 2737de15bd9bac..4a7f1ef868a564 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -57,7 +57,7 @@ jobs: - name: Build Android CHIPTool and CHIPTest run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-{arm,arm64,x64,x86}-chip-*' build" + "./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-{arm,arm64}-chip-*' build" # - name: Build Android Studio build (arm64 only) # run: | # ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 68cef7b29446a9..972768a595a1d0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -90,6 +90,11 @@ jobs: - name: Run Build Without Progress Logging timeout-minutes: 20 run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Setup Build Without Error Logging + run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false" + - name: Run Build Without Error Logging + timeout-minutes: 20 + run: scripts/run_in_build_env.sh "ninja -C ./out" build_linux: name: Build on Linux (fake, gcc_release, clang, mbedtls, simulated) timeout-minutes: 90 diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index cebd9102383422..88818ec8693c55 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -82,7 +82,7 @@ jobs: timeout-minutes: 10 run: | scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \ - -args='import("//with_pw_rpc.gni")' + 'import("//with_pw_rpc.gni")' .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \ out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - name: Build example EFR32 Window Covering for BRD4161A diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml new file mode 100644 index 00000000000000..ea96c4d94413e1 --- /dev/null +++ b/.github/workflows/fuzzing-build.yaml @@ -0,0 +1,131 @@ +# 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. + +name: Fuzzing Builds + +on: + # For now, only manual triggers. + workflow_dispatch: + +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: + build_linux_fuzzing: + name: Build on Linux + timeout-minutes: 90 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build:0.5.48 + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - run: apt-get update + - run: apt-get install --fix-missing llvm-10 clang-10 + - name: + Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + - 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 all-clusters-app + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-no-ble-libfuzzer-test-group \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: + objdir-linux + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + build_darwin_fuzzing: + name: Build on Darwin + timeout-minutes: 90 + runs-on: macos-latest + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Setup Environment + run: brew install openssl pkg-config llvm + - name: Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + - name: Fix pkgconfig link + working-directory: /usr/local/lib/pkgconfig + run: | + pwd + ls -la /usr/local/Cellar/ + ls -la /usr/local/Cellar/openssl@1.1 + OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'` + ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* . + - name: Bootstrap + timeout-minutes: 25 + 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 all-clusters-app + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-all-clusters-no-ble-asan-libfuzzer \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: + crash-darwin + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.gitmodules b/.gitmodules index e90a9c72373ae2..b8f7b0832f3d99 100644 --- a/.gitmodules +++ b/.gitmodules @@ -162,3 +162,6 @@ [submodule "p6/lwip"] path = third_party/p6/p6_sdk/libs/lwip url = https://github.com/lwip-tcpip/lwip.git +[submodule "third_party/jsoncpp/repo"] + path = third_party/jsoncpp/repo + url = https://github.com/open-source-parsers/jsoncpp.git diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 9df167b4f83234..f08497920fa488 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -307,9 +307,6 @@ declare_args() { # enable undefined behavior sanitizer is_ubsan = false - # enable libfuzzer - is_libfuzzer = false - # Exit on sanitize error. Generally standard libraries may get errors # so not stopping on the first error is often useful is_sanitize_fatal = true diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 00bb1317576a26..f5b6414eca8ee4 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -41,4 +41,7 @@ declare_args() { # C++ standard level (value for -std flag). cpp_standard = "gnu++14" + + # enable libfuzzer + is_libfuzzer = false } diff --git a/config/efr32/toolchain/BUILD.gn b/config/efr32/toolchain/BUILD.gn index 76747ede876a5c..8f448eb44838b9 100644 --- a/config/efr32/toolchain/BUILD.gn +++ b/config/efr32/toolchain/BUILD.gn @@ -37,3 +37,9 @@ arm_toolchain("efr32_window_app") { import("${chip_root}/examples/window-app/efr32/args.gni") } } +arm_toolchain("rs911x_lock_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/lock-app/rs911x/args.gni") + } +} diff --git a/config/esp32/components/chip/component.mk b/config/esp32/components/chip/component.mk index 6b8714b1db620e..61ab9100fa78e7 100644 --- a/config/esp32/components/chip/component.mk +++ b/config/esp32/components/chip/component.mk @@ -136,6 +136,7 @@ ifeq ($(is_debug),false) endif if [[ "$(CONFIG_ENABLE_PW_RPC)" = "y" ]]; then \ echo "chip_build_pw_rpc_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ + echo "chip_build_pw_trace_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ echo "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"" >> $(OUTPUT_DIR)/args.gn ;\ diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 8ace731baac543..90c7595fe5020d 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -151,6 +151,20 @@ config CHIP_ROTATING_DEVICE_ID Enables rotating device identifier that provides a non-trackable identifier which is unique per device and rotates at pre-defined moments. +config CHIP_COMMISSIONABLE_DEVICE_TYPE + bool "Enable the device type subtype in commissionable node discovery record" + depends on CHIP_ENABLE_DNSSD_SRP + help + Enables including device type subtype in the commissionable node discovery record, + which allows filtering of the results to find the nodes that match the device type. + +config CHIP_DEVICE_TYPE + int "Device type" + default 65535 + range 0 65535 + help + Type of device that uses the CHIP Device Type Identifier. The default value means invalid device type. + config CHIP_OPERATIONAL_TIME_SAVE_INTERVAL int "Interval of saving node operation time to flash in hours unit" default 10 diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/guides/nrfconnect_examples_configuration.md index f51250e9662b49..b0d94ae84540d4 100644 --- a/docs/guides/nrfconnect_examples_configuration.md +++ b/docs/guides/nrfconnect_examples_configuration.md @@ -142,3 +142,85 @@ Read the guide in the nRF Connect SDK's Zephyr documentation if you are interested in getting more advanced and detailed information about the configuration structure. + +
+ +## Configuring Matter in nRF Connect platform + +### Mandatory configuration + +To use the Matter protocol, you need to set the `CONFIG_CHIP` Kconfig option. +Setting this option enables the Matter protocol stack and other associated +Kconfig options, including `CONFIG_CHIP_ENABLE_DNSSD_SRP` that is required for +the Matter device to be discoverable using DNS-SD. + +After that, make sure to set the `CONFIG_CHIP_PROJECT_CONFIG` Kconfig option and +define the path to the configuration file that specifies Vendor ID, Product ID, +and other project-specific Matter settings. + +
+ +### Optional configuration + +After enabling the Matter protocol and defining the path to the Matter +configuration file, you can enable additional options in Kconfig. + +**Sleepy End Device support** + +You can enable the support for Thread Sleepy End Device in Matter by setting the +following Kconfig options: + +- `CONFIG_OPENTHREAD_MTD` +- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT` + +**Commissioning with NFC support** + +You can configure the Matter protocol to use an NFC tag for commissioning, +instead of using a QR code, which is the default configuration. + +To enable NFC for commissioning and share the onboarding payload in an NFC tag, +set the `CONFIG_CHIP_NFC_COMMISSIONING` option. + +**Logging** + +You can enable logging for both the stack and Zephyr’s +[Logging](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/logging/index.html#logging-api) +API by setting the `CONFIG_LOG` option. + +Zephyr allows you to configure log levels of different software modules +independently. To change the log level configuration for the Matter module, set +one of the available options: + +- `CONFIG_MATTER_LOG_LEVEL_ERR` +- `CONFIG_MATTER_LOG_LEVEL_INFO` +- `CONFIG_MATTER_LOG_LEVEL_DBG` + +**Shell** + +You can enable the Matter shell library using the `CONFIG_CHIP_LIB_SHELL` +Kconfig option. This option lets you use the Matter specific shell commands. See +[Using CLI in nRF Connect examples](nrfconnect_examples_cli.md) for the list of +available Matter shell commands. + +**Matter device identification** + +Matter has many mandatory and optional ways to identify a specific device. These +can be used for various purposes, such as dividing devices into groups (by +function, by vendor or by location), device commissioning or vendor-specific +cases before the device was commissioned (for example, identifying factory +software version or related features). + +Only some part of these features can be configured using Kconfig options and +only those were listed below: + +- `CONFIG_CHIP_DEVICE_TYPE` - type of device that uses the Matter Device Type + Identifier, for example Door Lock (0x000A) or Dimmable Light Bulb (0x0101). +- `CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE` - enables including optional device + type subtype in the commissionable node discovery record, which allows + filtering of the discovery results to find the nodes that match the device + type. +- `CONFIG_CHIP_ROTATING_DEVICE_ID` - enables rotating device identifier, an + optional feature that provides an additional unique identifier for each + device. This identifier is similar to the serial number, but it additionally + changes at predefined times to protect against long-term tracking of the + device. diff --git a/docs/guides/python_chip_controller_building.md b/docs/guides/python_chip_controller_building.md index d7deba4b07dd49..d250afe174cde9 100644 --- a/docs/guides/python_chip_controller_building.md +++ b/docs/guides/python_chip_controller_building.md @@ -143,61 +143,17 @@ following command to scan all advertised Matter devices: chip-device-ctrl > ble-scan ``` -### Step 4: Connect to Matter accessory device over Bluetooth LE +### Step 4: Set network pairing credentials -The controller uses a 12-bit value called **discriminator** to discern between -multiple commissionable device advertisements. Moreover, a 27-bit **PIN code** -is used by the controller to authenticate in the device. You can find those -values in the logging terminal of the device (for example, UART). For example: - -``` -I: 254 [DL]Device Configuration: -I: 257 [DL] Serial Number: TEST_SN -I: 260 [DL] Vendor Id: 9050 (0x235A) -I: 263 [DL] Product Id: 20043 (0x4E4B) -I: 267 [DL] Hardware Version: 1 -I: 270 [DL] Setup Pin Code: 20202021 -I: 273 [DL] Setup Discriminator: 3840 (0xF00) -I: 278 [DL] Manufacturing Date: (not set) -I: 281 [DL] Device Type: 65535 (0xFFFF) -``` - -Run the following command to establish the secure connection over Bluetooth LE, -with the following assumptions for the Matter accessory device: - -- The discriminator of the device is _3840_ -- The setup pin code of the device is _20202021_ -- The temporary Node ID is _1234_ +You must provide the controller with network credentials that will be further +used in the device commissioning procedure to configure the device with a +network interface, such as Thread or Wi-Fi. -``` -chip-device-ctrl > connect -ble 3840 20202021 1234 -``` - -You can skip the last parameter, that is the Node ID. If you skip it, the -controller will assign it randomly. However, note the Node ID down, because it -is required later in the configuration process. - -At the end of the secure connection establishment, the Python controller prints -the following log: - -``` -Secure Session to Device Established -``` - -This means that the PASE (Password-Authenticated Session Establishment) session -using SPAKE2+ protocol is completed. - -### Step 5: Commission Matter accessory to the underlying network +#### Setting Thread network credentials -The main goal of the network commissioning step is to configure the device with -a network interface, such as Thread or Wi-Fi. This process provides the device -with network credentials. - -#### Commissioning a Thread device - -1. Fetch and store the current Active Operational Dataset and Extended PAN ID - from the Thread Border Router. Depending if Thread Border Router is running - on Docker or natively on Raspberry Pi, execute the following commands: +1. Fetch and store the current Active Operational Dataset from the Thread Border + Router. Depending on if the Thread Border Router is running on Docker or + natively on Raspberry Pi, execute the following commands: - For Docker: @@ -205,10 +161,6 @@ with network credentials. sudo docker exec -it otbr sh -c "sudo ot-ctl dataset active -x" 0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 Done - - sudo docker exec -it otbr sh -c "sudo ot-ctl dataset extpanid” - 4fe76e9a8b5edaf5 - Done ``` - For native installation: @@ -217,10 +169,6 @@ with network credentials. sudo ot-ctl dataset active -x 0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 Done - - sudo ot-ctl dataset extpanid - 4fe76e9a8b5edaf5 - Done ``` Matter specification does not define how the Thread or Wi-Fi credentials are @@ -228,73 +176,80 @@ with network credentials. datasets directly from the Thread Border Router, you might also use a different out-of-band method. -2. Inject the previously obtained Active Operational Dataset as hex-encoded - value using ZCL Network Commissioning cluster: - - > Each ZCL command has a following format: - > `zcl [arguments]` +2. Set the previously obtained Active Operational Dataset as a hex-encoded value + using the following command: ``` - chip-device-ctrl > zcl NetworkCommissioning AddOrUpdateThreadNetwork 1234 0 0 operationalDataset=hex:0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 breadcrumb=0 + chip-device-ctrl > set-pairing-thread-credential 0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 ``` -3. Enable Thread interface on the device by executing the following command with - `networkID` equal to Extended PAN Id of the Thread network: - - ``` - chip-device-ctrl > zcl NetworkCommissioning ConnectNetwork 1234 0 0 networkID=hex:4fe76e9a8b5edaf5 breadcrumb=0 - ``` +#### Setting Wi-Fi network credentials -#### Commissioning a Wi-Fi device +Assuming your Wi-Fi SSID is _TESTSSID_, and your Wi-Fi password is _P455W4RD_, +set the credentials to the controller by executing the following command: -1. Assuming your Wi-Fi SSID is _TESTSSID_, and your Wi-Fi password is - _P455W4RD_, inject the credentials to the device by executing the following - command: +``` +chip-device-ctrl > set-pairing-wifi-credential TESTSSID P455W4RD +``` - ``` - chip-device-ctrl > zcl NetworkCommissioning AddOrUpdateWiFiNetwork 1234 0 0 ssid=str:TESTSSID credentials=str:P455W4RD breadcrumb=0 - ``` +### Step 5: Commission the Matter accessory device over Bluetooth LE -2. Enable the Wi-Fi interface on the device by executing the following command: +The controller uses a 12-bit value called **discriminator** to discern between +multiple commissionable device advertisements, as well as a 27-bit **setup PIN +code** to authenticate the device. You can find these values in the logging +terminal of the device (for example, UART). For example: - ``` - chip-device-ctrl > zcl NetworkCommissioning ConnectNetwork 1234 0 0 networkID=str:TESTSSID breadcrumb=0 - ``` +``` +I: 254 [DL]Device Configuration: +I: 257 [DL] Serial Number: TEST_SN +I: 260 [DL] Vendor Id: 9050 (0x235A) +I: 263 [DL] Product Id: 20043 (0x4E4B) +I: 267 [DL] Hardware Version: 1 +I: 270 [DL] Setup Pin Code: 20202021 +I: 273 [DL] Setup Discriminator: 3840 (0xF00) +I: 278 [DL] Manufacturing Date: (not set) +I: 281 [DL] Device Type: 65535 (0xFFFF) +``` -### Step 6: Close Bluetooth LE connection. +Run the following command to establish the secure connection over Bluetooth LE, +with the following assumptions for the Matter accessory device: -After the Matter accessory device was provisioned with Thread or Wi-Fi -credentials (or both), the commissioning process is finished. The Python CHIP -controller is now using only the IPv6 traffic to reach the device, so you can -close the Bluetooth LE connection. To close the connection, run the following -command: +- The discriminator of the device is _3840_ +- The setup pin code of the device is _20202021_ +- The temporary Node ID is _1234_ ``` -chip-device-ctrl > close-ble +chip-device-ctrl > connect -ble 3840 20202021 1234 ``` -### Step 7: Discover IPv6 address of the Matter accessory. - -The Matter controller must discover the IPv6 address of the node that it -previously commissioned. Depending on the network type: +You can skip the last parameter, the Node ID, in the command. If you skip it, +the controller will assign it randomly. In that case, note down the Node ID, +because it is required later in the configuration process. -- For Thread, the Matter accessory uses SRP (Service Registration Protocol) to - register its presence on the Thread Border Router’s SRP Server. -- For Wi-Fi or Ethernet devices, the Matter accessory uses the mDNS (Multicast - Domain Name System) protocol. +After connecting the device over Bluetooth LE, the controller will go through +the following stages: -Assuming your Node ID is _1234_ (use the Node ID you noted down when you -established the secure connection over Bluetooth LE)), run the following -command: +- Establishing a secure connection that completes the PASE + (Password-Authenticated Session Establishment) session using SPAKE2+ + protocol and results in printing the following log: -``` -chip-device-ctrl > resolve 1234 -``` + ``` + Secure Session to Device Established + ``` -A notification in the log indicates that the node address has been updated. The -IPv6 address of the device is cached in the controller for later usage. +- Providing the device with a network interface using ZCL Network + Commissioning cluster commands, and the network pairing credentials set in + the previous step. +- Discovering the IPv6 address of the Matter accessory using the SRP (Service + Registration Protocol) for Thread devices, or the mDNS (Multicast Domain + Name System) protocol for Wi-Fi or Ethernet devices. It results in printing + log that indicates that the node address has been updated. The IPv6 address + of the device is cached in the controller for later usage. +- Closing the Bluetooth LE connection, as the commissioning process is + finished and the Python CHIP controller is now using only the IPv6 traffic + to reach the device. -### Step 8: Control application ZCL clusters. +### Step 6: Control application ZCL clusters. For the light bulb example, execute the following command to toggle the LED state: @@ -310,7 +265,7 @@ value somewhere between 0 and 255. chip-device-ctrl > zcl LevelControl MoveToLevel 1234 1 0 level=50 ``` -### Step 9: Read basic information out of the accessory. +### Step 7: Read basic information out of the accessory. Every Matter accessory device supports a Basic Cluster, which maintains collection of attributes that a controller can obtain from a device, such as the @@ -372,6 +327,24 @@ chip-device-ctrl > ble-scan 2021-05-29 22:28:16,246 ChipBLEMgr INFO scanning stopped ``` +### `set-pairing-thread-credential ` + +Provides the controller with Thread network credentials that will be used in the +device commissioning procedure to configure the device with a Thread interface. + +``` +chip-device-ctrl > set-pairing-thread-credential 0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 +``` + +### `set-pairing-wifi-credential ` + +Provides the controller with Wi-Fi network credentials that will be used in the +device commissioning procedure to configure the device with a Wi-Fi interface. + +``` +chip-device-ctrl > set-pairing-wifi-credential TESTSSID P455W4RD +``` + ### `connect -ip
[]` Do key exchange and establish a secure session between controller and device diff --git a/examples/all-clusters-app/all-clusters-common/BUILD.gn b/examples/all-clusters-app/all-clusters-common/BUILD.gn index 0210fcedb2c646..90751a8106cea9 100644 --- a/examples/all-clusters-app/all-clusters-common/BUILD.gn +++ b/examples/all-clusters-app/all-clusters-common/BUILD.gn @@ -22,4 +22,5 @@ chip_data_model("all-clusters-common") { zap_pregenerated_dir = "${chip_root}/zzz_generated/all-clusters-app/zap-generated" is_server = true + use_default_client_callbacks = true } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index fe24dc6be7d331..72d0a2fe9bc8c9 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AccessControl = 31 { @@ -48,27 +48,27 @@ server cluster AccessControl = 31 { info event AccessControlEntryChanged = 0 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - AccessControlEntry latestValue = 4; + nullable AccessControlEntry latestValue = 4; } info event AccessControlExtensionChanged = 1 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - ExtensionEntry latestValue = 4; + nullable ExtensionEntry latestValue = 4; } attribute AccessControlEntry acl[] = 0; attribute ExtensionEntry extension[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AdministratorCommissioning = 60 { @@ -87,7 +87,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -122,7 +122,7 @@ server cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -133,12 +133,12 @@ server cluster ApplicationLauncher = 1292 { } struct ApplicationLauncherApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AudioOutput = 1291 { @@ -152,14 +152,14 @@ server cluster AudioOutput = 1291 { } struct OutputInfo { - INT8U index = 1; - OutputTypeEnum outputType = 2; - CHAR_STRING name = 3; + INT8U index = 0; + OutputTypeEnum outputType = 1; + CHAR_STRING name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BarrierControl = 259 { @@ -167,7 +167,7 @@ server cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -211,7 +211,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -220,11 +220,11 @@ server cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -250,7 +250,7 @@ server cluster BooleanState = 69 { } readonly attribute boolean stateValue = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BridgedActions = 37 { @@ -283,19 +283,19 @@ server cluster BridgedActions = 37 { } struct ActionStruct { - INT16U actionID = 1; - CHAR_STRING name = 2; - ActionTypeEnum type = 3; - INT16U endpointListID = 4; - INT16U supportedCommands = 5; - ActionStateEnum status = 6; + INT16U actionID = 0; + CHAR_STRING name = 1; + ActionTypeEnum type = 2; + INT16U endpointListID = 3; + INT16U supportedCommands = 4; + ActionStateEnum status = 5; } struct EndpointListStruct { - INT16U endpointListID = 1; - CHAR_STRING name = 2; - EndpointListTypeEnum type = 3; - ENDPOINT_NO endpoints[] = 4; + INT16U endpointListID = 0; + CHAR_STRING name = 1; + EndpointListTypeEnum type = 2; + ENDPOINT_NO endpoints[] = 3; } info event StateChanged = 0 { @@ -314,11 +314,11 @@ server cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; readonly attribute long_char_string setupUrl = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BridgedDeviceBasic = 57 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Channel = 1284 { @@ -332,15 +332,15 @@ server cluster Channel = 1284 { } struct ChannelInfo { - INT16U majorNumber = 1; - INT16U minorNumber = 2; - CHAR_STRING name = 3; - CHAR_STRING callSign = 4; - CHAR_STRING affiliateCallSign = 5; + INT16U majorNumber = 0; + INT16U minorNumber = 1; + CHAR_STRING name = 2; + CHAR_STRING callSign = 3; + CHAR_STRING affiliateCallSign = 4; } readonly attribute ChannelInfo channelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -442,7 +442,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -642,57 +642,57 @@ server cluster ContentLauncher = 1290 { } struct ContentSearch { - Parameter parameterList[] = 1; + Parameter parameterList[] = 0; } struct Parameter { - ParameterEnum type = 1; - CHAR_STRING value = 2; - AdditionalInfo externalIDList[] = 3; + ParameterEnum type = 0; + CHAR_STRING value = 1; + AdditionalInfo externalIDList[] = 2; } struct AdditionalInfo { - CHAR_STRING name = 1; - CHAR_STRING value = 2; + CHAR_STRING name = 0; + CHAR_STRING value = 1; } struct BrandingInformation { - CHAR_STRING providerName = 1; - StyleInformation background = 2; - StyleInformation logo = 3; - StyleInformation progressBar = 4; - StyleInformation splash = 5; - StyleInformation waterMark = 6; + CHAR_STRING providerName = 0; + StyleInformation background = 1; + StyleInformation logo = 2; + StyleInformation progressBar = 3; + StyleInformation splash = 4; + StyleInformation waterMark = 5; } struct StyleInformation { - CHAR_STRING imageUrl = 1; - CHAR_STRING color = 2; - Dimension size = 3; + CHAR_STRING imageUrl = 0; + CHAR_STRING color = 1; + Dimension size = 2; } struct Dimension { - double width = 1; - double height = 2; - MetricTypeEnum metric = 3; + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; } readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -920,8 +920,8 @@ server cluster DoorLock = 257 { } struct DlCredential { - DlCredentialType credentialType = 1; - INT16U credentialIndex = 2; + DlCredentialType credentialType = 0; + INT16U credentialIndex = 1; } critical event DoorLockAlarm = 0 { @@ -988,7 +988,7 @@ server cluster DoorLock = 257 { attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; attribute boolean requirePINforRemoteOperation = 51; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1079,7 +1079,7 @@ server cluster ElectricalMeasurement = 2820 { readonly attribute int16s activePower = 1291; readonly attribute int16s activePowerMin = 1292; readonly attribute int16s activePowerMax = 1293; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -1105,15 +1105,15 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { @@ -1121,7 +1121,7 @@ server cluster FlowMeasurement = 1028 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1139,15 +1139,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1233,12 +1233,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -1268,7 +1268,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1305,7 +1305,7 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupInfo groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1339,7 +1339,7 @@ server cluster GroupKeyManagement = 63 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1424,7 +1424,7 @@ server cluster IasZone = 1280 { readonly attribute bitmap16 zoneStatus = 2; attribute node_id iasCieAddress = 16; readonly attribute int8u zoneId = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1472,7 +1472,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1503,7 +1503,7 @@ server cluster IlluminanceMeasurement = 1024 { readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute enum8 lightSensorType = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -1602,7 +1602,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -1630,8 +1630,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1692,7 +1692,7 @@ server cluster LocalizationConfiguration = 43 { } server cluster LowPower = 1288 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1714,15 +1714,15 @@ server cluster MediaInput = 1287 { } struct InputInfo { - INT8U index = 1; - InputTypeEnum inputType = 2; - CHAR_STRING name = 3; - CHAR_STRING description = 4; + INT8U index = 0; + InputTypeEnum inputType = 1; + CHAR_STRING name = 2; + CHAR_STRING description = 3; } readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster MediaPlayback = 1286 { @@ -1748,14 +1748,14 @@ server cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ModeSelect = 80 { struct ModeOptionStruct { - CHAR_STRING label = 1; - INT8U mode = 2; - INT32U semanticTag = 3; + CHAR_STRING label = 0; + INT8U mode = 1; + INT32U semanticTag = 2; } readonly attribute int8u currentMode = 0; @@ -1763,7 +1763,7 @@ server cluster ModeSelect = 80 { attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; readonly attribute char_string description = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -1798,28 +1798,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -1830,8 +1830,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1912,7 +1912,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1993,7 +1993,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { info event DownloadError = 2 { INT32U softwareVersion = 0; INT64U bytesDownloaded = 1; - INT8U progressPercent = 2; + nullable INT8U progressPercent = 2; nullable INT64S platformCode = 3; } @@ -2001,7 +2001,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -2018,7 +2018,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -2042,8 +2042,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2067,7 +2067,7 @@ server cluster OnOff = 6 { server cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -2084,21 +2084,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2182,20 +2189,20 @@ server cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -2290,8 +2297,8 @@ server cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { @@ -2299,14 +2306,14 @@ server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -2314,7 +2321,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2404,11 +2411,11 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -2419,8 +2426,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2459,8 +2466,8 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -2471,13 +2478,13 @@ server cluster TargetNavigator = 1285 { } struct TargetInfo { - INT8U identifier = 1; - CHAR_STRING name = 2; + INT8U identifier = 0; + CHAR_STRING name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { @@ -2485,7 +2492,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2497,50 +2504,50 @@ server cluster TestCluster = 1295 { } struct TestListStructOctet { - INT64U fabricIndex = 1; - OCTET_STRING operationalCert = 2; + INT64U fabricIndex = 0; + OCTET_STRING operationalCert = 1; } struct NullablesAndOptionalsStruct { - nullable INT16U nullableInt = 1; - optional INT16U optionalInt = 2; - optional nullable INT16U nullableOptionalInt = 3; - nullable CHAR_STRING nullableString = 4; - optional CHAR_STRING optionalString = 5; - optional nullable CHAR_STRING nullableOptionalString = 6; - nullable SimpleStruct nullableStruct = 7; - optional SimpleStruct optionalStruct = 8; - optional nullable SimpleStruct nullableOptionalStruct = 9; - nullable SimpleEnum nullableList[] = 10; - optional SimpleEnum optionalList[] = 11; - optional nullable SimpleEnum nullableOptionalList[] = 12; + nullable INT16U nullableInt = 0; + optional INT16U optionalInt = 1; + optional nullable INT16U nullableOptionalInt = 2; + nullable CHAR_STRING nullableString = 3; + optional CHAR_STRING optionalString = 4; + optional nullable CHAR_STRING nullableOptionalString = 5; + nullable SimpleStruct nullableStruct = 6; + optional SimpleStruct optionalStruct = 7; + optional nullable SimpleStruct nullableOptionalStruct = 8; + nullable SimpleEnum nullableList[] = 9; + optional SimpleEnum optionalList[] = 10; + optional nullable SimpleEnum nullableOptionalList[] = 11; } struct SimpleStruct { - INT8U a = 1; - BOOLEAN b = 2; - SimpleEnum c = 3; - OCTET_STRING d = 4; - CHAR_STRING e = 5; - SimpleBitmap f = 6; - single g = 7; - double h = 8; + INT8U a = 0; + BOOLEAN b = 1; + SimpleEnum c = 2; + OCTET_STRING d = 3; + CHAR_STRING e = 4; + SimpleBitmap f = 5; + single g = 6; + double h = 7; } struct NestedStructList { - INT8U a = 1; - BOOLEAN b = 2; - SimpleStruct c = 3; - SimpleStruct d[] = 4; - INT32U e[] = 5; - OCTET_STRING f[] = 6; - INT8U g[] = 7; + INT8U a = 0; + BOOLEAN b = 1; + SimpleStruct c = 2; + SimpleStruct d[] = 3; + INT32U e[] = 4; + OCTET_STRING f[] = 5; + INT8U g[] = 6; } struct NestedStruct { - INT8U a = 1; - BOOLEAN b = 2; - SimpleStruct c = 3; + INT8U a = 0; + BOOLEAN b = 1; + SimpleStruct c = 2; } info event TestEvent = 1 { @@ -2629,7 +2636,7 @@ server cluster TestCluster = 1295 { attribute int8s nullableRangeRestrictedInt8s = 32807; attribute int16u nullableRangeRestrictedInt16u = 32808; attribute int16s nullableRangeRestrictedInt16s = 32809; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -2762,15 +2769,15 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThermostatUserInterfaceConfiguration = 516 { attribute enum8 temperatureDisplayMode = 0; attribute enum8 keypadLockout = 1; attribute enum8 scheduleProgrammingVisibility = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -2797,53 +2804,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -2913,20 +2920,20 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2986,8 +2993,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } @@ -3011,8 +3018,8 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command DownOrClose(): DefaultSuccess = 1; command StopMotion(): DefaultSuccess = 2; 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 94a3240c27969d..90ddac7d87f30d 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 @@ -4355,6 +4355,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, @@ -7204,9 +7219,9 @@ ] }, { - "name": "MA-rootdevice", - "deviceTypeName": "MA-rootdevice", - "deviceTypeCode": 22, + "name": "MA-onofflight", + "deviceTypeName": "MA-onofflight", + "deviceTypeCode": 256, "deviceTypeProfileId": 259, "clusters": [ { @@ -17119,9 +17134,9 @@ ] }, { - "name": "MA-rootdevice", - "deviceTypeName": "MA-rootdevice", - "deviceTypeCode": 22, + "name": "MA-onofflight", + "deviceTypeName": "MA-onofflight", + "deviceTypeCode": 256, "deviceTypeProfileId": 259, "clusters": [ { @@ -20121,22 +20136,22 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-rootdevice", + "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 22 + "deviceIdentifier": 256 }, { - "endpointTypeName": "MA-rootdevice", + "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 2, "profileId": 259, "endpointId": 2, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 22 + "deviceIdentifier": 256 } ] } diff --git a/examples/all-clusters-app/all-clusters-common/include/binding-handler.h b/examples/all-clusters-app/all-clusters-common/include/binding-handler.h new file mode 100644 index 00000000000000..b5d6df2b2acbb0 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/binding-handler.h @@ -0,0 +1,22 @@ +/* + * + * 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. + */ + +#pragma once + +#include "lib/core/CHIPError.h" + +CHIP_ERROR InitBindingHandlers(); diff --git a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp new file mode 100644 index 00000000000000..020c1210806171 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp @@ -0,0 +1,112 @@ +/* + * + * 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. + */ + +#include "binding-handler.h" + +#include "app-common/zap-generated/ids/Clusters.h" +#include "app-common/zap-generated/ids/Commands.h" +#include "app/CommandSender.h" +#include "app/clusters/bindings/BindingManager.h" +#include "app/server/Server.h" +#include "controller/InvokeInteraction.h" +#include "lib/core/CHIPError.h" + +#if defined(ENABLE_CHIP_SHELL) +#include "lib/shell/Engine.h" + +using chip::Shell::Engine; +using chip::Shell::shell_command_t; +using chip::Shell::streamer_get; +using chip::Shell::streamer_printf; +#endif // defined(ENABLE_CHIP_SHELL) + +static bool sSwitchOnOffState = false; +#if defined(ENABLE_CHIP_SHELL) +static void ToggleSwitchOnOff(bool newState) +{ + sSwitchOnOffState = newState; + chip::BindingManager::GetInstance().NotifyBoundClusterChanged(1, chip::app::Clusters::OnOff::Id, nullptr); +} + +static CHIP_ERROR SwitchCommandHandler(int argc, char ** argv) +{ + if (argc == 1 && strcmp(argv[0], "on") == 0) + { + ToggleSwitchOnOff(true); + return CHIP_NO_ERROR; + } + if (argc == 1 && strcmp(argv[0], "off") == 0) + { + ToggleSwitchOnOff(false); + return CHIP_NO_ERROR; + } + streamer_printf(streamer_get(), "Usage: switch [on|off]"); + return CHIP_NO_ERROR; +} + +static void RegisterSwitchCommands() +{ + static const shell_command_t sSwitchCommand = { SwitchCommandHandler, "switch", "Switch commands. Usage: switch [on|off]" }; + Engine::Root().RegisterCommands(&sSwitchCommand, 1); + return; +} +#endif // defined(ENABLE_CHIP_SHELL) + +static void BoundDeviceChangedHandler(const EmberBindingTableEntry * binding, chip::DeviceProxy * peer_device, void * context) +{ + using namespace chip; + using namespace chip::app; + + if (binding->type == EMBER_MULTICAST_BINDING) + { + ChipLogError(NotSpecified, "Group binding is not supported now"); + return; + } + + if (binding->type == EMBER_UNICAST_BINDING && binding->local == 1 && binding->clusterId == Clusters::OnOff::Id) + { + auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { + ChipLogProgress(NotSpecified, "OnOff command succeeds"); + }; + auto onFailure = [](const StatusIB & status, CHIP_ERROR error) { + ChipLogError(NotSpecified, "OnOff command failed: %" CHIP_ERROR_FORMAT, error.Format()); + }; + + if (sSwitchOnOffState) + { + Clusters::OnOff::Commands::On::Type onCommand; + Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), + binding->remote, onCommand, onSuccess, onFailure); + } + else + { + Clusters::OnOff::Commands::Off::Type offCommand; + Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), + binding->remote, offCommand, onSuccess, onFailure); + } + } +} + +CHIP_ERROR InitBindingHandlers() +{ + chip::BindingManager::GetInstance().SetAppServer(&chip::Server::GetInstance()); + chip::BindingManager::GetInstance().RegisterBoundDeviceChangedHandler(BoundDeviceChangedHandler); +#if defined(ENABLE_CHIP_SHELL) + RegisterSwitchCommands(); +#endif + return CHIP_NO_ERROR; +} diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 1f4ca1ca5a630e..cfb88c5606f70d 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -15,6 +15,7 @@ control. - [Flashing app using script](#flashing-app-using-script) - [Note](#note) - [Using the RPC console](#using-the-rpc-console) + - [Device Tracing](#device-tracing) --- @@ -295,3 +296,16 @@ From within the console you can then invoke rpcs: rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + +## Device Tracing + +Device tracing is available to analyze the device performance. To turn on +tracing, build with RPC enabled. See +[Using the RPC console](#using-the-rpc-console). + +Obtain tracing json file. + +``` + $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -d {PORT} -o {OUTPUT_FILE} \ + -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto +``` diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 2738a4b4f9ebfb..a98e4e9f60cf54 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -537,6 +538,7 @@ static void InitServer(intptr_t context) SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); NetWorkCommissioningInstInit(); SetupPretendDevices(); + InitBindingHandlers(); } static void InitOTARequestor(void) diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 3e700fd1af5b5e..36d3d0aa3c10a9 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -14,14 +14,18 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") +import("${build_root}/config/compiler/compiler.gni") -executable("chip-all-clusters-app") { +import("${chip_root}/src/lib/lib.gni") + +source_set("chip-all-clusters-common") { sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "include/tv-callbacks.cpp", "include/tv-callbacks.h", - "main.cpp", + "main-common.cpp", ] deps = [ @@ -35,9 +39,47 @@ executable("chip-all-clusters-app") { cflags = [ "-Wconversion" ] - output_dir = root_out_dir + if (chip_build_libshell) { + defines = [ "ENABLE_CHIP_SHELL" ] + } +} + +if (is_libfuzzer) { + executable("chip-all-clusters-app-fuzzing") { + sources = [ "fuzzing-main.cpp" ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/linux:app-main", + ] + + cflags = [ "-Wconversion" ] + + output_dir = root_out_dir + } +} else { + executable("chip-all-clusters-app") { + sources = [ "main.cpp" ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/linux:app-main", + ] + + cflags = [ "-Wconversion" ] + + include_dirs = + [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] + + output_dir = root_out_dir + } } group("linux") { - deps = [ ":chip-all-clusters-app" ] + deps = [] + if (is_libfuzzer) { + deps += [ ":chip-all-clusters-app-fuzzing" ] + } else { + deps += [ ":chip-all-clusters-app" ] + } } diff --git a/examples/all-clusters-app/linux/fuzzing-main.cpp b/examples/all-clusters-app/linux/fuzzing-main.cpp new file mode 100644 index 00000000000000..f7fef1bb214fb1 --- /dev/null +++ b/examples/all-clusters-app/linux/fuzzing-main.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppMain.h" +#include + +using namespace chip; +using namespace chip::DeviceLayer; + +void CleanShutdown() +{ + Server::GetInstance().Shutdown(); + PlatformMgr().Shutdown(); + // TODO: We don't Platform::MemoryShutdown because ~CASESessionManager calls + // Dnssd::ResolverProxy::Shutdown, which starts doing Platform::Delete. + // Platform::MemoryShutdown(); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize) +{ + static bool matterStackInitialized = false; + if (!matterStackInitialized) + { + // Might be simpler to do ChipLinuxAppInit() with argc == 0, argv set to + // just a fake executable name? + VerifyOrDie(Platform::MemoryInit() == CHIP_NO_ERROR); + VerifyOrDie(PlatformMgr().InitChipStack() == CHIP_NO_ERROR); + + // ChipLinuxAppMainLoop blocks, and we don't want that here. + VerifyOrDie(Server::GetInstance().Init() == CHIP_NO_ERROR); + + ApplicationInit(); + + // We don't start the event loop task, because we don't plan to deliver + // data on a separate thread. + + matterStackInitialized = true; + + // The fuzzer does not have a way to tell us when it's done, so just + // shut down things on exit. + atexit(CleanShutdown); + } + + // For now, just dump the data as a UDP payload into the session manager. + // But maybe we should try to separately extract a PeerAddress and data from + // the incoming data? + Transport::PeerAddress peerAddr; + System::PacketBufferHandle buf = + System::PacketBufferHandle::NewWithData(aData, aSize, /* aAdditionalSize = */ 0, /* aReservedSize = */ 0); + + // Ignoring the return value from OnMessageReceived, because we might be + // passing it all sorts of garbage that will cause it to fail. + Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf)); + + // Now process pending events until our sentinel is reached. + PlatformMgr().ScheduleWork([](intptr_t) { PlatformMgr().StopEventLoopTask(); }); + PlatformMgr().RunEventLoop(); + return 0; +} diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp new file mode 100644 index 00000000000000..9497d1d0f5f072 --- /dev/null +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "include/tv-callbacks.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::DeviceLayer; + +namespace { +static LowPowerManager lowPowerManager; +} // namespace + +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) +{ + emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); + return true; +} + +void OnIdentifyStart(::Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStart"); +} + +void OnIdentifyStop(::Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStop"); +} + +void OnTriggerEffect(::Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE"); + break; + default: + ChipLogProgress(Zcl, "No identifier effect"); + return; + } +} + +static Identify gIdentify0 = { + chip::EndpointId{ 0 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, +}; + +static Identify gIdentify1 = { + chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, +}; + +// Network commissioning +namespace { +// This file is being used by platforms other than Linux, so we need this check to disable related features since we only +// implemented them on linux. +#if CHIP_DEVICE_LAYER_TARGET_LINUX +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver; +Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sLinuxThreadDriver); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(1 /* Endpoint Id */, &sLinuxWiFiDriver); +#endif +#endif +} // namespace + +void ApplicationInit() +{ +#if CHIP_DEVICE_LAYER_TARGET_LINUX && defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + sThreadNetworkCommissioningInstance.Init(); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +#endif +} + +void emberAfLowPowerClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); + chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); +} diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index f7a58ab4e5dcfc..3ae4959c2a64fd 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -16,106 +16,13 @@ * limitations under the License. */ -#include "include/tv-callbacks.h" -#include -#include -#include -#include -#include - #include "AppMain.h" - -using namespace chip; -using namespace chip::app; -using namespace chip::DeviceLayer; - -namespace { -static LowPowerManager lowPowerManager; -} // namespace - -bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) -{ - emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); - return true; -} - -void OnIdentifyStart(::Identify *) -{ - ChipLogProgress(Zcl, "OnIdentifyStart"); -} - -void OnIdentifyStop(::Identify *) -{ - ChipLogProgress(Zcl, "OnIdentifyStop"); -} - -void OnTriggerEffect(::Identify * identify) -{ - switch (identify->mCurrentEffectIdentifier) - { - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE"); - break; - default: - ChipLogProgress(Zcl, "No identifier effect"); - return; - } -} - -static Identify gIdentify0 = { - chip::EndpointId{ 0 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, -}; - -static Identify gIdentify1 = { - chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, -}; - -// Network commissioning -namespace { -// This file is being used by platforms other than Linux, so we need this check to disable related features since we only -// implemented them on linux. -#if CHIP_DEVICE_LAYER_TARGET_LINUX -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver; -Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sLinuxThreadDriver); -#endif -#if CHIP_DEVICE_CONFIG_ENABLE_WPA -NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; -Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(1 /* Endpoint Id */, &sLinuxWiFiDriver); -#endif -#endif -} // namespace - -void ApplicationInit() -{ -#if CHIP_DEVICE_LAYER_TARGET_LINUX && defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - sThreadNetworkCommissioningInstance.Init(); -#endif -#if CHIP_DEVICE_CONFIG_ENABLE_WPA - sWiFiNetworkCommissioningInstance.Init(); -#endif -#endif -} +#include "binding-handler.h" int main(int argc, char * argv[]) { VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); + VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); ChipLinuxAppMainLoop(); return 0; } - -void emberAfLowPowerClusterInitCallback(EndpointId endpoint) -{ - ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); - chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); -} diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index ca364740a9e9f2..bbb871d89943ad 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -86,6 +86,7 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/application-basic-server/application-basic-server.cpp ${APP_CLUSTERS}/basic/basic.cpp + ${APP_CLUSTERS}/bindings/BindingManager.cpp ${APP_CLUSTERS}/bindings/bindings.cpp ${APP_CLUSTERS}/on-off-server/on-off-server.cpp ${APP_CLUSTERS}/access-control-server/access-control-server.cpp diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 3961b050530505..f8504f25addfa8 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,20 +68,20 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -161,15 +161,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -255,12 +255,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -318,8 +318,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -405,28 +405,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -437,8 +437,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -515,7 +515,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -536,21 +536,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -626,11 +633,11 @@ server cluster OperationalCredentials = 62 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -641,8 +648,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -679,8 +686,8 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -707,53 +714,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -823,13 +830,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -889,8 +896,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 074fef3c6e5c3b..ceab47a82bb9be 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -2918,6 +2918,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 7b2fb7081f1d00..71b77ea34cffb1 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -71,6 +71,7 @@ static_library("chip-tool-utils") { "${chip_root}/src/lib", "${chip_root}/src/platform", "${chip_root}/third_party/inipp", + "${chip_root}/third_party/jsoncpp", ] cflags = [ "-Wconversion" ] @@ -96,6 +97,7 @@ executable("chip-tool") { "${chip_root}/src/lib", "${chip_root}/src/platform", "${chip_root}/third_party/inipp", + "${chip_root}/third_party/jsoncpp", ] cflags = [ "-Wconversion" ] diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp index a8e5ddd0071086..bf1af719280ae9 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.cpp +++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp @@ -33,7 +33,9 @@ void ModelCommand::OnDeviceConnectedFn(void * context, ChipDevice * device) { ModelCommand * command = reinterpret_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "OnDeviceConnectedFn: context is null")); - command->SendCommand(device, command->mEndPointId); + + CHIP_ERROR err = command->SendCommand(device, command->mEndPointId); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); } void ModelCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR err) diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 7592969a5c1ad0..a7f619a272e723 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -531,9 +531,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) {{/unless}} {{/if}} {{#if isReportableAttribute}} - {{#unless isList}} make_unique(), // - {{/unless}} {{/if}} {{/unless}} {{/chip_server_cluster_attributes}} diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 2a8a71863dfa33..a85b63d25dc961 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -28,6 +28,10 @@ function getTests() 'Test_TC_BOOL_2_1', ]; + const BridgedActions = [ + 'Test_TC_BRAC_1_1', + ]; + const ColorControl = [ 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', @@ -72,6 +76,11 @@ function getTests() 'Test_TC_EMR_1_1', ]; + const EthernetNetworkDiagnostics = [ + 'Test_TC_ETHDIAG_1_1', + 'Test_TC_ETHDIAG_2_1', + ]; + const FlowMeasurement = [ 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', @@ -132,6 +141,10 @@ function getTests() 'Test_TC_OO_2_3', ]; + const PowerSource = [ + 'Test_TC_PS_1_1', + ]; + const PressureMeasurement = [ 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', @@ -150,6 +163,11 @@ function getTests() 'Test_TC_RH_2_2', ]; + const Switch = [ + 'Test_TC_SWTCH_2_1', + 'Test_TC_SWTCH_2_2', + ]; + const TemperatureMeasurement = [ 'Test_TC_TM_1_1', 'Test_TC_TM_2_1', @@ -172,6 +190,11 @@ function getTests() 'Test_TC_DIAGTH_1_1', ]; + const WiFiNetworkDiagnostics = [ + 'Test_TC_WIFIDIAG_1_1', + 'Test_TC_WIFIDIAG_3_1', + ]; + const WindowCovering = [ 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', @@ -229,23 +252,28 @@ function getTests() const tests = [ BinaryInput, // BooleanState, // + BridgedActions, // ColorControl, // DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // + EthernetNetworkDiagnostics, // FlowMeasurement, // IlluminanceMeasurement, // LevelControl, // MediaControl, // OccupancySensing, // OnOff, // + PowerSource, // PressureMeasurement, // PumpConfigurationControl, // RelativeHumidityMeasurement, // + Switch, // TemperatureMeasurement, // Thermostat, // ThermostatUserConfiguration, // ThreadNetworkDiagnostics, // + WiFiNetworkDiagnostics, // WindowCovering, // TV, // Others, // diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index c84c60cd4242e8..2dbd6bc86aa468 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,20 +68,20 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -309,8 +309,8 @@ server cluster DoorLock = 257 { } struct DlCredential { - DlCredentialType credentialType = 1; - INT16U credentialIndex = 2; + DlCredentialType credentialType = 0; + INT16U credentialIndex = 1; } critical event DoorLockAlarm = 0 { @@ -368,7 +368,7 @@ server cluster DoorLock = 257 { attribute boolean enablePrivacyModeButton = 43; attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -470,13 +470,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -494,15 +494,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -588,12 +588,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -623,7 +623,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -657,28 +657,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -689,8 +689,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -764,21 +764,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -861,22 +868,22 @@ server cluster PowerSource = 47 { readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; readonly attribute char_string batteryReplacementDescription = 19; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -887,8 +894,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -915,53 +922,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -1031,13 +1038,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1097,8 +1104,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.zap b/examples/door-lock-app/door-lock-common/door-lock-app.zap index e0811fbe202f99..1a7e40362e00b4 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.zap +++ b/examples/door-lock-app/door-lock-common/door-lock-app.zap @@ -3885,6 +3885,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index a248836a3f7efa..b9bbca9a8dc80f 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -44,6 +44,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -52,6 +59,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -63,6 +90,7 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ @@ -77,10 +105,36 @@ efr32_sdk("sdk") { "PW_RPC_ENABLED", ] } + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("lighting_app") { output_name = "chip-efr32-lighting-example.out" + include_dirs = [ "include" ] + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -99,26 +153,50 @@ efr32_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${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 { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${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", + ] + } + } + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs } - - include_dirs = [ "include" ] - - defines = [] if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c" ] diff --git a/examples/lighting-app/efr32/build_for_wifi_args.gni b/examples/lighting-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/lighting-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lighting-app/efr32/build_for_wifi_gnfile.gn b/examples/lighting-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/lighting-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/lighting-app/efr32/include/AppConfig.h b/examples/lighting-app/efr32/include/AppConfig.h index efe17b3b39288f..91501d889a6234 100644 --- a/examples/lighting-app/efr32/include/AppConfig.h +++ b/examples/lighting-app/efr32/include/AppConfig.h @@ -21,7 +21,7 @@ // ---- Lighting Example App Config ---- -#define APP_TASK_NAME "APP" +#define APP_TASK_NAME "Lit" // Time it takes in ms for the simulated actuator to move from one // state to another. diff --git a/examples/lighting-app/efr32/include/FreeRTOSConfig.h b/examples/lighting-app/efr32/include/FreeRTOSConfig.h index 3d241f9a24ce0e..17bc3975fe19af 100644 --- a/examples/lighting-app/efr32/include/FreeRTOSConfig.h +++ b/examples/lighting-app/efr32/include/FreeRTOSConfig.h @@ -237,7 +237,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configENABLE_BACKWARD_COMPATIBILITY (1) #define configSUPPORT_STATIC_ALLOCATION (1) #define configSUPPORT_DYNAMIC_ALLOCATION (1) +#ifdef SL_WIFI +#define configTOTAL_HEAP_SIZE ((size_t)(28 * 1024)) +#else #define configTOTAL_HEAP_SIZE ((size_t)(20 * 1024)) +#endif /* Optional functions - most linkers will remove unused functions anyway. */ #define INCLUDE_vTaskPrioritySet (1) diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index 778acda0bd3fc9..acdf7f8c78ea4d 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -51,6 +51,9 @@ #include #include #endif +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif /* SL_WIFI */ #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -73,9 +76,17 @@ QueueHandle_t sAppEventQueue; LEDWidget sStatusLED; LEDWidget sLightLED; +#ifdef SL_WIFI +bool sIsWiFiProvisioned = false; +bool sIsWiFiEnabled = false; +bool sIsWiFiAttached = false; +#endif /* SL_WIFI */ + +#if CHIP_ENABLE_OPENTHREAD bool sIsThreadProvisioned = false; bool sIsThreadEnabled = false; -bool sHaveBLEConnections = false; +#endif /* CHIP_ENABLE_OPENTHREAD */ +bool sHaveBLEConnections = false; EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; @@ -88,6 +99,7 @@ StaticTask_t appTaskStruct; /********************************************************** * Identify Callbacks *********************************************************/ + namespace { void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) { @@ -208,6 +220,18 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif // Init ZCL Data Model chip::Server::GetInstance().Init(); @@ -294,9 +318,16 @@ void AppTask::AppTaskMain(void * pvParameter) // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#ifdef SL_WIFI + sIsWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + sIsWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); + sIsWiFiAttached = ConnectivityMgr().IsWiFiStationConnected(); +#endif /* SL_WIFI */ +#if CHIP_ENABLE_OPENTHREAD sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#endif /* CHIP_ENABLE_OPENTHREAD */ + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } @@ -333,18 +364,16 @@ void AppTask::AppTaskMain(void * pvParameter) sStatusLED.Blink(300, 700); } } - else if (sIsThreadProvisioned && sIsThreadEnabled) +#if CHIP_ENABLE_OPENTHREAD + if (sIsThreadProvisioned && sIsThreadEnabled) +#else + if (sIsWiFiProvisioned && sIsWiFiEnabled && !sIsWiFiAttached) +#endif { sStatusLED.Blink(950, 50); } - else if (sHaveBLEConnections) - { - sStatusLED.Blink(100, 100); - } - else - { - sStatusLED.Blink(50, 950); - } + else if (sHaveBLEConnections) { sStatusLED.Blink(100, 100); } + else { sStatusLED.Blink(50, 950); } } sStatusLED.Animate(); @@ -484,16 +513,17 @@ void AppTask::FunctionHandler(AppEvent * aEvent) sAppTask.CancelTimer(); sAppTask.mFunction = kFunction_NoneSelected; +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else if (!ConnectivityMgr().IsThreadProvisioned()) +#endif /* !SL_WIFI */ { // Enable BLE advertisements ConnectivityMgr().SetBLEAdvertisingEnabled(true); ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising); } - else - { - EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); - } + else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp index 943f0993a7af35..297601ac6f8670 100644 --- a/examples/lighting-app/efr32/src/main.cpp +++ b/examples/lighting-app/efr32/src/main.cpp @@ -48,8 +48,8 @@ #include "lcd.h" #endif -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -62,6 +62,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + #if PW_RPC_ENABLED #include "Rpc.h" #endif @@ -70,6 +74,7 @@ #include "matter_shell.h" #endif +#define BLE_DEV_NAME "SiLabs-Light" using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; @@ -135,7 +140,7 @@ int main(void) EFR32_LOG("PlatformMgr().InitChipStack() failed"); appError(ret); } - chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("EFR32_LIGHT"); + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(BLE_DEV_NAME); #if CHIP_ENABLE_OPENTHREAD EFR32_LOG("Initializing OpenThread stack"); ret = ThreadStackMgr().InitThreadStack(); @@ -160,6 +165,13 @@ int main(void) EFR32_LOG("PlatformMgr().StartEventLoopTask() failed"); appError(ret); } +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ #if CHIP_ENABLE_OPENTHREAD EFR32_LOG("Starting OpenThread task"); @@ -172,6 +184,13 @@ int main(void) appError(ret); } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef RS911X_WIFI + /* + * Start up any RSI interface stuff + * (Not required) - Note that wfx_wifi_start will deal with + * starting up a rsi task - which will initialize the SPI interface. + */ +#endif EFR32_LOG("Starting App Task"); ret = GetAppTask().StartAppTask(); diff --git a/examples/lighting-app/efr32/with_pw_rpc.gni b/examples/lighting-app/efr32/with_pw_rpc.gni index d0a8f2c0485f06..3922567d5b071a 100644 --- a/examples/lighting-app/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/efr32/with_pw_rpc.gni @@ -23,6 +23,5 @@ 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/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 2567e30773641b..b2e216e95e5504 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -76,7 +76,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -147,7 +147,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -320,15 +320,15 @@ server cluster ColorControl = 768 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -384,15 +384,15 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -410,15 +410,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -504,12 +504,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -539,7 +539,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -567,7 +567,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -612,8 +612,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -699,28 +699,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -731,8 +731,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -813,7 +813,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -905,7 +905,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { info event DownloadError = 2 { INT32U softwareVersion = 0; INT64U bytesDownloaded = 1; - INT8U progressPercent = 2; + nullable INT8U progressPercent = 2; nullable INT64S platformCode = 3; } @@ -913,7 +913,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -930,7 +930,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -954,8 +954,8 @@ client cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -979,8 +979,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -1004,7 +1004,7 @@ server cluster OnOff = 6 { server cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -1021,21 +1021,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1111,11 +1118,11 @@ server cluster OperationalCredentials = 62 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -1126,8 +1133,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -1189,53 +1196,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -1305,15 +1312,15 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1373,8 +1380,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 5c63eaa227ffbb..fb1e68cb44bec1 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -4143,6 +4143,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index 5a4fdf42a2d176..bfad30ece1b85f 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -74,6 +74,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/server/CommissioningWindowManager.cpp ${CHIP_ROOT}/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp + ${CHIP_ROOT}/src/app/clusters/bindings/BindingManager.cpp ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp ${CHIP_ROOT}/src/app/clusters/descriptor/descriptor.cpp ${CHIP_ROOT}/src/app/clusters/identify-server/identify-server.cpp diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 428931ffcd2cdc..4b8c416fffdfa5 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -79,7 +79,7 @@ qpg_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common/color_format", ] - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index cabca3ee2eb539..f6bb6443f127ba 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -73,6 +73,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/server/CommissioningWindowManager.cpp ${CHIP_ROOT}/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp + ${CHIP_ROOT}/src/app/clusters/bindings/BindingManager.cpp ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp ${CHIP_ROOT}/src/app/clusters/descriptor/descriptor.cpp ${CHIP_ROOT}/src/app/clusters/identify-server/identify-server.cpp diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 534ce5343e2dde..7dcc8802659fdc 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -43,6 +43,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -51,6 +58,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -62,6 +89,7 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ @@ -75,10 +103,37 @@ efr32_sdk("sdk") { "PW_RPC_ENABLED", ] } + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("lock_app") { output_name = "chip-efr32-lock-example.out" + include_dirs = [ "include" ] + + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -101,22 +156,49 @@ efr32_executable("lock_app") { "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", "${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 { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${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", + ] + } + } + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs } - - include_dirs = [ "include" ] - - defines = [] if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c" ] diff --git a/examples/lock-app/efr32/build_for_wifi_args.gni b/examples/lock-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/lock-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +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/build_for_wifi_gnfile.gn b/examples/lock-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/lock-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/lock-app/efr32/include/AppConfig.h b/examples/lock-app/efr32/include/AppConfig.h index 77223889639fb1..84b588c4997970 100644 --- a/examples/lock-app/efr32/include/AppConfig.h +++ b/examples/lock-app/efr32/include/AppConfig.h @@ -21,7 +21,7 @@ // ---- Lock Example App Config ---- -#define APP_TASK_NAME "APP" +#define APP_TASK_NAME "Lck" // Time it takes in ms for the simulated actuator to move from one // state to another. diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 0a67f008a94317..a02b834ca0e9eb 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -47,6 +47,9 @@ #include #include #endif +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -68,9 +71,17 @@ QueueHandle_t sAppEventQueue; LEDWidget sStatusLED; LEDWidget sLockLED; +#ifdef SL_WIFI +bool sIsWiFiProvisioned = false; +bool sIsWiFiEnabled = false; +bool sIsWiFiAttached = false; +#endif + +#if CHIP_ENABLE_OPENTHREAD bool sIsThreadProvisioned = false; bool sIsThreadEnabled = false; -bool sHaveBLEConnections = false; +#endif +bool sHaveBLEConnections = false; StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; @@ -98,6 +109,18 @@ CHIP_ERROR AppTask::StartAppTask() CHIP_ERROR AppTask::Init() { +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif // Init ZCL Data Model chip::Server::GetInstance().Init(); @@ -185,9 +208,16 @@ void AppTask::AppTaskMain(void * pvParameter) // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#ifdef SL_WIFI + sIsWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + sIsWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); + sIsWiFiAttached = ConnectivityMgr().IsWiFiStationConnected(); +#endif +#if CHIP_ENABLE_OPENTHREAD sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#endif + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } @@ -205,18 +235,16 @@ void AppTask::AppTaskMain(void * pvParameter) // Otherwise, blink the LED ON for a very short time. if (sAppTask.mFunction != kFunction_FactoryReset) { +#if CHIP_ENABLE_OPENTHREAD if (sIsThreadProvisioned && sIsThreadEnabled) +#else + if (sIsWiFiProvisioned && sIsWiFiEnabled && !sIsWiFiAttached) +#endif { sStatusLED.Blink(950, 50); } - else if (sHaveBLEConnections) - { - sStatusLED.Blink(100, 100); - } - else - { - sStatusLED.Blink(50, 950); - } + else if (sHaveBLEConnections) { sStatusLED.Blink(100, 100); } + else { sStatusLED.Blink(50, 950); } } sStatusLED.Animate(); @@ -356,16 +384,17 @@ void AppTask::FunctionHandler(AppEvent * aEvent) sAppTask.CancelTimer(); sAppTask.mFunction = kFunction_NoneSelected; +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else if (!ConnectivityMgr().IsThreadProvisioned()) +#endif { // Enable BLE advertisements ConnectivityMgr().SetBLEAdvertisingEnabled(true); ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising); } - else - { - EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); - } + else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp index c92b9e71c8b7d5..7e25365142199d 100644 --- a/examples/lock-app/efr32/src/main.cpp +++ b/examples/lock-app/efr32/src/main.cpp @@ -56,8 +56,8 @@ #include "matter_shell.h" #endif -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -70,6 +70,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; @@ -169,6 +173,13 @@ int main(void) appError(ret); } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ EFR32_LOG("Starting App Task"); ret = GetAppTask().StartAppTask(); diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 1e4cc77e0a03ea..fe6fecc6a9dd26 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,20 +68,20 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -161,15 +161,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -255,12 +255,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -324,28 +324,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -356,8 +356,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -438,8 +438,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -460,21 +460,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -557,22 +564,22 @@ server cluster PowerSource = 47 { readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; readonly attribute char_string batteryReplacementDescription = 19; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -583,8 +590,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -611,53 +618,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -727,13 +734,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -793,8 +800,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 0365ec7275c95e..08b8f6614b3cbb 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -3885,6 +3885,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 49fa9d1c366efe..f7326fa9822375 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -72,6 +72,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/server/CommissioningWindowManager.cpp ${CHIP_ROOT}/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp + ${CHIP_ROOT}/src/app/clusters/bindings/BindingManager.cpp ${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 diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index 0ba2a9729c709f..c25fe779b00dc0 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -75,7 +75,7 @@ qpg_executable("lock_app") { cflags = [ "-Wconversion" ] - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index cb0ab78e63bfda..e30623a820f786 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -75,12 +75,12 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -141,26 +141,26 @@ server cluster NetworkCommissioning = 49 { } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -235,19 +235,19 @@ server cluster OperationalCredentials = 62 { } struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 127426ee77ade9..09b4f798d20c84 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -2,13 +2,13 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -26,15 +26,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -100,28 +100,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -132,8 +132,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -214,7 +214,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -272,21 +272,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -351,7 +358,7 @@ server cluster OperationalCredentials = 62 { server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index f806fa5a73f4f7..c447385b451e87 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1721,6 +1721,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 35533af4a4838a..fae07dd1a603d8 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster Basic = 40 { @@ -32,14 +32,14 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -57,15 +57,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -131,28 +131,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -163,8 +163,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -245,7 +245,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -337,7 +337,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { info event DownloadError = 2 { INT32U softwareVersion = 0; INT64U bytesDownloaded = 1; - INT8U progressPercent = 2; + nullable INT8U progressPercent = 2; nullable INT64S platformCode = 3; } @@ -345,7 +345,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -372,21 +372,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -462,7 +469,7 @@ server cluster OperationalCredentials = 62 { server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index 364b27439619af..9f9ca70a12c219 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1820,6 +1820,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/persistent-storage/qpg/BUILD.gn b/examples/persistent-storage/qpg/BUILD.gn index 907dfba90e9a1b..19cfb9eb550549 100644 --- a/examples/persistent-storage/qpg/BUILD.gn +++ b/examples/persistent-storage/qpg/BUILD.gn @@ -63,7 +63,7 @@ qpg_executable("persistent_storage") { output_dir = root_out_dir - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 67d215fd083f47..07f3fde86630e9 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -35,7 +35,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -90,7 +90,7 @@ server cluster ColorControl = 768 { attribute bitmap8 colorControlOptions = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -122,15 +122,15 @@ server cluster ColorControl = 768 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -148,12 +148,12 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -190,7 +190,7 @@ server cluster GeneralCommissioning = 48 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -268,7 +268,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -375,28 +375,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -407,8 +407,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -485,7 +485,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -507,12 +507,12 @@ server cluster OperationalCredentials = 62 { } struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; @@ -520,7 +520,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -596,9 +596,9 @@ server cluster OperationalCredentials = 62 { server cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -606,7 +606,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -698,14 +698,14 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 67d215fd083f47..07f3fde86630e9 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -35,7 +35,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -90,7 +90,7 @@ server cluster ColorControl = 768 { attribute bitmap8 colorControlOptions = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -122,15 +122,15 @@ server cluster ColorControl = 768 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -148,12 +148,12 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -190,7 +190,7 @@ server cluster GeneralCommissioning = 48 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -268,7 +268,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -375,28 +375,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -407,8 +407,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -485,7 +485,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -507,12 +507,12 @@ server cluster OperationalCredentials = 62 { } struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } readonly attribute FabricDescriptor fabricsList[] = 1; @@ -520,7 +520,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -596,9 +596,9 @@ server cluster OperationalCredentials = 62 { server cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -606,7 +606,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -698,14 +698,14 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/platform/efr32/uart.cpp b/examples/platform/efr32/uart.cpp index 9d3cbc2b1d966d..8d384a9ac657b4 100644 --- a/examples/platform/efr32/uart.cpp +++ b/examples/platform/efr32/uart.cpp @@ -200,7 +200,9 @@ void USART_IRQHandler(void) #ifdef ENABLE_CHIP_SHELL chip::NotifyShellProcessFromISR(); #endif -#ifndef PW_RPC_ENABLED +#if defined(SL_WIFI) + /* TODO */ +#elif !defined(PW_RPC_ENABLED) otSysEventSignalPending(); #endif } @@ -224,7 +226,9 @@ static void UART_rx_callback(UARTDRV_Handle_t handle, Ecode_t transferStatus, ui #ifdef ENABLE_CHIP_SHELL chip::NotifyShellProcessFromISR(); #endif -#ifndef PW_RPC_ENABLED +#if defined(SL_WIFI) + /* TODO */ +#elif !defined(PW_RPC_ENABLED) otSysEventSignalPending(); #endif } diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 09e1a54d48acb4..fafa5afa0c8ab9 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -397,6 +397,7 @@ DeviceCommissioner * GetDeviceCommissioner() void ChipLinuxAppMainLoop() { #if defined(ENABLE_CHIP_SHELL) + Engine::Root().Init(); std::thread shellThread([]() { Engine::Root().RunMainLoop(); }); chip::Shell::RegisterCommissioneeCommands(); #endif diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 12c14847adfbaa..058c65c234e391 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,22 +68,22 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -118,21 +118,21 @@ server cluster DiagnosticLogs = 50 { server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -150,15 +150,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -244,12 +244,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -279,7 +279,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -380,28 +380,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -412,8 +412,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -490,7 +490,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -511,21 +511,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -603,14 +610,14 @@ client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -705,17 +712,17 @@ server cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -726,22 +733,22 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -768,53 +775,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -884,13 +891,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 547b2575f3240a..27899b8e60278c 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -3661,6 +3661,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 929d2259528a35..fcc69efb730f52 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,22 +68,22 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -139,20 +139,20 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -170,15 +170,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -264,12 +264,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -299,7 +299,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster LevelControl = 8 { @@ -314,7 +314,7 @@ client cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -400,28 +400,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -432,8 +432,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -510,7 +510,7 @@ client cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -531,21 +531,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -623,7 +630,7 @@ client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -701,16 +708,16 @@ client cluster PumpConfigurationAndControl = 512 { readonly attribute enum8 effectiveControlMode = 18; readonly attribute int16s capacity = 19; attribute enum8 operationMode = 32; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -721,15 +728,15 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -756,53 +763,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -872,13 +879,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -938,8 +945,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index dac6c8c62b9387..a3f8134ecae07f 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -3661,6 +3661,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 689ac8d7e180c1..1943328215ef9a 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,20 +68,20 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -161,15 +161,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -255,12 +255,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -324,28 +324,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -356,8 +356,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateWiFiNetworkRequest { OCTET_STRING ssid = 0; @@ -425,21 +425,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -519,20 +526,20 @@ server cluster SoftwareDiagnostics = 52 { } readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -592,8 +599,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap index 34c598b17e0028..018ede5303867b 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap @@ -2274,6 +2274,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, @@ -2471,10 +2486,10 @@ ] }, { - "name": "MA-rootdevice", - "deviceTypeName": "MA-rootdevice", + "name": "MA-tempsensor", + "deviceTypeName": "MA-tempsensor", "deviceTypeCode": 22, - "deviceTypeProfileId": 259, + "deviceTypeProfileId": 770, "clusters": [ { "name": "Power Configuration", @@ -3400,13 +3415,13 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-rootdevice", + "endpointTypeName": "MA-tempsensor", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 22 + "deviceIdentifier": 770 } ] -} \ No newline at end of file +} diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index dbb441e1f04efb..08678f8f9dd7f5 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -76,13 +76,13 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -104,15 +104,15 @@ server cluster Binding = 30 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -168,13 +168,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -192,15 +192,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -286,12 +286,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -321,7 +321,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -345,12 +345,12 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -428,7 +428,7 @@ client cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -467,7 +467,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -512,28 +512,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -544,8 +544,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -626,7 +626,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -684,21 +684,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -774,9 +781,9 @@ server cluster OperationalCredentials = 62 { server cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -784,7 +791,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -874,11 +881,11 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -889,8 +896,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Thermostat = 513 { @@ -917,8 +924,8 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -984,53 +991,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -1100,13 +1107,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1166,8 +1173,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index c4f33595c982f9..705464718d4a8c 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -3991,6 +3991,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index b85ad7df624620..2b896b3e017f27 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2,12 +2,12 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -43,7 +43,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -72,8 +72,8 @@ server cluster ApplicationBasic = 1293 { } struct ApplicationBasicApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute char_string vendorName = 0; @@ -84,7 +84,7 @@ server cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -95,18 +95,18 @@ server cluster ApplicationLauncher = 1292 { } struct ApplicationEP { - ApplicationLauncherApplication application = 1; - CHAR_STRING endpoint = 2; + ApplicationLauncherApplication application = 0; + CHAR_STRING endpoint = 1; } struct ApplicationLauncherApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute INT16U applicationLauncherList[] = 0; attribute ApplicationEP applicationLauncherApp = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -142,14 +142,14 @@ server cluster AudioOutput = 1291 { } struct OutputInfo { - INT8U index = 1; - OutputTypeEnum outputType = 2; - CHAR_STRING name = 3; + INT8U index = 0; + OutputTypeEnum outputType = 1; + CHAR_STRING name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -197,13 +197,13 @@ server cluster Basic = 40 { readonly attribute char_string serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } client cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -224,7 +224,7 @@ client cluster Binding = 30 { } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -255,24 +255,24 @@ server cluster Channel = 1284 { } struct ChannelInfo { - INT16U majorNumber = 1; - INT16U minorNumber = 2; - CHAR_STRING name = 3; - CHAR_STRING callSign = 4; - CHAR_STRING affiliateCallSign = 5; + INT16U majorNumber = 0; + INT16U minorNumber = 1; + CHAR_STRING name = 2; + CHAR_STRING callSign = 3; + CHAR_STRING affiliateCallSign = 4; } struct LineupInfo { - CHAR_STRING operatorName = 1; - CHAR_STRING lineupName = 2; - CHAR_STRING postalCode = 3; - LineupInfoTypeEnum lineupInfoType = 4; + CHAR_STRING operatorName = 0; + CHAR_STRING lineupName = 1; + CHAR_STRING postalCode = 2; + LineupInfoTypeEnum lineupInfoType = 3; } readonly attribute ChannelInfo channelList[] = 0; attribute LineupInfo channelLineup = 1; attribute ChannelInfo currentChannel = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -326,44 +326,44 @@ server cluster ContentLauncher = 1290 { } struct ContentSearch { - Parameter parameterList[] = 1; + Parameter parameterList[] = 0; } struct Parameter { - ParameterEnum type = 1; - CHAR_STRING value = 2; - AdditionalInfo externalIDList[] = 3; + ParameterEnum type = 0; + CHAR_STRING value = 1; + AdditionalInfo externalIDList[] = 2; } struct AdditionalInfo { - CHAR_STRING name = 1; - CHAR_STRING value = 2; + CHAR_STRING name = 0; + CHAR_STRING value = 1; } struct BrandingInformation { - CHAR_STRING providerName = 1; - StyleInformation background = 2; - StyleInformation logo = 3; - StyleInformation progressBar = 4; - StyleInformation splash = 5; - StyleInformation waterMark = 6; + CHAR_STRING providerName = 0; + StyleInformation background = 1; + StyleInformation logo = 2; + StyleInformation progressBar = 3; + StyleInformation splash = 4; + StyleInformation waterMark = 5; } struct StyleInformation { - CHAR_STRING imageUrl = 1; - CHAR_STRING color = 2; - Dimension size = 3; + CHAR_STRING imageUrl = 0; + CHAR_STRING color = 1; + Dimension size = 2; } struct Dimension { - double width = 1; - double height = 2; - MetricTypeEnum metric = 3; + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; } readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -388,15 +388,15 @@ server cluster ContentLauncher = 1290 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -452,13 +452,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -476,15 +476,15 @@ client cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -534,15 +534,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -628,12 +628,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -663,7 +663,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -687,7 +687,7 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -786,7 +786,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -820,8 +820,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -882,7 +882,7 @@ server cluster LocalizationConfiguration = 43 { } server cluster LowPower = 1288 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -904,15 +904,15 @@ server cluster MediaInput = 1287 { } struct InputInfo { - INT8U index = 1; - InputTypeEnum inputType = 2; - CHAR_STRING name = 3; - CHAR_STRING description = 4; + INT8U index = 0; + InputTypeEnum inputType = 1; + CHAR_STRING name = 2; + CHAR_STRING description = 3; } readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -947,8 +947,8 @@ server cluster MediaPlayback = 1286 { } struct PlaybackPosition { - INT64U updatedAt = 1; - INT64U position = 2; + INT64U updatedAt = 0; + INT64U position = 1; } readonly attribute PlaybackStateEnum playbackState = 0; @@ -958,7 +958,7 @@ server cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1015,28 +1015,28 @@ client cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -1047,8 +1047,8 @@ client cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1134,28 +1134,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -1166,8 +1166,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1248,7 +1248,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1309,7 +1309,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1330,21 +1330,28 @@ client cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1421,21 +1428,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1513,16 +1527,16 @@ server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u measuredValue = 0; readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -1533,8 +1547,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -1545,13 +1559,13 @@ server cluster TargetNavigator = 1285 { } struct TargetInfo { - INT8U identifier = 1; - CHAR_STRING name = 2; + INT8U identifier = 0; + CHAR_STRING name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -1590,53 +1604,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -1706,18 +1720,18 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1777,8 +1791,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 819488c416eb25..437564af70bcc5 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -4006,6 +4006,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index c45abe423067d5..ed780da7f8b1a4 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2,12 +2,12 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } client cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -39,7 +39,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -73,7 +73,7 @@ client cluster ApplicationBasic = 1293 { readonly attribute int16u productId = 3; readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -84,12 +84,12 @@ client cluster ApplicationLauncher = 1292 { } struct ApplicationLauncherApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -120,13 +120,13 @@ client cluster AudioOutput = 1291 { } struct OutputInfo { - INT8U index = 1; - OutputTypeEnum outputType = 2; - CHAR_STRING name = 3; + INT8U index = 0; + OutputTypeEnum outputType = 1; + CHAR_STRING name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -146,7 +146,7 @@ server cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -190,7 +190,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -199,11 +199,11 @@ server cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -238,7 +238,7 @@ server cluster BridgedDeviceBasic = 57 { readonly attribute char_string productLabel = 14; readonly attribute char_string serialNumber = 15; readonly attribute boolean reachable = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Leave(): DefaultSuccess = 2; command ReachableChanged(): DefaultSuccess = 3; @@ -257,24 +257,24 @@ client cluster Channel = 1284 { } struct ChannelInfo { - INT16U majorNumber = 1; - INT16U minorNumber = 2; - CHAR_STRING name = 3; - CHAR_STRING callSign = 4; - CHAR_STRING affiliateCallSign = 5; + INT16U majorNumber = 0; + INT16U minorNumber = 1; + CHAR_STRING name = 2; + CHAR_STRING callSign = 3; + CHAR_STRING affiliateCallSign = 4; } struct LineupInfo { - CHAR_STRING operatorName = 1; - CHAR_STRING lineupName = 2; - CHAR_STRING postalCode = 3; - LineupInfoTypeEnum lineupInfoType = 4; + CHAR_STRING operatorName = 0; + CHAR_STRING lineupName = 1; + CHAR_STRING postalCode = 2; + LineupInfoTypeEnum lineupInfoType = 3; } readonly attribute ChannelInfo channelList[] = 0; attribute LineupInfo channelLineup = 1; attribute ChannelInfo currentChannel = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -391,7 +391,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -545,44 +545,44 @@ client cluster ContentLauncher = 1290 { } struct ContentSearch { - Parameter parameterList[] = 1; + Parameter parameterList[] = 0; } struct Parameter { - ParameterEnum type = 1; - CHAR_STRING value = 2; - AdditionalInfo externalIDList[] = 3; + ParameterEnum type = 0; + CHAR_STRING value = 1; + AdditionalInfo externalIDList[] = 2; } struct AdditionalInfo { - CHAR_STRING name = 1; - CHAR_STRING value = 2; + CHAR_STRING name = 0; + CHAR_STRING value = 1; } struct BrandingInformation { - CHAR_STRING providerName = 1; - StyleInformation background = 2; - StyleInformation logo = 3; - StyleInformation progressBar = 4; - StyleInformation splash = 5; - StyleInformation waterMark = 6; + CHAR_STRING providerName = 0; + StyleInformation background = 1; + StyleInformation logo = 2; + StyleInformation progressBar = 3; + StyleInformation splash = 4; + StyleInformation waterMark = 5; } struct StyleInformation { - CHAR_STRING imageUrl = 1; - CHAR_STRING color = 2; - Dimension size = 3; + CHAR_STRING imageUrl = 0; + CHAR_STRING color = 1; + Dimension size = 2; } struct Dimension { - double width = 1; - double height = 2; - MetricTypeEnum metric = 3; + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; } readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -602,15 +602,15 @@ client cluster ContentLauncher = 1290 { server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -838,8 +838,8 @@ server cluster DoorLock = 257 { } struct DlCredential { - DlCredentialType credentialType = 1; - INT16U credentialIndex = 2; + DlCredentialType credentialType = 0; + INT16U credentialIndex = 1; } critical event DoorLockAlarm = 0 { @@ -906,7 +906,7 @@ server cluster DoorLock = 257 { attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; attribute boolean requirePINforRemoteOperation = 51; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1008,20 +1008,20 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1039,15 +1039,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1133,12 +1133,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -1168,7 +1168,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1192,12 +1192,12 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1282,7 +1282,7 @@ server cluster IasZone = 1280 { readonly attribute bitmap16 zoneStatus = 2; attribute node_id iasCieAddress = 16; readonly attribute int8u zoneId = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1329,7 +1329,7 @@ server cluster Identify = 3 { } attribute int16u identifyTime = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1439,7 +1439,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1473,7 +1473,7 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1550,14 +1550,14 @@ client cluster MediaInput = 1287 { } struct InputInfo { - INT8U index = 1; - InputTypeEnum inputType = 2; - CHAR_STRING name = 3; - CHAR_STRING description = 4; + INT8U index = 0; + InputTypeEnum inputType = 1; + CHAR_STRING name = 2; + CHAR_STRING description = 3; } readonly attribute InputInfo mediaInputList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1591,7 +1591,7 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1644,28 +1644,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -1676,8 +1676,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1758,7 +1758,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1806,7 +1806,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -1830,8 +1830,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1852,21 +1852,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1944,21 +1951,21 @@ server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u measuredValue = 0; readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -1966,7 +1973,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2056,11 +2063,11 @@ server cluster Scenes = 5 { server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -2071,8 +2078,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -2108,7 +2115,7 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2119,12 +2126,12 @@ client cluster TargetNavigator = 1285 { } struct TargetInfo { - INT8U identifier = 1; - CHAR_STRING name = 2; + INT8U identifier = 0; + CHAR_STRING name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2138,7 +2145,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2150,8 +2157,8 @@ server cluster TestCluster = 1295 { } struct TestListStructOctet { - INT64U fabricIndex = 1; - OCTET_STRING operationalCert = 2; + INT64U fabricIndex = 0; + OCTET_STRING operationalCert = 1; } info event TestEvent = 1 { @@ -2183,7 +2190,7 @@ server cluster TestCluster = 1295 { attribute OCTET_STRING listOctetString[] = 27; attribute TestListStructOctet listStructOctetString[] = 28; attribute long_octet_string longOctetString = 29; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; response struct TestSpecificResponse { INT8U returnValue = 0; @@ -2209,8 +2216,8 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; response struct GetWeeklyScheduleResponse { ENUM8 numberOfTransitionsForSequence = 0; @@ -2244,53 +2251,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -2360,18 +2367,18 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2431,8 +2438,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { @@ -2454,7 +2461,7 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 18c2a7b5f589a4..e9050524569460 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -3991,6 +3991,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, @@ -6536,9 +6551,9 @@ ] }, { - "name": "MA-rootdevice", - "deviceTypeName": "MA-rootdevice", - "deviceTypeCode": 22, + "name": "MA-videoplayer", + "deviceTypeName": "MA-videoplayer", + "deviceTypeCode": 35, "deviceTypeProfileId": 259, "clusters": [ { @@ -13559,9 +13574,9 @@ ] }, { - "name": "Anonymous Endpoint Type", - "deviceTypeName": "MA-rootdevice", - "deviceTypeCode": 22, + "name": "MA-occupancysensor", + "deviceTypeName": "MA-occupancysensor", + "deviceTypeCode": 263, "deviceTypeProfileId": 259, "clusters": [ { @@ -16486,22 +16501,22 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-rootdevice", + "endpointTypeName": "MA-videoplayer", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 22 + "deviceIdentifier": 35 }, { - "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeName": "MA-occupancysensor", "endpointTypeIndex": 2, "profileId": 259, "endpointId": 2, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 22 + "deviceIdentifier": 263 } ] -} +} \ No newline at end of file diff --git a/examples/window-app/common/include/WindowApp.h b/examples/window-app/common/include/WindowApp.h index e8184e21103b40..f5dc1f582ba35a 100644 --- a/examples/window-app/common/include/WindowApp.h +++ b/examples/window-app/common/include/WindowApp.h @@ -135,10 +135,15 @@ class WindowApp protected: struct StateFlags { +#if CHIP_ENABLE_OPENTHREAD bool isThreadProvisioned = false; bool isThreadEnabled = false; - bool haveBLEConnections = false; - bool isWinking = false; +#else + bool isWiFiProvisioned = false; + bool isWiFiEnabled = false; +#endif + bool haveBLEConnections = false; + bool isWinking = false; }; Cover & GetCover(); diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp index 813ad816a156ad..d69e128257e9f2 100644 --- a/examples/window-app/common/src/WindowApp.cpp +++ b/examples/window-app/common/src/WindowApp.cpp @@ -138,8 +138,11 @@ CHIP_ERROR WindowApp::Run() { StateFlags oldState; +#if CHIP_ENABLE_OPENTHREAD oldState.isThreadProvisioned = !ConnectivityMgr().IsThreadProvisioned(); - +#else + oldState.isWiFiProvisioned = !ConnectivityMgr().IsWiFiStationProvisioned(); +#endif while (true) { ProcessEvents(); @@ -151,13 +154,22 @@ CHIP_ERROR WindowApp::Run() // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#if CHIP_ENABLE_OPENTHREAD mState.isThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); mState.isThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - mState.haveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#else + mState.isWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + mState.isWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); +#endif + mState.haveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } +#if CHIP_ENABLE_OPENTHREAD if (mState.isThreadProvisioned != oldState.isThreadProvisioned) +#else + if (mState.isWiFiProvisioned != oldState.isWiFiProvisioned) +#endif { // Provisioned state changed DispatchEvent(EventId::ProvisionedStateChanged); diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index ad2102baaccc80..c7206c376b16e3 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } server cluster AdministratorCommissioning = 60 { @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -75,20 +75,20 @@ server cluster Basic = 40 { readonly attribute char_string serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -114,13 +114,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -138,15 +138,15 @@ server cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -232,12 +232,12 @@ server cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -267,7 +267,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -295,7 +295,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -346,28 +346,28 @@ server cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -378,8 +378,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -453,21 +453,28 @@ server cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -551,17 +558,17 @@ server cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -572,8 +579,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -600,53 +607,53 @@ server cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -716,13 +723,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -782,8 +789,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { @@ -805,8 +812,8 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 847536871850f5..11b170b5edaf53 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -3666,6 +3666,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 40bf9abe5f4545..2f3c814e4a83cb 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -37,6 +37,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -45,6 +52,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -56,17 +83,47 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ "BOARD_ID=${efr32_board}", "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", ] + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("window_app") { output_name = "chip-efr32-window-example.out" output_dir = root_out_dir + include_dirs = [ + "include", + "${project_dir}/common/include", + ] + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -79,36 +136,58 @@ efr32_executable("window_app") { "src/main.cpp", ] + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs + } deps = [ ":sdk", "${chip_root}/examples/common/QRCode", "${chip_root}/examples/window-app/common:window-common", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${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 { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${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", - "${project_dir}/common/include", - ] - - defines = [] - if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c", diff --git a/examples/window-app/efr32/build_for_wifi_args.gni b/examples/window-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/window-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/window-app/efr32/build_for_wifi_gnfile.gn b/examples/window-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/window-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/window-app/efr32/src/WindowAppImpl.cpp b/examples/window-app/efr32/src/WindowAppImpl.cpp index 6a294c941b5261..7bff2706e5b5cb 100644 --- a/examples/window-app/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/efr32/src/WindowAppImpl.cpp @@ -31,6 +31,10 @@ #include #include +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif + #define APP_TASK_STACK_SIZE (4096) #define APP_TASK_PRIORITY 2 #define APP_EVENT_QUEUE_SIZE 10 @@ -143,6 +147,18 @@ void WindowAppImpl::OnIconTimeout(WindowApp::Timer & timer) CHIP_ERROR WindowAppImpl::Init() { +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif WindowApp::Init(); // Initialize App Task @@ -308,18 +324,18 @@ void WindowAppImpl::UpdateLEDs() { mStatusLED.Blink(200, 200); } - else if (mState.isThreadProvisioned && mState.isThreadEnabled) - { - mStatusLED.Blink(950, 50); - } - else if (mState.haveBLEConnections) - { - mStatusLED.Blink(100, 100); - } else +#if CHIP_ENABLE_OPENTHREAD + if (mState.isThreadProvisioned && mState.isThreadEnabled) +#else + if (mState.isWiFiProvisioned && mState.isWiFiEnabled) +#endif + { - mStatusLED.Blink(50, 950); + mStatusLED.Blink(950, 50); } + else if (mState.haveBLEConnections) { mStatusLED.Blink(100, 100); } + else { mStatusLED.Blink(50, 950); } // Action LED @@ -346,7 +362,11 @@ void WindowAppImpl::UpdateLCD() { // Update LCD #ifdef DISPLAY_ENABLED +#if CHIP_ENABLE_OPENTHREAD if (mState.isThreadProvisioned) +#else + if (mState.isWiFiProvisioned) +#endif { Cover & cover = GetCover(); EmberAfWcType type = TypeGet(cover.mEndpoint); diff --git a/examples/window-app/efr32/src/main.cpp b/examples/window-app/efr32/src/main.cpp index b9d4e3070a4d01..2a8704b949dc9d 100644 --- a/examples/window-app/efr32/src/main.cpp +++ b/examples/window-app/efr32/src/main.cpp @@ -28,8 +28,8 @@ #include #include -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -42,6 +42,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + #if PW_RPC_ENABLED #include #endif @@ -50,6 +54,7 @@ #include "matter_shell.h" #endif +#define BLE_DEV_NAME "EFR32_WINDOW" using namespace ::chip::DeviceLayer; // ================================================================================ @@ -107,7 +112,7 @@ int main(void) EFR32_LOG("PlatformMgr().InitChipStack() failed"); appError(err); } - chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("EFR32_WINDOW"); + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(BLE_DEV_NAME); EFR32_LOG("Starting Platform Manager Event Loop"); err = PlatformMgr().StartEventLoopTask(); @@ -144,6 +149,14 @@ int main(void) } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ + #ifdef ENABLE_CHIP_SHELL chip::startShellTask(); #endif diff --git a/integrations/docker/images/chip-build-ameba/Dockerfile b/integrations/docker/images/chip-build-ameba/Dockerfile index 1a0d97d29e5654..29127ce422c973 100644 --- a/integrations/docker/images/chip-build-ameba/Dockerfile +++ b/integrations/docker/images/chip-build-ameba/Dockerfile @@ -9,7 +9,7 @@ RUN set -x \ && cd ${AMEBA_DIR} \ && git clone --progress -b cmake_build https://github.com/pankore/ambd_sdk_with_chip_non_NDA.git \ && cd ambd_sdk_with_chip_non_NDA \ - && git reset --hard 4491131 \ + && git reset --hard 0eafdc7 \ && git submodule update --depth 1 --init --progress \ && cd project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/toolchain \ && cat asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2.part* > asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2 \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 4a9997ad0d2342..4a43b1aab9af3e 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.48 Version bump reason: [nrf] Bump west version +0.5.49 Version bump reason: [Ameba] Revise 'otar' to 'ota_requestor' diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 8d38fbb20f8bf4..5e729c86d4fb23 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -161,6 +161,7 @@ def HostTargets(): HostBuildVariant(name="no-ble", enable_ble=False), HostBuildVariant(name="tsan", conflicts=['asan'], use_tsan=True), HostBuildVariant(name="asan", conflicts=['tsan'], use_asan=True), + HostBuildVariant(name="libfuzzer", use_libfuzzer=True, use_clang=True), HostBuildVariant(name="test-group", validator=AcceptNameWithSubstrings(['-all-clusters', '-chip-tool']), test_group=True), HostBuildVariant(name="same-event-loop", diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 047d7a2a959fef..58685b62092f5a 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -131,7 +131,7 @@ class HostBuilder(GnBuilder): def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ipv4=True, enable_ble=True, use_tsan=False, use_asan=False, separate_event_loop=True, - test_group=False): + test_group=False, use_libfuzzer=False, use_clang=False): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) @@ -159,6 +159,12 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip self.extra_gn_options.append( 'chip_enable_group_messaging_tests=true') + if use_libfuzzer: + self.extra_gn_options.append('is_libfuzzer=true') + + if use_clang: + self.extra_gn_options.append('is_clang=true') + if app == HostApp.TESTS: self.extra_gn_options.append('chip_build_tests=true') self.build_command = 'check' diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 1054dbaa184d49..ed0cc22502bfff 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -16,27 +16,86 @@ # limitations under the License. # -set -e - # Build script for GN EFT32 examples GitHub workflow. +set -e source "$(dirname "$0")/../../scripts/activate.sh" set -x env +USE_WF200=0 +USE_RS911X=0 +USE_WIFI=0 + +ROOT=$1 +arg2=$2 +shift +shift +while [ $# -gt 0 ]; do + case $1 in + --wifi) + if [ -z "$2" ]; then + echo "--efr requires BRDxxxx" + exit 1 + fi + if [ X"$2" = "Xrs911x" ]; then + WIFI_ARGS="use_rs911x=true" + elif [ "$2" = wf200 ]; then + WIFI_ARGS="use_wf200=true" + else + echo "Wifi usage: --wifi rs911x|wf200" + exit 1 + fi + shift + shift -if [ -z "$3" ]; then - gn gen --check --fail-on-unused-args --root="$1" --args="" "$2"/"$EFR32_BOARD"/ - ninja -v -C "$2"/"$EFR32_BOARD"/ - #print stats - arm-none-eabi-size -A "$2"/"$EFR32_BOARD"/*.out + ;; + --efr) + if [ -z "$2" ]; then + echo "--efr requires BRDxxxx" + exit 1 + fi + EFR32_BOARD=$2 + shift + shift + ;; + + --gnargs) + echo "-gnargs - Not yet implemented" + exit 1 + GNARGS=$2 + shift + shift + ;; + + *) + EFR32_BOARD=$1 + shift + if [ X"$1" != "X" ]; then + GNARGS=$1 + shift + fi + ;; + esac +done + +if [ X"$EFR32_BOARD" = "X" ]; then + echo "EFR32_BOARD not defined" + exit 1 +fi +BUILD_DIR=$arg2/$EFR32_BOARD +echo BUILD_DIR="$BUILD_DIR" +if [ "X$WIFI_ARGS" != "X" ]; then + gn gen --check --fail-on-unused-args --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="efr32_board=\"$EFR32_BOARD\" $WIFI_ARGS" "$BUILD_DIR" else - if [ -z "$4" ]; then - gn gen --check --fail-on-unused-args --root="$1" --args="efr32_board=\"$3\"" "$2/$3" + # thread build + # + if [ -z "$GNARGS" ]; then + gn gen --check --fail-on-unused-args --root="$ROOT" --args="efr32_board=\"$EFR32_BOARD\"" "$BUILD_DIR" else - gn gen --check --fail-on-unused-args --root="$1" --args="efr32_board=\"$3\"" "$2/$3" "$4" + gn gen --check --fail-on-unused-args --root="$ROOT" --args="efr32_board=\"$EFR32_BOARD\" $GNARGS" "$BUILD_DIR" fi - ninja -v -C "$2/$3" - #print stats - arm-none-eabi-size -A "$2"/"$3"/*.out fi +ninja -v -C "$BUILD_DIR"/ +#print stats +arm-none-eabi-size -A "$BUILD_DIR"/*.out diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index 08d5d42ed3376a..26d7e8cf75173e 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -55,7 +55,8 @@ CHIP_ERROR CASESessionManager::FindOrEstablishSession(PeerId peerId, Callback::C CHIP_ERROR err = session->Connect(onConnection, onFailure, mConfig.dnsResolver); if (err != CHIP_NO_ERROR) { - ReleaseSession(session); + // Release the peer rather than the pointer in case the failure handler has already released the session. + ReleaseSession(peerId); } return err; diff --git a/src/app/DeviceProxy.cpp b/src/app/DeviceProxy.cpp index 0e374cff5bc385..b0958115a684c3 100644 --- a/src/app/DeviceProxy.cpp +++ b/src/app/DeviceProxy.cpp @@ -68,24 +68,4 @@ void DeviceProxy::CancelIMResponseHandler(void * commandObj) mCallbacksMgr.CancelResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */); } -CHIP_ERROR DeviceProxy::SendWriteAttributeRequest(app::WriteClientHandle aHandle, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - VerifyOrReturnLogError(IsSecureConnected(), CHIP_ERROR_INCORRECT_STATE); - - CHIP_ERROR err = CHIP_NO_ERROR; - - app::WriteClient * writeClient = aHandle.Get(); - - if (onSuccessCallback != nullptr || onFailureCallback != nullptr) - { - AddIMResponseHandler(writeClient, onSuccessCallback, onFailureCallback); - } - if ((err = aHandle.SendWriteRequest(GetSecureSession().Value())) != CHIP_NO_ERROR) - { - CancelIMResponseHandler(writeClient); - } - return err; -} - } // namespace chip diff --git a/src/app/DeviceProxy.h b/src/app/DeviceProxy.h index 50684140aabb54..fd7e8275d4144e 100644 --- a/src/app/DeviceProxy.h +++ b/src/app/DeviceProxy.h @@ -53,9 +53,6 @@ class DLL_EXPORT DeviceProxy virtual CHIP_ERROR ShutdownSubscriptions() { return CHIP_ERROR_NOT_IMPLEMENTED; } - virtual CHIP_ERROR SendWriteAttributeRequest(app::WriteClientHandle aHandle, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback); - virtual CHIP_ERROR SendCommands(app::CommandSender * commandObj); // Interaction model uses the object and callback interface instead of sequence number to mark different transactions. diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 8ee3ea7e957aa1..4b8ad8c596eedf 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -112,14 +112,6 @@ void InteractionModelEngine::Shutdown() // mpActiveReadClientList = nullptr; - for (auto & writeClient : mWriteClients) - { - if (!writeClient.IsFree()) - { - writeClient.Shutdown(); - } - } - for (auto & writeHandler : mWriteHandlers) { VerifyOrDie(writeHandler.IsFree()); @@ -147,21 +139,6 @@ uint32_t InteractionModelEngine::GetNumActiveReadHandlers() const return numActive; } -uint32_t InteractionModelEngine::GetNumActiveWriteClients() const -{ - uint32_t numActive = 0; - - for (auto & writeClient : mWriteClients) - { - if (!writeClient.IsFree()) - { - numActive++; - } - } - - return numActive; -} - uint32_t InteractionModelEngine::GetNumActiveWriteHandlers() const { uint32_t numActive = 0; @@ -205,25 +182,6 @@ CHIP_ERROR InteractionModelEngine::ShutdownSubscriptions(FabricIndex aFabricInde return CHIP_NO_ERROR; } -CHIP_ERROR InteractionModelEngine::NewWriteClient(WriteClientHandle & apWriteClient, WriteClient::Callback * apCallback, - const Optional & aTimedWriteTimeoutMs) -{ - apWriteClient.SetWriteClient(nullptr); - - for (auto & writeClient : mWriteClients) - { - if (!writeClient.IsFree()) - { - continue; - } - ReturnLogErrorOnFailure(writeClient.Init(mpExchangeMgr, apCallback, aTimedWriteTimeoutMs)); - apWriteClient.SetWriteClient(&writeClient); - return CHIP_NO_ERROR; - } - - return CHIP_ERROR_NO_MEMORY; -} - void InteractionModelEngine::OnDone(CommandHandler & apCommandObj) { mCommandHandlerObjs.ReleaseObject(&apCommandObj); @@ -428,11 +386,6 @@ void InteractionModelEngine::OnResponseTimeout(Messaging::ExchangeContext * ec) ChipLogValueExchange(ec)); } -uint16_t InteractionModelEngine::GetWriteClientArrayIndex(const WriteClient * const apWriteClient) const -{ - return static_cast(apWriteClient - mWriteClients); -} - uint16_t InteractionModelEngine::GetReadHandlerArrayIndex(const ReadHandler * const apReadHandler) const { return static_cast(apReadHandler - mReadHandlers); diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index e52c3c2ad85003..7f9f92d5e343a9 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -111,28 +111,9 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman */ CHIP_ERROR ShutdownSubscriptions(FabricIndex aFabricIndex, NodeId aPeerNodeId); - /** - * Retrieve a WriteClient that the SDK consumer can use to send a write. If the call succeeds, - * see WriteClient documentation for lifetime handling. - * - * The Write interaction is more like Invoke interaction (cluster specific commands) since it will include cluster specific - * payload, and may have the need to encode non-scalar values (like structs and arrays). Thus we use WriteClientHandle to - * prevent user's code from leaking WriteClients. - * - * @param[out] apWriteClient A pointer to the WriteClient object. - * - * @retval #CHIP_ERROR_NO_MEMORY If there is no WriteClient available - * @retval #CHIP_NO_ERROR On success. - */ - CHIP_ERROR NewWriteClient(WriteClientHandle & apWriteClient, WriteClient::Callback * callback, - const Optional & aTimedWriteTimeoutMs = NullOptional); - uint32_t GetNumActiveReadHandlers() const; uint32_t GetNumActiveWriteHandlers() const; - uint32_t GetNumActiveWriteClients() const; - - uint16_t GetWriteClientArrayIndex(const WriteClient * const apWriteClient) const; uint16_t GetReadHandlerArrayIndex(const ReadHandler * const apReadHandler) const; /** @@ -256,12 +237,9 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman CommandHandlerInterface * mCommandHandlerList = nullptr; - // TODO(#8006): investgate if we can disable some IM functions on some compact accessories. - // TODO(#8006): investgate if we can provide more flexible object management on devices with more resources. BitMapObjectPool mCommandHandlerObjs; BitMapObjectPool mTimedHandlers; ReadHandler mReadHandlers[CHIP_IM_MAX_NUM_READ_HANDLER]; - WriteClient mWriteClients[CHIP_IM_MAX_NUM_WRITE_CLIENT]; WriteHandler mWriteHandlers[CHIP_IM_MAX_NUM_WRITE_HANDLER]; reporting::Engine mReportingEngine; BitMapObjectPool mClusterInfoPool; diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index fb13647938d53a..fcb647adb8922b 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -31,11 +31,10 @@ namespace chip { namespace app { -CHIP_ERROR WriteClient::Init(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, - const Optional & aTimedWriteTimeoutMs) +CHIP_ERROR WriteClient::Init() { - VerifyOrReturnError(apExchangeMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(mpExchangeMgr == nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mState == State::Uninitialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mpExchangeMgr != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mpExchangeCtx == nullptr, CHIP_ERROR_INCORRECT_STATE); System::PacketBufferHandle packet = System::PacketBufferHandle::New(chip::app::kMaxSecureSduLengthBytes); @@ -44,43 +43,55 @@ CHIP_ERROR WriteClient::Init(Messaging::ExchangeManager * apExchangeMgr, Callbac mMessageWriter.Init(std::move(packet)); ReturnErrorOnFailure(mWriteRequestBuilder.Init(&mMessageWriter)); - mWriteRequestBuilder.TimedRequest(aTimedWriteTimeoutMs.HasValue()); + mWriteRequestBuilder.TimedRequest(mTimedWriteTimeoutMs.HasValue()); ReturnErrorOnFailure(mWriteRequestBuilder.GetError()); mWriteRequestBuilder.CreateWriteRequests(); ReturnErrorOnFailure(mWriteRequestBuilder.GetError()); - ClearExistingExchangeContext(); - mpExchangeMgr = apExchangeMgr; - mpCallback = apCallback; - mTimedWriteTimeoutMs = aTimedWriteTimeoutMs; + MoveToState(State::Initialized); return CHIP_NO_ERROR; } -void WriteClient::Shutdown() +void WriteClient::Close() { - VerifyOrReturn(mState != State::Uninitialized); - ClearExistingExchangeContext(); - ShutdownInternal(); -} + MoveToState(State::AwaitingDestruction); -void WriteClient::ShutdownInternal() -{ - mMessageWriter.Reset(); + // OnDone below can destroy us before we unwind all the way back into the + // exchange code and it tries to close itself. Make sure that it doesn't + // try to notify us that it's closing, since we will be dead. + // + // For more details, see #10344. + if (mpExchangeCtx != nullptr) + { + mpExchangeCtx->SetDelegate(nullptr); + } - mpExchangeMgr = nullptr; mpExchangeCtx = nullptr; - ClearState(); - mpCallback->OnDone(this); + if (mpCallback) + { + mpCallback->OnDone(this); + } } -void WriteClient::ClearExistingExchangeContext() +void WriteClient::Abort() { - // Discard any existing exchange context. Effectively we can only have one IM exchange with - // a single node at any one time. + // + // If the exchange context hasn't already been gracefully closed + // (signaled by setting it to null), then we need to forcibly + // tear it down. + // if (mpExchangeCtx != nullptr) { + // We might be a delegate for this exchange, and we don't want the + // OnExchangeClosing notification in that case. Null out the delegate + // to avoid that. + // + // TODO: This makes all sorts of assumptions about what the delegate is + // (notice the "might" above!) that might not hold in practice. We + // really need a better solution here.... + mpExchangeCtx->SetDelegate(nullptr); mpExchangeCtx->Abort(); mpExchangeCtx = nullptr; } @@ -135,6 +146,10 @@ CHIP_ERROR WriteClient::ProcessWriteResponseMessage(System::PacketBufferHandle & CHIP_ERROR WriteClient::PrepareAttribute(const AttributePathParams & attributePathParams) { + if (mState == State::Uninitialized) + { + ReturnErrorOnFailure(Init()); + } VerifyOrReturnError(attributePathParams.IsValidAttributePath(), CHIP_ERROR_INVALID_PATH_LIST); AttributeDataIBs::Builder & writeRequests = mWriteRequestBuilder.GetWriteRequests(); AttributeDataIB::Builder & attributeDataIB = writeRequests.CreateAttributeDataIBBuilder(); @@ -195,6 +210,9 @@ const char * WriteClient::GetStateStr() const case State::ResponseReceived: return "ResponseReceived"; + + case State::AwaitingDestruction: + return "AwaitingDestruction"; } #endif // CHIP_DETAIL_LOGGING return "N/A"; @@ -220,10 +238,6 @@ CHIP_ERROR WriteClient::SendWriteRequest(const SessionHandle & session, System:: err = FinalizeMessage(mPendingWriteData); SuccessOrExit(err); - // Discard any existing exchange context. Effectively we can only have one exchange per WriteClient - // at any one time. - ClearExistingExchangeContext(); - // Create a new exchange context. mpExchangeCtx = mpExchangeMgr->NewContext(session, this); VerifyOrExit(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); @@ -246,7 +260,6 @@ CHIP_ERROR WriteClient::SendWriteRequest(const SessionHandle & session, System:: if (err != CHIP_NO_ERROR) { ChipLogError(DataManagement, "Write client failed to SendWriteRequest: %s", ErrorStr(err)); - ClearExistingExchangeContext(); } else { @@ -259,8 +272,11 @@ CHIP_ERROR WriteClient::SendWriteRequest(const SessionHandle & session, System:: // Always shutdown on Group communication ChipLogDetail(DataManagement, "Closing on group Communication "); - // onDone is called - ShutdownInternal(); + // Tell the application to release the object. + // TODO: Consumers expect to hand off ownership of the WriteClient and wait for OnDone + // after SendWriteRequest returns success. Calling OnDone before returning is weird. + // Need to refactor the code to avoid this. + Close(); } } @@ -329,7 +345,7 @@ CHIP_ERROR WriteClient::OnMessageReceived(Messaging::ExchangeContext * apExchang if (mState != State::AwaitingResponse) { - ShutdownInternal(); + Close(); } // Else we got a response to a Timed Request and just sent the write. @@ -345,7 +361,7 @@ void WriteClient::OnResponseTimeout(Messaging::ExchangeContext * apExchangeConte { mpCallback->OnError(this, StatusIB(Protocols::InteractionModel::Status::Failure), CHIP_ERROR_TIMEOUT); } - ShutdownInternal(); + Close(); } CHIP_ERROR WriteClient::ProcessAttributeStatusIB(AttributeStatusIB::Parser & aAttributeStatusIB) @@ -391,24 +407,6 @@ CHIP_ERROR WriteClient::ProcessAttributeStatusIB(AttributeStatusIB::Parser & aAt return err; } -CHIP_ERROR WriteClientHandle::SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout) -{ - CHIP_ERROR err = mpWriteClient->SendWriteRequest(session, timeout); - - // Transferring ownership of the underlying WriteClient to the IM layer. IM will manage its lifetime. - // For groupcast writes, there is no transfer of ownership since the interaction is done upon transmission of the action - if (err == CHIP_NO_ERROR) - { - // Release the WriteClient without closing it. - mpWriteClient = nullptr; - } - else - { - SetWriteClient(nullptr); - } - return err; -} - CHIP_ERROR WriteClient::HandleTimedStatus(const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload, StatusIB & aStatusIB) { diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index e81e09d422643d..90e3307eb875a9 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -42,7 +42,6 @@ namespace chip { namespace app { -class WriteClientHandle; class InteractionModelEngine; /** @@ -105,6 +104,48 @@ class WriteClient : public Messaging::ExchangeDelegate virtual void OnDone(WriteClient * apWriteClient) = 0; }; + /** + * Construct the client object. Within the lifetime + * of this instance. + * + * @param[in] apExchangeMgr A pointer to the ExchangeManager object. + * @param[in] apDelegate InteractionModelDelegate set by application. + * @param[in] aTimedWriteTimeoutMs If provided, do a timed write using this timeout. + */ + WriteClient(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, + const Optional & aTimedWriteTimeoutMs) : + mpExchangeMgr(apExchangeMgr), + mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs) + {} + + /** + * Encode an attribute value that can be directly encoded using TLVWriter::Put + */ + template + CHIP_ERROR EncodeAttributeWritePayload(const chip::app::AttributePathParams & attributePath, const T & value) + { + chip::TLV::TLVWriter * writer = nullptr; + + ReturnErrorOnFailure(PrepareAttribute(attributePath)); + VerifyOrReturnError((writer = GetAttributeDataIBTLVWriter()) != nullptr, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure( + DataModel::Encode(*writer, chip::TLV::ContextTag(to_underlying(chip::app::AttributeDataIB::Tag::kData)), value)); + ReturnErrorOnFailure(FinishAttribute()); + + return CHIP_NO_ERROR; + } + + /** + * Once SendWriteRequest returns successfully, the WriteClient will + * handle calling Shutdown on itself once it decides it's done with waiting + * for a response (i.e. times out or gets a response). Client can specify + * the maximum time to wait for response (in milliseconds) via timeout parameter. + * Default timeout value will be used otherwise. + * If SendWriteRequest is never called, or the call fails, the API + * consumer is responsible for calling Shutdown on the WriteClient. + */ + CHIP_ERROR SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout = kImMessageTimeout); + /** * Shutdown the WriteClient. This terminates this instance * of the object and releases all held resources. @@ -115,10 +156,17 @@ class WriteClient : public Messaging::ExchangeDelegate CHIP_ERROR FinishAttribute(); TLV::TLVWriter * GetAttributeDataIBTLVWriter(); + /* + * Destructor - as part of destruction, it will abort the exchange context + * if a valid one still exists. + * + * See Abort() for details on when that might occur. + */ + virtual ~WriteClient() { Abort(); } + private: friend class TestWriteInteraction; friend class InteractionModelEngine; - friend class WriteClientHandle; enum class State { @@ -128,40 +176,18 @@ class WriteClient : public Messaging::ExchangeDelegate AwaitingTimedStatus, // Sent a Tiemd Request, waiting for response. AwaitingResponse, // The client has sent out the write request message ResponseReceived, // We have gotten a response after sending write request + AwaitingDestruction, // The object has completed its work and is awaiting destruction by the application. }; /** - * Finalize Write Request Message TLV Builder and retrieve final data from tlv builder for later sending + * The actual init function, called during encoding first attribute data. */ - CHIP_ERROR FinalizeMessage(System::PacketBufferHandle & aPacket); + CHIP_ERROR Init(); /** - * Once SendWriteRequest returns successfully, the WriteClient will - * handle calling Shutdown on itself once it decides it's done with waiting - * for a response (i.e. times out or gets a response). Client can specify - * the maximum time to wait for response (in milliseconds) via timeout parameter. - * Default timeout value will be used otherwise. - * If SendWriteRequest is never called, or the call fails, the API - * consumer is responsible for calling Shutdown on the WriteClient. - */ - CHIP_ERROR SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout); - - /** - * Initialize the client object. Within the lifetime - * of this instance, this method is invoked once after object - * construction until a call to Shutdown is made to terminate the - * instance. - * - * @param[in] apExchangeMgr A pointer to the ExchangeManager object. - * @param[in] apDelegate InteractionModelDelegate set by application. - * @param[in] aTimedWriteTimeoutMs If provided, do a timed write using this timeout. - * @retval #CHIP_ERROR_INCORRECT_STATE incorrect state if it is already initialized - * @retval #CHIP_NO_ERROR On success. + * Finalize Write Request Message TLV Builder and retrieve final data from tlv builder for later sending */ - CHIP_ERROR Init(Messaging::ExchangeManager * apExchangeMgr, Callback * apDelegate, - const Optional & aTimedWriteTimeoutMs); - - virtual ~WriteClient() = default; + CHIP_ERROR FinalizeMessage(System::PacketBufferHandle & aPacket); CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override; @@ -175,15 +201,23 @@ class WriteClient : public Messaging::ExchangeDelegate void MoveToState(const State aTargetState); CHIP_ERROR ProcessWriteResponseMessage(System::PacketBufferHandle && payload); CHIP_ERROR ProcessAttributeStatusIB(AttributeStatusIB::Parser & aAttributeStatusIB); - void ClearExistingExchangeContext(); const char * GetStateStr() const; void ClearState(); /** - * Internal shutdown method that we use when we know what's going on with - * our exchange and don't need to manually close it. + * Called internally to signal the completion of all work on this object, gracefully close the + * exchange (by calling into the base class) and finally, signal to the application that it's + * safe to release this object. */ - void ShutdownInternal(); + void Close(); + + /** + * This forcibly closes the exchange context if a valid one is pointed to. Such a situation does + * not arise during normal message processing flows that all normally call Close() above. This can only + * arise due to application-initiated destruction of the object when this object is handling receiving/sending + * message payloads. + */ + void Abort(); // Handle a message received when we are expecting a status response to a // Timed Request. The caller is assumed to have already checked that our @@ -213,82 +247,5 @@ class WriteClient : public Messaging::ExchangeDelegate Optional mTimedWriteTimeoutMs; }; -class WriteClientHandle -{ -public: - /** - * Construct an empty WriteClientHandle. - */ - WriteClientHandle() : mpWriteClient(nullptr) {} - WriteClientHandle(decltype(nullptr)) : mpWriteClient(nullptr) {} - - /** - * Construct a WriteClientHandle that takes ownership of a WriteClient from another. - */ - WriteClientHandle(WriteClientHandle && aOther) - { - mpWriteClient = aOther.mpWriteClient; - aOther.mpWriteClient = nullptr; - } - - ~WriteClientHandle() { SetWriteClient(nullptr); } - - /** - * Access a WriteClientHandle's public methods. - */ - WriteClient * operator->() const { return mpWriteClient; } - - WriteClient * Get() const { return mpWriteClient; } - - /** - * Finalize the message and send it to the desired node. The underlying write object will always be released, and the user - * should not use this object after calling this function. - * - * Note: In failure cases this will _synchronously_ invoke OnDone on the - * WriteClient::Callback before returning. - */ - CHIP_ERROR SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout = kImMessageTimeout); - - /** - * Encode an attribute value that can be directly encoded using TLVWriter::Put - */ - template - CHIP_ERROR EncodeAttributeWritePayload(const chip::app::AttributePathParams & attributePath, const T & value) - { - chip::TLV::TLVWriter * writer = nullptr; - - VerifyOrReturnError(mpWriteClient != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(mpWriteClient->PrepareAttribute(attributePath)); - VerifyOrReturnError((writer = mpWriteClient->GetAttributeDataIBTLVWriter()) != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure( - DataModel::Encode(*writer, chip::TLV::ContextTag(to_underlying(chip::app::AttributeDataIB::Tag::kData)), value)); - ReturnErrorOnFailure(mpWriteClient->FinishAttribute()); - - return CHIP_NO_ERROR; - } - - /** - * Set the internal WriteClient of the Handler, expected to be called by InteractionModelEngline only since the user - * application does not have direct access to apWriteClient. - */ - void SetWriteClient(WriteClient * apWriteClient) - { - if (mpWriteClient != nullptr) - { - mpWriteClient->Shutdown(); - } - mpWriteClient = apWriteClient; - } - -private: - friend class TestWriteInteraction; - - WriteClientHandle(const WriteClientHandle &) = delete; - WriteClientHandle & operator=(const WriteClientHandle &) = delete; - WriteClientHandle & operator=(const WriteClientHandle &&) = delete; - - WriteClient * mpWriteClient = nullptr; -}; - } // namespace app } // namespace chip diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 3ea9d09b684dfc..0e18514f229d9a 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -154,6 +154,12 @@ template("chip_data_model") { "${_app_root}/clusters/${cluster}/BDXDownloader.h", "${_app_root}/clusters/${cluster}/OTARequestor.cpp", ] + } else if (cluster == "bindings") { + sources += [ + "${_app_root}/clusters/${cluster}/${cluster}.cpp", + "${_app_root}/clusters/${cluster}/BindingManager.cpp", + "${_app_root}/clusters/${cluster}/BindingManager.h", + ] } else { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ] } diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp new file mode 100644 index 00000000000000..8198f77bfc39d9 --- /dev/null +++ b/src/app/clusters/bindings/BindingManager.cpp @@ -0,0 +1,211 @@ +/* + * + * Copyright (c) 2022 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. + */ + +#include +#include + +namespace chip { + +BindingManager BindingManager::sBindingManager; + +CHIP_ERROR BindingManager::EstablishConnection(FabricIndex fabric, NodeId node) +{ + VerifyOrReturnError(mAppServer != nullptr, CHIP_ERROR_INCORRECT_STATE); + + FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(fabric); + VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); + PeerId peer = fabricInfo->GetPeerIdForNode(node); + CHIP_ERROR error = + mAppServer->GetCASESessionManager()->FindOrEstablishSession(peer, &mOnConnectedCallback, &mOnConnectionFailureCallback); + if (error == CHIP_ERROR_NO_MEMORY) + { + // Release the least recently used entry + // TODO: Some reference counting mechanism shall be added the CASESessionManager + // so that other session clients don't get accidentally closed. + PendingNotificationEntry * entry = mPendingNotificationMap.FindLRUEntry(); + if (entry != nullptr) + { + mAppServer->GetCASESessionManager()->ReleaseSession(entry->GetPeerId()); + mPendingNotificationMap.RemoveEntry(entry); + // Now retry + error = mAppServer->GetCASESessionManager()->FindOrEstablishSession(peer, &mOnConnectedCallback, + &mOnConnectionFailureCallback); + } + } + return error; +} + +CHIP_ERROR BindingManager::EnqueueUnicastNotification(FabricIndex fabric, NodeId node, EndpointId endpoint, ClusterId cluster, + void * context) +{ + VerifyOrReturnError(mAppServer != nullptr, CHIP_ERROR_INCORRECT_STATE); + + FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(fabric); + VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); + PeerId peer = fabricInfo->GetPeerIdForNode(node); + return mPendingNotificationMap.AddPendingNotification(peer, endpoint, cluster, context); +} + +void BindingManager::HandleDeviceConnected(void * context, OperationalDeviceProxy * device) +{ + BindingManager * manager = static_cast(context); + manager->HandleDeviceConnected(device); +} + +void BindingManager::HandleDeviceConnected(OperationalDeviceProxy * device) +{ + mPendingNotificationMap.ForEachActiveObject([&](PendingNotificationEntry * entry) -> Loop { + if (entry->GetPeerId() == device->GetPeerId()) + { + SyncPendingNotificationsToPeer(device, entry); + } + + return Loop::Continue; + }); +} + +void BindingManager::SyncPendingNotificationsToPeer(OperationalDeviceProxy * device, PendingNotificationEntry * pendingClusters) +{ + for (const ClusterPath & path : *pendingClusters) + { + ClusterId cluster = path.cluster; + EndpointId endpoint = path.endpoint; + for (uint8_t j = 0; j < EMBER_BINDING_TABLE_SIZE; j++) + { + EmberBindingTableEntry entry; + if (emberGetBinding(j, &entry) == EMBER_SUCCESS && entry.type == EMBER_UNICAST_BINDING && entry.clusterId == cluster && + entry.local == endpoint && mBoundDeviceChangedHandler) + { + mBoundDeviceChangedHandler(&entry, device, path.context); + } + } + } + mPendingNotificationMap.RemoveEntry(pendingClusters); +} + +void BindingManager::HandleDeviceConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) +{ + BindingManager * manager = static_cast(context); + manager->HandleDeviceConnectionFailure(peerId, error); +} + +void BindingManager::HandleDeviceConnectionFailure(PeerId peerId, CHIP_ERROR error) +{ + // Simply release the entry, the connection will be re-established as needed. + ChipLogError(AppServer, "Failed to establish connection to node 0x" ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); + mAppServer->GetCASESessionManager()->ReleaseSession(peerId); +} + +CHIP_ERROR BindingManager::LastUnicastBindingRemoved(FabricIndex fabric, NodeId node) +{ + VerifyOrReturnError(mAppServer != nullptr, CHIP_ERROR_INCORRECT_STATE); + + FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(fabric); + VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); + PeerId peer = fabricInfo->GetPeerIdForNode(node); + PendingNotificationEntry * entry = mPendingNotificationMap.FindEntry(peer); + if (entry) + { + mPendingNotificationMap.RemoveEntry(entry); + } + + mAppServer->GetCASESessionManager()->ReleaseSession(peer); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, ClusterId cluster, void * context) +{ + VerifyOrReturnError(mAppServer != nullptr, CHIP_ERROR_INCORRECT_STATE); + + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + EmberBindingTableEntry entry; + + if (emberGetBinding(i, &entry) == EMBER_SUCCESS && entry.type != EMBER_UNUSED_BINDING && entry.local == endpoint && + entry.clusterId == cluster) + { + if (entry.type == EMBER_UNICAST_BINDING) + { + FabricInfo * fabricInfo = mAppServer->GetFabricTable().FindFabricWithIndex(entry.fabricIndex); + VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); + PeerId peer = fabricInfo->GetPeerIdForNode(entry.nodeId); + OperationalDeviceProxy * peerDevice = mAppServer->GetCASESessionManager()->FindExistingSession(peer); + if (peerDevice != nullptr && mBoundDeviceChangedHandler) + { + // We already have an active connection + mBoundDeviceChangedHandler(&entry, peerDevice, context); + } + else + { + // Enqueue pending cluster and establish connection + ReturnErrorOnFailure( + EnqueueUnicastNotification(entry.fabricIndex, entry.nodeId, entry.local, entry.clusterId, context)); + ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId)); + } + } + else if (entry.type == EMBER_MULTICAST_BINDING) + { + mBoundDeviceChangedHandler(&entry, nullptr, context); + } + } + } + return CHIP_NO_ERROR; +} + +BindingManager::PendingNotificationEntry * BindingManager::PendingNotificationMap::FindLRUEntry() +{ + PendingNotificationEntry * lruEntry = nullptr; + mPendingNotificationMap.ForEachActiveObject([&](PendingNotificationEntry * entry) { + if (lruEntry == nullptr || lruEntry->GetLastUpdateTime() > entry->GetLastUpdateTime()) + { + lruEntry = entry; + } + return Loop::Continue; + }); + return lruEntry; +} + +BindingManager::PendingNotificationEntry * BindingManager::PendingNotificationMap::FindEntry(PeerId peerId) +{ + PendingNotificationEntry * foundEntry = nullptr; + mPendingNotificationMap.ForEachActiveObject([&](PendingNotificationEntry * entry) { + if (entry->GetPeerId() == peerId) + { + foundEntry = entry; + return Loop::Break; + } + return Loop::Continue; + }); + return foundEntry; +} + +CHIP_ERROR BindingManager::PendingNotificationMap::AddPendingNotification(PeerId peer, EndpointId endpoint, ClusterId cluster, + void * context) +{ + PendingNotificationEntry * entry = FindEntry(peer); + + if (entry == nullptr) + { + entry = mPendingNotificationMap.CreateObject(peer); + VerifyOrReturnError(entry != nullptr, CHIP_ERROR_NO_MEMORY); + } + entry->AddPendingNotification(endpoint, cluster, context); + entry->Touch(); + return CHIP_NO_ERROR; +} + +} // namespace chip diff --git a/src/app/clusters/bindings/BindingManager.h b/src/app/clusters/bindings/BindingManager.h new file mode 100644 index 00000000000000..8456f1ace7180e --- /dev/null +++ b/src/app/clusters/bindings/BindingManager.h @@ -0,0 +1,195 @@ +/* + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include +#include +#include + +namespace chip { + +/** + * Application callback function when a cluster associated with a binding changes. + * + * The connection is managed by the stack and peer_device is guaranteed to be available. + * The application shall decide the content to be sent to the peer. + * + * For unicast bindings peer_device will be a connected peer and group will be empty. + * For multicast bindings peer_device will be nullptr. + * + * E.g. The application will send on/off commands to peer for the OnOff cluster. + * + */ +using BoundDeviceChangedHandler = void (*)(const EmberBindingTableEntry * binding, DeviceProxy * peer_device, void * context); + +/** + * + * The BindingManager class manages the connections for unicast bindings and notifies the application + * when a binding is ready to be communicated with. + * + * A CASE connection will be triggered when: + * - The binding cluster adds a unicast entry to the binding table. + * - A watched cluster changes with a unicast binding but we cannot find an active connection to the peer. + * + * The class uses an LRU mechanism to choose the connection to eliminate when there is no space for a new connection. + * The BindingManager class will not actively re-establish connection and will connect on-demand (when binding cluster + * or watched cluster is changed). + * + */ +class BindingManager +{ +public: + BindingManager() : + mOnConnectedCallback(HandleDeviceConnected, this), mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) + {} + + void RegisterBoundDeviceChangedHandler(BoundDeviceChangedHandler handler) { mBoundDeviceChangedHandler = handler; } + + void SetAppServer(Server * appServer) { mAppServer = appServer; } + + /* + * Notifies the BindingManager that a new unicast binding is created. + * + */ + CHIP_ERROR UnicastBindingCreated(FabricIndex fabric, NodeId node) { return EstablishConnection(fabric, node); } + + /* + * Notfies the BindingManager that the **last** unicast binding to a device has been removed. + * + */ + CHIP_ERROR LastUnicastBindingRemoved(FabricIndex fabric, NodeId node); + + /* + * Notify a cluster change to **all** bound devices associated with the (endpoint, cluster) tuple. + * + * For unicast bindings with an active session and multicast bindings, the BoundDeviceChangedHandler + * will be called before the function returns. + * + * For unicast bindings without an active session, the notification will be queued and a new session will + * be initiated. The BoundDeviceChangedHandler will be called once the session is established. + * + */ + CHIP_ERROR NotifyBoundClusterChanged(EndpointId endpoint, ClusterId cluster, void * context); + + static BindingManager & GetInstance() { return sBindingManager; } + +private: + static BindingManager sBindingManager; + + static constexpr uint8_t kMaxPendingNotifications = 3; + + struct ClusterPath + { + void * context; + ClusterId cluster; + EndpointId endpoint; + }; + + // A pending notification to be sent to a binding waiting for the CASE session to be established. + class PendingNotificationEntry + { + public: + PendingNotificationEntry(PeerId peerId) : mPeerId(peerId) {} + + PeerId GetPeerId() { return mPeerId; } + + System::Clock::Timestamp GetLastUpdateTime() { return mLastUpdateTime; } + void Touch() { mLastUpdateTime = System::SystemClock().GetMonotonicTimestamp(); } + + ClusterPath * begin() { return &mPendingNotifications[0]; } + ClusterPath * end() { return &mPendingNotifications[mNumPendingNotifications]; } + + void AddPendingNotification(EndpointId endpoint, ClusterId cluster, void * context) + { + for (ClusterPath & path : *this) + { + // New notifications for the same (endpoint, cluster) shall + // simply overrride the old ones + if (path.cluster == cluster && path.endpoint == endpoint) + { + path.context = context; + return; + } + } + if (mNumPendingNotifications < kMaxPendingNotifications) + { + mPendingNotifications[mNumPendingNotifications++] = { context, cluster, endpoint }; + } + else + { + mPendingNotifications[mNextToOverride] = { context, cluster, endpoint }; + mNextToOverride++; + mNextToOverride %= kMaxPendingNotifications; + } + } + + private: + PeerId mPeerId; + System::Clock::Timestamp mLastUpdateTime; + // TODO: Make the pending notifications list of binding table indecies and list of contexts + ClusterPath mPendingNotifications[kMaxPendingNotifications]; + + uint8_t mNumPendingNotifications = 0; + uint8_t mNextToOverride = 0; + }; + + // The pool for all the pending comands. + class PendingNotificationMap + { + public: + PendingNotificationEntry * FindLRUEntry(); + + PendingNotificationEntry * FindEntry(PeerId peerId); + + CHIP_ERROR AddPendingNotification(PeerId peer, EndpointId endpoint, ClusterId cluster, void * context); + + void RemoveEntry(PendingNotificationEntry * entry) { mPendingNotificationMap.ReleaseObject(entry); } + + template + Loop ForEachActiveObject(Function && function) + { + return mPendingNotificationMap.ForEachActiveObject(std::forward(function)); + } + + private: + BitMapObjectPool mPendingNotificationMap; + }; + + static void HandleDeviceConnected(void * context, OperationalDeviceProxy * device); + void HandleDeviceConnected(OperationalDeviceProxy * device); + + static void HandleDeviceConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error); + void HandleDeviceConnectionFailure(PeerId peerId, CHIP_ERROR error); + + CHIP_ERROR EstablishConnection(FabricIndex fabric, NodeId node); + + // Called when CASE session is established to a peer device. Will send all the pending commands to the peer. + void SyncPendingNotificationsToPeer(OperationalDeviceProxy * device, PendingNotificationEntry * pendingClusters); + + // Called when CASE session is not established to a peer device. Will enqueue the command and initialize connection. + CHIP_ERROR EnqueueUnicastNotification(FabricIndex fabric, NodeId node, EndpointId endpoint, ClusterId cluster, void * context); + + PendingNotificationMap mPendingNotificationMap; + BoundDeviceChangedHandler mBoundDeviceChangedHandler; + Server * mAppServer = nullptr; + + Callback::Callback mOnConnectedCallback; + Callback::Callback mOnConnectionFailureCallback; +}; + +} // namespace chip diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index 73c06996717139..13bfc15d7ebb8c 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -25,41 +25,16 @@ #include #include #include +#include #include #include using namespace chip; using namespace chip::app::Clusters::Binding; -EmberStatus prepareBinding(EmberBindingTableEntry & binding, NodeId nodeId, GroupId groupId, EndpointId endpointId, - ClusterId clusterId) -{ - if (groupId && nodeId) - { - return EMBER_BAD_ARGUMENT; - } - - binding.clusterId = clusterId; - binding.local = emberAfCurrentCommand()->apsFrame->destinationEndpoint; - binding.networkIndex = 0; - - if (groupId) - { - binding.type = EMBER_MULTICAST_BINDING; - binding.groupId = groupId; - binding.remote = 0; - } - else - { - binding.type = EMBER_UNICAST_BINDING; - binding.nodeId = nodeId; - binding.remote = endpointId; - } - - return EMBER_SUCCESS; -} +// TODO: add binding table to the persistent storage -EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * bindingIndex) +static EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * bindingIndex) { EmberBindingTableEntry currentEntry; for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) @@ -75,7 +50,7 @@ EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * binding return EMBER_NOT_FOUND; } -EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) +static EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) { EmberBindingTableEntry currentEntry; for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) @@ -94,20 +69,32 @@ EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::Bind::DecodableType & commandData) { - auto & nodeId = commandData.nodeId; - auto & groupId = commandData.groupId; - auto & endpointId = commandData.endpointId; - auto & clusterId = commandData.clusterId; + NodeId nodeId = commandData.nodeId; + GroupId groupId = commandData.groupId; + ClusterId clusterId = commandData.clusterId; + EndpointId remoteEndpoint = commandData.endpointId; + EndpointId localEndpoint = commandPath.mEndpointId; + FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); + EmberBindingTableEntry bindingEntry; ChipLogDetail(Zcl, "RX: BindCallback"); - EmberBindingTableEntry bindingEntry; - if (prepareBinding(bindingEntry, nodeId, groupId, endpointId, clusterId) != EMBER_SUCCESS) + if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0) || (groupId != 0 && remoteEndpoint != 0)) { + ChipLogError(Zcl, "Binding: Invalid request"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); return true; } + if (groupId) + { + bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId); + } + else + { + bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId); + } + uint8_t bindingIndex; if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_NOT_FOUND) { @@ -121,27 +108,63 @@ bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const a return true; } + if (nodeId) + { + CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingCreated(fabricIndex, nodeId); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress( + Zcl, "Binding: Failed to create session for unicast binding to device " ChipLogFormatX64 ": %" CHIP_ERROR_FORMAT, + ChipLogValueX64(nodeId), err.Format()); + } + } emberSetBinding(bindingIndex, &bindingEntry); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } +static uint8_t GetNumberOfUnicastBindingForNode(FabricIndex fabric, NodeId node) +{ + uint8_t numBinding = 0; + EmberBindingTableEntry entry; + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + if (emberGetBinding(i, &entry) == EMBER_SUCCESS && entry.type == EMBER_UNICAST_BINDING && entry.fabricIndex == fabric && + entry.nodeId == node) + { + numBinding++; + } + } + return numBinding; +} + bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::Unbind::DecodableType & commandData) { - auto & nodeId = commandData.nodeId; - auto & groupId = commandData.groupId; - auto & endpointId = commandData.endpointId; - auto & clusterId = commandData.clusterId; + NodeId nodeId = commandData.nodeId; + GroupId groupId = commandData.groupId; + ClusterId clusterId = commandData.clusterId; + EndpointId remoteEndpoint = commandData.endpointId; + EndpointId localEndpoint = commandPath.mEndpointId; + FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); + EmberBindingTableEntry bindingEntry; ChipLogDetail(Zcl, "RX: UnbindCallback"); - EmberBindingTableEntry bindingEntry; - if (prepareBinding(bindingEntry, nodeId, groupId, endpointId, clusterId) != EMBER_SUCCESS) + if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0)) { + ChipLogError(Zcl, "Binding: Invalid request"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); return true; } + if (groupId) + { + bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId); + } + else + { + bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId); + } uint8_t bindingIndex; if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_SUCCESS) @@ -151,6 +174,16 @@ bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const } emberDeleteBinding(bindingIndex); + if (nodeId != 0 && GetNumberOfUnicastBindingForNode(fabricIndex, nodeId) == 0) + { + CHIP_ERROR err = BindingManager::GetInstance().LastUnicastBindingRemoved(fabricIndex, nodeId); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Binding: Failed to disconnect device " ChipLogFormatX64 ": %s", ChipLogValueX64(nodeId), + err.AsString()); + } + } + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/clusters/groups-client/groups-client.cpp b/src/app/clusters/groups-client/groups-client.cpp index 373561e115dde4..f69fa876dc43e3 100644 --- a/src/app/clusters/groups-client/groups-client.cpp +++ b/src/app/clusters/groups-client/groups-client.cpp @@ -76,7 +76,7 @@ bool emberAfGroupsClusterGetGroupMembershipResponseCallback(app::CommandHandler { emberAfGroupsClusterPrint(" [0x%2x]", emberAfGetInt16u(groupList + (i << 1), 0, 2)); } - emberAfGroupsClusterPrintln(""); + emberAfGroupsClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 4c35510fdf9f72..a7f8f1361fd405 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -41,26 +41,15 @@ #include "on-off-server.h" #include +#include #include #include #include -#include -#include -#include - #ifdef EMBER_AF_PLUGIN_SCENES #include #endif // EMBER_AF_PLUGIN_SCENES -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER -#include "../zll-on-off-server/zll-on-off-server.h" -#endif - -#ifdef EMBER_AF_PLUGIN_ZLL_LEVEL_CONTROL_SERVER -#include "../zll-level-control-server/zll-level-control-server.h" -#endif - using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::OnOff; @@ -189,13 +178,6 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t comm } } -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (initiatedByLevelChange) - { - emberAfPluginZllOnOffServerLevelControlZllExtensions(endpoint); - } -#endif - #ifdef EMBER_AF_PLUGIN_SCENES // the scene has been changed (the value of on/off has changed) so // the current scene as described in the attribute table is invalid, @@ -273,12 +255,7 @@ void OnOffServer::initOnOffServer(chip::EndpointId endpoint) bool OnOffServer::offCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerOffZllExtensions(emberAfCurrentCommand()); - } -#endif + emberAfSendImmediateDefaultResponse(status); return true; } @@ -287,13 +264,6 @@ bool OnOffServer::onCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerOnZllExtensions(emberAfCurrentCommand()); - } -#endif - emberAfSendImmediateDefaultResponse(status); return true; } @@ -301,24 +271,21 @@ bool OnOffServer::onCommand(const app::ConcreteCommandPath & commandPath) bool OnOffServer::toggleCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerToggleZllExtensions(emberAfCurrentCommand()); - } -#endif + emberAfSendImmediateDefaultResponse(status); return true; } -bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandPath, +bool OnOffServer::offWithEffectCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OffWithEffect::DecodableType & commandData) { OnOffEffectIdentifier effectId = commandData.effectId; uint8_t effectVariant = commandData.effectVariant; chip::EndpointId endpoint = commandPath.mEndpointId; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - +#ifdef EMBER_AF_PLUGIN_SCENES + FabricIndex fabric = commandObj->GetAccessingFabricIndex(); +#endif // EMBER_AF_PLUGIN_SCENES bool globalSceneControl = false; OnOff::Attributes::GlobalSceneControl::Get(endpoint, &globalSceneControl); @@ -327,6 +294,16 @@ bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandP if (globalSceneControl) { +#ifdef EMBER_AF_PLUGIN_SCENES + GroupId groupId = ZCL_SCENES_GLOBAL_SCENE_GROUP_ID; + if (emberAfCurrentCommand()->type == EMBER_INCOMING_MULTICAST) + { + groupId = emberAfCurrentCommand()->source->GetSessionHandle()->AsGroupSession()->GetGroupId(); + } + + emberAfScenesClusterStoreCurrentSceneCallback(fabric, endpoint, groupId, ZCL_SCENES_GLOBAL_SCENE_SCENE_ID); +#endif // EMBER_AF_PLUGIN_SCENES + OnOff::Attributes::GlobalSceneControl::Set(endpoint, false); status = setOnOffValue(endpoint, Commands::Off::Id, false); @@ -355,10 +332,13 @@ bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandP return true; } -bool OnOffServer::OnWithRecallGlobalSceneCommand(const app::ConcreteCommandPath & commandPath) +bool OnOffServer::OnWithRecallGlobalSceneCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath) { chip::EndpointId endpoint = commandPath.mEndpointId; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; +#ifdef EMBER_AF_PLUGIN_SCENES + FabricIndex fabric = commandObj->GetAccessingFabricIndex(); +#endif // EMBER_AF_PLUGIN_SCENES bool globalSceneControl = false; OnOff::Attributes::GlobalSceneControl::Get(endpoint, &globalSceneControl); @@ -369,6 +349,16 @@ bool OnOffServer::OnWithRecallGlobalSceneCommand(const app::ConcreteCommandPath return true; } +#ifdef EMBER_AF_PLUGIN_SCENES + GroupId groupId = ZCL_SCENES_GLOBAL_SCENE_GROUP_ID; + if (emberAfCurrentCommand()->type == EMBER_INCOMING_MULTICAST) + { + groupId = emberAfCurrentCommand()->source->GetSessionHandle()->AsGroupSession()->GetGroupId(); + } + + emberAfScenesClusterRecallSavedSceneCallback(fabric, endpoint, groupId, ZCL_SCENES_GLOBAL_SCENE_SCENE_ID); +#endif // EMBER_AF_PLUGIN_SCENES + OnOff::Attributes::GlobalSceneControl::Set(endpoint, true); setOnOffValue(endpoint, Commands::On::Id, false); @@ -631,14 +621,14 @@ bool emberAfOnOffClusterToggleCallback(app::CommandHandler * commandObj, const a bool emberAfOnOffClusterOffWithEffectCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OffWithEffect::DecodableType & commandData) { - return OnOffServer::Instance().offWithEffectCommand(commandPath, commandData); + return OnOffServer::Instance().offWithEffectCommand(commandObj, commandPath, commandData); } bool emberAfOnOffClusterOnWithRecallGlobalSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OnWithRecallGlobalScene::DecodableType & commandData) { - return OnOffServer::Instance().OnWithRecallGlobalSceneCommand(commandPath); + return OnOffServer::Instance().OnWithRecallGlobalSceneCommand(commandObj, commandPath); } bool emberAfOnOffClusterOnWithTimedOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index 8e2502007f1a3c..043c3c8c52a932 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include #include @@ -49,9 +50,9 @@ class OnOffServer bool onCommand(const chip::app::ConcreteCommandPath & commandPath); bool toggleCommand(const chip::app::ConcreteCommandPath & commandPath); void initOnOffServer(chip::EndpointId endpoint); - bool offWithEffectCommand(const chip::app::ConcreteCommandPath & commandPath, + bool offWithEffectCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OnOff::Commands::OffWithEffect::DecodableType & commandData); - bool OnWithRecallGlobalSceneCommand(const chip::app::ConcreteCommandPath & commandPath); + bool OnWithRecallGlobalSceneCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath); bool OnWithTimedOffCommand(const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData); void updateOnOffTimeCommand(chip::EndpointId endpoint); diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index aa4f268b21604c..3842fbd4eb0d47 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -70,12 +70,40 @@ class OperationalCredentialsAttrAccess : public AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: + CHIP_ERROR ReadNOCs(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadSupportedFabrics(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadCommissionedFabrics(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadFabricsList(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadRootCertificates(EndpointId endpoint, AttributeValueEncoder & aEncoder); }; +CHIP_ERROR OperationalCredentialsAttrAccess::ReadNOCs(EndpointId endpoint, AttributeValueEncoder & aEncoder) +{ + auto accessingFabricIndex = aEncoder.AccessingFabricIndex(); + + return aEncoder.EncodeList([accessingFabricIndex](const auto & encoder) -> CHIP_ERROR { + for (auto & fabricInfo : Server::GetInstance().GetFabricTable()) + { + Clusters::OperationalCredentials::Structs::NOCStruct::Type noc; + + if (!fabricInfo.IsInitialized()) + continue; + + noc.fabricIndex = fabricInfo.GetFabricIndex(); + + if (accessingFabricIndex == fabricInfo.GetFabricIndex()) + { + ReturnErrorOnFailure(fabricInfo.GetNOCCert(noc.noc)); + ReturnErrorOnFailure(fabricInfo.GetICACert(noc.icac)); + } + + ReturnErrorOnFailure(encoder.Encode(noc)); + } + + return CHIP_NO_ERROR; + }); +} + CHIP_ERROR OperationalCredentialsAttrAccess::ReadSupportedFabrics(EndpointId endpoint, AttributeValueEncoder & aEncoder) { uint8_t fabricCount = CHIP_CONFIG_MAX_DEVICE_ADMINS; @@ -142,6 +170,9 @@ CHIP_ERROR OperationalCredentialsAttrAccess::Read(const ConcreteReadAttributePat switch (aPath.mAttributeId) { + case Attributes::NOCs::Id: { + return ReadNOCs(aPath.mEndpointId, aEncoder); + } case Attributes::SupportedFabrics::Id: { return ReadSupportedFabrics(aPath.mEndpointId, aEncoder); } @@ -453,6 +484,9 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co err = Server::GetInstance().GetFabricTable().Store(fabricIndex); VerifyOrExit(err == CHIP_NO_ERROR, nocResponse = ConvertToNOCResponseStatus(err)); + // Notify the secure session of the new fabric. + commandObj->GetExchangeContext()->GetSessionHandle()->AsSecureSession()->NewFabric(fabricIndex); + // We might have a new operational identity, so we should start advertising it right away. app::DnssdServer::Instance().AdvertiseOperational(); diff --git a/src/app/clusters/ota-requestor/BDXDownloader.cpp b/src/app/clusters/ota-requestor/BDXDownloader.cpp index 69297107afdf17..31a77fdfef2c55 100644 --- a/src/app/clusters/ota-requestor/BDXDownloader.cpp +++ b/src/app/clusters/ota-requestor/BDXDownloader.cpp @@ -18,6 +18,7 @@ #include "BDXDownloader.h" +#include #include #include #include @@ -28,6 +29,8 @@ #include using chip::OTADownloader; +using chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum; +using chip::app::DataModel::Nullable; using chip::bdx::TransferSession; namespace chip { @@ -68,7 +71,7 @@ CHIP_ERROR BDXDownloader::BeginPrepareDownload() VerifyOrReturnError(mImageProcessor != nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(mImageProcessor->PrepareDownload()); - SetState(State::kPreparing); + SetState(State::kPreparing, OTAChangeReasonEnum::kSuccess); return CHIP_NO_ERROR; } @@ -79,7 +82,7 @@ CHIP_ERROR BDXDownloader::OnPreparedForDownload(CHIP_ERROR status) if (status == CHIP_NO_ERROR) { - SetState(State::kInProgress); + SetState(State::kInProgress, OTAChangeReasonEnum::kSuccess); // Must call here because StartTransfer() should have prepared a ReceiveInit message, and now we should send it. PollTransferSession(); @@ -88,7 +91,7 @@ CHIP_ERROR BDXDownloader::OnPreparedForDownload(CHIP_ERROR status) { ChipLogError(BDX, "failed to prepare download: %" CHIP_ERROR_FORMAT, status.Format()); mBdxTransfer.Reset(); - SetState(State::kIdle); + SetState(State::kIdle, OTAChangeReasonEnum::kFailure); } return CHIP_NO_ERROR; @@ -113,7 +116,7 @@ void BDXDownloader::OnDownloadTimeout() { mImageProcessor->Abort(); } - SetState(State::kIdle); + SetState(State::kIdle, OTAChangeReasonEnum::kTimeOut); } else { @@ -131,7 +134,7 @@ void BDXDownloader::EndDownload(CHIP_ERROR reason) { mImageProcessor->Abort(); } - SetState(State::kIdle); + SetState(State::kIdle, OTAChangeReasonEnum::kSuccess); // Because AbortTransfer() will generate a StatusReport to send. PollTransferSession(); @@ -174,14 +177,16 @@ CHIP_ERROR BDXDownloader::HandleBdxEvent(const chip::bdx::TransferSession::Outpu if (outEvent.msgTypeData.HasMessageType(chip::bdx::MessageType::BlockAckEOF)) { // BDX transfer is not complete until BlockAckEOF has been sent - SetState(State::kComplete); + SetState(State::kComplete, OTAChangeReasonEnum::kSuccess); } break; } case TransferSession::OutputEventType::kBlockReceived: { chip::ByteSpan blockData(outEvent.blockdata.Data, outEvent.blockdata.Length); ReturnErrorOnFailure(mImageProcessor->ProcessBlock(blockData)); - mStateDelegate->OnUpdateProgressChanged(mImageProcessor->GetPercentComplete()); + Nullable percent; + mImageProcessor->GetPercentComplete(percent); + mStateDelegate->OnUpdateProgressChanged(percent); // TODO: this will cause problems if Finalize() is not guaranteed to do its work after ProcessBlock(). if (outEvent.blockdata.IsEof) @@ -219,13 +224,13 @@ CHIP_ERROR BDXDownloader::HandleBdxEvent(const chip::bdx::TransferSession::Outpu return CHIP_NO_ERROR; } -void BDXDownloader::SetState(State state) +void BDXDownloader::SetState(State state, OTAChangeReasonEnum reason) { mState = state; if (mStateDelegate) { - mStateDelegate->OnDownloadStateChanged(state); + mStateDelegate->OnDownloadStateChanged(state, reason); } } diff --git a/src/app/clusters/ota-requestor/BDXDownloader.h b/src/app/clusters/ota-requestor/BDXDownloader.h index d783662c5a38fc..96c63d941d9180 100644 --- a/src/app/clusters/ota-requestor/BDXDownloader.h +++ b/src/app/clusters/ota-requestor/BDXDownloader.h @@ -26,6 +26,7 @@ #include "OTADownloader.h" +#include #include #include #include @@ -49,10 +50,10 @@ class BDXDownloader : public chip::OTADownloader { public: // Handle download state change - virtual void OnDownloadStateChanged(State state) = 0; + virtual void OnDownloadStateChanged(State state, app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum reason) = 0; // Handle update progress change - virtual void OnUpdateProgressChanged(uint8_t percent) = 0; - virtual ~StateDelegate() = default; + virtual void OnUpdateProgressChanged(app::DataModel::Nullable percent) = 0; + virtual ~StateDelegate() = default; }; // To be called when there is an incoming message to handle (of any protocol type) @@ -77,7 +78,7 @@ class BDXDownloader : public chip::OTADownloader private: void PollTransferSession(); CHIP_ERROR HandleBdxEvent(const chip::bdx::TransferSession::OutputEvent & outEvent); - void SetState(State state); + void SetState(State state, app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum reason); chip::bdx::TransferSession mBdxTransfer; MessagingDelegate * mMsgDelegate = nullptr; diff --git a/src/app/clusters/ota-requestor/OTADownloader.h b/src/app/clusters/ota-requestor/OTADownloader.h index b77514c35b53b2..fa12bbce77a07e 100644 --- a/src/app/clusters/ota-requestor/OTADownloader.h +++ b/src/app/clusters/ota-requestor/OTADownloader.h @@ -75,7 +75,7 @@ class OTADownloader virtual ~OTADownloader() = default; protected: - OTAImageProcessorInterface * mImageProcessor; + OTAImageProcessorInterface * mImageProcessor = nullptr; State mState; }; diff --git a/src/app/clusters/ota-requestor/OTARequestor.cpp b/src/app/clusters/ota-requestor/OTARequestor.cpp index 616e259069ecfc..c44d8a1754fb61 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.cpp +++ b/src/app/clusters/ota-requestor/OTARequestor.cpp @@ -36,6 +36,7 @@ using namespace app::Clusters::OtaSoftwareUpdateProvider; using namespace app::Clusters::OtaSoftwareUpdateProvider::Commands; using namespace app::Clusters::OtaSoftwareUpdateRequestor; using namespace app::Clusters::OtaSoftwareUpdateRequestor::Commands; +using app::DataModel::Nullable; using bdx::TransferSession; // Global instance of the OTARequestorInterface. @@ -87,17 +88,6 @@ static void LogApplyUpdateResponse(const ApplyUpdateResponse::DecodableType & re ChipLogDetail(SoftwareUpdate, " delayedActionTime: %" PRIu32 " seconds", response.delayedActionTime); } -static void SetUpdateStateAttribute(OTAUpdateStateEnum state) -{ - OtaRequestorServerSetUpdateState(state); - - // The UpdateStateProgress attribute only applies to the querying state - if (state != OTAUpdateStateEnum::kQuerying) - { - OtaRequestorServerSetUpdateStateProgress(0); - } -} - void StartDelayTimerHandler(System::Layer * systemLayer, void * appState) { VerifyOrReturn(appState != nullptr); @@ -129,13 +119,13 @@ void OTARequestor::OnQueryImageResponse(void * context, const QueryImageResponse if (err != CHIP_NO_ERROR) { - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kQuerying, err); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kQuerying, err); return; } MutableByteSpan updateToken(requestorCore->mUpdateTokenBuffer); CopySpanToMutableSpan(update.updateToken, updateToken); - requestorCore->mUpdateVersion = update.softwareVersion; + requestorCore->mTargetVersion = update.softwareVersion; requestorCore->mUpdateToken = updateToken; requestorCore->mOtaRequestorDriver->UpdateAvailable(update, @@ -145,16 +135,15 @@ void OTARequestor::OnQueryImageResponse(void * context, const QueryImageResponse case OTAQueryStatus::kBusy: requestorCore->mOtaRequestorDriver->UpdateNotFound(UpdateNotFoundReason::Busy, System::Clock::Seconds32(response.delayedActionTime.ValueOr(0))); - SetUpdateStateAttribute(OTAUpdateStateEnum::kDelayedOnQuery); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kDelayedOnQuery, OTAChangeReasonEnum::kDelayByProvider); break; case OTAQueryStatus::kNotAvailable: requestorCore->mOtaRequestorDriver->UpdateNotFound(UpdateNotFoundReason::NotAvailable, System::Clock::Seconds32(response.delayedActionTime.ValueOr(0))); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kIdle, OTAChangeReasonEnum::kSuccess); break; default: - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kQuerying, CHIP_ERROR_BAD_REQUEST); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kQuerying, CHIP_ERROR_BAD_REQUEST); break; } } @@ -165,8 +154,7 @@ void OTARequestor::OnQueryImageFailure(void * context, EmberAfStatus status) VerifyOrDie(requestorCore != nullptr); ChipLogDetail(SoftwareUpdate, "QueryImage failure response %" PRIu8, status); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kQuerying, CHIP_ERROR_BAD_REQUEST); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kQuerying, CHIP_ERROR_BAD_REQUEST); } void OTARequestor::OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response) @@ -183,11 +171,11 @@ void OTARequestor::OnApplyUpdateResponse(void * context, const ApplyUpdateRespon break; case OTAApplyUpdateAction::kAwaitNextAction: requestorCore->mOtaRequestorDriver->UpdateSuspended(System::Clock::Seconds32(response.delayedActionTime)); - SetUpdateStateAttribute(OTAUpdateStateEnum::kDelayedOnApply); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kDelayedOnApply, OTAChangeReasonEnum::kDelayByProvider); break; case OTAApplyUpdateAction::kDiscontinue: requestorCore->mOtaRequestorDriver->UpdateDiscontinued(); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kIdle, OTAChangeReasonEnum::kSuccess); break; } } @@ -198,8 +186,7 @@ void OTARequestor::OnApplyUpdateFailure(void * context, EmberAfStatus status) VerifyOrDie(requestorCore != nullptr); ChipLogDetail(SoftwareUpdate, "ApplyUpdate failure response %" PRIu8, status); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kApplying, CHIP_ERROR_BAD_REQUEST); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kApplying, CHIP_ERROR_BAD_REQUEST); } void OTARequestor::OnNotifyUpdateAppliedResponse(void * context, const app::DataModel::NullObjectType & response) {} @@ -210,8 +197,7 @@ void OTARequestor::OnNotifyUpdateAppliedFailure(void * context, EmberAfStatus st VerifyOrDie(requestorCore != nullptr); ChipLogDetail(SoftwareUpdate, "NotifyUpdateApplied failure response %" PRIu8, status); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kNotifying, CHIP_ERROR_BAD_REQUEST); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kNotifying, CHIP_ERROR_BAD_REQUEST); } EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * commandObj, @@ -299,11 +285,11 @@ void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * devicePr if (err != CHIP_NO_ERROR) { ChipLogError(SoftwareUpdate, "Failed to send QueryImage command: %" CHIP_ERROR_FORMAT, err.Format()); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kQuerying, err); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kQuerying, err); return; } - SetUpdateStateAttribute(OTAUpdateStateEnum::kQuerying); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kQuerying, OTAChangeReasonEnum::kSuccess); break; } case kStartBDX: { @@ -312,12 +298,11 @@ void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * devicePr if (err != CHIP_NO_ERROR) { ChipLogError(SoftwareUpdate, "Failed to start download: %" CHIP_ERROR_FORMAT, err.Format()); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kDownloading, err); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kDownloading, err); return; } - SetUpdateStateAttribute(OTAUpdateStateEnum::kDownloading); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kDownloading, OTAChangeReasonEnum::kSuccess); break; } case kApplyUpdate: { @@ -326,12 +311,11 @@ void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * devicePr if (err != CHIP_NO_ERROR) { ChipLogError(SoftwareUpdate, "Failed to send ApplyUpdate command: %" CHIP_ERROR_FORMAT, err.Format()); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kApplying, err); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kApplying, err); return; } - SetUpdateStateAttribute(OTAUpdateStateEnum::kApplying); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kApplying, OTAChangeReasonEnum::kSuccess); break; } case kNotifyUpdateApplied: { @@ -340,12 +324,11 @@ void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * devicePr if (err != CHIP_NO_ERROR) { ChipLogError(SoftwareUpdate, "Failed to send NotifyUpdateApplied command: %" CHIP_ERROR_FORMAT, err.Format()); - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kNotifying, err); - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kNotifying, err); return; } - SetUpdateStateAttribute(OTAUpdateStateEnum::kIdle); + requestorCore->RecordNewUpdateState(OTAUpdateStateEnum::kIdle, OTAChangeReasonEnum::kSuccess); break; } default: @@ -365,13 +348,13 @@ void OTARequestor::OnConnectionFailure(void * context, PeerId peerId, CHIP_ERROR switch (requestorCore->mOnConnectedAction) { case kQueryImage: - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kQuerying, error); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kQuerying, error); break; case kStartBDX: - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kDownloading, error); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kDownloading, error); break; case kApplyUpdate: - requestorCore->mOtaRequestorDriver->HandleError(UpdateFailureState::kApplying, error); + requestorCore->RecordErrorUpdateState(UpdateFailureState::kApplying, error); break; default: break; @@ -402,12 +385,21 @@ void OTARequestor::ApplyUpdate() ConnectToProvider(kApplyUpdate); } -void OTARequestor::NotifyUpdateApplied() +void OTARequestor::NotifyUpdateApplied(uint32_t version) { + // New version is executing so update where applicable + VerifyOrReturn(Basic::Attributes::SoftwareVersion::Set(kRootEndpointId, version) == EMBER_ZCL_STATUS_SUCCESS); + mCurrentVersion = version; + + // Log the VersionApplied event + uint16_t productId; + VerifyOrReturn(Basic::Attributes::ProductID::Get(kRootEndpointId, &productId) == EMBER_ZCL_STATUS_SUCCESS); + OtaRequestorServerOnVersionApplied(version, productId); + ConnectToProvider(kNotifyUpdateApplied); } -void OTARequestor::OnDownloadStateChanged(OTADownloader::State state) +void OTARequestor::OnDownloadStateChanged(OTADownloader::State state, OTAChangeReasonEnum reason) { VerifyOrReturn(mOtaRequestorDriver != nullptr); @@ -417,18 +409,66 @@ void OTARequestor::OnDownloadStateChanged(OTADownloader::State state) mOtaRequestorDriver->UpdateDownloaded(); break; case OTADownloader::State::kIdle: - mOtaRequestorDriver->HandleError(UpdateFailureState::kDownloading, CHIP_ERROR_CONNECTION_ABORTED); + if (reason != OTAChangeReasonEnum::kSuccess) + { + RecordErrorUpdateState(UpdateFailureState::kDownloading, CHIP_ERROR_CONNECTION_ABORTED, reason); + } + break; default: break; } } -void OTARequestor::OnUpdateProgressChanged(uint8_t percent) +void OTARequestor::OnUpdateProgressChanged(Nullable percent) { OtaRequestorServerSetUpdateStateProgress(percent); } +void OTARequestor::RecordNewUpdateState(OTAUpdateStateEnum newState, OTAChangeReasonEnum reason) +{ + // Set server UpdateState attribute + OtaRequestorServerSetUpdateState(newState); + + // The UpdateStateProgress attribute only applies to the downloading state + if (newState != OTAUpdateStateEnum::kDownloading) + { + app::DataModel::Nullable percent; + percent.SetNull(); + OtaRequestorServerSetUpdateStateProgress(percent); + } + + // Log the StateTransition event + Nullable previousState; + previousState.SetNonNull(mCurrentUpdateState); + Nullable targetSoftwareVersion; + if ((newState == OTAUpdateStateEnum::kDownloading) || (newState == OTAUpdateStateEnum::kApplying) || + (newState == OTAUpdateStateEnum::kRollingBack)) + { + targetSoftwareVersion.SetNonNull(mTargetVersion); + } + OtaRequestorServerOnStateTransition(previousState, newState, reason, targetSoftwareVersion); + + mCurrentUpdateState = newState; +} + +void OTARequestor::RecordErrorUpdateState(UpdateFailureState failureState, CHIP_ERROR error, OTAChangeReasonEnum reason) +{ + // Inform driver of the error + mOtaRequestorDriver->HandleError(failureState, error); + + // Log the DownloadError event + OTAImageProcessorInterface * imageProcessor = mBdxDownloader->GetImageProcessorDelegate(); + VerifyOrReturn(imageProcessor != nullptr); + Nullable progressPercent; + imageProcessor->GetPercentComplete(progressPercent); + Nullable platformCode; + OtaRequestorServerOnDownloadError(mTargetVersion, imageProcessor->GetBytesDownloaded(), progressPercent, platformCode); + + // Whenever an error occurs, always reset to Idle state + RecordNewUpdateState(OTAUpdateStateEnum::kIdle, reason); +} + CHIP_ERROR OTARequestor::GenerateUpdateToken() { if (mUpdateToken.empty()) @@ -540,7 +580,7 @@ CHIP_ERROR OTARequestor::SendApplyUpdateRequest(OperationalDeviceProxy & deviceP ApplyUpdateRequest::Type args; args.updateToken = mUpdateToken; - args.newVersion = mUpdateVersion; + args.newVersion = mTargetVersion; Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(&deviceProxy, mProviderEndpointId); @@ -554,7 +594,7 @@ CHIP_ERROR OTARequestor::SendNotifyUpdateAppliedRequest(OperationalDeviceProxy & NotifyUpdateApplied::Type args; args.updateToken = mUpdateToken; - args.softwareVersion = mUpdateVersion; + args.softwareVersion = mCurrentVersion; Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(&deviceProxy, mProviderEndpointId); diff --git a/src/app/clusters/ota-requestor/OTARequestor.h b/src/app/clusters/ota-requestor/OTARequestor.h index fc70e83fab975c..0f650f78ddd618 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.h +++ b/src/app/clusters/ota-requestor/OTARequestor.h @@ -63,12 +63,13 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe // Send ApplyImage void ApplyUpdate() override; - // Send NotifyUpdateApplied - void NotifyUpdateApplied() override; + // Send NotifyUpdateApplied, update Basic cluster SoftwareVersion attribute, log the VersionApplied event + void NotifyUpdateApplied(uint32_t version) override; //////////// BDXDownloader::StateDelegate Implementation /////////////// - void OnDownloadStateChanged(OTADownloader::State state) override; - void OnUpdateProgressChanged(uint8_t percent) override; + void OnDownloadStateChanged(OTADownloader::State state, + app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum reason) override; + void OnUpdateProgressChanged(app::DataModel::Nullable percent) override; /** * Called to perform some initialization including: @@ -84,8 +85,14 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe mOtaRequestorDriver = driver; mBdxDownloader = downloader; - OtaRequestorServerSetUpdateState(app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum::kIdle); - OtaRequestorServerSetUpdateStateProgress(0); + uint32_t version; + VerifyOrDie(app::Clusters::Basic::Attributes::SoftwareVersion::Get(kRootEndpointId, &version) == EMBER_ZCL_STATUS_SUCCESS); + mCurrentVersion = version; + + OtaRequestorServerSetUpdateState(mCurrentUpdateState); + app::DataModel::Nullable percent; + percent.SetNull(); + OtaRequestorServerSetUpdateStateProgress(percent); } /** @@ -122,6 +129,8 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe private: using QueryImageResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType; using ApplyUpdateResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; + using OTAUpdateStateEnum = app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum; + using OTAChangeReasonEnum = app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum; static constexpr size_t kMaxUpdateTokenLen = 32; @@ -192,6 +201,17 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe chip::BDXDownloader * mDownloader; }; + /** + * Record the new update state by updating the corresponding server attribute and logging a StateTransition event + */ + void RecordNewUpdateState(OTAUpdateStateEnum newState, OTAChangeReasonEnum reason); + + /** + * Record the error update state by informing the driver of the error and calling `RecordNewUpdateState` + */ + void RecordErrorUpdateState(UpdateFailureState failureState, CHIP_ERROR error, + OTAChangeReasonEnum reason = OTAChangeReasonEnum::kFailure); + /** * Generate an update token using the operational node ID in case of token lost, received in QueryImageResponse */ @@ -260,8 +280,10 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe BDXMessenger mBdxMessenger; // TODO: ideally this is held by the application uint8_t mUpdateTokenBuffer[kMaxUpdateTokenLen]; ByteSpan mUpdateToken; - uint32_t mUpdateVersion = 0; - Server * mServer = nullptr; + uint32_t mCurrentVersion = 0; + uint32_t mTargetVersion = 0; + OTAUpdateStateEnum mCurrentUpdateState = OTAUpdateStateEnum::kIdle; + Server * mServer = nullptr; }; } // namespace chip diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp index 0fc2bffba7ce45..e87339bfe040ed 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -85,7 +86,7 @@ EmberAfStatus OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - // Find all endpoints that has OtaSoftwareUpdateRequestor implemented + // Find all endpoints that have OtaSoftwareUpdateRequestor implemented for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id)) { OTAUpdateStateEnum currentValue; @@ -102,17 +103,18 @@ EmberAfStatus OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value) return status; } -EmberAfStatus OtaRequestorServerSetUpdateStateProgress(uint8_t value) +EmberAfStatus OtaRequestorServerSetUpdateStateProgress(app::DataModel::Nullable value) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - // Find all endpoints that has OtaSoftwareUpdateRequestor implemented + // Find all endpoints that have OtaSoftwareUpdateRequestor implemented for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id)) { app::DataModel::Nullable currentValue; status = Attributes::UpdateStateProgress::Get(endpoint, currentValue); VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status); - if (currentValue.IsNull() || currentValue.Value() != value) + + if (currentValue != value) { status = Attributes::UpdateStateProgress::Set(endpoint, value); VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status); @@ -122,6 +124,62 @@ EmberAfStatus OtaRequestorServerSetUpdateStateProgress(uint8_t value) return status; } +void OtaRequestorServerOnStateTransition(DataModel::Nullable previousState, OTAUpdateStateEnum newState, + OTAChangeReasonEnum reason, DataModel::Nullable const & targetSoftwareVersion) +{ + if (!previousState.IsNull() && previousState.Value() == newState) + { + ChipLogError(Zcl, "Previous state and new state are the same, no event to log"); + return; + } + + // Find all endpoints that have OtaSoftwareUpdateRequestor implemented + for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id)) + { + Events::StateTransition::Type event{ previousState, newState, reason, targetSoftwareVersion }; + EventNumber eventNumber; + + CHIP_ERROR err = LogEvent(event, endpoint, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(Zcl, "Failed to record StateTransition event: %" CHIP_ERROR_FORMAT, err.Format()); + } + } +} + +void OtaRequestorServerOnVersionApplied(uint32_t softwareVersion, uint16_t productId) +{ + // Find all endpoints that have OtaSoftwareUpdateRequestor implemented + for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id)) + { + Events::VersionApplied::Type event{ softwareVersion, productId }; + EventNumber eventNumber; + + CHIP_ERROR err = LogEvent(event, endpoint, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(Zcl, "Failed to record VersionApplied event: %" CHIP_ERROR_FORMAT, err.Format()); + } + } +} + +void OtaRequestorServerOnDownloadError(uint32_t softwareVersion, uint64_t bytesDownloaded, + DataModel::Nullable progressPercent, DataModel::Nullable platformCode) +{ + // Find all endpoints that have OtaSoftwareUpdateRequestor implemented + for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id)) + { + Events::DownloadError::Type event{ softwareVersion, bytesDownloaded, progressPercent, platformCode }; + EventNumber eventNumber; + + CHIP_ERROR err = LogEvent(event, endpoint, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(Zcl, "Failed to record DownloadError event: %" CHIP_ERROR_FORMAT, err.Format()); + } + } +} + // ----------------------------------------------------------------------------- // Callbacks implementation diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.h b/src/app/clusters/ota-requestor/ota-requestor-server.h index 9a5afcfc193979..ad0ecdd94e41b9 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.h +++ b/src/app/clusters/ota-requestor/ota-requestor-server.h @@ -21,4 +21,14 @@ #include EmberAfStatus OtaRequestorServerSetUpdateState(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value); -EmberAfStatus OtaRequestorServerSetUpdateStateProgress(uint8_t value); +EmberAfStatus OtaRequestorServerSetUpdateStateProgress(chip::app::DataModel::Nullable value); + +void OtaRequestorServerOnStateTransition( + chip::app::DataModel::Nullable previousState, + chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum newState, + chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAChangeReasonEnum reason, + chip::app::DataModel::Nullable const & targetSoftwareVersion); +void OtaRequestorServerOnVersionApplied(uint32_t softwareVersion, uint16_t productId); +void OtaRequestorServerOnDownloadError(uint32_t softwareVersion, uint64_t bytesDownloaded, + chip::app::DataModel::Nullable progressPercent, + chip::app::DataModel::Nullable platformCode); diff --git a/src/app/clusters/scenes-client/scenes-client.cpp b/src/app/clusters/scenes-client/scenes-client.cpp index 8a59aa0593c4ea..3f15fd9fe0f90b 100644 --- a/src/app/clusters/scenes-client/scenes-client.cpp +++ b/src/app/clusters/scenes-client/scenes-client.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include using namespace chip; @@ -100,7 +100,7 @@ bool emberAfScenesClusterGetSceneMembershipResponseCallback(app::CommandHandler } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } @@ -157,7 +157,7 @@ bool emberAfPluginScenesClientParseViewSceneResponse(const EmberAfClusterCommand } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 366ef0457fff13..6a7286ac922a0b 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -104,6 +104,11 @@ "name": "Commands Ids header", "output": "ids/Commands.h" }, + { + "path": "../../zap-templates/templates/app/ids/Events.zapt", + "name": "Events Ids header", + "output": "ids/Events.h" + }, { "path": "../../zap-templates/templates/app/cluster-objects.zapt", "name": "Cluster objects header for Interaction Model", diff --git a/src/app/data-model/Nullable.h b/src/app/data-model/Nullable.h index e8bf8c5ae2d1a1..c6d279b0e0310e 100644 --- a/src/app/data-model/Nullable.h +++ b/src/app/data-model/Nullable.h @@ -73,6 +73,9 @@ struct Nullable : protected Optional { return true; } + + bool operator==(const Nullable & other) const { return Optional::operator==(other); } + bool operator!=(const Nullable & other) const { return !(*this == other); } }; } // namespace DataModel diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index d5d519581d568a..91a92c4dafd758 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -270,6 +270,11 @@ void CommissioningWindowManager::CloseCommissioningWindow() CHIP_ERROR CommissioningWindowManager::StartAdvertisement() { +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + // notify device layer that advertisement is beginning (to do work such as increment rotating id) + DeviceLayer::ConfigurationMgr().NotifyOfAdvertisementStart(); +#endif + if (mIsBLE) { ReturnErrorOnFailure(chip::DeviceLayer::ConnectivityMgr().SetBLEAdvertisingEnabled(true)); diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index ee167fddb16ed9..57b893372007de 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -50,7 +50,7 @@ class TestWriteInteraction static void TestWriteRoundtripWithClusterObjects(nlTestSuite * apSuite, void * apContext); private: - static void AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClientHandle & aWriteClient); + static void AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClient & aWriteClient); static void AddAttributeStatus(nlTestSuite * apSuite, void * apContext, WriteHandler & aWriteHandler); static void GenerateWriteRequest(nlTestSuite * apSuite, void * apContext, bool aIsTimedWrite, System::PacketBufferHandle & aPayload); @@ -84,7 +84,7 @@ class TestWriteClientCallback : public chip::app::WriteClient::Callback int mOnDoneCalled = 0; }; -void TestWriteInteraction::AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClientHandle & aWriteClient) +void TestWriteInteraction::AddAttributeDataIB(nlTestSuite * apSuite, void * apContext, WriteClient & aWriteClient) { CHIP_ERROR err = CHIP_NO_ERROR; AttributePathParams attributePathParams; @@ -92,15 +92,15 @@ void TestWriteInteraction::AddAttributeDataIB(nlTestSuite * apSuite, void * apCo attributePathParams.mClusterId = 3; attributePathParams.mAttributeId = 4; - err = aWriteClient->PrepareAttribute(attributePathParams); + err = aWriteClient.PrepareAttribute(attributePathParams); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - chip::TLV::TLVWriter * writer = aWriteClient->GetAttributeDataIBTLVWriter(); + chip::TLV::TLVWriter * writer = aWriteClient.GetAttributeDataIBTLVWriter(); err = writer->PutBoolean(chip::TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), true); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = aWriteClient->FinishAttribute(); + err = aWriteClient.FinishAttribute(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } @@ -214,27 +214,21 @@ void TestWriteInteraction::TestWriteClient(nlTestSuite * apSuite, void * apConte CHIP_ERROR err = CHIP_NO_ERROR; - app::WriteClient writeClient; - app::WriteClientHandle writeClientHandle; - writeClientHandle.SetWriteClient(&writeClient); + TestWriteClientCallback callback; + app::WriteClient writeClient(&ctx.GetExchangeManager(), &callback, /* aTimedWriteTimeoutMs = */ NullOptional); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - TestWriteClientCallback callback; - err = writeClient.Init(&ctx.GetExchangeManager(), &callback, /* aTimedWriteTimeoutMs = */ NullOptional); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AddAttributeDataIB(apSuite, apContext, writeClientHandle); + AddAttributeDataIB(apSuite, apContext, writeClient); - err = writeClientHandle.SendWriteRequest(ctx.GetSessionBobToAlice()); + err = writeClient.SendWriteRequest(ctx.GetSessionBobToAlice()); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - // The internal WriteClient should be nullptr once we SendWriteRequest. - NL_TEST_ASSERT(apSuite, nullptr == writeClientHandle.mpWriteClient); GenerateWriteResponse(apSuite, apContext, buf); err = writeClient.ProcessWriteResponseMessage(std::move(buf)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - writeClient.Shutdown(); + writeClient.Close(); Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); @@ -246,24 +240,20 @@ void TestWriteInteraction::TestWriteClientGroup(nlTestSuite * apSuite, void * ap CHIP_ERROR err = CHIP_NO_ERROR; - app::WriteClient writeClient; - app::WriteClientHandle writeClientHandle; - writeClientHandle.SetWriteClient(&writeClient); + TestWriteClientCallback callback; + app::WriteClient writeClient(&ctx.GetExchangeManager(), &callback, /* aTimedWriteTimeoutMs = */ NullOptional); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - TestWriteClientCallback callback; - err = writeClient.Init(&ctx.GetExchangeManager(), &callback, /* aTimedWriteTimeoutMs = */ NullOptional); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AddAttributeDataIB(apSuite, apContext, writeClientHandle); + AddAttributeDataIB(apSuite, apContext, writeClient); SessionHandle groupSession = ctx.GetSessionBobToFriends(); NL_TEST_ASSERT(apSuite, groupSession->IsGroupSession()); - err = writeClientHandle.SendWriteRequest(groupSession); + err = writeClient.SendWriteRequest(groupSession); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - // The internal WriteClient should be shutdown once we SendWriteRequest for group. - NL_TEST_ASSERT(apSuite, nullptr == writeClientHandle.mpWriteClient); + // The WriteClient should be shutdown once we SendWriteRequest for group. + NL_TEST_ASSERT(apSuite, writeClient.mState == WriteClient::State::AwaitingDestruction); } void TestWriteInteraction::TestWriteHandler(nlTestSuite * apSuite, void * apContext) @@ -339,9 +329,7 @@ void TestWriteInteraction::TestWriteRoundtripWithClusterObjects(nlTestSuite * ap err = engine->Init(&ctx.GetExchangeManager(), nullptr); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - app::WriteClientHandle writeClient; - err = engine->NewWriteClient(writeClient, &callback); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + app::WriteClient writeClient(engine->GetExchangeManager(), &callback, Optional::Missing()); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); @@ -407,9 +395,7 @@ void TestWriteInteraction::TestWriteRoundtrip(nlTestSuite * apSuite, void * apCo err = engine->Init(&ctx.GetExchangeManager(), nullptr); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - app::WriteClientHandle writeClient; - err = engine->NewWriteClient(writeClient, &callback); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + app::WriteClient writeClient(engine->GetExchangeManager(), &callback, Optional::Missing()); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); AddAttributeDataIB(apSuite, apContext, writeClient); diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index e00e3b8d65576d..7e84ac02f8e64d 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -341,7 +341,7 @@ CHIP_ERROR SendReadRequest() return err; } -CHIP_ERROR SendWriteRequest(chip::app::WriteClientHandle & apWriteClient) +CHIP_ERROR SendWriteRequest(chip::app::WriteClient & apWriteClient) { CHIP_ERROR err = CHIP_NO_ERROR; chip::TLV::TLVWriter * writer; @@ -354,13 +354,13 @@ CHIP_ERROR SendWriteRequest(chip::app::WriteClientHandle & apWriteClient) attributePathParams.mClusterId = 3; attributePathParams.mAttributeId = 4; - SuccessOrExit(err = apWriteClient->PrepareAttribute(attributePathParams)); + SuccessOrExit(err = apWriteClient.PrepareAttribute(attributePathParams)); - writer = apWriteClient->GetAttributeDataIBTLVWriter(); + writer = apWriteClient.GetAttributeDataIBTLVWriter(); SuccessOrExit(err = writer->PutBoolean(chip::TLV::ContextTag(chip::to_underlying(chip::app::AttributeDataIB::Tag::kData)), true)); - SuccessOrExit(err = apWriteClient->FinishAttribute()); + SuccessOrExit(err = apWriteClient.FinishAttribute()); SuccessOrExit(err = apWriteClient.SendWriteRequest(gSession.Get(), gMessageTimeout)); gWriteCount++; @@ -556,8 +556,8 @@ void WriteRequestTimerHandler(chip::System::Layer * systemLayer, void * appState if (gWriteRespCount < kMaxWriteMessageCount) { - chip::app::WriteClientHandle writeClient; - err = chip::app::InteractionModelEngine::GetInstance()->NewWriteClient(writeClient, &gMockDelegate); + chip::app::WriteClient writeClient(chip::app::InteractionModelEngine::GetInstance()->GetExchangeManager(), &gMockDelegate, + chip::Optional::Missing()); SuccessOrExit(err); err = SendWriteRequest(writeClient); diff --git a/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml new file mode 100644 index 00000000000000..7cb7fcc9e8a35a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml @@ -0,0 +1,37 @@ +# 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. + +name: 77.1.1. [TC-BRAC-1.1] Global attributes with server as DUT + +config: + cluster: "Bridged Actions" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 diff --git a/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml new file mode 100644 index 00000000000000..c919838d9881fe --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml @@ -0,0 +1,162 @@ +# 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. + +name: 48.1.1. [TC-ETHDIAG-1.1] Attributes with server as DUT + +config: + cluster: "Ethernet Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Disabled due to issue #11670 and #13648 + - label: "Read PHYRate attribute" + disabled: true + command: "readAttribute" + attribute: "PHYRate" + response: + value: null + + - label: "Read PHYRate attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PHYRate" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 9 + + - label: "Read FullDuplex attribute" + disabled: true + command: "readAttribute" + attribute: "FullDuplex" + response: + value: null + + - label: "Read FullDuplex attribute constraints" + disabled: true + command: "readAttribute" + attribute: "FullDuplex" + response: + constraints: + type: bool + + - label: "Read PacketRxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + value: 0 + + - label: "Read PacketRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + constraints: + type: uint64 + + - label: "Read PacketTxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + value: 0 + + - label: "Read PacketTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + constraints: + type: uint64 + + - label: "Read TxErrCount attribute" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + value: 0 + + - label: "Read TxErrCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + constraints: + type: uint64 + + - label: "Read CollisionCount attribute" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + value: 0 + + - label: "Read CollisionCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + constraints: + type: uint64 + + - label: "Read OverrunCount attribute" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 + + - label: "Read OverrunCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + constraints: + type: uint64 + + - label: "Read CarrierDetect attribute" + disabled: true + command: "readAttribute" + attribute: "CarrierDetect" + response: + value: null + + - label: "Read CarrierDetect attribute constraints" + disabled: true + command: "readAttribute" + attribute: "CarrierDetect" + response: + constraints: + type: bool + + - label: "Read TimeSinceReset attribute" + disabled: true + command: "readAttribute" + attribute: "TimeSinceReset" + response: + value: 0 + + - label: "Read TimeSinceReset attribute constraints" + disabled: true + command: "readAttribute" + attribute: "TimeSinceReset" + response: + constraints: + type: uint64 diff --git a/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml new file mode 100644 index 00000000000000..a488632be2eeff --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml @@ -0,0 +1,64 @@ +# 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. + +name: 48.1.3. [TC-ETHDIAG-2.1] Command received functionality with server as DUT + +config: + cluster: "Ethernet Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13648 + - label: "Sends ResetCounts command" + disabled: true + command: "ResetCounts" + + - label: "Read the PacketRxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + value: 0 + + - label: "Read the PacketTxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + value: 0 + + - label: "Read the TxErrCount attribute" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + value: 0 + + - label: "Read the CollisionCount attribute" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + value: 0 + + - label: "Read the OverrunCount attribute" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml new file mode 100644 index 00000000000000..061aba72bef687 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml @@ -0,0 +1,94 @@ +# 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. + +name: 62.1.1. [TC-PS-1.1] Global attributes with server as DUT + +config: + cluster: "Power Source" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: + "write the default values to mandatory global attribute: + ClusterRevision" + command: "writeAttribute" + attribute: "ClusterRevision" + arguments: + value: 1 + response: + error: UNSUPPORTED_WRITE + + - label: "reads back global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + #disabled due to issue #13442 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml new file mode 100644 index 00000000000000..e112b0da7cfbce --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml @@ -0,0 +1,66 @@ +# 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. + +name: 74.2.1. [TC-SWTCH-2.1] Attributes with server as DUT + +config: + cluster: "Switch" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Read NumberOfPositions attribute" + command: "readAttribute" + attribute: "number of positions" + response: + value: 2 + + - label: "Read NumberOfPositions attribute" + command: "readAttribute" + attribute: "number of positions" + response: + constraints: + type: uint8 + minValue: 2 + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + constraints: + type: uint8 + minValue: 0 + + - label: "Read MultiPressMax attribute" + command: "readAttribute" + attribute: "multi press max" + response: + value: 2 + + - label: "Read MultiPressMax attribute" + command: "readAttribute" + attribute: "multi press max" + response: + constraints: + type: uint8 + minValue: 2 diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml new file mode 100644 index 00000000000000..71f7849f2d39d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml @@ -0,0 +1,514 @@ +# 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. + +name: 74.2.2. [TC-SWTCH-2.2] Primary functionality with server as DUT + +config: + cluster: "Switch" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #### 2: tests for Latching Switch + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Set up subscription to SwitchLatched event" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to first position" + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to second position" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "SwitchLatched event with NewPosition set to 1" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 1 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "SwitchLatched event with NewPosition set to 1 higher than in previous + event" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 2 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "SwitchLatched event with NewPosition set to 1 higher than in previous + event" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 3 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "SwitchLatched event with NewPosition set to 0" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + ### 3: tests for Momentary Switch + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Set up subscription to InitialPress event" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to second position" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 1 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch (release switch)" + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + ## 4: tests for Momentary Switch with release capability but not long press capabilities + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress and ShortRelease events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch for 5 seconds" + + - label: "Wait 3000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 3000 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + ## 5: tests for Momentary Switch with release and long press capabilitie + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress, LongPress, + ShortRelease, LongRelease events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch for 5 seconds" + + - label: "Wait 3000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 3000 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "LongPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "LongRelease event with PreviousPosition set to 1" + disabled: true + + ## 6: tests for Momentary Switch with multi-press capabilities + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress, ShortRelease, + MultiPressOngoing, MultiPressComplete events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 2" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 1" + disabled: true + + # 6i + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressOngoing event with NewPosition set to 1 and + CurrentNumberOfPressesCounted set to 2" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressOngoing event with NewPosition set to 1 and + CurrentNumberOfPressesCounted set to 3" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 3" + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml new file mode 100644 index 00000000000000..6258d1750d4ac3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml @@ -0,0 +1,216 @@ +# 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. + +name: 54.1.1. [TC-WIFIDIAG-1.1] Attributes with server as DUT + +config: + cluster: "WiFi Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13645 and 11670 + - label: "Reads NetworkInterface structure attribute from DUT" + disabled: true + cluster: "General Diagnostics" + command: "readAttribute" + attribute: "NetworkInterfaces" + response: + constraints: + type: list + + - label: "Reads SecurityType attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "SecurityType" + response: + value: null + + - label: "Reads SecurityType attribute constraints" + disabled: true + command: "readAttribute" + attribute: "SecurityType" + response: + constraints: + type: enum + + - label: "Reads WiFiVersion attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "WiFiVersion" + response: + value: null + + - label: "Reads WiFiVersion attribute constraints" + disabled: true + command: "readAttribute" + attribute: "WiFiVersion" + response: + constraints: + type: enum + + - label: "Reads ChannelNumber attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "ChannelNumber" + response: + value: null + + - label: "Reads ChannelNumber attribute constraints" + disabled: true + command: "readAttribute" + attribute: "ChannelNumber" + response: + constraints: + type: uint16 + + - label: "Reads RSSI attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "RSSI" + response: + value: null + + - label: "Reads RSSI attribute constraints" + disabled: true + command: "readAttribute" + attribute: "RSSI" + response: + constraints: + type: int8 + minValue: -120 + maxValue: 0 + + - label: "Reads BeaconLostCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + value: 0 + + - label: "Reads BeaconLostCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + constraints: + type: uint32 + + - label: "Reads BeaconRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + value: 0 + + - label: "Reads BeaconRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketMulticastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketMulticastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + value: 0 + + - label: "Reads PacketMulticastTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketUnicastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + value: 0 + + - label: "Reads PacketUnicastRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketUnicastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + value: 0 + + - label: "Reads PacketUnicastTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + constraints: + type: uint32 + + - label: "Reads CurrentMaxRate attribute from DUT" + optional: true + command: "readAttribute" + attribute: "CurrentMaxRate" + response: + value: 0 + + - label: "Reads CurrentMaxRate attribute constraints" + optional: true + command: "readAttribute" + attribute: "CurrentMaxRate" + response: + constraints: + type: uint64 + + - label: "Reads OverrunCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 + + - label: "Reads OverrunCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + constraints: + type: uint64 diff --git a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml new file mode 100644 index 00000000000000..ba69ea1d0917c7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml @@ -0,0 +1,72 @@ +# 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. + +name: + 54.2.3. [TC-WIFIDIAG-3.1] Command received functionality with server as DUT + +config: + cluster: "WiFi Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13645 + - label: "TH sends ResetCounts command to DUT" + disabled: true + command: "ResetCounts" + + - label: "Reads BeaconLostCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + value: 0 + + - label: "Reads BeaconRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + value: 0 + + - label: "Reads PacketUnicastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + value: 0 + + - label: "Reads PacketUnicastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + value: 0 diff --git a/src/app/util/types_stub.h b/src/app/util/types_stub.h index 6410c6c032e8f9..ba97c524f74eab 100644 --- a/src/app/util/types_stub.h +++ b/src/app/util/types_stub.h @@ -495,8 +495,40 @@ enum */ struct EmberBindingTableEntry { + EmberBindingTableEntry() = default; + + static EmberBindingTableEntry ForNode(chip::FabricIndex fabric, chip::NodeId node, chip::EndpointId localEndpoint, + chip::EndpointId remoteEndpoint, chip::ClusterId cluster) + { + EmberBindingTableEntry entry = { + .type = EMBER_UNICAST_BINDING, + .fabricIndex = fabric, + .local = localEndpoint, + .clusterId = cluster, + .remote = remoteEndpoint, + .nodeId = node, + }; + return entry; + } + + static EmberBindingTableEntry ForGroup(chip::FabricIndex fabric, chip::GroupId group, chip::EndpointId localEndpoint, + chip::ClusterId cluster) + { + EmberBindingTableEntry entry = { + .type = EMBER_MULTICAST_BINDING, + .fabricIndex = fabric, + .local = localEndpoint, + .clusterId = cluster, + .remote = 0, + .groupId = group, + }; + return entry; + } + /** The type of binding. */ EmberBindingType type; + + chip::FabricIndex fabricIndex; /** The endpoint on the local node. */ chip::EndpointId local; /** A cluster ID that matches one from the local endpoint's simple descriptor. @@ -519,8 +551,6 @@ struct EmberBindingTableEntry chip::NodeId nodeId; chip::GroupId groupId; }; - /** The index of the network the binding belongs to. */ - uint8_t networkIndex; bool operator==(EmberBindingTableEntry const & other) const { @@ -539,7 +569,7 @@ struct EmberBindingTableEntry return false; } - return local == other.local && clusterId == other.clusterId && remote == other.remote && networkIndex == other.networkIndex; + return fabricIndex == other.fabricIndex && local == other.local && clusterId == other.clusterId && remote == other.remote; } }; diff --git a/src/app/zap-templates/partials/cluster-objects-field-init.zapt b/src/app/zap-templates/partials/cluster-objects-field-init.zapt index b6729e7eac3d7e..70d55789aabd44 100644 --- a/src/app/zap-templates/partials/cluster-objects-field-init.zapt +++ b/src/app/zap-templates/partials/cluster-objects-field-init.zapt @@ -8,7 +8,7 @@ {{~#if_is_struct type}} {{! Structs have their own initializers }} {{~else~}} - = static_cast<{{zapTypeToEncodableClusterObjectType type}}>(0) + = static_cast<{{zapTypeToEncodableClusterObjectType type ns=ns}}>(0) {{~/if_is_struct}} {{~/unless}} {{~/unless}} diff --git a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt index f989635a19c965..e4b0278cae26ca 100644 --- a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt +++ b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt @@ -54,7 +54,7 @@ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) switch (currentDecodeTagId) { {{#zcl_command_arguments}} - case {{index}}: + case {{fieldIdentifier}}: {{#if isArray}} // Just for compatibility, we will add array type support in IM later. TLVUnpackError = aDataTlv.GetDataPtr(const_cast({{asSymbol label}})); diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index e1f01ae81fde56..efa88f812e1126 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -35,6 +35,9 @@ readonly {{!marker to place a space even with whitespace removal~}} {{~/unless~}} {{~!TODO: write only attributes should also be supported~}} + {{#if isGlobalAttribute~}} + global {{!marker to place a space even with whitespace removal~}} + {{~/if~}} {{~#unless isReportableAttribute~}} nosubscribe {{!marker to place a space even with whitespace removal~}} {{~/unless~}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index d6684e20ddb768..bcc515dd53b298 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -12,9 +12,10 @@ #include #include #include -#include -#include #include +#include +#include +#include namespace chip { namespace app { @@ -99,7 +100,7 @@ namespace Commands { namespace {{asUpperCamelCase name}} { enum class Fields { {{#zcl_command_arguments}} - k{{asUpperCamelCase label}} = {{index}}, + k{{asUpperCamelCase label}} = {{fieldIdentifier}}, {{/zcl_command_arguments}} }; @@ -176,7 +177,7 @@ struct TypeInfo {{#zcl_attributes_server}} {{! isOptional=false because optional attributes don't get represented as Optional types here. }} - Attributes::{{asUpperCamelCase label}}::TypeInfo::DecodableType {{asLowerCamelCase label}}{{> cluster_objects_field_init isOptional=false}}; + Attributes::{{asUpperCamelCase label}}::TypeInfo::DecodableType {{asLowerCamelCase label}}{{> cluster_objects_field_init ns=parent.name isOptional=false}}; {{/zcl_attributes_server}} }; }; @@ -187,7 +188,6 @@ namespace Events { {{/first}} namespace {{asUpperCamelCase name}} { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::{{asUpperCamelCase priority}}; -static constexpr EventId kEventId = {{asMEI manufacturerCode code}}; enum class Fields { {{#zcl_event_fields}} @@ -199,7 +199,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::{{asUpperCamelCase name}}::Id; } static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} @@ -212,7 +212,7 @@ public: struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::{{asUpperCamelCase name}}::Id; } static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} diff --git a/src/app/zap-templates/templates/app/ids/Events.zapt b/src/app/zap-templates/templates/app/ids/Events.zapt new file mode 100644 index 00000000000000..dca5a226aa1c1c --- /dev/null +++ b/src/app/zap-templates/templates/app/ids/Events.zapt @@ -0,0 +1,32 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +{{#zcl_clusters}} +{{#zcl_events}} +{{#first}} +namespace {{asUpperCamelCase parent.label}} { +namespace Events { + +{{/first}} +namespace {{asUpperCamelCase name}} { +static constexpr EventId Id = {{asMEI manufacturerCode code}}; +} // namespace {{asUpperCamelCase name}} + +{{#last}} +} // namespace Events +} // namespace {{asUpperCamelCase parent.label}} + +{{/last}} +{{/zcl_events}} +{{/zcl_clusters}} + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/templates/chip/helper.js b/src/app/zap-templates/templates/chip/helper.js index c7f9ea859b6a02..997848f9f5d352 100644 --- a/src/app/zap-templates/templates/chip/helper.js +++ b/src/app/zap-templates/templates/chip/helper.js @@ -250,8 +250,7 @@ function chip_cluster_command_arguments(options) const commands = getCommands.call(this.parent, 'chip_cluster_commands_argments'); const filter = command => command.id == commandId; - return asBlocks.call(this, - commands.then(items => items.find(filter).arguments.map((value, index) => ({...value, fieldIdentifier : index }))), options); + return asBlocks.call(this, commands.then(items => items.find(filter).arguments), options); } /** @@ -300,8 +299,7 @@ function chip_cluster_response_arguments(options) const responses = getResponses.call(this.parent, 'chip_cluster_responses_argments'); const filter = command => command.id == commandId; - return asBlocks.call(this, - responses.then(items => items.find(filter).arguments.map((value, index) => ({...value, fieldIdentifier : index }))), options); + return asBlocks.call(this, responses.then(items => items.find(filter).arguments), options); } /** diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml index 6b912b1de27157..00405d84eec76a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -89,18 +89,18 @@ limitations under the License. The cluster SHALL send AccessControlEntryChanged events whenever its ACL attribute data is changed by an Administrator. - - + + - + The cluster SHALL send AccessControlExtensionChanged events whenever its extension attribute data is changed by an Administrator. - - + + - + diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml index 906c0c5cd4786c..c83bff37b74dbc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml @@ -150,7 +150,7 @@ limitations under the License. This event SHALL be generated whenever an error occurs during OTA Requestor download operation. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index a6e0012cd14dec..f24ff35b33539a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -19,7 +19,7 @@ limitations under the License. - + @@ -43,8 +43,9 @@ limitations under the License. - + + @@ -54,6 +55,7 @@ limitations under the License. OPERATIONAL_CREDENTIALS_CLUSTER This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. + NOCs fabrics list SupportedFabrics CommissionedFabrics diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 9e7dad861ebfd1..61350870fb1a0e 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -619,6 +619,12 @@ CHIP_ERROR DeviceCommissioner::Init(CommissionerInitParams params) params.systemState->SessionMgr()->RegisterRecoveryDelegate(*this); +#if 0 // + // We cannot reinstantiate session ID allocator state from each fabric-scoped commissioner + // individually because the session ID allocator space is and must be shared for all users + // of the Session Manager. Disable persistence for now. #12821 tracks a proper fix this issue. + // + uint16_t nextKeyID = 0; uint16_t size = sizeof(nextKeyID); CHIP_ERROR error = mStorageDelegate->SyncGetKeyValue(kNextAvailableKeyID, &nextKeyID, size); @@ -627,6 +633,8 @@ CHIP_ERROR DeviceCommissioner::Init(CommissionerInitParams params) nextKeyID = 0; } ReturnErrorOnFailure(mIDAllocator.ReserveUpTo(nextKeyID)); +#endif + mPairingDelegate = params.pairingDelegate; #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY // make this commissioner discoverable @@ -840,12 +848,25 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re // Immediately persist the updated mNextKeyID value // TODO maybe remove FreeRendezvousSession() since mNextKeyID is always persisted immediately - PersistNextKeyId(); + // + // Disabling session ID persistence (see previous comment in Init() about persisting key ids) + // + // PersistNextKeyId(); exit: if (err != CHIP_NO_ERROR) { - RendezvousCleanup(err); + // Delete the current rendezvous session only if a device is not currently being paired. + if (mDeviceBeingCommissioned == nullptr) + { + FreeRendezvousSession(); + } + + if (device != nullptr) + { + ReleaseCommissioneeDevice(device); + mDeviceBeingCommissioned = nullptr; + } } return err; @@ -1628,7 +1649,6 @@ void DeviceCommissioner::OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & if (mDeviceBeingCommissioned != nullptr && mDeviceBeingCommissioned->GetDeviceId() == nodeData.mPeerId.GetNodeId()) { - RendezvousCleanup(CHIP_NO_ERROR); // Let's release the device that's being paired, if pairing was successful, // and the device is available on the operational network. ReleaseCommissioneeDevice(mDeviceBeingCommissioned); diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index a53c4fdcb2fa37..ddb460051b40b9 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -146,7 +146,9 @@ void SetUpCodePairer::OnDiscoveredDeviceOverBle(BLE_CONNECTION_OBJECT connObj) Transport::PeerAddress peerAddress = Transport::PeerAddress::BLE(); RendezvousParameters params = RendezvousParameters().SetPeerAddress(peerAddress).SetConnectionObject(connObj); - OnDeviceDiscovered(params); + // We don't have network credentials, so can't do the entire pairing flow. Just establish a PASE session to the + // device and let our consumer deal with the rest. + LogErrorOnFailure(mCommissioner->EstablishPASEConnection(mRemoteId, params.SetSetupPINCode(mSetUpPINCode))); } void SetUpCodePairer::OnDiscoveredDeviceOverBleSuccess(void * appState, BLE_CONNECTION_OBJECT connObj) diff --git a/src/controller/WriteInteraction.h b/src/controller/WriteInteraction.h index 4f2472b5ca27ea..09cc527f462515 100644 --- a/src/controller/WriteInteraction.h +++ b/src/controller/WriteInteraction.h @@ -78,6 +78,7 @@ class WriteCallback final : public app::WriteClient::Callback mOnDone(apWriteClient); } + chip::Platform::Delete(apWriteClient); // Always needs to be the last call chip::Platform::Delete(this); } @@ -100,29 +101,30 @@ CHIP_ERROR WriteAttribute(const SessionHandle & sessionHandle, chip::EndpointId WriteCallback::OnErrorCallbackType onErrorCb, const Optional & aTimedWriteTimeoutMs, WriteCallback::OnDoneCallbackType onDoneCb = nullptr) { - app::WriteClientHandle handle; - auto callback = Platform::MakeUnique(onSuccessCb, onErrorCb, onDoneCb); - VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); - - ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, callback.get(), aTimedWriteTimeoutMs)); + auto client = Platform::MakeUnique(app::InteractionModelEngine::GetInstance()->GetExchangeManager(), + callback.get(), aTimedWriteTimeoutMs); - // At this point the handle will ensure our callback's OnDone is always - // called. - callback.release(); + VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(client != nullptr, CHIP_ERROR_NO_MEMORY); if (sessionHandle->IsGroupSession()) { ReturnErrorOnFailure( - handle.EncodeAttributeWritePayload(chip::app::AttributePathParams(clusterId, attributeId), requestData)); + client->EncodeAttributeWritePayload(chip::app::AttributePathParams(clusterId, attributeId), requestData)); } else { ReturnErrorOnFailure( - handle.EncodeAttributeWritePayload(chip::app::AttributePathParams(endpointId, clusterId, attributeId), requestData)); + client->EncodeAttributeWritePayload(chip::app::AttributePathParams(endpointId, clusterId, attributeId), requestData)); } - ReturnErrorOnFailure(handle.SendWriteRequest(sessionHandle)); + ReturnErrorOnFailure(client->SendWriteRequest(sessionHandle)); + + // At this point the handle will ensure our callback's OnDone is always + // called. + client.release(); + callback.release(); return CHIP_NO_ERROR; } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 2175f416ff7daa..dca196240a3623 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2,8 +2,8 @@ // It is for view/code review purposes only. struct LabelStruct { - CHAR_STRING label = 1; - CHAR_STRING value = 2; + CHAR_STRING label = 0; + CHAR_STRING value = 1; } client cluster AccessControl = 31 { @@ -48,29 +48,29 @@ client cluster AccessControl = 31 { info event AccessControlEntryChanged = 0 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - AccessControlEntry latestValue = 4; + nullable AccessControlEntry latestValue = 4; } info event AccessControlExtensionChanged = 1 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - ExtensionEntry latestValue = 4; + nullable ExtensionEntry latestValue = 4; } attribute AccessControlEntry acl[] = 0; attribute ExtensionEntry extension[] = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster AccountLogin = 1294 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -106,8 +106,8 @@ client cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -136,8 +136,8 @@ client cluster ApplicationBasic = 1293 { } struct ApplicationBasicApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute char_string vendorName = 0; @@ -148,8 +148,8 @@ client cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -160,13 +160,13 @@ client cluster ApplicationLauncher = 1292 { } struct ApplicationLauncherApplication { - INT16U catalogVendorId = 1; - CHAR_STRING applicationId = 2; + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -202,15 +202,15 @@ client cluster AudioOutput = 1291 { } struct OutputInfo { - INT8U index = 1; - OutputTypeEnum outputType = 2; - CHAR_STRING name = 3; + INT8U index = 0; + OutputTypeEnum outputType = 1; + CHAR_STRING name = 2; } readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -230,8 +230,8 @@ client cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -275,8 +275,8 @@ client cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -285,13 +285,13 @@ client cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Binding = 30 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -317,8 +317,8 @@ client cluster BooleanState = 69 { } readonly attribute boolean stateValue = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster BridgedActions = 37 { @@ -351,19 +351,19 @@ client cluster BridgedActions = 37 { } struct ActionStruct { - INT16U actionID = 1; - CHAR_STRING name = 2; - ActionTypeEnum type = 3; - INT16U endpointListID = 4; - INT16U supportedCommands = 5; - ActionStateEnum status = 6; + INT16U actionID = 0; + CHAR_STRING name = 1; + ActionTypeEnum type = 2; + INT16U endpointListID = 3; + INT16U supportedCommands = 4; + ActionStateEnum status = 5; } struct EndpointListStruct { - INT16U endpointListID = 1; - CHAR_STRING name = 2; - EndpointListTypeEnum type = 3; - ENDPOINT_NO endpoints[] = 4; + INT16U endpointListID = 0; + CHAR_STRING name = 1; + EndpointListTypeEnum type = 2; + ENDPOINT_NO endpoints[] = 3; } info event StateChanged = 0 { @@ -382,8 +382,8 @@ client cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; readonly attribute long_char_string setupUrl = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct DisableActionRequest { INT16U actionID = 0; @@ -465,8 +465,8 @@ client cluster BridgedActions = 37 { } client cluster BridgedDeviceBasic = 57 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Channel = 1284 { @@ -480,16 +480,16 @@ client cluster Channel = 1284 { } struct ChannelInfo { - INT16U majorNumber = 1; - INT16U minorNumber = 2; - CHAR_STRING name = 3; - CHAR_STRING callSign = 4; - CHAR_STRING affiliateCallSign = 5; + INT16U majorNumber = 0; + INT16U minorNumber = 1; + CHAR_STRING name = 2; + CHAR_STRING callSign = 3; + CHAR_STRING affiliateCallSign = 4; } readonly attribute ChannelInfo channelList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -613,8 +613,8 @@ client cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -814,45 +814,45 @@ client cluster ContentLauncher = 1290 { } struct ContentSearch { - Parameter parameterList[] = 1; + Parameter parameterList[] = 0; } struct Parameter { - ParameterEnum type = 1; - CHAR_STRING value = 2; - AdditionalInfo externalIDList[] = 3; + ParameterEnum type = 0; + CHAR_STRING value = 1; + AdditionalInfo externalIDList[] = 2; } struct AdditionalInfo { - CHAR_STRING name = 1; - CHAR_STRING value = 2; + CHAR_STRING name = 0; + CHAR_STRING value = 1; } struct BrandingInformation { - CHAR_STRING providerName = 1; - StyleInformation background = 2; - StyleInformation logo = 3; - StyleInformation progressBar = 4; - StyleInformation splash = 5; - StyleInformation waterMark = 6; + CHAR_STRING providerName = 0; + StyleInformation background = 1; + StyleInformation logo = 2; + StyleInformation progressBar = 3; + StyleInformation splash = 4; + StyleInformation waterMark = 5; } struct StyleInformation { - CHAR_STRING imageUrl = 1; - CHAR_STRING color = 2; - Dimension size = 3; + CHAR_STRING imageUrl = 0; + CHAR_STRING color = 1; + Dimension size = 2; } struct Dimension { - double width = 1; - double height = 2; - MetricTypeEnum metric = 3; + double width = 0; + double height = 1; + MetricTypeEnum metric = 2; } readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -877,16 +877,16 @@ client cluster ContentLauncher = 1290 { client cluster Descriptor = 29 { struct DeviceType { - DEVTYPE_ID type = 1; - INT16U revision = 2; + DEVTYPE_ID type = 0; + INT16U revision = 1; } readonly attribute DeviceType deviceList[] = 0; readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster DiagnosticLogs = 50 { @@ -909,7 +909,7 @@ client cluster DiagnosticLogs = 50 { kBdx = 1; } - readonly attribute attrib_id attributeList[] = 65531; + readonly global attribute attrib_id attributeList[] = 65531; request struct RetrieveLogsRequestRequest { LogsIntent intent = 0; @@ -1122,8 +1122,8 @@ client cluster DoorLock = 257 { } struct DlCredential { - DlCredentialType credentialType = 1; - INT16U credentialIndex = 2; + DlCredentialType credentialType = 0; + INT16U credentialIndex = 1; } critical event DoorLockAlarm = 0 { @@ -1179,8 +1179,8 @@ client cluster DoorLock = 257 { attribute boolean enableOneTouchLocking = 41; attribute boolean enablePrivacyModeButton = 43; attribute int8u wrongCodeEntryLimit = 48; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1271,8 +1271,8 @@ client cluster ElectricalMeasurement = 2820 { readonly attribute int16s activePower = 1291; readonly attribute int16s activePowerMin = 1292; readonly attribute int16s activePowerMax = 1293; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster EthernetNetworkDiagnostics = 55 { @@ -1298,17 +1298,17 @@ client cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { @@ -1316,8 +1316,8 @@ client cluster FlowMeasurement = 1028 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -1335,15 +1335,15 @@ client cluster GeneralCommissioning = 48 { } struct BasicCommissioningInfoType { - INT32U failSafeExpiryLengthMs = 1; + INT32U failSafeExpiryLengthMs = 0; } attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1429,12 +1429,12 @@ client cluster GeneralDiagnostics = 51 { } struct NetworkInterfaceType { - CHAR_STRING name = 1; - BOOLEAN fabricConnected = 2; - BOOLEAN offPremiseServicesReachableIPv4 = 3; - BOOLEAN offPremiseServicesReachableIPv6 = 4; - OCTET_STRING hardwareAddress = 5; - InterfaceType type = 6; + CHAR_STRING name = 0; + BOOLEAN fabricConnected = 1; + BOOLEAN offPremiseServicesReachableIPv4 = 2; + BOOLEAN offPremiseServicesReachableIPv6 = 3; + OCTET_STRING hardwareAddress = 4; + InterfaceType type = 5; } critical event HardwareFaultChange = 0 { @@ -1464,8 +1464,8 @@ client cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster GroupKeyManagement = 63 { @@ -1502,8 +1502,8 @@ client cluster GroupKeyManagement = 63 { readonly attribute GroupInfo groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1537,8 +1537,8 @@ client cluster GroupKeyManagement = 63 { client cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1616,8 +1616,8 @@ client cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1648,8 +1648,8 @@ client cluster IlluminanceMeasurement = 1024 { readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute enum8 lightSensorType = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster KeypadInput = 1289 { @@ -1748,8 +1748,8 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1787,9 +1787,9 @@ client cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1850,8 +1850,8 @@ client cluster LocalizationConfiguration = 43 { } client cluster LowPower = 1288 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1873,16 +1873,16 @@ client cluster MediaInput = 1287 { } struct InputInfo { - INT8U index = 1; - InputTypeEnum inputType = 2; - CHAR_STRING name = 3; - CHAR_STRING description = 4; + INT8U index = 0; + InputTypeEnum inputType = 1; + CHAR_STRING name = 2; + CHAR_STRING description = 3; } readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1922,8 +1922,8 @@ client cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1956,9 +1956,9 @@ client cluster MediaPlayback = 1286 { client cluster ModeSelect = 80 { struct ModeOptionStruct { - CHAR_STRING label = 1; - INT8U mode = 2; - INT32U semanticTag = 3; + CHAR_STRING label = 0; + INT8U mode = 1; + INT32U semanticTag = 2; } readonly attribute int8u currentMode = 0; @@ -1966,8 +1966,8 @@ client cluster ModeSelect = 80 { attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; readonly attribute char_string description = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -2002,28 +2002,28 @@ client cluster NetworkCommissioning = 49 { } struct NetworkInfo { - OCTET_STRING networkID = 1; - BOOLEAN connected = 2; + OCTET_STRING networkID = 0; + BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 1; - OCTET_STRING ssid = 2; - OCTET_STRING bssid = 3; - INT16U channel = 4; - WiFiBand wiFiBand = 5; - INT8S rssi = 6; + BITMAP8 security = 0; + OCTET_STRING ssid = 1; + OCTET_STRING bssid = 2; + INT16U channel = 3; + WiFiBand wiFiBand = 4; + INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 1; - INT64U extendedPanId = 2; - CHAR_STRING networkName = 3; - INT16U channel = 4; - INT8U version = 5; - INT64U extendedAddress = 6; - INT8S rssi = 7; - INT8U lqi = 8; + INT64U panId = 0; + INT64U extendedPanId = 1; + CHAR_STRING networkName = 2; + INT16U channel = 3; + INT8U version = 4; + INT64U extendedAddress = 5; + INT8S rssi = 6; + INT8U lqi = 7; } readonly attribute int8u maxNetworks = 0; @@ -2034,8 +2034,8 @@ client cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -2116,8 +2116,8 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -2209,7 +2209,7 @@ client cluster OtaSoftwareUpdateRequestor = 42 { info event DownloadError = 2 { INT32U softwareVersion = 0; INT64U bytesDownloaded = 1; - INT8U progressPercent = 2; + nullable INT8U progressPercent = 2; nullable INT64S platformCode = 3; } @@ -2217,8 +2217,8 @@ client cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -2235,8 +2235,8 @@ client cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -2260,9 +2260,9 @@ client cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2286,8 +2286,8 @@ client cluster OnOff = 6 { client cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster OperationalCredentials = 62 { @@ -2304,22 +2304,29 @@ client cluster OperationalCredentials = 62 { kInvalidFabricIndex = 11; } + struct NOCStruct { + fabric_idx fabricIndex = 0; + OCTET_STRING noc = 1; + OCTET_STRING icac = 2; + } + struct FabricDescriptor { - INT8U fabricIndex = 1; - OCTET_STRING rootPublicKey = 2; - INT16U vendorId = 3; - FABRIC_ID fabricId = 4; - NODE_ID nodeId = 5; - CHAR_STRING label = 6; + fabric_idx fabricIndex = 0; + OCTET_STRING rootPublicKey = 1; + INT16U vendorId = 2; + FABRIC_ID fabricId = 3; + NODE_ID nodeId = 4; + CHAR_STRING label = 5; } + readonly nosubscribe attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2403,23 +2410,23 @@ client cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -2514,9 +2521,9 @@ client cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster RelativeHumidityMeasurement = 1029 { @@ -2524,15 +2531,15 @@ client cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Scenes = 5 { struct SceneExtensionFieldSet { - CLUSTER_ID clusterId = 1; - INT8U length = 2; - INT8U value = 3; + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; } readonly attribute int8u sceneCount = 0; @@ -2540,8 +2547,8 @@ client cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2631,11 +2638,11 @@ client cluster Scenes = 5 { client cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { - INT64U id = 1; - CHAR_STRING name = 2; - INT32U stackFreeCurrent = 3; - INT32U stackFreeMinimum = 4; - INT32U stackSize = 5; + INT64U id = 0; + CHAR_STRING name = 1; + INT32U stackFreeCurrent = 2; + INT32U stackFreeMinimum = 3; + INT32U stackSize = 4; } info event SoftwareFault = 0 { @@ -2646,9 +2653,9 @@ client cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2687,9 +2694,9 @@ client cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2700,14 +2707,14 @@ client cluster TargetNavigator = 1285 { } struct TargetInfo { - INT8U identifier = 1; - CHAR_STRING name = 2; + INT8U identifier = 0; + CHAR_STRING name = 1; } readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2727,8 +2734,8 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster TestCluster = 1295 { @@ -2740,50 +2747,50 @@ client cluster TestCluster = 1295 { } struct TestListStructOctet { - INT64U fabricIndex = 1; - OCTET_STRING operationalCert = 2; + INT64U fabricIndex = 0; + OCTET_STRING operationalCert = 1; } struct NullablesAndOptionalsStruct { - nullable INT16U nullableInt = 1; - optional INT16U optionalInt = 2; - optional nullable INT16U nullableOptionalInt = 3; - nullable CHAR_STRING nullableString = 4; - optional CHAR_STRING optionalString = 5; - optional nullable CHAR_STRING nullableOptionalString = 6; - nullable SimpleStruct nullableStruct = 7; - optional SimpleStruct optionalStruct = 8; - optional nullable SimpleStruct nullableOptionalStruct = 9; - nullable SimpleEnum nullableList[] = 10; - optional SimpleEnum optionalList[] = 11; - optional nullable SimpleEnum nullableOptionalList[] = 12; + nullable INT16U nullableInt = 0; + optional INT16U optionalInt = 1; + optional nullable INT16U nullableOptionalInt = 2; + nullable CHAR_STRING nullableString = 3; + optional CHAR_STRING optionalString = 4; + optional nullable CHAR_STRING nullableOptionalString = 5; + nullable SimpleStruct nullableStruct = 6; + optional SimpleStruct optionalStruct = 7; + optional nullable SimpleStruct nullableOptionalStruct = 8; + nullable SimpleEnum nullableList[] = 9; + optional SimpleEnum optionalList[] = 10; + optional nullable SimpleEnum nullableOptionalList[] = 11; } struct SimpleStruct { - INT8U a = 1; - BOOLEAN b = 2; - SimpleEnum c = 3; - OCTET_STRING d = 4; - CHAR_STRING e = 5; - SimpleBitmap f = 6; - single g = 7; - double h = 8; + INT8U a = 0; + BOOLEAN b = 1; + SimpleEnum c = 2; + OCTET_STRING d = 3; + CHAR_STRING e = 4; + SimpleBitmap f = 5; + single g = 6; + double h = 7; } struct NestedStructList { - INT8U a = 1; - BOOLEAN b = 2; - SimpleStruct c = 3; - SimpleStruct d[] = 4; - INT32U e[] = 5; - OCTET_STRING f[] = 6; - INT8U g[] = 7; + INT8U a = 0; + BOOLEAN b = 1; + SimpleStruct c = 2; + SimpleStruct d[] = 3; + INT32U e[] = 4; + OCTET_STRING f[] = 5; + INT8U g[] = 6; } struct NestedStruct { - INT8U a = 1; - BOOLEAN b = 2; - SimpleStruct c = 3; + INT8U a = 0; + BOOLEAN b = 1; + SimpleStruct c = 2; } info event TestEvent = 1 { @@ -2873,8 +2880,8 @@ client cluster TestCluster = 1295 { attribute int8s nullableRangeRestrictedInt8s = 32807; attribute int16u nullableRangeRestrictedInt16u = 32808; attribute int16s nullableRangeRestrictedInt16s = 32809; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -3012,9 +3019,9 @@ client cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -3060,8 +3067,8 @@ client cluster ThermostatUserInterfaceConfiguration = 516 { attribute enum8 temperatureDisplayMode = 0; attribute enum8 keypadLockout = 1; attribute enum8 scheduleProgrammingVisibility = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster ThreadNetworkDiagnostics = 53 { @@ -3088,53 +3095,53 @@ client cluster ThreadNetworkDiagnostics = 53 { } struct NeighborTable { - INT64U extAddress = 1; - INT32U age = 2; - INT16U rloc16 = 3; - INT32U linkFrameCounter = 4; - INT32U mleFrameCounter = 5; - INT8U lqi = 6; - INT8S averageRssi = 7; - INT8S lastRssi = 8; - INT8U frameErrorRate = 9; - INT8U messageErrorRate = 10; - BOOLEAN rxOnWhenIdle = 11; - BOOLEAN fullThreadDevice = 12; - BOOLEAN fullNetworkData = 13; - BOOLEAN isChild = 14; + INT64U extAddress = 0; + INT32U age = 1; + INT16U rloc16 = 2; + INT32U linkFrameCounter = 3; + INT32U mleFrameCounter = 4; + INT8U lqi = 5; + INT8S averageRssi = 6; + INT8S lastRssi = 7; + INT8U frameErrorRate = 8; + INT8U messageErrorRate = 9; + BOOLEAN rxOnWhenIdle = 10; + BOOLEAN fullThreadDevice = 11; + BOOLEAN fullNetworkData = 12; + BOOLEAN isChild = 13; } struct RouteTable { - INT64U extAddress = 1; - INT16U rloc16 = 2; - INT8U routerId = 3; - INT8U nextHop = 4; - INT8U pathCost = 5; - INT8U LQIIn = 6; - INT8U LQIOut = 7; - INT8U age = 8; - BOOLEAN allocated = 9; - BOOLEAN linkEstablished = 10; + INT64U extAddress = 0; + INT16U rloc16 = 1; + INT8U routerId = 2; + INT8U nextHop = 3; + INT8U pathCost = 4; + INT8U LQIIn = 5; + INT8U LQIOut = 6; + INT8U age = 7; + BOOLEAN allocated = 8; + BOOLEAN linkEstablished = 9; } struct SecurityPolicy { - INT16U rotationTime = 1; - BITMAP16 flags = 2; + INT16U rotationTime = 0; + BITMAP16 flags = 1; } struct OperationalDatasetComponents { - BOOLEAN activeTimestampPresent = 1; - BOOLEAN pendingTimestampPresent = 2; - BOOLEAN masterKeyPresent = 3; - BOOLEAN networkNamePresent = 4; - BOOLEAN extendedPanIdPresent = 5; - BOOLEAN meshLocalPrefixPresent = 6; - BOOLEAN delayPresent = 7; - BOOLEAN panIdPresent = 8; - BOOLEAN channelPresent = 9; - BOOLEAN pskcPresent = 10; - BOOLEAN securityPolicyPresent = 11; - BOOLEAN channelMaskPresent = 12; + BOOLEAN activeTimestampPresent = 0; + BOOLEAN pendingTimestampPresent = 1; + BOOLEAN masterKeyPresent = 2; + BOOLEAN networkNamePresent = 3; + BOOLEAN extendedPanIdPresent = 4; + BOOLEAN meshLocalPrefixPresent = 5; + BOOLEAN delayPresent = 6; + BOOLEAN panIdPresent = 7; + BOOLEAN channelPresent = 8; + BOOLEAN pskcPresent = 9; + BOOLEAN securityPolicyPresent = 10; + BOOLEAN channelMaskPresent = 11; } info event ConnectionStatus = 0 { @@ -3204,22 +3211,22 @@ client cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster WiFiNetworkDiagnostics = 54 { @@ -3279,9 +3286,9 @@ client cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } @@ -3305,9 +3312,9 @@ client cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 482e0223506022..f0bf6fbcaa7517 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -6139,6 +6139,21 @@ } ], "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "fabrics list", "code": 1, @@ -6229,6 +6244,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index d295e248dbbdf5..1d80c1906e923a 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -733,6 +733,8 @@ typedef void (*CHIPOperationalCredentialsClusterNOCResponseCallbackType)( typedef void (*CHIPOperationalCredentialsClusterOpCSRResponseCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterNOCsAttributeCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Attributes::NOCs::TypeInfo::DecodableType &); typedef void (*CHIPOperationalCredentialsClusterFabricsListAttributeCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Attributes::FabricsList::TypeInfo::DecodableType &); typedef void (*CHIPOperationalCredentialsClusterSupportedFabricsAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index 6a33054bc7d72e..c616359d6a1b60 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -10800,6 +10800,42 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readClusterRevisionAttribute) onFailure.release(); } +JNI_METHOD(void, OperationalCredentialsCluster, readNOCsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::NOCs::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OperationalCredentialsCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, OperationalCredentialsCluster, readFabricsListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index ddf7dfa5ba8e37..95e39a8076ad99 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -8174,6 +8174,137 @@ void CHIPOnOffSwitchConfigurationAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$OperationalCredentialsCluster$NOCsAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$OperationalCredentialsCluster$NOCsAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;[B[B)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find NOCsAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + chip::FabricIndex fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool nocNull = false; + bool nocHasValue = true; + + chip::ByteSpan nocValue = entry.noc; + + jbyteArray noc = nullptr; + if (!nocNull && nocHasValue) + { + noc = env->NewByteArray(nocValue.size()); + env->SetByteArrayRegion(noc, 0, nocValue.size(), reinterpret_cast(nocValue.data())); + } + + bool icacNull = false; + bool icacHasValue = true; + + chip::ByteSpan icacValue = entry.icac; + + jbyteArray icac = nullptr; + if (!icacNull && icacHasValue) + { + icac = env->NewByteArray(icacValue.size()); + env->SetByteArrayRegion(icac, 0, icacValue.size(), reinterpret_cast(icacValue.data())); + } + + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, noc, icac); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create NOCsAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + } + VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding NOCsAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), @@ -8259,7 +8390,7 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( bool fabricIndexNull = false; bool fabricIndexHasValue = true; - uint8_t fabricIndexValue = entry.fabricIndex; + chip::FabricIndex fabricIndexValue = entry.fabricIndex; jobject fabricIndex = nullptr; if (!fabricIndexNull && fabricIndexHasValue) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 11baa808a14808..9cbc0f40ac76e0 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -2825,6 +2825,39 @@ class CHIPOnOffSwitchConfigurationAttributeListAttributeCallback bool keepAlive; }; +class CHIPOperationalCredentialsNOCsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPOperationalCredentialsNOCsAttributeCallback(); + + static void maybeDestroy(CHIPOperationalCredentialsNOCsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPOperationalCredentialsFabricsListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 0c0a20087a6019..3ccf41825d1d7c 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -9838,6 +9838,44 @@ public interface OpCSRResponseCallback { void onError(Exception error); } + public static class NOCsAttribute { + public Integer fabricIndex; + public byte[] noc; + public byte[] icac; + + public NOCsAttribute(Integer fabricIndex, byte[] noc, byte[] icac) { + this.fabricIndex = fabricIndex; + this.noc = noc; + this.icac = icac; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); + output.append("\n"); + + output.append("byte[] "); + output.append(Arrays.toString(noc)); + output.append("\n"); + + output.append("byte[] "); + output.append(Arrays.toString(icac)); + output.append("\n"); + + return output.toString(); + } + } + + public interface NOCsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public static class FabricsListAttribute { public Integer fabricIndex; public byte[] rootPublicKey; @@ -9924,6 +9962,10 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished() {} } + public void readNOCsAttribute(NOCsAttributeCallback callback) { + readNOCsAttribute(chipClusterPtr, callback); + } + public void readFabricsListAttribute(FabricsListAttributeCallback callback) { readFabricsListAttribute(chipClusterPtr, callback); } @@ -9973,6 +10015,8 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + private native void readNOCsAttribute(long chipClusterPtr, NOCsAttributeCallback callback); + private native void readFabricsListAttribute( long chipClusterPtr, FabricsListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 0d7e27d584b738..200d72746744e9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -2767,6 +2767,34 @@ public void onError(Exception error) { } } + public static class DelegatedOperationalCredentialsClusterNOCsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedOperationalCredentialsClusterFabricsListAttributeCallback implements ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback, DelegatedClusterCallback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 5ff4ce3b2470aa..1485c805c5f3b2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -4147,6 +4147,21 @@ public Map> getReadAttributeMap() { readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo); readAttributeMap.put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo); Map readOperationalCredentialsInteractionInfo = new LinkedHashMap<>(); + Map readOperationalCredentialsNOCsCommandParams = + new LinkedHashMap(); + InteractionInfo readOperationalCredentialsNOCsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .readNOCsAttribute( + (ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedOperationalCredentialsClusterNOCsAttributeCallback(), + readOperationalCredentialsNOCsCommandParams); + readOperationalCredentialsInteractionInfo.put( + "readNOCsAttribute", readOperationalCredentialsNOCsAttributeInteractionInfo); Map readOperationalCredentialsFabricsListCommandParams = new LinkedHashMap(); InteractionInfo readOperationalCredentialsFabricsListAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 37d158c20d8c85..0677aec9022146 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3317,6 +3317,11 @@ class ChipClusters: }, }, "attributes": { + 0x00000000: { + "attributeName": "NOCs", + "attributeId": 0x00000000, + "type": "", + }, 0x00000001: { "attributeName": "FabricsList", "attributeId": 0x00000001, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index bf0b7d22cfce3a..f5d675ce4aba73 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -1839,9 +1839,9 @@ class SceneExtensionFieldSet(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="clusterId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="length", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="value", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="length", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=uint), ]) clusterId: 'uint' = 0 @@ -3924,10 +3924,10 @@ class PowerProfileRecord(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="powerProfileId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="powerProfileRemoteControl", Tag=3, Type=bool), - ClusterObjectFieldDescriptor(Label="powerProfileState", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="powerProfileId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="powerProfileRemoteControl", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="powerProfileState", Tag=3, Type=uint), ]) powerProfileId: 'uint' = 0 @@ -3941,8 +3941,8 @@ class ScheduledPhase(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="scheduledTime", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="scheduledTime", Tag=1, Type=uint), ]) energyPhaseId: 'uint' = 0 @@ -3954,12 +3954,12 @@ class TransferredPhase(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="macroPhaseId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="expectedDuration", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="peakPower", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="energy", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="maxActivationDelay", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="energyPhaseId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="macroPhaseId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="expectedDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="peakPower", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="energy", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="maxActivationDelay", Tag=5, Type=uint), ]) energyPhaseId: 'uint' = 0 @@ -4869,8 +4869,8 @@ class DeviceType(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="type", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="revision", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="type", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="revision", Tag=1, Type=uint), ]) type: 'uint' = 0 @@ -5297,17 +5297,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), - ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.AccessControlEntry), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=typing.Union[Nullable, AccessControl.Structs.AccessControlEntry]), ]) adminFabricIndex: 'uint' = 0 - adminNodeID: 'uint' = 0 - adminPasscodeID: 'uint' = 0 + adminNodeID: 'typing.Union[Nullable, uint]' = NullValue + adminPasscodeID: 'typing.Union[Nullable, uint]' = NullValue changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 - latestValue: 'AccessControl.Structs.AccessControlEntry' = field(default_factory=lambda: AccessControl.Structs.AccessControlEntry()) + latestValue: 'typing.Union[Nullable, AccessControl.Structs.AccessControlEntry]' = NullValue @dataclass class AccessControlExtensionChanged(ClusterEvent): @@ -5324,17 +5324,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), - ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.ExtensionEntry), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=typing.Union[Nullable, AccessControl.Structs.ExtensionEntry]), ]) adminFabricIndex: 'uint' = 0 - adminNodeID: 'uint' = 0 - adminPasscodeID: 'uint' = 0 + adminNodeID: 'typing.Union[Nullable, uint]' = NullValue + adminPasscodeID: 'typing.Union[Nullable, uint]' = NullValue changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 - latestValue: 'AccessControl.Structs.ExtensionEntry' = field(default_factory=lambda: AccessControl.Structs.ExtensionEntry()) + latestValue: 'typing.Union[Nullable, AccessControl.Structs.ExtensionEntry]' = NullValue @dataclass @@ -5664,12 +5664,12 @@ class ActionStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="actionID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="type", Tag=3, Type=BridgedActions.Enums.ActionTypeEnum), - ClusterObjectFieldDescriptor(Label="endpointListID", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="supportedCommands", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="status", Tag=6, Type=BridgedActions.Enums.ActionStateEnum), + ClusterObjectFieldDescriptor(Label="actionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="type", Tag=2, Type=BridgedActions.Enums.ActionTypeEnum), + ClusterObjectFieldDescriptor(Label="endpointListID", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="supportedCommands", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="status", Tag=5, Type=BridgedActions.Enums.ActionStateEnum), ]) actionID: 'uint' = 0 @@ -5685,10 +5685,10 @@ class EndpointListStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="endpointListID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="type", Tag=3, Type=BridgedActions.Enums.EndpointListTypeEnum), - ClusterObjectFieldDescriptor(Label="endpoints", Tag=4, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="endpointListID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="type", Tag=2, Type=BridgedActions.Enums.EndpointListTypeEnum), + ClusterObjectFieldDescriptor(Label="endpoints", Tag=3, Type=typing.List[uint]), ]) endpointListID: 'uint' = 0 @@ -7031,13 +7031,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="bytesDownloaded", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="progressPercent", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="progressPercent", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="platformCode", Tag=3, Type=typing.Union[Nullable, int]), ]) softwareVersion: 'uint' = 0 bytesDownloaded: 'uint' = 0 - progressPercent: 'uint' = 0 + progressPercent: 'typing.Union[Nullable, uint]' = NullValue platformCode: 'typing.Union[Nullable, int]' = NullValue @@ -8055,7 +8055,7 @@ class BasicCommissioningInfoType(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="failSafeExpiryLengthMs", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="failSafeExpiryLengthMs", Tag=0, Type=uint), ]) failSafeExpiryLengthMs: 'uint' = 0 @@ -8347,8 +8347,8 @@ class NetworkInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="networkID", Tag=1, Type=bytes), - ClusterObjectFieldDescriptor(Label="connected", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="networkID", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="connected", Tag=1, Type=bool), ]) networkID: 'bytes' = b"" @@ -8360,14 +8360,14 @@ class ThreadInterfaceScanResult(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="panId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="extendedPanId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="networkName", Tag=3, Type=str), - ClusterObjectFieldDescriptor(Label="channel", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="version", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="extendedAddress", Tag=6, Type=uint), - ClusterObjectFieldDescriptor(Label="rssi", Tag=7, Type=int), - ClusterObjectFieldDescriptor(Label="lqi", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="panId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="extendedPanId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="networkName", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="channel", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="version", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="extendedAddress", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="rssi", Tag=6, Type=int), + ClusterObjectFieldDescriptor(Label="lqi", Tag=7, Type=uint), ]) panId: 'uint' = 0 @@ -8385,12 +8385,12 @@ class WiFiInterfaceScanResult(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="security", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="ssid", Tag=2, Type=bytes), - ClusterObjectFieldDescriptor(Label="bssid", Tag=3, Type=bytes), - ClusterObjectFieldDescriptor(Label="channel", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="wiFiBand", Tag=5, Type=NetworkCommissioning.Enums.WiFiBand), - ClusterObjectFieldDescriptor(Label="rssi", Tag=6, Type=int), + ClusterObjectFieldDescriptor(Label="security", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="ssid", Tag=1, Type=bytes), + ClusterObjectFieldDescriptor(Label="bssid", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="channel", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="wiFiBand", Tag=4, Type=NetworkCommissioning.Enums.WiFiBand), + ClusterObjectFieldDescriptor(Label="rssi", Tag=5, Type=int), ]) security: 'uint' = 0 @@ -8961,12 +8961,12 @@ class NetworkInterfaceType(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="fabricConnected", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv4", Tag=3, Type=bool), - ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv6", Tag=4, Type=bool), - ClusterObjectFieldDescriptor(Label="hardwareAddress", Tag=5, Type=bytes), - ClusterObjectFieldDescriptor(Label="type", Tag=6, Type=GeneralDiagnostics.Enums.InterfaceType), + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="fabricConnected", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv4", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv6", Tag=3, Type=bool), + ClusterObjectFieldDescriptor(Label="hardwareAddress", Tag=4, Type=bytes), + ClusterObjectFieldDescriptor(Label="type", Tag=5, Type=GeneralDiagnostics.Enums.InterfaceType), ]) name: 'str' = "" @@ -9274,9 +9274,9 @@ class SoftwareFault(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="faultRecording", Tag=3, Type=bytes), + ClusterObjectFieldDescriptor(Label="id", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="faultRecording", Tag=2, Type=bytes), ]) id: 'uint' = 0 @@ -9289,11 +9289,11 @@ class ThreadMetrics(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="stackFreeCurrent", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="stackFreeMinimum", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="stackSize", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="id", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="stackFreeCurrent", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="stackFreeMinimum", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="stackSize", Tag=4, Type=uint), ]) id: 'uint' = 0 @@ -9625,20 +9625,20 @@ class NeighborTable(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="extAddress", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="age", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="rloc16", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="linkFrameCounter", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="mleFrameCounter", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="lqi", Tag=6, Type=uint), - ClusterObjectFieldDescriptor(Label="averageRssi", Tag=7, Type=int), - ClusterObjectFieldDescriptor(Label="lastRssi", Tag=8, Type=int), - ClusterObjectFieldDescriptor(Label="frameErrorRate", Tag=9, Type=uint), - ClusterObjectFieldDescriptor(Label="messageErrorRate", Tag=10, Type=uint), - ClusterObjectFieldDescriptor(Label="rxOnWhenIdle", Tag=11, Type=bool), - ClusterObjectFieldDescriptor(Label="fullThreadDevice", Tag=12, Type=bool), - ClusterObjectFieldDescriptor(Label="fullNetworkData", Tag=13, Type=bool), - ClusterObjectFieldDescriptor(Label="isChild", Tag=14, Type=bool), + ClusterObjectFieldDescriptor(Label="extAddress", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="age", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="rloc16", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="linkFrameCounter", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="mleFrameCounter", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="lqi", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="averageRssi", Tag=6, Type=int), + ClusterObjectFieldDescriptor(Label="lastRssi", Tag=7, Type=int), + ClusterObjectFieldDescriptor(Label="frameErrorRate", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="messageErrorRate", Tag=9, Type=uint), + ClusterObjectFieldDescriptor(Label="rxOnWhenIdle", Tag=10, Type=bool), + ClusterObjectFieldDescriptor(Label="fullThreadDevice", Tag=11, Type=bool), + ClusterObjectFieldDescriptor(Label="fullNetworkData", Tag=12, Type=bool), + ClusterObjectFieldDescriptor(Label="isChild", Tag=13, Type=bool), ]) extAddress: 'uint' = 0 @@ -9662,18 +9662,18 @@ class OperationalDatasetComponents(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="activeTimestampPresent", Tag=1, Type=bool), - ClusterObjectFieldDescriptor(Label="pendingTimestampPresent", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="masterKeyPresent", Tag=3, Type=bool), - ClusterObjectFieldDescriptor(Label="networkNamePresent", Tag=4, Type=bool), - ClusterObjectFieldDescriptor(Label="extendedPanIdPresent", Tag=5, Type=bool), - ClusterObjectFieldDescriptor(Label="meshLocalPrefixPresent", Tag=6, Type=bool), - ClusterObjectFieldDescriptor(Label="delayPresent", Tag=7, Type=bool), - ClusterObjectFieldDescriptor(Label="panIdPresent", Tag=8, Type=bool), - ClusterObjectFieldDescriptor(Label="channelPresent", Tag=9, Type=bool), - ClusterObjectFieldDescriptor(Label="pskcPresent", Tag=10, Type=bool), - ClusterObjectFieldDescriptor(Label="securityPolicyPresent", Tag=11, Type=bool), - ClusterObjectFieldDescriptor(Label="channelMaskPresent", Tag=12, Type=bool), + ClusterObjectFieldDescriptor(Label="activeTimestampPresent", Tag=0, Type=bool), + ClusterObjectFieldDescriptor(Label="pendingTimestampPresent", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="masterKeyPresent", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="networkNamePresent", Tag=3, Type=bool), + ClusterObjectFieldDescriptor(Label="extendedPanIdPresent", Tag=4, Type=bool), + ClusterObjectFieldDescriptor(Label="meshLocalPrefixPresent", Tag=5, Type=bool), + ClusterObjectFieldDescriptor(Label="delayPresent", Tag=6, Type=bool), + ClusterObjectFieldDescriptor(Label="panIdPresent", Tag=7, Type=bool), + ClusterObjectFieldDescriptor(Label="channelPresent", Tag=8, Type=bool), + ClusterObjectFieldDescriptor(Label="pskcPresent", Tag=9, Type=bool), + ClusterObjectFieldDescriptor(Label="securityPolicyPresent", Tag=10, Type=bool), + ClusterObjectFieldDescriptor(Label="channelMaskPresent", Tag=11, Type=bool), ]) activeTimestampPresent: 'bool' = False @@ -9695,16 +9695,16 @@ class RouteTable(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="extAddress", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="rloc16", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="routerId", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="nextHop", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="pathCost", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="LQIIn", Tag=6, Type=uint), - ClusterObjectFieldDescriptor(Label="LQIOut", Tag=7, Type=uint), - ClusterObjectFieldDescriptor(Label="age", Tag=8, Type=uint), - ClusterObjectFieldDescriptor(Label="allocated", Tag=9, Type=bool), - ClusterObjectFieldDescriptor(Label="linkEstablished", Tag=10, Type=bool), + ClusterObjectFieldDescriptor(Label="extAddress", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="rloc16", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="routerId", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="nextHop", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="pathCost", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="LQIIn", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="LQIOut", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="age", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="allocated", Tag=8, Type=bool), + ClusterObjectFieldDescriptor(Label="linkEstablished", Tag=9, Type=bool), ]) extAddress: 'uint' = 0 @@ -9724,8 +9724,8 @@ class SecurityPolicy(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="rotationTime", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="flags", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="rotationTime", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="flags", Tag=1, Type=uint), ]) rotationTime: 'uint' = 0 @@ -12419,6 +12419,7 @@ class OperationalCredentials(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ + ClusterObjectFieldDescriptor(Label="NOCs", Tag=0x00000000, Type=typing.List[OperationalCredentials.Structs.NOCStruct]), ClusterObjectFieldDescriptor(Label="fabricsList", Tag=0x00000001, Type=typing.List[OperationalCredentials.Structs.FabricDescriptor]), ClusterObjectFieldDescriptor(Label="supportedFabrics", Tag=0x00000002, Type=uint), ClusterObjectFieldDescriptor(Label="commissionedFabrics", Tag=0x00000003, Type=uint), @@ -12429,6 +12430,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) + NOCs: 'typing.List[OperationalCredentials.Structs.NOCStruct]' = None fabricsList: 'typing.List[OperationalCredentials.Structs.FabricDescriptor]' = None supportedFabrics: 'uint' = None commissionedFabrics: 'uint' = None @@ -12459,12 +12461,12 @@ class FabricDescriptor(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="rootPublicKey", Tag=2, Type=bytes), - ClusterObjectFieldDescriptor(Label="vendorId", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="fabricId", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="nodeId", Tag=5, Type=uint), - ClusterObjectFieldDescriptor(Label="label", Tag=6, Type=str), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="rootPublicKey", Tag=1, Type=bytes), + ClusterObjectFieldDescriptor(Label="vendorId", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="fabricId", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="nodeId", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="label", Tag=5, Type=str), ]) fabricIndex: 'uint' = 0 @@ -12480,12 +12482,14 @@ class NOCStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="noc", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="noc", Tag=1, Type=bytes), + ClusterObjectFieldDescriptor(Label="icac", Tag=2, Type=bytes), ]) fabricIndex: 'uint' = 0 noc: 'bytes' = b"" + icac: 'bytes' = b"" @@ -12705,6 +12709,22 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Attributes: + @dataclass + class NOCs(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003E + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[OperationalCredentials.Structs.NOCStruct]) + + value: 'typing.List[OperationalCredentials.Structs.NOCStruct]' = field(default_factory=lambda: []) + @dataclass class FabricsList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -13160,8 +13180,8 @@ class LabelStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="label", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=str), ]) label: 'str' = "" @@ -13264,8 +13284,8 @@ class LabelStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="label", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=str), ]) label: 'str' = "" @@ -13698,9 +13718,9 @@ class ModeOptionStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="label", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="mode", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="semanticTag", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="semanticTag", Tag=2, Type=uint), ]) label: 'str' = "" @@ -13713,8 +13733,8 @@ class SemanticTag(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="mfgCode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), ]) mfgCode: 'uint' = 0 @@ -14319,8 +14339,8 @@ class DlCredential(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="credentialType", Tag=1, Type=DoorLock.Enums.DlCredentialType), - ClusterObjectFieldDescriptor(Label="credentialIndex", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="credentialType", Tag=0, Type=DoorLock.Enums.DlCredentialType), + ClusterObjectFieldDescriptor(Label="credentialIndex", Tag=1, Type=uint), ]) credentialType: 'DoorLock.Enums.DlCredentialType' = 0 @@ -26817,8 +26837,8 @@ class IasAceZoneStatusResult(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="zoneId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="zoneStatus", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="zoneId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="zoneStatus", Tag=1, Type=uint), ]) zoneId: 'uint' = 0 @@ -27482,11 +27502,11 @@ class ChannelInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="majorNumber", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="minorNumber", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=3, Type=str), - ClusterObjectFieldDescriptor(Label="callSign", Tag=4, Type=str), - ClusterObjectFieldDescriptor(Label="affiliateCallSign", Tag=5, Type=str), + ClusterObjectFieldDescriptor(Label="majorNumber", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="minorNumber", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="callSign", Tag=3, Type=str), + ClusterObjectFieldDescriptor(Label="affiliateCallSign", Tag=4, Type=str), ]) majorNumber: 'uint' = 0 @@ -27501,10 +27521,10 @@ class LineupInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="operatorName", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="lineupName", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="postalCode", Tag=3, Type=str), - ClusterObjectFieldDescriptor(Label="lineupInfoType", Tag=4, Type=Channel.Enums.LineupInfoTypeEnum), + ClusterObjectFieldDescriptor(Label="operatorName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="lineupName", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="postalCode", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="lineupInfoType", Tag=3, Type=Channel.Enums.LineupInfoTypeEnum), ]) operatorName: 'str' = "" @@ -27714,8 +27734,8 @@ class TargetInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="identifier", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="identifier", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), ]) identifier: 'uint' = 0 @@ -27896,8 +27916,8 @@ class PlaybackPosition(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="updatedAt", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="position", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="updatedAt", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="position", Tag=1, Type=uint), ]) updatedAt: 'uint' = 0 @@ -28278,10 +28298,10 @@ class InputInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="index", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="inputType", Tag=2, Type=MediaInput.Enums.InputTypeEnum), - ClusterObjectFieldDescriptor(Label="name", Tag=3, Type=str), - ClusterObjectFieldDescriptor(Label="description", Tag=4, Type=str), + ClusterObjectFieldDescriptor(Label="index", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="inputType", Tag=1, Type=MediaInput.Enums.InputTypeEnum), + ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="description", Tag=3, Type=str), ]) index: 'uint' = 0 @@ -28769,9 +28789,9 @@ class Dimension(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="width", Tag=1, Type=float), - ClusterObjectFieldDescriptor(Label="height", Tag=2, Type=float), - ClusterObjectFieldDescriptor(Label="metric", Tag=3, Type=ContentLauncher.Enums.MetricTypeEnum), + ClusterObjectFieldDescriptor(Label="width", Tag=0, Type=float), + ClusterObjectFieldDescriptor(Label="height", Tag=1, Type=float), + ClusterObjectFieldDescriptor(Label="metric", Tag=2, Type=ContentLauncher.Enums.MetricTypeEnum), ]) width: 'float' = 0.0 @@ -28784,8 +28804,8 @@ class AdditionalInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=str), ]) name: 'str' = "" @@ -28797,9 +28817,9 @@ class Parameter(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="type", Tag=1, Type=ContentLauncher.Enums.ParameterEnum), - ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="externalIDList", Tag=3, Type=typing.List[ContentLauncher.Structs.AdditionalInfo]), + ClusterObjectFieldDescriptor(Label="type", Tag=0, Type=ContentLauncher.Enums.ParameterEnum), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=2, Type=typing.List[ContentLauncher.Structs.AdditionalInfo]), ]) type: 'ContentLauncher.Enums.ParameterEnum' = 0 @@ -28812,7 +28832,7 @@ class ContentSearch(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="parameterList", Tag=1, Type=typing.List[ContentLauncher.Structs.Parameter]), + ClusterObjectFieldDescriptor(Label="parameterList", Tag=0, Type=typing.List[ContentLauncher.Structs.Parameter]), ]) parameterList: 'typing.List[ContentLauncher.Structs.Parameter]' = field(default_factory=lambda: []) @@ -28823,9 +28843,9 @@ class StyleInformation(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="imageUrl", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="color", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="size", Tag=3, Type=ContentLauncher.Structs.Dimension), + ClusterObjectFieldDescriptor(Label="imageUrl", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="color", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="size", Tag=2, Type=ContentLauncher.Structs.Dimension), ]) imageUrl: 'str' = "" @@ -28838,12 +28858,12 @@ class BrandingInformation(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="providerName", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="background", Tag=2, Type=ContentLauncher.Structs.StyleInformation), - ClusterObjectFieldDescriptor(Label="logo", Tag=3, Type=ContentLauncher.Structs.StyleInformation), - ClusterObjectFieldDescriptor(Label="progressBar", Tag=4, Type=ContentLauncher.Structs.StyleInformation), - ClusterObjectFieldDescriptor(Label="splash", Tag=5, Type=ContentLauncher.Structs.StyleInformation), - ClusterObjectFieldDescriptor(Label="waterMark", Tag=6, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="providerName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="background", Tag=1, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="logo", Tag=2, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="progressBar", Tag=3, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="splash", Tag=4, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="waterMark", Tag=5, Type=ContentLauncher.Structs.StyleInformation), ]) providerName: 'str' = "" @@ -29033,9 +29053,9 @@ class OutputInfo(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="index", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="outputType", Tag=2, Type=AudioOutput.Enums.OutputTypeEnum), - ClusterObjectFieldDescriptor(Label="name", Tag=3, Type=str), + ClusterObjectFieldDescriptor(Label="index", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="outputType", Tag=1, Type=AudioOutput.Enums.OutputTypeEnum), + ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=str), ]) index: 'uint' = 0 @@ -29196,8 +29216,8 @@ class ApplicationLauncherApplication(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationId", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="applicationId", Tag=1, Type=str), ]) catalogVendorId: 'uint' = 0 @@ -29209,8 +29229,8 @@ class ApplicationEP(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=1, Type=ApplicationLauncher.Structs.ApplicationLauncherApplication), - ClusterObjectFieldDescriptor(Label="endpoint", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.ApplicationLauncherApplication), + ClusterObjectFieldDescriptor(Label="endpoint", Tag=1, Type=str), ]) application: 'ApplicationLauncher.Structs.ApplicationLauncherApplication' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherApplication()) @@ -29415,8 +29435,8 @@ class ApplicationBasicApplication(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationId", Tag=2, Type=str), + ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="applicationId", Tag=1, Type=str), ]) catalogVendorId: 'uint' = 0 @@ -29936,14 +29956,14 @@ class SimpleStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="a", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="b", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="c", Tag=3, Type=TestCluster.Enums.SimpleEnum), - ClusterObjectFieldDescriptor(Label="d", Tag=4, Type=bytes), - ClusterObjectFieldDescriptor(Label="e", Tag=5, Type=str), - ClusterObjectFieldDescriptor(Label="f", Tag=6, Type=uint), - ClusterObjectFieldDescriptor(Label="g", Tag=7, Type=float), - ClusterObjectFieldDescriptor(Label="h", Tag=8, Type=float), + ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="b", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="c", Tag=2, Type=TestCluster.Enums.SimpleEnum), + ClusterObjectFieldDescriptor(Label="d", Tag=3, Type=bytes), + ClusterObjectFieldDescriptor(Label="e", Tag=4, Type=str), + ClusterObjectFieldDescriptor(Label="f", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="g", Tag=6, Type=float), + ClusterObjectFieldDescriptor(Label="h", Tag=7, Type=float), ]) a: 'uint' = 0 @@ -29961,18 +29981,18 @@ class NullablesAndOptionalsStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="nullableInt", Tag=1, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="optionalInt", Tag=2, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="nullableOptionalInt", Tag=3, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="nullableString", Tag=4, Type=typing.Union[Nullable, str]), - ClusterObjectFieldDescriptor(Label="optionalString", Tag=5, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="nullableOptionalString", Tag=6, Type=typing.Union[None, Nullable, str]), - ClusterObjectFieldDescriptor(Label="nullableStruct", Tag=7, Type=typing.Union[Nullable, TestCluster.Structs.SimpleStruct]), - ClusterObjectFieldDescriptor(Label="optionalStruct", Tag=8, Type=typing.Optional[TestCluster.Structs.SimpleStruct]), - ClusterObjectFieldDescriptor(Label="nullableOptionalStruct", Tag=9, Type=typing.Union[None, Nullable, TestCluster.Structs.SimpleStruct]), - ClusterObjectFieldDescriptor(Label="nullableList", Tag=10, Type=typing.Union[Nullable, typing.List[TestCluster.Enums.SimpleEnum]]), - ClusterObjectFieldDescriptor(Label="optionalList", Tag=11, Type=typing.Optional[typing.List[TestCluster.Enums.SimpleEnum]]), - ClusterObjectFieldDescriptor(Label="nullableOptionalList", Tag=12, Type=typing.Union[None, Nullable, typing.List[TestCluster.Enums.SimpleEnum]]), + ClusterObjectFieldDescriptor(Label="nullableInt", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="optionalInt", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="nullableOptionalInt", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="nullableString", Tag=3, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="optionalString", Tag=4, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="nullableOptionalString", Tag=5, Type=typing.Union[None, Nullable, str]), + ClusterObjectFieldDescriptor(Label="nullableStruct", Tag=6, Type=typing.Union[Nullable, TestCluster.Structs.SimpleStruct]), + ClusterObjectFieldDescriptor(Label="optionalStruct", Tag=7, Type=typing.Optional[TestCluster.Structs.SimpleStruct]), + ClusterObjectFieldDescriptor(Label="nullableOptionalStruct", Tag=8, Type=typing.Union[None, Nullable, TestCluster.Structs.SimpleStruct]), + ClusterObjectFieldDescriptor(Label="nullableList", Tag=9, Type=typing.Union[Nullable, typing.List[TestCluster.Enums.SimpleEnum]]), + ClusterObjectFieldDescriptor(Label="optionalList", Tag=10, Type=typing.Optional[typing.List[TestCluster.Enums.SimpleEnum]]), + ClusterObjectFieldDescriptor(Label="nullableOptionalList", Tag=11, Type=typing.Union[None, Nullable, typing.List[TestCluster.Enums.SimpleEnum]]), ]) nullableInt: 'typing.Union[Nullable, uint]' = NullValue @@ -29994,9 +30014,9 @@ class NestedStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="a", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="b", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="c", Tag=3, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="b", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="c", Tag=2, Type=TestCluster.Structs.SimpleStruct), ]) a: 'uint' = 0 @@ -30009,13 +30029,13 @@ class NestedStructList(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="a", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="b", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="c", Tag=3, Type=TestCluster.Structs.SimpleStruct), - ClusterObjectFieldDescriptor(Label="d", Tag=4, Type=typing.List[TestCluster.Structs.SimpleStruct]), - ClusterObjectFieldDescriptor(Label="e", Tag=5, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="f", Tag=6, Type=typing.List[bytes]), - ClusterObjectFieldDescriptor(Label="g", Tag=7, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="b", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="c", Tag=2, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor(Label="d", Tag=3, Type=typing.List[TestCluster.Structs.SimpleStruct]), + ClusterObjectFieldDescriptor(Label="e", Tag=4, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="f", Tag=5, Type=typing.List[bytes]), + ClusterObjectFieldDescriptor(Label="g", Tag=6, Type=typing.List[uint]), ]) a: 'uint' = 0 @@ -30032,7 +30052,7 @@ class DoubleNestedStructList(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="a", Tag=1, Type=typing.List[TestCluster.Structs.NestedStructList]), + ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=typing.List[TestCluster.Structs.NestedStructList]), ]) a: 'typing.List[TestCluster.Structs.NestedStructList]' = field(default_factory=lambda: []) @@ -30043,8 +30063,8 @@ class TestListStructOctet(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="operationalCert", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalCert", Tag=1, Type=bytes), ]) fabricIndex: 'uint' = 0 diff --git a/src/controller/python/chip/clusters/attribute.cpp b/src/controller/python/chip/clusters/attribute.cpp index 2953ae06651270..465448437aa7ee 100644 --- a/src/controller/python/chip/clusters/attribute.cpp +++ b/src/controller/python/chip/clusters/attribute.cpp @@ -213,7 +213,7 @@ class WriteClientCallback : public WriteClient::Callback void OnDone(WriteClient * apWriteClient) override { gOnWriteDoneCallback(mAppContext); - // delete apWriteClient; + delete apWriteClient; delete this; }; @@ -256,14 +256,14 @@ chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContex CHIP_ERROR err = CHIP_NO_ERROR; std::unique_ptr callback = std::make_unique(appContext); - app::WriteClientHandle client; + std::unique_ptr client = std::make_unique( + app::InteractionModelEngine::GetInstance()->GetExchangeManager(), callback.get(), + timedWriteTimeoutMs != 0 ? Optional(timedWriteTimeoutMs) : Optional::Missing()); va_list args; va_start(args, n); - SuccessOrExit(err = app::InteractionModelEngine::GetInstance()->NewWriteClient( - client, callback.get(), - timedWriteTimeoutMs != 0 ? Optional(timedWriteTimeoutMs) : Optional::Missing())); + VerifyOrExit(device != nullptr && device->GetSecureSession().HasValue(), err = CHIP_ERROR_INCORRECT_STATE); { for (size_t i = 0; i < n; i++) @@ -292,8 +292,9 @@ chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContex } } - SuccessOrExit(err = device->SendWriteAttributeRequest(std::move(client), nullptr, nullptr)); + SuccessOrExit(err = client->SendWriteRequest(device->GetSecureSession().Value())); + client.release(); callback.release(); exit: diff --git a/src/controller/python/chip/native/StackInit.cpp b/src/controller/python/chip/native/StackInit.cpp index e438972ca2229a..3d071d1b4d8f22 100644 --- a/src/controller/python/chip/native/StackInit.cpp +++ b/src/controller/python/chip/native/StackInit.cpp @@ -80,8 +80,10 @@ void pychip_native_init() { ChipLogError(DeviceLayer, "Failed to initialize CHIP stack: platform init failed: %s", chip::ErrorStr(err)); } - int result = pthread_create(&sPlatformMainThread, nullptr, PlatformMainLoop, nullptr); + int result = pthread_create(&sPlatformMainThread, nullptr, PlatformMainLoop, nullptr); +#if CHIP_ERROR_LOGGING int tmpErrno = errno; +#endif // CHIP_ERROR_LOGGING if (result != 0) { diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index 7457b2f4b28e55..02f984666f8914 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -200,13 +200,13 @@ class DLL_EXPORT FabricInfo return CHIP_NO_ERROR; } - CHIP_ERROR GetICACert(ByteSpan & cert) + CHIP_ERROR GetICACert(ByteSpan & cert) const { cert = mICACert; return CHIP_NO_ERROR; } - CHIP_ERROR GetNOCCert(ByteSpan & cert) + CHIP_ERROR GetNOCCert(ByteSpan & cert) const { ReturnErrorCodeIf(mNOCCert.empty(), CHIP_ERROR_INCORRECT_STATE); cert = mNOCCert; diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index b36d5467106fb5..ac65c77fd9d8db 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -97,6 +97,7 @@ static void _logSSLError() unsigned long ssl_err_code = ERR_get_error(); while (ssl_err_code != 0) { +#if CHIP_ERROR_LOGGING const char * err_str_lib = ERR_lib_error_string(ssl_err_code); const char * err_str_routine = ERR_func_error_string(ssl_err_code); const char * err_str_reason = ERR_reason_error_string(ssl_err_code); @@ -104,6 +105,7 @@ static void _logSSLError() { ChipLogError(Crypto, " ssl err %s %s %s\n", err_str_lib, err_str_routine, err_str_reason); } +#endif // CHIP_ERROR_LOGGING ssl_err_code = ERR_get_error(); } } diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m index df63c6978e8aec..4e2ee4ba58bad8 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m @@ -628,62 +628,31 @@ - (void)retrieveAndSendWiFiCredentials } NSLog(@"New SSID: %@ Password: %@", networkSSID.text, networkPassword.text); - [strongSelf addOrUpdateWiFiNetwork:networkSSID.text password:networkPassword.text]; + [strongSelf commissionWithSSID:networkSSID.text password:networkPassword.text]; } }]]; [self presentViewController:alertController animated:YES completion:nil]; } -- (void)addOrUpdateWiFiNetwork:(NSString *)ssid password:(NSString *)password +- (void)commissionWithSSID:(NSString *)ssid password:(NSString *)password { - CHIPDevice * chipDevice = CHIPGetDeviceBeingCommissioned(); - if (chipDevice) { - self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; - params.ssid = [ssid dataUsingEncoding:NSUTF8StringEncoding]; - params.credentials = [password dataUsingEncoding:NSUTF8StringEncoding]; - params.breadcrumb = @(0); - - __weak typeof(self) weakSelf = self; - [self->_cluster - addOrUpdateWiFiNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable response, - NSError * _Nullable error) { - // TODO: addWiFiNetworkWithParams - // returns status in its response, - // not via the NSError! - [weakSelf onAddNetworkResponse:error isWiFi:YES]; - }]; - } else { - NSLog(@"Status: Failed to find a device being commissioned"); - } -} -- (void)addOrUpdateThreadNetwork:(NSData *)threadDataSet -{ - CHIPDevice * chipDevice = CHIPGetDeviceBeingCommissioned(); - if (chipDevice) { - self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; - params.operationalDataset = threadDataSet; - params.breadcrumb = @(0); - - __weak typeof(self) weakSelf = self; - [self->_cluster - addOrUpdateThreadNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable response, - NSError * _Nullable error) { - // TODO: addThreadNetworkWithParams - // returns status in its response, - // not via the NSError! - [weakSelf onAddNetworkResponse:error isWiFi:NO]; - }]; - } else { - NSLog(@"Status: Failed to find a device being commissioned"); + NSError * error; + CHIPDeviceController * controller = [CHIPDeviceController sharedController]; + // create commissioning params in ObjC. Pass those in here with network credentials. + // maybe this just becomes the new norm + CHIPCommissioningParameters * params = [[CHIPCommissioningParameters alloc] init]; + params.wifiSSID = [ssid dataUsingEncoding:NSUTF8StringEncoding]; + params.wifiCredentials = [password dataUsingEncoding:NSUTF8StringEncoding]; + + uint64_t deviceId = CHIPGetNextAvailableDeviceID() - 1; + + if (![controller commissionDevice:deviceId commissioningParams:params error:&error]) { + NSLog(@"Failed to commission Device %llu, with error %@", deviceId, error); } } -- (void)onAddNetworkResponse:(NSError *)error isWiFi:(BOOL)isWiFi +- (void)onAddNetworkResponse:(NSError *)error { if (error != nil) { NSLog(@"Error adding network: %@", error); @@ -691,13 +660,9 @@ - (void)onAddNetworkResponse:(NSError *)error isWiFi:(BOOL)isWiFi } __auto_type * params = [[CHIPNetworkCommissioningClusterConnectNetworkParams alloc] init]; - if (isWiFi) { - NSString * ssid = CHIPGetDomainValueForKey(kCHIPToolDefaultsDomain, kNetworkSSIDDefaultsKey); - params.networkID = [ssid dataUsingEncoding:NSUTF8StringEncoding]; - } else { - uint8_t tempThreadNetworkId[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; - params.networkID = [NSData dataWithBytes:tempThreadNetworkId length:sizeof(tempThreadNetworkId)]; - } + + NSString * ssid = CHIPGetDomainValueForKey(kCHIPToolDefaultsDomain, kNetworkSSIDDefaultsKey); + params.networkID = [ssid dataUsingEncoding:NSUTF8StringEncoding]; params.breadcrumb = @(0); __weak typeof(self) weakSelf = self; @@ -721,7 +686,7 @@ - (void)onConnectNetworkResponse:(NSError *)error [controller updateDevice:deviceId fabricId:0]; } -- (void)onAddressUpdated:(NSError * _Nullable)error +- (void)onCommissioningComplete:(NSError * _Nullable)error { if (error != nil) { NSLog(@"Error retrieving device informations over Mdns: %@", error); diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index ad51c7f8c0ef25..9c5f2f2794e573 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -68,7 +68,9 @@ 998F286D26D55E10001846C6 /* CHIPKeypair.h in Headers */ = {isa = PBXBuildFile; fileRef = 998F286C26D55E10001846C6 /* CHIPKeypair.h */; settings = {ATTRIBUTES = (Public, ); }; }; 998F286F26D55EC5001846C6 /* CHIPP256KeypairBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 998F286E26D55EC5001846C6 /* CHIPP256KeypairBridge.h */; }; 998F287126D56940001846C6 /* CHIPP256KeypairBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 998F287026D56940001846C6 /* CHIPP256KeypairBridge.mm */; }; + 99AECC802798A57F00B6355B /* CHIPCommissioningParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 99AECC7F2798A57E00B6355B /* CHIPCommissioningParameters.m */; }; 99C65E10267282F1003402F6 /* CHIPControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C65E0F267282F1003402F6 /* CHIPControllerTests.m */; }; + 99D466E12798936D0089A18F /* CHIPCommissioningParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 99D466E02798936D0089A18F /* CHIPCommissioningParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; B20252972459E34F00F97062 /* CHIP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B202528D2459E34F00F97062 /* CHIP.framework */; }; B289D4212639C0D300D4E314 /* CHIPOnboardingPayloadParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B289D41F2639C0D300D4E314 /* CHIPOnboardingPayloadParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; B289D4222639C0D300D4E314 /* CHIPOnboardingPayloadParser.m in Sources */ = {isa = PBXBuildFile; fileRef = B289D4202639C0D300D4E314 /* CHIPOnboardingPayloadParser.m */; }; @@ -157,7 +159,9 @@ 998F286C26D55E10001846C6 /* CHIPKeypair.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPKeypair.h; sourceTree = ""; }; 998F286E26D55EC5001846C6 /* CHIPP256KeypairBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPP256KeypairBridge.h; sourceTree = ""; }; 998F287026D56940001846C6 /* CHIPP256KeypairBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPP256KeypairBridge.mm; sourceTree = ""; }; + 99AECC7F2798A57E00B6355B /* CHIPCommissioningParameters.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHIPCommissioningParameters.m; sourceTree = ""; }; 99C65E0F267282F1003402F6 /* CHIPControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHIPControllerTests.m; sourceTree = ""; }; + 99D466E02798936D0089A18F /* CHIPCommissioningParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPCommissioningParameters.h; sourceTree = ""; }; B202528D2459E34F00F97062 /* CHIP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CHIP.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B20252912459E34F00F97062 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B20252962459E34F00F97062 /* CHIPTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CHIPTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -285,6 +289,8 @@ 997DED172695344800975E97 /* CHIPThreadOperationalDataset.h */, 2C8C8FBD253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.h */, 2C8C8FBF253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.mm */, + 99D466E02798936D0089A18F /* CHIPCommissioningParameters.h */, + 99AECC7F2798A57E00B6355B /* CHIPCommissioningParameters.m */, 2CB7163E252F731E0026E2BB /* CHIPDevicePairingDelegate.h */, 2CB71638252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h */, 2CB71639252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.mm */, @@ -345,6 +351,7 @@ 2CB7163B252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h in Headers */, 1E16A90326B98AF100683C53 /* CHIPTestClustersObjc.h in Headers */, 2C1B027B2641DB4E00780EF1 /* CHIPOperationalCredentialsDelegate.h in Headers */, + 99D466E12798936D0089A18F /* CHIPCommissioningParameters.h in Headers */, B289D4212639C0D300D4E314 /* CHIPOnboardingPayloadParser.h in Headers */, 513DDB862761F69300DAA01A /* CHIPAttributeTLVValueDecoder_Internal.h in Headers */, 2CB7163F252F731E0026E2BB /* CHIPDevicePairingDelegate.h in Headers */, @@ -492,6 +499,7 @@ buildActionMask = 2147483647; files = ( 2C8C8FC2253E0C2100797F05 /* CHIPPersistentStorageDelegateBridge.mm in Sources */, + 99AECC802798A57F00B6355B /* CHIPCommissioningParameters.m in Sources */, 2CB7163C252E8A7C0026E2BB /* CHIPDevicePairingDelegateBridge.mm in Sources */, 997DED162695343400975E97 /* CHIPThreadOperationalDataset.mm in Sources */, 998F287126D56940001846C6 /* CHIPP256KeypairBridge.mm in Sources */, diff --git a/src/darwin/Framework/CHIP/CHIP.h b/src/darwin/Framework/CHIP/CHIP.h index 376ec2193a5a77..3fba51a63516b6 100644 --- a/src/darwin/Framework/CHIP/CHIP.h +++ b/src/darwin/Framework/CHIP/CHIP.h @@ -19,6 +19,7 @@ #import #import #import +#import #import #import #import diff --git a/src/darwin/Framework/CHIP/CHIPCommissioningParameters.h b/src/darwin/Framework/CHIP/CHIPCommissioningParameters.h new file mode 100644 index 00000000000000..5a2e65da00d13b --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPCommissioningParameters.h @@ -0,0 +1,51 @@ +/** + * + * Copyright (c) 2022 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 + +NS_ASSUME_NONNULL_BEGIN + +/** + * The class definition for the CHIPCommissioningParameters + * + */ +@interface CHIPCommissioningParameters : NSObject + +/** + * The CSRNonce + */ +@property (nonatomic, nullable, copy, readwrite) NSData * CSRNonce; +/** + * The AttestationNonce + */ +@property (nonatomic, nullable, copy, readwrite) NSData * attestationNonce; +/** + * The Wi-Fi SSID + */ +@property (nonatomic, nullable, copy, readwrite) NSData * wifiSSID; +/** + * The Wi-Fi Credentials + */ +@property (nonatomic, nullable, copy, readwrite) NSData * wifiCredentials; +/** + * The Thread operational dataset + */ +@property (nonatomic, nullable, copy, readwrite) NSData * threadOperationalDataset; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPCommissioningParameters.m b/src/darwin/Framework/CHIP/CHIPCommissioningParameters.m new file mode 100644 index 00000000000000..a4ed0d8c257a04 --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPCommissioningParameters.m @@ -0,0 +1,26 @@ +/** + * + * Copyright (c) 2022 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 "CHIPCommissioningParameters.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation CHIPCommissioningParameters : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.h b/src/darwin/Framework/CHIP/CHIPDeviceController.h index bd239b55de7cd8..0d53fb0e9a37bf 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.h @@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN typedef void (^CHIPDeviceConnectionCallback)(CHIPDevice * _Nullable device, NSError * _Nullable error); +@class CHIPCommissioningParameters; @protocol CHIPDevicePairingDelegate; @protocol CHIPPersistentStorageDelegate; @protocol CHIPKeypair; @@ -49,6 +50,9 @@ typedef void (^CHIPDeviceConnectionCallback)(CHIPDevice * _Nullable device, NSEr error:(NSError * __autoreleasing *)error; - (BOOL)pairDevice:(uint64_t)deviceID onboardingPayload:(NSString *)onboardingPayload error:(NSError * __autoreleasing *)error; +- (BOOL)commissionDevice:(uint64_t)deviceId + commissioningParams:(CHIPCommissioningParameters *)commissioningParams + error:(NSError * __autoreleasing *)error; - (void)setListenPort:(uint16_t)port; - (BOOL)unpairDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.mm b/src/darwin/Framework/CHIP/CHIPDeviceController.mm index 7b3a14afcb55e4..ff81c56cc7947b 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.mm +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.mm @@ -16,6 +16,7 @@ */ #import "CHIPDeviceController.h" +#import "CHIPCommissioningParameters.h" #import "CHIPDevicePairingDelegateBridge.h" #import "CHIPDevice_Internal.h" #import "CHIPError_Internal.h" @@ -352,6 +353,47 @@ - (BOOL)pairDevice:(uint64_t)deviceID onboardingPayload:(NSString *)onboardingPa return success; } +- (BOOL)commissionDevice:(uint64_t)deviceId + commissioningParams:(CHIPCommissioningParameters *)commissioningParams + error:(NSError * __autoreleasing *)error +{ + __block CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE; + __block BOOL success = NO; + if (![self isRunning]) { + success = ![self checkForError:errorCode logMsg:kErrorNotRunning error:error]; + return success; + } + dispatch_sync(_chipWorkQueue, ^{ + if ([self isRunning]) { + chip::Controller::CommissioningParameters params; + if (commissioningParams.CSRNonce) { + params.SetCSRNonce( + chip::ByteSpan((uint8_t *) commissioningParams.CSRNonce.bytes, commissioningParams.CSRNonce.length)); + } + if (commissioningParams.attestationNonce) { + params.SetAttestationNonce(chip::ByteSpan( + (uint8_t *) commissioningParams.attestationNonce.bytes, commissioningParams.attestationNonce.length)); + } + if (commissioningParams.threadOperationalDataset) { + params.SetThreadOperationalDataset(chip::ByteSpan((uint8_t *) commissioningParams.threadOperationalDataset.bytes, + commissioningParams.threadOperationalDataset.length)); + } + if (commissioningParams.wifiSSID && commissioningParams.wifiCredentials) { + chip::ByteSpan ssid((uint8_t *) commissioningParams.wifiSSID.bytes, commissioningParams.wifiSSID.length); + chip::ByteSpan credentials( + (uint8_t *) commissioningParams.wifiCredentials.bytes, commissioningParams.wifiCredentials.length); + chip::Controller::WiFiCredentials wifiCreds(ssid, credentials); + params.SetWiFiCredentials(wifiCreds); + } + + _operationalCredentialsDelegate->SetDeviceID(deviceId); + errorCode = self.cppCommissioner->Commission(deviceId, params); + } + success = ![self checkForError:errorCode logMsg:kErrorPairDevice error:error]; + }); + return success; +} + - (BOOL)unpairDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error { __block CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE; diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h index 1c8293c67e0e1b..1c403911955f8f 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h @@ -45,16 +45,16 @@ typedef NS_ENUM(NSUInteger, CHIPPairingStatus) { - (void)onPairingComplete:(nullable NSError *)error; /** - * Notify the delegate when pairing is deleted + * Notify the delegate when commissioning is completed * */ -- (void)onPairingDeleted:(nullable NSError *)error; +- (void)onCommissioningComplete:(nullable NSError *)error; /** - * Notify the delegate when address is updated + * Notify the delegate when pairing is deleted * */ -- (void)onAddressUpdated:(nullable NSError *)error; +- (void)onPairingDeleted:(nullable NSError *)error; @end diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h index c7ae4779ccb0c8..85dbf70eb8272a 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h @@ -38,6 +38,8 @@ class CHIPDevicePairingDelegateBridge : public chip::Controller::DevicePairingDe void OnPairingDeleted(CHIP_ERROR error) override; + void OnCommissioningComplete(chip::NodeId deviceId, CHIP_ERROR error) override; + void OnAddressUpdateComplete(chip::NodeId nodeId, CHIP_ERROR error) override; private: diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm index 264726caca220c..c0a69fe17cb98d 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm @@ -95,17 +95,23 @@ } } -void CHIPDevicePairingDelegateBridge::OnAddressUpdateComplete(chip::NodeId nodeId, CHIP_ERROR error) +void CHIPDevicePairingDelegateBridge::OnCommissioningComplete(chip::NodeId nodeId, CHIP_ERROR error) { - NSLog(@"OnAddressUpdateComplete. Status %s", chip::ErrorStr(error)); + NSLog(@"DevicePairingDelegate Commissioning complete. NodeId %llu Status %s", nodeId, chip::ErrorStr(error)); id strongDelegate = mDelegate; - if ([strongDelegate respondsToSelector:@selector(onAddressUpdated:)]) { + if ([strongDelegate respondsToSelector:@selector(onCommissioningComplete:)]) { if (strongDelegate && mQueue) { dispatch_async(mQueue, ^{ NSError * nsError = [CHIPError errorForCHIPErrorCode:error]; - [strongDelegate onAddressUpdated:nsError]; + [strongDelegate onCommissioningComplete:nsError]; }); } } } + +void CHIPDevicePairingDelegateBridge::OnAddressUpdateComplete(chip::NodeId nodeId, CHIP_ERROR error) +{ + // Todo, is there any benefit of exposing this anymore? + NSLog(@"OnAddressUpdateComplete. Status %s", chip::ErrorStr(error)); +} diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index b510811b21b636..f76727aa9c7e06 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -90,6 +90,13 @@ CHIPDevice * GetConnectedDevice(void) _expectation = nil; } +- (void)onCommissioningComplete:(NSError *)error +{ + XCTAssertEqual(error.code, 0); + [_expectation fulfill]; + _expectation = nil; +} + - (void)onAddressUpdated:(NSError *)error { XCTAssertEqual(error.code, 0); diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index 09c410c0bbfd22..acbd8c6b86a8e5 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -28,6 +28,10 @@ function getTests() 'Test_TC_BOOL_2_1', ]; + const BridgedActions = [ + 'Test_TC_BRAC_1_1', + ]; + const ColorControl = [ 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', @@ -71,6 +75,11 @@ function getTests() 'Test_TC_EMR_1_1', ]; + const EthernetNetworkDiagnostics = [ + 'Test_TC_ETHDIAG_1_1', + 'Test_TC_ETHDIAG_2_1', + ]; + const FlowMeasurement = [ 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', @@ -131,6 +140,10 @@ function getTests() 'Test_TC_OO_2_3', ]; + const PowerSource = [ + 'Test_TC_PS_1_1', + ]; + const PressureMeasurement = [ 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', @@ -149,6 +162,11 @@ function getTests() 'Test_TC_RH_2_2', ]; + const Switch = [ + 'Test_TC_SWTCH_2_1', + 'Test_TC_SWTCH_2_2', + ]; + const TemperatureMeasurement = [ 'Test_TC_TM_1_1', 'Test_TC_TM_2_1', @@ -171,6 +189,11 @@ function getTests() 'Test_TC_DIAGTH_1_1', ]; + const WiFiNetworkDiagnostics = [ + 'Test_TC_WIFIDIAG_1_1', + 'Test_TC_WIFIDIAG_3_1', + ]; + const WindowCovering = [ 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', @@ -210,23 +233,28 @@ function getTests() const tests = [ BinaryInput, // BooleanState, // + BridgedActions, // ColorControl, // DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // + EthernetNetworkDiagnostics, // FlowMeasurement, // IlluminanceMeasurement, // LevelControl, // MediaControl, // OccupancySensing, // OnOff, // + PowerSource, // PressureMeasurement, // PumpConfigurationControl, // RelativeHumidityMeasurement, // + Switch, // TemperatureMeasurement, // Thermostat, // ThermostatUserConfiguration, // ThreadNetworkDiagnostics, // + WiFiNetworkDiagnostics, // WindowCovering, // Others, // SoftwareDiagnostics, // diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index de0f93cb807d52..6569d7296e278e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -4977,6 +4977,35 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::OperationalCredentials::Id: { using namespace Clusters::OperationalCredentials; switch (aPath.mAttributeId) { + case Attributes::NOCs::Id: { + using TypeInfo = Attributes::NOCs::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPOperationalCredentialsClusterNOCStruct * newElement_0; + newElement_0 = [CHIPOperationalCredentialsClusterNOCStruct new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.noc = [NSData dataWithBytes:entry_0.noc.data() length:entry_0.noc.size()]; + newElement_0.icac = [NSData dataWithBytes:entry_0.icac.data() length:entry_0.icac.size()]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; + return value; + } case Attributes::FabricsList::Id: { using TypeInfo = Attributes::FabricsList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index a7ea7adbf96324..8532c3a5483e9d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -3480,6 +3480,49 @@ } } +void CHIPOperationalCredentialsNOCsListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & + value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPOperationalCredentialsClusterNOCStruct * newElement_0; + newElement_0 = [CHIPOperationalCredentialsClusterNOCStruct new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.noc = [NSData dataWithBytes:entry_0.noc.data() length:entry_0.noc.size()]; + newElement_0.icac = [NSData dataWithBytes:entry_0.icac.data() length:entry_0.icac.size()]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & value) diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 620ea3a3457f9d..45d5978b975e86 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -3113,6 +3113,37 @@ class CHIPOnOffSwitchConfigurationAttributeListListAttributeCallbackSubscription SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPOperationalCredentialsNOCsListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPOperationalCredentialsNOCsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & + value); +}; + +class CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge + : public CHIPOperationalCredentialsNOCsListAttributeCallbackBridge +{ +public: + CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPOperationalCredentialsNOCsListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 7b2994d30fbcb4..64cfc7056c090f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -3103,6 +3103,8 @@ NS_ASSUME_NONNULL_BEGIN completionHandler:(void (^)(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)readAttributeNOCsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeFabricsListWithMinInterval:(uint16_t)minInterval diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index badc4ce2bd589c..9eaee739ff51d5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -12958,6 +12958,17 @@ new CHIPOperationalCredentialsClusterNOCResponseCallbackBridge( }); } +- (void)readAttributeNOCsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPOperationalCredentialsNOCsListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index 77d89dd91468fd..fae3b526054ef3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -234,6 +234,7 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPOperationalCredentialsClusterNOCStruct : NSObject @property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; @property (strong, nonatomic) NSData * _Nonnull noc; +@property (strong, nonatomic) NSData * _Nonnull icac; - (instancetype)init; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index de4f4843d9b2d4..5ce12df0edc4d6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -466,6 +466,8 @@ - (instancetype)init _fabricIndex = @(0); _noc = [NSData data]; + + _icac = [NSData data]; } return self; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index 971945764cfe7b..245028aea67762 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -686,6 +686,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestOperationalCredentials : CHIPOperationalCredentials +- (void)writeAttributeNOCsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFabricsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeSupportedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeCommissionedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 228f1b8ecd1b12..b4d1325d837cec 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -6715,6 +6715,47 @@ @implementation CHIPTestOperationalCredentials return &_cppCluster; } +- (void)writeAttributeNOCsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPOperationalCredentialsClusterNOCStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPOperationalCredentialsClusterNOCStruct *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].noc = [self asByteSpan:element_0.noc]; + listHolder_0->mList[i_0].icac = [self asByteSpan:element_0.icac]; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeFabricsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 835eb5fa2b4999..784f77cfc82a02 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -106,6 +106,13 @@ - (void)onPairingComplete:(NSError *)error _expectation = nil; } +- (void)onCommissioningComplete:(NSError *)error +{ + XCTAssertEqual(error.code, 0); + [_expectation fulfill]; + _expectation = nil; +} + - (void)onAddressUpdated:(NSError *)error { XCTAssertEqual(error.code, 0); @@ -994,6 +1001,58 @@ - (void)testSendClusterTest_TC_BOOL_2_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_BRAC_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BRAC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BRAC_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -10417,6 +10476,24 @@ - (void)testSendClusterTest_TC_EMR_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -15932,6 +16009,124 @@ - (void)testSendClusterTest_TC_OO_2_3_000046_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PS_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000003_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -18104,6 +18299,503 @@ - (void)testSendClusterTest_TC_RH_2_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_SWTCH_2_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_SWTCH_2_2_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000001_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to SwitchLatched event"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000002_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to first position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000004_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to second position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000005_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress event"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000006_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000008_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to second position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000009_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch (release switch)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000010_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress and ShortRelease events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000011_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000012_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000013_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000014_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000015_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 3000); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000016_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000017_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000018_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000019_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000020_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000021_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000022_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 3000); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000023_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000024_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt( + expectation, queue, @"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000025_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000026_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000027_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000028_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000029_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000030_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000031_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000032_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000033_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000034_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000035_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000036_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000037_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -22126,6 +22818,81 @@ - (void)testSendClusterTest_TC_DIAGTH_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentMaxRate attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentMaxRate attribute from DUT Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentMaxRate attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentMaxRate attribute constraints Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_WIFIDIAG_3_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_WNCV_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -48930,6 +49697,31 @@ - (void)testSendClusterOnOffSwitchConfigurationReadAttributeClusterRevisionWithC [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterOperationalCredentialsReadAttributeNOCsWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"OperationalCredentialsReadAttributeNOCsWithCompletionHandler"]; + + [cluster readAttributeNOCsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"OperationalCredentials NOCs Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterOperationalCredentialsReadAttributeFabricsListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 28b044ee896e9b..a8977307b14aee 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -136,6 +136,13 @@ class ConfigurationManager virtual bool IsFullyProvisioned() = 0; virtual void InitiateFactoryReset() = 0; + // Gets called when starting BLE/DNS-SD advertisement +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + virtual void NotifyOfAdvertisementStart() {} +#else + void NotifyOfAdvertisementStart() {} +#endif + virtual void LogDeviceConfig() = 0; virtual bool IsCommissionableDeviceTypeEnabled() = 0; diff --git a/src/include/platform/OTAImageProcessor.h b/src/include/platform/OTAImageProcessor.h index b5954394add880..95815230bc3136 100644 --- a/src/include/platform/OTAImageProcessor.h +++ b/src/include/platform/OTAImageProcessor.h @@ -18,6 +18,7 @@ #pragma once +#include #include #include #include @@ -32,6 +33,21 @@ struct OTAImageProcessorParams uint64_t totalFileBytes = 0; }; +// TODO: Parse the header when the image is received +struct OTAImageProcessorHeader +{ + uint16_t vendorId; + uint16_t productId; + uint32_t softwareVersion; + CharSpan softwareVersionString; + uint64_t payloadSize; + uint16_t minApplicableSoftwareVersion; + uint16_t maxApplicableSoftwareVersion; + CharSpan releaseNotesUrl; + uint8_t imageDigestType; + ByteSpan imageDigest; +}; + /** * @class OTAImageProcessorInterface * @@ -83,20 +99,26 @@ class DLL_EXPORT OTAImageProcessorInterface /** * Called to check the current download status of the OTA image download. */ - virtual uint8_t GetPercentComplete() + virtual void GetPercentComplete(app::DataModel::Nullable & percent) { if (mParams.totalFileBytes == 0) { - return 0; + percent.SetNull(); } else { - return static_cast((mParams.downloadedBytes * 100) / mParams.totalFileBytes); + percent.SetNonNull(static_cast((mParams.downloadedBytes * 100) / mParams.totalFileBytes)); } } + /** + * Called to check the current number of bytes that have been downloaded of the OTA image + */ + virtual uint64_t GetBytesDownloaded() { return mParams.downloadedBytes; } + protected: OTAImageProcessorParams mParams; + OTAImageProcessorHeader mHeader; }; } // namespace chip diff --git a/src/include/platform/OTARequestorInterface.h b/src/include/platform/OTARequestorInterface.h index 7825eb1fde35c8..28febbfac64afe 100644 --- a/src/include/platform/OTARequestorInterface.h +++ b/src/include/platform/OTARequestorInterface.h @@ -65,7 +65,7 @@ class OTARequestorInterface virtual void ApplyUpdate() = 0; // Send NotifyUpdateApplied command - virtual void NotifyUpdateApplied() = 0; + virtual void NotifyUpdateApplied(uint32_t version) = 0; // Manually set OTA Provider parameters virtual void TestModeSetProviderParameters(NodeId nodeId, FabricIndex fabIndex, EndpointId endpointId) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp index 72d5875abbe21e..e327da4cfd38d3 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp @@ -248,11 +248,16 @@ CHIP_ERROR GenericConfigurationManagerImpl::StoreManufacturingDate( template void GenericConfigurationManagerImpl::InitiateFactoryReset() +{} + +template +void GenericConfigurationManagerImpl::NotifyOfAdvertisementStart() { #if CHIP_ENABLE_ROTATING_DEVICE_ID + // Increment life time counter to protect against long-term tracking of rotating device ID. IncrementLifetimeCounter(); -#endif // Inheriting classes should call this method so the lifetime counter is updated if necessary. +#endif } template diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index 7fb9554ae0737c..e498eb0e60854e 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -113,6 +113,11 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR RunUnitTests(void) override; bool IsFullyProvisioned() override; void InitiateFactoryReset() override; +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + void NotifyOfAdvertisementStart() override; +#else + void NotifyOfAdvertisementStart(); +#endif void LogDeviceConfig() override; virtual ~GenericConfigurationManagerImpl() = default; diff --git a/src/lib/dnssd/minimal_mdns/Server.cpp b/src/lib/dnssd/minimal_mdns/Server.cpp index 01b881f39c78fb..816feac1e71e77 100644 --- a/src/lib/dnssd/minimal_mdns/Server.cpp +++ b/src/lib/dnssd/minimal_mdns/Server.cpp @@ -165,6 +165,7 @@ CHIP_ERROR JoinMulticastGroup(chip::Inet::InterfaceId interfaceId, chip::Inet::U return endpoint->JoinMulticastGroup(interfaceId, address); } +#if CHIP_ERROR_LOGGING const char * AddressTypeStr(chip::Inet::IPAddressType addressType) { switch (addressType) @@ -179,6 +180,7 @@ const char * AddressTypeStr(chip::Inet::IPAddressType addressType) return "UNKNOWN"; } } +#endif } // namespace diff --git a/src/lwip/BUILD.gn b/src/lwip/BUILD.gn index a038fe06875500..6fb03fc2768381 100644 --- a/src/lwip/BUILD.gn +++ b/src/lwip/BUILD.gn @@ -99,14 +99,13 @@ if (current_os == "zephyr" || current_os == "mbed") { lwip_target("lwip") { public = [ - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/cc.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/perf.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwipopts.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwippools.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/cc.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/perf.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/lwipopts.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/lwippools.h", "freertos/arch/sys_arch.h", ] - sources = - [ "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/sys_arch.c" ] + sources = [ "${qpg_sdk_root}/Components/ThirdParty/Lwip/sys_arch.c" ] public_deps = [ ":lwip_buildconfig" ] public_deps += [ "${qpg_sdk_build_root}:qpg_sdk" ] diff --git a/src/lwip/efr32/lwipopts-rs911x.h b/src/lwip/efr32/lwipopts-rs911x.h new file mode 100644 index 00000000000000..9be70a784da48c --- /dev/null +++ b/src/lwip/efr32/lwipopts-rs911x.h @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#if 1 +#define MEM_LIBC_MALLOC (1) +#define mem_clib_free vPortFree +#define mem_clib_malloc pvPortMalloc +#else +#define MEM_LIBC_MALLOC (0) +#endif + +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (7) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#ifndef LWIP_IPV4 +#define LWIP_IPV4 1 +#endif +#ifndef LWIP_IPV6 +#define LWIP_IPV6 1 +#endif +#ifndef LWIP_ARP +#define LWIP_ARP (1) +#endif +#define LWIP_DNS (0) +#ifndef LWIP_ICMP +#define LWIP_ICMP (1) +#endif +#ifndef LWIP_IGMP +#define LWIP_IGMP (1) +#endif +#ifndef LWIP_DHCP +#define LWIP_DHCP (1) +#endif +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (1) +#define LWIP_IPV6_ROUTER_SUPPORT 1 +#define LWIP_ND6_LISTEN_RA 1 + +#define LWIP_ND6_NUM_NEIGHBORS (2) +#define LWIP_ND6_NUM_DESTINATIONS (3) +#define LWIP_ND6_NUM_PREFIXES (2) +#define LWIP_ND6_NUM_ROUTERS (2) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (2) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (2) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (3) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) +#define LWIP_ND6_ALLOW_RA_UPDATES 1 + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (14) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#ifndef LWIP_IPV6_ND +#define LWIP_IPV6_ND 1 +#endif +#define LWIP_ND6_QUEUEING 1 +#define LWIP_NUM_ND6_QUEUE 3 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts-thread.h b/src/lwip/efr32/lwipopts-thread.h new file mode 100644 index 00000000000000..f667e5bb3a8f27 --- /dev/null +++ b/src/lwip/efr32/lwipopts-thread.h @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#define MEM_LIBC_MALLOC (0) +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (5) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#define LWIP_IPV4 0 + +#define LWIP_IPV6 1 +#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 +#define LWIP_ARP (0) +#define LWIP_DNS (0) +#define LWIP_ICMP (0) +#define LWIP_IGMP (0) +#define LWIP_DHCP (0) +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (0) +#define LWIP_IPV6_ROUTER_SUPPORT 0 +#define LWIP_ND6_LISTEN_RA 0 + +#define LWIP_ND6_NUM_NEIGHBORS (0) +#define LWIP_ND6_NUM_DESTINATIONS (0) +#define LWIP_ND6_NUM_PREFIXES (0) +#define LWIP_ND6_NUM_ROUTERS (0) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (0) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (0) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (0) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (0) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#define LWIP_IPV6_ND 0 +#define LWIP_ND6_QUEUEING 0 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts-wf200.h b/src/lwip/efr32/lwipopts-wf200.h new file mode 100644 index 00000000000000..31dbf793c3b8c9 --- /dev/null +++ b/src/lwip/efr32/lwipopts-wf200.h @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#if 1 +#define MEM_LIBC_MALLOC (1) +#define mem_clib_free vPortFree +#define mem_clib_malloc pvPortMalloc +#else +#define MEM_LIBC_MALLOC (0) +#endif + +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (5) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#ifndef LWIP_IPV4 +#define LWIP_IPV4 0 +#endif +#ifndef LWIP_IPV6 +#define LWIP_IPV6 1 +#endif +#ifndef LWIP_ARP +#define LWIP_ARP (0) +#endif +#define LWIP_DNS (0) +#ifndef LWIP_ICMP +#define LWIP_ICMP (1) +#endif +#ifndef LWIP_IGMP +#define LWIP_IGMP (0) +#endif +#ifndef LWIP_DHCP +#define LWIP_DHCP (0) +#endif +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (1) +#define LWIP_IPV6_ROUTER_SUPPORT 1 +#define LWIP_ND6_LISTEN_RA 1 + +#define LWIP_ND6_NUM_NEIGHBORS (2) +#define LWIP_ND6_NUM_DESTINATIONS (3) +#define LWIP_ND6_NUM_PREFIXES (2) +#define LWIP_ND6_NUM_ROUTERS (2) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (2) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (2) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (3) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) +#define LWIP_ND6_ALLOW_RA_UPDATES 1 + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (14) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#ifndef LWIP_IPV6_ND +#define LWIP_IPV6_ND 0 +#endif +#define LWIP_ND6_QUEUEING 1 +#define LWIP_NUM_ND6_QUEUE 3 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts.h b/src/lwip/efr32/lwipopts.h index f667e5bb3a8f27..499e11d4700c19 100644 --- a/src/lwip/efr32/lwipopts.h +++ b/src/lwip/efr32/lwipopts.h @@ -1,182 +1,7 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Nest Labs, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Compile-time configuration for LwIP on EFR32 platforms using the - * Silicon Labs EFR32 SDK. - * - */ - -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - -#if CHIP_HAVE_CONFIG_H -#include -#endif - -#include - -#define NO_SYS 0 -#define MEM_ALIGNMENT (4) -#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) -#define LWIP_TIMEVAL_PRIVATE (0) -#define MEM_LIBC_MALLOC (0) -#define LWIP_COMPAT_MUTEX (0) -#define SYS_LIGHTWEIGHT_PROT (1) -#define LWIP_AUTOIP (0) -#define LWIP_DHCP_AUTOIP_COOP (0) -#define LWIP_SOCKET_SET_ERRNO 0 -#define IP_REASS_MAX_PBUFS 0 -#define IP_REASSEMBLY 0 -#define MEMP_NUM_REASSDATA 0 -#define LWIP_SO_RCVTIMEO 0 -#define SO_REUSE (1) -#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) -#define LWIP_STATS (0) -#define LWIP_TCPIP_CORE_LOCKING 1 -#define TCP_QUEUE_OOSEQ 0 -#define ARP_QUEUEING (0) -#define TCPIP_THREAD_NAME "LWIP" - -#define LWIP_SOCKET 0 - -#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 - -#define LWIP_RAW 1 -#define MEMP_NUM_RAW_PCB (4) - -#define MEMP_NUM_UDP_PCB (5) - -#define LWIP_HAVE_LOOPIF (0) - -// TODO: not sure why this is disabled -#define LWIP_NETIF_LOOPBACK (0) - -#define MEMP_NUM_NETCONN (0) - -#define LWIP_IPV4 0 - -#define LWIP_IPV6 1 -#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 -#define LWIP_ARP (0) -#define LWIP_DNS (0) -#define LWIP_ICMP (0) -#define LWIP_IGMP (0) -#define LWIP_DHCP (0) -#define LWIP_IPV6_REASS (0) -#define LWIP_IPV6_DHCP6 0 -#define LWIP_IPV6_AUTOCONFIG (0) -#define LWIP_IPV6_ROUTER_SUPPORT 0 -#define LWIP_ND6_LISTEN_RA 0 - -#define LWIP_ND6_NUM_NEIGHBORS (0) -#define LWIP_ND6_NUM_DESTINATIONS (0) -#define LWIP_ND6_NUM_PREFIXES (0) -#define LWIP_ND6_NUM_ROUTERS (0) -#define LWIP_ND6_MAX_MULTICAST_SOLICIT (0) -#define LWIP_ND6_MAX_UNICAST_SOLICIT (0) -#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (0) -#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) - -#if defined(EFR32MG21) -#define MEMP_SEPARATE_POOLS (1) -#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) -#define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (5) -#define PBUF_POOL_BUFSIZE (1280) -#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) -#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) -#else -#define MEMP_SEPARATE_POOLS (1) -#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) -#define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (8) -#define PBUF_POOL_BUFSIZE (1280) -#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) -#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) -#endif - -#define TCP_MSS (1152) -#define TCP_SND_BUF (2 * TCP_MSS) -#define TCP_LISTEN_BACKLOG (1) - -#define ETH_PAD_SIZE (0) -#define SUB_ETHERNET_HEADER_SPACE (0) -#define PBUF_LINK_HLEN (0) - -#if defined(EFR32MG21) -#define TCPIP_THREAD_STACKSIZE (1536) +#if defined(WF200_WIFI) +#include "lwipopts-wf200.h" +#elif defined(RS911X_WIFI) +#include "lwipopts-rs911x.h" #else -#define TCPIP_THREAD_STACKSIZE (2048) -#endif - -#define TCPIP_THREAD_PRIO (2) - -#define NETIF_MAX_HWADDR_LEN 8U - -#define LWIP_IPV6_NUM_ADDRESSES 5 - -#define LWIP_IPV6_ND 0 -#define LWIP_ND6_QUEUEING 0 - -#define LWIP_MULTICAST_PING 0 - -#define TCPIP_MBOX_SIZE 6 -#define DEFAULT_RAW_RECVMBOX_SIZE 6 -#define DEFAULT_UDP_RECVMBOX_SIZE 6 -#define DEFAULT_TCP_RECVMBOX_SIZE 6 - -#ifdef LWIP_DEBUG - -#define MEMP_OVERFLOW_CHECK (0) -#define MEMP_SANITY_CHECK (0) -#define MEM_DEBUG (LWIP_DBG_OFF) -#define MEMP_DEBUG (LWIP_DBG_OFF) -#define PBUF_DEBUG (LWIP_DBG_OFF) -#define API_LIB_DEBUG (LWIP_DBG_OFF) -#define API_MSG_DEBUG (LWIP_DBG_OFF) -#define TCPIP_DEBUG (LWIP_DBG_OFF) -#define NETIF_DEBUG (LWIP_DBG_OFF) -#define SOCKETS_DEBUG (LWIP_DBG_OFF) -#define DEMO_DEBUG (LWIP_DBG_OFF) -#define DHCP_DEBUG (LWIP_DBG_OFF) -#define AUTOIP_DEBUG (LWIP_DBG_OFF) -#define ETHARP_DEBUG (LWIP_DBG_OFF) -#define IP_DEBUG (LWIP_DBG_OFF) -#define IP_REASS_DEBUG (LWIP_DBG_OFF) -#define IP6_DEBUG (LWIP_DBG_OFF) -#define RAW_DEBUG (LWIP_DBG_OFF) -#define ICMP_DEBUG (LWIP_DBG_OFF) -#define UDP_DEBUG (LWIP_DBG_OFF) -#define TCP_DEBUG (LWIP_DBG_OFF) -#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) -#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) -#define TCP_RTO_DEBUG (LWIP_DBG_OFF) -#define TCP_CWND_DEBUG (LWIP_DBG_OFF) -#define TCP_WND_DEBUG (LWIP_DBG_OFF) -#define TCP_FR_DEBUG (LWIP_DBG_OFF) -#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) -#define TCP_RST_DEBUG (LWIP_DBG_OFF) -#define PPP_DEBUG (LWIP_DBG_OFF) +#include "lwipopts-thread.h" #endif - -#define LWIP_DBG_TYPES_ON \ - (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ - -#endif /* __LWIPOPTS_H__ */ diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 4869be51e4dbc9..755d54e2d36d7c 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -123,8 +123,10 @@ void ReliableMessageMgr::ExecuteActions() VerifyOrDie(!entry->retainedBuf.IsNull()); - uint8_t sendCount = entry->sendCount; + uint8_t sendCount = entry->sendCount; +#if CHIP_ERROR_LOGGING || CHIP_DETAIL_LOGGING uint32_t messageCounter = entry->retainedBuf.GetMessageCounter(); +#endif // CHIP_ERROR_LOGGING || CHIP_DETAIL_LOGGING if (sendCount == CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS) { diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 5efbf9e4c733e7..00469606e03597 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -36,7 +36,6 @@ static_library("EFR32") { "CHIPPlatformConfig.h", "ConfigurationManagerImpl.cpp", "ConfigurationManagerImpl.h", - "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", "DeviceNetworkProvisioningDelegateImpl.cpp", "DeviceNetworkProvisioningDelegateImpl.h", @@ -87,6 +86,7 @@ static_library("EFR32") { sources += [ "../OpenThread/OpenThreadUtils.cpp", + "ConnectivityManagerImpl.cpp", "ThreadStackManagerImpl.cpp", "ThreadStackManagerImpl.h", ] @@ -95,5 +95,11 @@ static_library("EFR32") { sources += [ "../OpenThread/DnssdImpl.cpp" ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } + } else { + sources += [ + "ConnectivityManagerImpl_WIFI.cpp", + "ServiceProvisioning.cpp", + "ServiceProvisioning.h", + ] } } diff --git a/src/platform/EFR32/CHIPDevicePlatformConfig.h b/src/platform/EFR32/CHIPDevicePlatformConfig.h index 36ea40f8ebe700..74521d1da33f60 100644 --- a/src/platform/EFR32/CHIPDevicePlatformConfig.h +++ b/src/platform/EFR32/CHIPDevicePlatformConfig.h @@ -29,17 +29,18 @@ #define CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN 0xB00000 #define CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN 0xC00000 +#if defined(SL_WIFI) +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 +#elif CHIP_ENABLE_OPENTHREAD + #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 - -#if CHIP_ENABLE_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 -#define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#endif - #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 +#define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 +#endif /* CHIP_ENABLE_OPENTHREAD */ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 diff --git a/src/platform/EFR32/CHIPDevicePlatformEvent.h b/src/platform/EFR32/CHIPDevicePlatformEvent.h index d2ae1b7c65ff35..1252e16064dd89 100644 --- a/src/platform/EFR32/CHIPDevicePlatformEvent.h +++ b/src/platform/EFR32/CHIPDevicePlatformEvent.h @@ -25,6 +25,9 @@ #pragma once #include +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif namespace chip { namespace DeviceLayer { @@ -44,7 +47,7 @@ enum PublicPlatformSpecificEventTypes */ enum InternalPlatformSpecificEventTypes { - /* None currently defined */ + kWFXSystemEvent = kRange_InternalPlatformSpecific, }; } // namespace DeviceEventType @@ -57,9 +60,39 @@ struct ChipDevicePlatformEvent final { union { - /* None currently defined */ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + struct + { + wfx_event_base_t eventBase; + union + { + sl_wfx_generic_message_t genericMsgEvent; + sl_wfx_startup_ind_t startupEvent; + sl_wfx_connect_ind_t connectEvent; + sl_wfx_disconnect_ind_t disconnectEvent; + + /* + * NOT CURRENTLY USED + *Some structs might be bigger in size than the one we use + * so we reduce the union size by commenting them out. + * Keep for possible future implementation. + */ + + // sl_wfx_generic_ind_t genericEvent; + // sl_wfx_exception_ind_t exceptionEvent; + // sl_wfx_error_ind_t errorEvent; + // sl_wfx_received_ind_t receivedEvent; + // sl_wfx_scan_result_ind_t scanResultEvent; + // sl_wfx_scan_complete_ind_t scanCompleteEvent; + // sl_wfx_start_ap_ind_t startApEvent; + // sl_wfx_stop_ap_ind_t stopApEvent; + // sl_wfx_ap_client_connected_ind_t apClientConnectedEvent; + // sl_wfx_ap_client_rejected_ind_t apClientRejectedEvent; + // sl_wfx_ap_client_disconnected_ind_t apClientDisconnectedEvent; + } data; + } WFXSystemEvent; +#endif }; }; - -} // namespace DeviceLayer +}; // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConfigurationManagerImpl.cpp b/src/platform/EFR32/ConfigurationManagerImpl.cpp index f550516e28b5a3..fccf7f6fd0f4de 100644 --- a/src/platform/EFR32/ConfigurationManagerImpl.cpp +++ b/src/platform/EFR32/ConfigurationManagerImpl.cpp @@ -32,6 +32,10 @@ #include "em_rmu.h" +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif + namespace chip { namespace DeviceLayer { @@ -291,10 +295,26 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) PersistedStorage::KeyValueStoreMgrImpl().ErasePartition(); #endif // CHIP_KVS_AVAILABLE +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + ChipLogProgress(DeviceLayer, "Clearing WiFi provision"); + wfx_clear_wifi_provision(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + // Restart the system. ChipLogProgress(DeviceLayer, "System restarting"); NVIC_SystemReset(); } +#ifdef SL_WIFI +CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) +{ + sl_wfx_mac_address_t macaddr; + wfx_get_wifi_mac_addr(SL_WFX_STA_INTERFACE, &macaddr); + memcpy(buf, &macaddr.octet[0], sizeof(macaddr.octet)); + + return CHIP_NO_ERROR; +} +#endif + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConfigurationManagerImpl.h b/src/platform/EFR32/ConfigurationManagerImpl.h index a638abc425f5f0..7a157ccc3b7fac 100644 --- a/src/platform/EFR32/ConfigurationManagerImpl.h +++ b/src/platform/EFR32/ConfigurationManagerImpl.h @@ -77,10 +77,12 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp static void DoFactoryReset(intptr_t arg); }; +#ifndef SL_WIFI inline CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } +#endif /* SL_WIFI */ } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConnectivityManagerImpl.h b/src/platform/EFR32/ConnectivityManagerImpl.h index 02e1c11c8c7cb9..7e817ad4da743c 100644 --- a/src/platform/EFR32/ConnectivityManagerImpl.h +++ b/src/platform/EFR32/ConnectivityManagerImpl.h @@ -30,7 +30,11 @@ #else #include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include +#else #include +#endif namespace Inet { class IPAddress; @@ -39,6 +43,8 @@ class IPAddress; namespace chip { namespace DeviceLayer { +class PlatformManagerImpl; + /** * Concrete implementation of the ConnectivityManager singleton object for Silicon Labs EFR32 platforms. */ @@ -54,7 +60,11 @@ class ConnectivityManagerImpl final : public ConnectivityManager, #else public Internal::GenericConnectivityManagerImpl_NoThread, #endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + public Internal::GenericConnectivityManagerImpl_WiFi +#else public Internal::GenericConnectivityManagerImpl_NoWiFi +#endif { // Allow the ConnectivityManager interface class to delegate method calls to // the implementation methods provided by this class. @@ -63,18 +73,103 @@ class ConnectivityManagerImpl final : public ConnectivityManager, private: // ===== Members that implement the ConnectivityManager abstract interface. + bool _HaveIPv4InternetConnectivity(void); + bool _HaveIPv6InternetConnectivity(void); +#if 0 // CHIP_DEVICE_CONFIG_ENABLE_THREAD + bool _HaveServiceConnectivity(void); +#endif CHIP_ERROR _Init(void); void _OnPlatformEvent(const ChipDeviceEvent * event); +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + using Flags = GenericConnectivityManagerImpl_WiFi::ConnectivityFlags; + WiFiStationMode _GetWiFiStationMode(void); + CHIP_ERROR _SetWiFiStationMode(WiFiStationMode val); + bool _IsWiFiStationEnabled(void); + bool _IsWiFiStationApplicationControlled(void); + bool _IsWiFiStationConnected(void); + System::Clock::Timeout _GetWiFiStationReconnectInterval(void); + CHIP_ERROR _SetWiFiStationReconnectInterval(System::Clock::Timeout val); + bool _IsWiFiStationProvisioned(void); + void _ClearWiFiStationProvision(void); + CHIP_ERROR _GetAndLogWifiStatsCounters(void); + bool _CanStartWiFiScan(); + void _OnWiFiScanDone(); + void _OnWiFiStationProvisionChange(); +#endif // ===== Members for internal use by the following friends. friend ConnectivityManager & ConnectivityMgr(void); friend ConnectivityManagerImpl & ConnectivityMgrImpl(void); static ConnectivityManagerImpl sInstance; + + // ===== Private members reserved for use by this class only. +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + System::Clock::Timestamp mLastStationConnectFailTime; + WiFiStationMode mWiFiStationMode; + WiFiStationState mWiFiStationState; + System::Clock::Timeout mWiFiStationReconnectInterval; + BitFlags mFlags; + + void DriveStationState(void); + void OnStationConnected(void); + void OnStationDisconnected(void); + void ChangeWiFiStationState(WiFiStationState newState); + static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState); + + void UpdateInternetConnectivityState(void); +#endif }; +inline bool ConnectivityManagerImpl::_HaveIPv4InternetConnectivity(void) +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + return mFlags.Has(Flags::kHaveIPv4InternetConnectivity); +#else + return false; +#endif +} + +inline bool ConnectivityManagerImpl::_HaveIPv6InternetConnectivity(void) +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + return mFlags.Has(Flags::kHaveIPv6InternetConnectivity); +#else + return false; +#endif +} + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +inline bool ConnectivityManagerImpl::_IsWiFiStationApplicationControlled(void) +{ + return mWiFiStationMode == kWiFiStationMode_ApplicationControlled; +} + +inline bool ConnectivityManagerImpl::_IsWiFiStationConnected(void) +{ + return mWiFiStationState == kWiFiStationState_Connected; +} + +inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiStationReconnectInterval(void) +{ + return mWiFiStationReconnectInterval; +} + +inline bool ConnectivityManagerImpl::_CanStartWiFiScan() +{ + return mWiFiStationState != kWiFiStationState_Connecting; +} +#endif +#if 0 // CHIP_DEVICE_CONFIG_ENABLE_THREAD +inline bool ConnectivityManagerImpl::_HaveServiceConnectivity(void) +{ + return _HaveServiceConnectivityViaThread(); +} +#endif + /** + * * Returns the public interface of the ConnectivityManager singleton object. * * Chip applications should use this to access features of the ConnectivityManager object diff --git a/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp b/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp new file mode 100644 index 00000000000000..bbae58753acf5b --- /dev/null +++ b/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp @@ -0,0 +1,485 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#endif + +#include "wfx_host_events.h" + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::TLV; +using namespace ::chip::DeviceLayer::Internal; + +namespace chip { +namespace DeviceLayer { + +ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; + +CHIP_ERROR ConnectivityManagerImpl::_Init() +{ + CHIP_ERROR err; + // Queue work items to bootstrap the AP and station state machines once the Chip event loop is running. + mWiFiStationMode = kWiFiStationMode_Disabled; + mWiFiStationState = kWiFiStationState_NotConnected; + mLastStationConnectFailTime = System::Clock::kZero; + mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL); + mFlags.ClearAll(); + + // TODO Initialize the Chip Addressing and Routing Module. + + // Ensure that station mode is enabled. + wfx_enable_sta_mode(); + + err = DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + + SuccessOrExit(err); + +exit: + return err; +} + +void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + // Forward the event to the generic base classes as needed. + // Handle Wfx wifi events... + if (event->Type == DeviceEventType::kWFXSystemEvent) + { + if (event->Platform.WFXSystemEvent.eventBase == WIFI_EVENT) + { + switch (event->Platform.WFXSystemEvent.data.genericMsgEvent.header.id) + { + case SL_WFX_STARTUP_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_START"); + DriveStationState(); + break; + case SL_WFX_CONNECT_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_CONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + if (event->Platform.WFXSystemEvent.data.connectEvent.body.status == 0) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + } + else + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + } + } + DriveStationState(); + break; + case SL_WFX_DISCONNECT_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_DISCONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + } + DriveStationState(); + break; + default: + break; + } + } + else if (event->Platform.WFXSystemEvent.eventBase == IP_EVENT) + { + switch (event->Platform.WFXSystemEvent.data.genericMsgEvent.header.id) + { + case IP_EVENT_STA_GOT_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_GOT_IP"); + UpdateInternetConnectivityState(); + break; + case IP_EVENT_STA_LOST_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_LOST_IP"); + UpdateInternetConnectivityState(); + break; + case IP_EVENT_GOT_IP6: + ChipLogProgress(DeviceLayer, "IP_EVENT_GOT_IP6"); + UpdateInternetConnectivityState(); + break; + default: + break; + } + } + } +} +ConnectivityManager::WiFiStationMode ConnectivityManagerImpl::_GetWiFiStationMode(void) +{ + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + wifi_mode_t curWiFiMode = wfx_get_wifi_mode(); + if ((curWiFiMode == WIFI_MODE_STA) || (curWiFiMode == WIFI_MODE_APSTA)) + { + mWiFiStationMode = kWiFiStationMode_Enabled; + } + else + { + mWiFiStationMode = kWiFiStationMode_Disabled; + } + } + return mWiFiStationMode; +} + +bool ConnectivityManagerImpl::_IsWiFiStationProvisioned(void) +{ + char ssid[65]; + size_t len = 0; + + /* See if we have SSID in our Keys */ + if ((Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, ssid, sizeof(ssid) - 1, len) == + CHIP_NO_ERROR) && + (ssid[0] != 0)) + { + return true; + } + + return false; +} + +bool ConnectivityManagerImpl::_IsWiFiStationEnabled(void) +{ + return wfx_is_sta_mode_enabled(); +} +CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationMode(ConnectivityManager::WiFiStationMode val) +{ + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + + if (mWiFiStationMode != val) + { + ChipLogProgress(DeviceLayer, "WiFi station mode change: %s -> %s", WiFiStationModeToStr(mWiFiStationMode), + WiFiStationModeToStr(val)); + } + + mWiFiStationMode = val; + + return CHIP_NO_ERROR; +} +CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationReconnectInterval(System::Clock::Timeout val) +{ + mWiFiStationReconnectInterval = val; + return CHIP_NO_ERROR; +} +void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) +{ + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + wfx_clear_wifi_provision(); + + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + } +} + +CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) +{ + return CHIP_ERROR_NOT_IMPLEMENTED; +} + +void ConnectivityManagerImpl::_OnWiFiScanDone() +{ + // CHIP_ERROR_NOT_IMPLEMENTED +} + +void ConnectivityManagerImpl::_OnWiFiStationProvisionChange() +{ + // Schedule a call to the DriveStationState method to adjust the station state as needed. + ChipLogProgress(DeviceLayer, "_ON WIFI PROVISION CHANGE"); + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); +} + +// == == == == == == == == == == ConnectivityManager Private Methods == == == == == == == == == == + +void ConnectivityManagerImpl::DriveStationState() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + sl_status_t serr; + bool stationConnected; + + // Refresh the current station mode. + GetWiFiStationMode(); + + // If the station interface is NOT under application control... + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + // Ensure that the WFX is started. + if ((serr = wfx_wifi_start()) != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "WFX_wifi_start: FAIL: %s", chip::ErrorStr(err)); + return; + } + // Ensure that station mode is enabled in the WFX WiFi layer. + wfx_enable_sta_mode(); + } + + stationConnected = wfx_is_sta_connected(); + + // If the station interface is currently connected ... + if (stationConnected) + { + // Advance the station state to Connected if it was previously NotConnected or + // a previously initiated connect attempt succeeded. + if (mWiFiStationState == kWiFiStationState_NotConnected || mWiFiStationState == kWiFiStationState_Connecting_Succeeded) + { + ChangeWiFiStationState(kWiFiStationState_Connected); + ChipLogProgress(DeviceLayer, "WiFi station interface connected"); + mLastStationConnectFailTime = System::Clock::kZero; + OnStationConnected(); + } + + // If the WiFi station interface is no longer enabled, or no longer provisioned, + // disconnect the station from the AP, unless the WiFi station mode is currently + // under application control. + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled && + (mWiFiStationMode != kWiFiStationMode_Enabled || !IsWiFiStationProvisioned())) + { + ChipLogProgress(DeviceLayer, "Disconnecting WiFi station interface"); + serr = wfx_sta_discon(); + if (serr != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "wfx_wifi_disconnect() failed: %s", chip::ErrorStr(err)); + } + SuccessOrExit(serr); + + ChangeWiFiStationState(kWiFiStationState_Disconnecting); + } + } + // Otherwise the station interface is NOT connected to an AP, so... + else + { + System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); + + // Advance the station state to NotConnected if it was previously Connected or Disconnecting, + // or if a previous initiated connect attempt failed. + if (mWiFiStationState == kWiFiStationState_Connected || mWiFiStationState == kWiFiStationState_Disconnecting || + mWiFiStationState == kWiFiStationState_Connecting_Failed) + { + WiFiStationState prevState = mWiFiStationState; + ChangeWiFiStationState(kWiFiStationState_NotConnected); + if (prevState != kWiFiStationState_Connecting_Failed) + { + ChipLogProgress(DeviceLayer, "WiFi station interface disconnected"); + mLastStationConnectFailTime = System::Clock::kZero; + OnStationDisconnected(); + } + else + { + mLastStationConnectFailTime = now; + } + } + + // If the WiFi station interface is now enabled and provisioned (and by implication, + // not presently under application control), AND the system is not in the process of + // scanning, then... + if (mWiFiStationMode == kWiFiStationMode_Enabled && IsWiFiStationProvisioned()) + { + // Initiate a connection to the AP if we haven't done so before, or if enough + // time has passed since the last attempt. + if (mLastStationConnectFailTime == System::Clock::kZero || + now >= mLastStationConnectFailTime + mWiFiStationReconnectInterval) + { + if (mWiFiStationState != kWiFiStationState_Connecting) + { + wfx_wifi_provision_t wcfg; + size_t sz; + + (void) Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, wcfg.ssid, + sizeof(wcfg.ssid), sz); + (void) Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiPSK, wcfg.passkey, + sizeof(wcfg.passkey), sz); + (void) Internal::EFR32Config::ReadConfigValueBin(Internal::EFR32Config::kConfigKey_WiFiSEC, &wcfg.security, + sizeof(wcfg.security), sz); + wfx_set_wifi_provision(&wcfg); + + ChipLogProgress(DeviceLayer, "Attempting to connect WiFi (%s)", wcfg.ssid); + if ((serr = wfx_connect_to_ap()) != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "wfx_connect_to_ap failed"); + } + SuccessOrExit(serr); + + ChangeWiFiStationState(kWiFiStationState_Connecting); + } + } + + // Otherwise arrange another connection attempt at a suitable point in the future. + else + { + System::Clock::Timestamp timeToNextConnect = (mLastStationConnectFailTime + mWiFiStationReconnectInterval) - now; + + ChipLogProgress(DeviceLayer, "Next WiFi station reconnect in %" PRIu32 " ms", + System::Clock::Milliseconds32(timeToNextConnect).count()); + + ReturnOnFailure(DeviceLayer::SystemLayer().StartTimer(timeToNextConnect, DriveStationState, NULL)); + } + } + } + +exit: + + ChipLogProgress(DeviceLayer, "Done driving station state, nothing else to do..."); + // Kick-off any pending network scan that might have been deferred due to the activity + // of the WiFi station. +} + +void ConnectivityManagerImpl::OnStationConnected() +{ + ChipDeviceEvent event; + + wfx_setup_ip6_link_local(SL_WFX_STA_INTERFACE); + + // Alert other components of the new state. + event.Type = DeviceEventType::kWiFiConnectivityChange; + event.WiFiConnectivityChange.Result = kConnectivity_Established; + (void) PlatformMgr().PostEvent(&event); + + UpdateInternetConnectivityState(); +} + +void ConnectivityManagerImpl::OnStationDisconnected() +{ + // TODO Invoke WARM to perform actions that occur when the WiFi station interface goes down. + + // Alert other components of the new state. + ChipDeviceEvent event; + event.Type = DeviceEventType::kWiFiConnectivityChange; + event.WiFiConnectivityChange.Result = kConnectivity_Lost; + (void) PlatformMgr().PostEvent(&event); + + UpdateInternetConnectivityState(); +} +void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, void * aAppState) +{ + sInstance.DriveStationState(); +} + +void ConnectivityManagerImpl::ChangeWiFiStationState(WiFiStationState newState) +{ + if (mWiFiStationState != newState) + { + ChipLogProgress(DeviceLayer, "WiFi station state change: %s -> %s", WiFiStationStateToStr(mWiFiStationState), + WiFiStationStateToStr(newState)); + mWiFiStationState = newState; + } +} + +void ConnectivityManagerImpl::UpdateInternetConnectivityState(void) +{ + bool haveIPv4Conn = false; + bool haveIPv6Conn = false; + bool hadIPv4Conn = mFlags.Has(ConnectivityFlags::kHaveIPv4InternetConnectivity); + bool hadIPv6Conn = mFlags.Has(ConnectivityFlags::kHaveIPv6InternetConnectivity); + IPAddress addr; + + // If the WiFi station is currently in the connected state... + if (mWiFiStationState == kWiFiStationState_Connected) + { +#if 1 //! defined (SL_WF200) || (SL_WF200 == 0) + + haveIPv4Conn = wfx_have_ipv4_addr(SL_WFX_STA_INTERFACE); + /* TODO - haveIPv6Conn */ +#else /* Old code that needed LWIP and its internals */ + // Get the LwIP netif for the WiFi station interface. + struct netif * netif = Internal::WFXUtils::GetStationNetif(); + + // If the WiFi station interface is up... + if (netif != NULL && netif_is_up(netif) && netif_is_link_up(netif)) + { + // // Check if a DNS server is currently configured. If so... + // TODO + // ip_addr_t dnsServerAddr = *dns_getserver(0); + // if (!ip_addr_isany_val(dnsServerAddr)) + if (1) + { + // If the station interface has been assigned an IPv4 address, and has + // an IPv4 gateway, then presume that the device has IPv4 Internet + // connectivity. + if (!ip4_addr_isany_val(*netif_ip4_addr(netif)) && !ip4_addr_isany_val(*netif_ip4_gw(netif))) + { + haveIPv4Conn = true; + char addrStr[INET_ADDRSTRLEN]; + // TODO: change the code to using IPv6 address + sprintf(addrStr, "%d.%d.%d.%d", (int) (netif->ip_addr.u_addr.ip4.addr & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 8) & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 16) & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 24) & 0xff)); + IPAddress::FromString(addrStr, addr); + } + + // TODO + // Search among the IPv6 addresses assigned to the interface for a Global Unicast + // address (2000::/3) that is in the valid state. If such an address is found... + // for (uint8_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) + // { + // if (ip6_addr_isglobal(netif_ip6_addr(netif, i)) && ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) + // { + // // Determine if there is a default IPv6 router that is currently reachable + // // via the station interface. If so, presume for now that the device has + // // IPv6 connectivity. + // struct netif * found_if = nd6_find_route(IP6_ADDR_ANY6); + // if (found_if && netif->num == found_if->num) + // { + // haveIPv6Conn = true; + // } + // } + // } + } + } +#endif /* OLD-Code */ + } + + // If the internet connectivity state has changed... + if (haveIPv4Conn != hadIPv4Conn || haveIPv6Conn != hadIPv6Conn) + { + // Update the current state. + mFlags.Set(ConnectivityFlags::kHaveIPv4InternetConnectivity, haveIPv4Conn) + .Set(ConnectivityFlags::kHaveIPv6InternetConnectivity, haveIPv6Conn); + + // Alert other components of the state change. + ChipDeviceEvent event; + event.Type = DeviceEventType::kInternetConnectivityChange; + event.InternetConnectivityChange.IPv4 = GetConnectivityChange(hadIPv4Conn, haveIPv4Conn); + event.InternetConnectivityChange.IPv6 = GetConnectivityChange(hadIPv6Conn, haveIPv6Conn); + addr.ToString(event.InternetConnectivityChange.address, sizeof(event.InternetConnectivityChange.address)); + (void) PlatformMgr().PostEvent(&event); + + if (haveIPv4Conn != hadIPv4Conn) + { + ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv4", (haveIPv4Conn) ? "ESTABLISHED" : "LOST"); + } + + if (haveIPv6Conn != hadIPv6Conn) + { + ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv6", (haveIPv6Conn) ? "ESTABLISHED" : "LOST"); + } + } +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp index 0f87641906c80b..f01887563d3cdd 100644 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp +++ b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp @@ -16,6 +16,9 @@ */ #include "DeviceNetworkProvisioningDelegateImpl.h" +#include "ServiceProvisioning.h" +#include +#include #if CHIP_ENABLE_OPENTHREAD #include @@ -40,5 +43,21 @@ DeviceNetworkProvisioningDelegateImpl::_ProvisionThreadNetwork(ByteSpan threadDa #endif // CHIP_ENABLE_OPENTHREAD } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::_ProvisionWiFiNetwork(const char * ssid, const char * key) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ChipLogProgress(NetworkProvisioning, "EFR Wifi provision: SSID: %s", ssid); + err = SetWiFiStationProvisioning(ssid, key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NetworkProvisioning, "ERR:WiFi:Provision network: %s", chip::ErrorStr(err)); + } + + return err; +} +#endif + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h index e799358e4b7536..6eb53530c0c8d1 100644 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h +++ b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h @@ -35,7 +35,11 @@ class DeviceNetworkProvisioningDelegateImpl final friend class GenericDeviceNetworkProvisioningDelegateImpl; private: +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + CHIP_ERROR _ProvisionWiFiNetwork(const char * ssid, const char * passwd); +#else CHIP_ERROR _ProvisionWiFiNetwork(const char * ssid, const char * passwd) { return CHIP_ERROR_NOT_IMPLEMENTED; } +#endif CHIP_ERROR _ProvisionThreadNetwork(ByteSpan threadData); }; diff --git a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp index e04a34057f8f4b..7c838ecb8633e7 100644 --- a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp @@ -25,8 +25,9 @@ #include #include +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include - +#endif #include #include "AppConfig.h" @@ -180,13 +181,16 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** { NetworkInterface * ifp = new NetworkInterface(); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD const char * threadNetworkName = otThreadGetNetworkName(ThreadStackMgrImpl().OTInstance()); ifp->name = Span(threadNetworkName, strlen(threadNetworkName)); ifp->fabricConnected = true; ifp->offPremiseServicesReachableIPv4 = false; ifp->offPremiseServicesReachableIPv6 = false; ifp->type = InterfaceType::EMBER_ZCL_INTERFACE_TYPE_THREAD; - +#else + /* TODO */ +#endif uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index 295c6f8e08af1d..ea66ef9cf92df5 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -95,8 +95,11 @@ class EFR32Config static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); static constexpr Key kConfigKey_ActiveLocale = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); - static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); - static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1C); // Allows 16 Group Keys to be created. + static constexpr Key kConfigKey_WiFiSSID = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); + static constexpr Key kConfigKey_WiFiPSK = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); + static constexpr Key kConfigKey_WiFiSEC = EFR32ConfigKey(kChipConfig_KeyBase, 0x0F); + static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x10); + static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1F); // Allows 16 Group Keys to be created. // CHIP Counter Keys static constexpr Key kConfigKey_BootCount = EFR32ConfigKey(kChipCounter_KeyBase, 0x00); diff --git a/src/platform/EFR32/InetPlatformConfig.h b/src/platform/EFR32/InetPlatformConfig.h index 87527cf1789e3e..3e8bb9a2f6d229 100644 --- a/src/platform/EFR32/InetPlatformConfig.h +++ b/src/platform/EFR32/InetPlatformConfig.h @@ -25,10 +25,21 @@ #pragma once +#include + // ==================== Platform Adaptations ==================== +#define INET_CONFIG_ERROR_TYPE int32_t +#define INET_CONFIG_NO_ERROR 0 +#define INET_CONFIG_ERROR_MIN 1000000 +#define INET_CONFIG_ERROR_MAX 1000999 + #ifndef INET_CONFIG_ENABLE_IPV4 -#error Inet IPv4 configuration should be configured at build generation time +#ifdef SL_WIFI +#define INET_CONFIG_ENABLE_IPV4 1 +#else /* For Thread only devices */ +#define INET_CONFIG_ENABLE_IPV4 0 +#endif #endif // ========== Platform-specific Configuration Overrides ========= @@ -38,5 +49,5 @@ #endif // INET_CONFIG_NUM_TCP_ENDPOINTS #ifndef INET_CONFIG_NUM_UDP_ENDPOINTS -#define INET_CONFIG_NUM_UDP_ENDPOINTS 4 +#define INET_CONFIG_NUM_UDP_ENDPOINTS 6 #endif // INET_CONFIG_NUM_UDP_ENDPOINTS diff --git a/src/platform/EFR32/PlatformManagerImpl.cpp b/src/platform/EFR32/PlatformManagerImpl.cpp index 790bf23da7ecca..14947f894681a4 100644 --- a/src/platform/EFR32/PlatformManagerImpl.cpp +++ b/src/platform/EFR32/PlatformManagerImpl.cpp @@ -84,6 +84,74 @@ CHIP_ERROR PlatformManagerImpl::_Shutdown() return Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +void PlatformManagerImpl::HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData) +{ + ChipDeviceEvent event; + memset(&event, 0, sizeof(event)); + event.Type = DeviceEventType::kWFXSystemEvent; + event.Platform.WFXSystemEvent.eventBase = eventBase; + + if (eventBase == WIFI_EVENT) + { + switch (eventData->header.id) + { + case SL_WFX_STARTUP_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.startupEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.startupEvent)); + break; + case SL_WFX_CONNECT_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.connectEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.connectEvent)); + break; + case SL_WFX_DISCONNECT_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.disconnectEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.disconnectEvent)); + break; + // case SL_WFX_RECEIVED_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.receivedEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.receivedEvent)); + // break; + // case SL_WFX_GENERIC_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.genericEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.genericEvent)); + // break; + // case SL_WFX_EXCEPTION_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.exceptionEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.exceptionEvent)); + // break; + // case SL_WFX_ERROR_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.errorEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.errorEvent)); + // break; + default: + break; + } + } + else if (eventBase == IP_EVENT) + { + switch (eventData->header.id) + { + case IP_EVENT_STA_GOT_IP: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + case IP_EVENT_GOT_IP6: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + case IP_EVENT_STA_LOST_IP: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + default: + break; + } + } + + (void) sInstance.PostEvent(&event); +} +#endif } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/PlatformManagerImpl.h b/src/platform/EFR32/PlatformManagerImpl.h index 63a3df6fc03eb8..975fd6ab3463e0 100644 --- a/src/platform/EFR32/PlatformManagerImpl.h +++ b/src/platform/EFR32/PlatformManagerImpl.h @@ -25,6 +25,9 @@ #pragma once #include +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif namespace chip { namespace DeviceLayer { @@ -46,6 +49,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener public: // ===== Platform-specific members that may be accessed directly by the application. +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + void HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData); +#endif System::Clock::Timestamp GetStartTime() { return mStartTime; } diff --git a/src/platform/EFR32/ServiceProvisioning.cpp b/src/platform/EFR32/ServiceProvisioning.cpp new file mode 100644 index 00000000000000..494c03b7ec2a61 --- /dev/null +++ b/src/platform/EFR32/ServiceProvisioning.cpp @@ -0,0 +1,56 @@ +/* + * + * 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. + */ + +#include +#include +#include + +#include "wfx_host_events.h" +#include + +#include "ServiceProvisioning.h" + +using namespace ::chip::DeviceLayer; + +CHIP_ERROR SetWiFiStationProvisioning(const char * ssid, const char * key) +{ + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled); + + CHIP_ERROR err = CHIP_NO_ERROR; + wfx_wifi_provision_t wifiConfig; + + // Set the wifi configuration + memset(&wifiConfig, 0, sizeof(wifiConfig)); + memcpy(wifiConfig.ssid, ssid, std::min(strlen(ssid) + 1, sizeof(wifiConfig.ssid))); + memcpy(wifiConfig.passkey, key, std::min(strlen(key) + 1, sizeof(wifiConfig.passkey))); + wifiConfig.security = WFX_SEC_WPA2; /* Need something better ? Scan? */ + + // Configure the WFX WiFi interface. + wfx_set_wifi_provision(&wifiConfig); + /* Save into internal Keys */ + (void) Internal::EFR32Config::WriteConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, (char *) ssid); + (void) Internal::EFR32Config::WriteConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiPSK, key); + (void) Internal::EFR32Config::WriteConfigValueBin(Internal::EFR32Config::kConfigKey_WiFiSEC, &wifiConfig.security, + sizeof(wifiConfig.security)); + + ChipLogProgress(DeviceLayer, "SP WiFi STA provision set (SSID: %s)", wifiConfig.ssid); + + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled); + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Enabled); + + return err; +} diff --git a/src/platform/EFR32/ServiceProvisioning.h b/src/platform/EFR32/ServiceProvisioning.h new file mode 100644 index 00000000000000..109ec4ae33ea6c --- /dev/null +++ b/src/platform/EFR32/ServiceProvisioning.h @@ -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. + */ + +#ifndef _SERVICE_PROVISIONING_H +#define _SERVICE_PROVISIONING_H + +#include + +CHIP_ERROR SetWiFiStationProvisioning(const char * ssid, const char * key); + +#endif // _SERVICE_PROVISIONING_H diff --git a/src/platform/EFR32/wifi_args.gni b/src/platform/EFR32/wifi_args.gni new file mode 100644 index 00000000000000..fc6660bc825d73 --- /dev/null +++ b/src/platform/EFR32/wifi_args.gni @@ -0,0 +1,46 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${chip_root}/examples/platform/efr32/args.gni") + +# ARM architecture flags will be set based on efr32_family. +arm_platform_config = "${efr32_sdk_build_root}/efr32_arm.gni" + +mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" + +#lwip_platform = "external" +lwip_platform = "efr32" +lwip_ipv6 = true +lwip_ipv4 = true +lwip_api = true +lwip_ethernet = true + +chip_device_platform = "efr32" +chip_enable_openthread = false +chip_inet_config_enable_ipv4 = true +chip_inet_config_enable_dns_resolver = false + +chip_build_tests = false +chip_config_memory_management = "platform" +chip_mdns = "minimal" +chip_enable_pw_rpc = false + +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] diff --git a/src/platform/Linux/OTAImageProcessorImpl.cpp b/src/platform/Linux/OTAImageProcessorImpl.cpp index 5c2fa16486ff8c..afcff9f326cfc1 100644 --- a/src/platform/Linux/OTAImageProcessorImpl.cpp +++ b/src/platform/Linux/OTAImageProcessorImpl.cpp @@ -125,10 +125,16 @@ void OTAImageProcessorImpl::HandleFinalize(intptr_t context) void OTAImageProcessorImpl::HandleApply(intptr_t context) { + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + return; + } + OTARequestorInterface * requestor = chip::GetRequestorInstance(); if (requestor != nullptr) { - requestor->NotifyUpdateApplied(); + requestor->NotifyUpdateApplied(imageProcessor->mHeader.softwareVersion); } } diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index d9fbaeb9d32c1a..6b4ad3ebf17368 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -88,19 +89,19 @@ void SignalHandler(int signum) err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED; break; case SIGTRAP: - PlatformMgrImpl().HandleSoftwareFault(SoftwareDiagnostics::Events::SoftwareFault::kEventId); + PlatformMgrImpl().HandleSoftwareFault(SoftwareDiagnostics::Events::SoftwareFault::Id); break; case SIGILL: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::HardwareFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::HardwareFaultChange::Id); break; case SIGALRM: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::RadioFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::RadioFaultChange::Id); break; case SIGVTALRM: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::Id); break; case SIGIO: - PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::kEventId); + PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::Id); break; default: break; @@ -385,7 +386,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) return; } - if (EventId == GeneralDiagnostics::Events::HardwareFaultChange::kEventId) + if (EventId == GeneralDiagnostics::Events::HardwareFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -402,7 +403,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) #endif delegate->OnHardwareFaultsDetected(previous, current); } - else if (EventId == GeneralDiagnostics::Events::RadioFaultChange::kEventId) + else if (EventId == GeneralDiagnostics::Events::RadioFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -419,7 +420,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) #endif delegate->OnRadioFaultsDetected(previous, current); } - else if (EventId == GeneralDiagnostics::Events::NetworkFaultChange::kEventId) + else if (EventId == GeneralDiagnostics::Events::NetworkFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -470,7 +471,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) return; } - if (EventId == Switch::Events::SwitchLatched::kEventId) + if (EventId == Switch::Events::SwitchLatched::Id) { uint8_t newPosition = 0; @@ -479,7 +480,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnSwitchLatched(newPosition); } - else if (EventId == Switch::Events::InitialPress::kEventId) + else if (EventId == Switch::Events::InitialPress::Id) { uint8_t newPosition = 0; @@ -488,7 +489,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnInitialPressed(newPosition); } - else if (EventId == Switch::Events::LongPress::kEventId) + else if (EventId == Switch::Events::LongPress::Id) { uint8_t newPosition = 0; @@ -497,7 +498,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnLongPressed(newPosition); } - else if (EventId == Switch::Events::ShortRelease::kEventId) + else if (EventId == Switch::Events::ShortRelease::Id) { uint8_t previousPosition = 0; @@ -506,7 +507,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnShortReleased(previousPosition); } - else if (EventId == Switch::Events::LongRelease::kEventId) + else if (EventId == Switch::Events::LongRelease::Id) { uint8_t previousPosition = 0; @@ -515,7 +516,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnLongReleased(previousPosition); } - else if (EventId == Switch::Events::MultiPressOngoing::kEventId) + else if (EventId == Switch::Events::MultiPressOngoing::Id) { uint8_t newPosition = 0; uint8_t currentNumberOfPressesCounted = 0; @@ -526,7 +527,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnMultiPressOngoing(newPosition, currentNumberOfPressesCounted); } - else if (EventId == Switch::Events::MultiPressComplete::kEventId) + else if (EventId == Switch::Events::MultiPressComplete::Id) { uint8_t newPosition = 0; uint8_t totalNumberOfPressesCounted = 0; diff --git a/src/platform/Linux/bluez/Helper.cpp b/src/platform/Linux/bluez/Helper.cpp index 30844ce3bc5eab..4819c3c8d2560d 100644 --- a/src/platform/Linux/bluez/Helper.cpp +++ b/src/platform/Linux/bluez/Helper.cpp @@ -422,7 +422,9 @@ static gboolean BluezCharacteristicAcquireWrite(BluezGattCharacteristic1 * aChar { int fds[2] = { -1, -1 }; GIOChannel * channel; +#if CHIP_ERROR_LOGGING char * errStr; +#endif // CHIP_ERROR_LOGGING GVariantDict options; bool isSuccess = false; BluezConnection * conn = nullptr; @@ -438,7 +440,9 @@ static gboolean BluezCharacteristicAcquireWrite(BluezGattCharacteristic1 * aChar if (socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK | SOCK_CLOEXEC, 0, fds) < 0) { +#if CHIP_ERROR_LOGGING errStr = strerror(errno); +#endif // CHIP_ERROR_LOGGING ChipLogError(DeviceLayer, "FAIL: socketpair: %s in %s", errStr, __func__); g_dbus_method_invocation_return_dbus_error(aInvocation, "org.bluez.Error.Failed", "FD creation failed"); goto exit; @@ -490,7 +494,9 @@ static gboolean BluezCharacteristicAcquireNotify(BluezGattCharacteristic1 * aCha { int fds[2] = { -1, -1 }; GIOChannel * channel; +#if CHIP_ERROR_LOGGING char * errStr; +#endif // CHIP_ERROR_LOGGING GVariantDict options; BluezConnection * conn = nullptr; bool isSuccess = false; @@ -515,7 +521,9 @@ static gboolean BluezCharacteristicAcquireNotify(BluezGattCharacteristic1 * aCha } if (socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK | SOCK_CLOEXEC, 0, fds) < 0) { +#if CHIP_ERROR_LOGGING errStr = strerror(errno); +#endif // CHIP_ERROR_LOGGING ChipLogError(DeviceLayer, "FAIL: socketpair: %s in %s", errStr, __func__); g_dbus_method_invocation_return_dbus_error(aInvocation, "org.bluez.Error.Failed", "FD creation failed"); goto exit; diff --git a/src/platform/Linux/bluez/MainLoop.cpp b/src/platform/Linux/bluez/MainLoop.cpp index 55c58bf38827c6..64320f5cfa674b 100644 --- a/src/platform/Linux/bluez/MainLoop.cpp +++ b/src/platform/Linux/bluez/MainLoop.cpp @@ -122,7 +122,9 @@ CHIP_ERROR MainLoop::EnsureStarted() } int pthreadErr = pthread_create(&mThread, nullptr, &MainLoop::Thread, reinterpret_cast(this)); - int tmpErrno = errno; +#if CHIP_ERROR_LOGGING + int tmpErrno = errno; +#endif // CHIP_ERROR_LOGGING if (pthreadErr != 0) { ChipLogError(DeviceLayer, "FAIL: pthread_create (%s) in %s", strerror(tmpErrno), __func__); diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp index f6f392ee1ceca7..c21134e33e5b83 100644 --- a/src/platform/Zephyr/BLEManagerImpl.cpp +++ b/src/platform/Zephyr/BLEManagerImpl.cpp @@ -359,11 +359,6 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) ChipLogProgress(DeviceLayer, "CHIPoBLE advertising stopped"); -#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - // Increment life time counter to protect against long-term tracking of rotating device ID. - ReturnErrorOnFailure(ConfigurationMgr().IncrementLifetimeCounter()); -#endif - // Post a CHIPoBLEAdvertisingChange(Stopped) event. { ChipDeviceEvent advChange; diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 60baa9424f4784..1097f7b2ff8fd6 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -102,3 +102,11 @@ #ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT + +#ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 +#endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE + +#ifdef CONFIG_CHIP_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE +#endif // CONFIG_CHIP_DEVICE_TYPE diff --git a/src/protocols/secure_channel/SessionIDAllocator.cpp b/src/protocols/secure_channel/SessionIDAllocator.cpp index 650dab3c2fbdbf..9df635d98d84fd 100644 --- a/src/protocols/secure_channel/SessionIDAllocator.cpp +++ b/src/protocols/secure_channel/SessionIDAllocator.cpp @@ -21,14 +21,16 @@ namespace chip { +uint16_t SessionIDAllocator::sNextAvailable = 1; + CHIP_ERROR SessionIDAllocator::Allocate(uint16_t & id) { - VerifyOrReturnError(mNextAvailable < kMaxSessionID, CHIP_ERROR_NO_MEMORY); - VerifyOrReturnError(mNextAvailable > kUnsecuredSessionId, CHIP_ERROR_INTERNAL); - id = mNextAvailable; + VerifyOrReturnError(sNextAvailable < kMaxSessionID, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sNextAvailable > kUnsecuredSessionId, CHIP_ERROR_INTERNAL); + id = sNextAvailable; // TODO - Update SessionID allocator to use freed session IDs - mNextAvailable++; + sNextAvailable++; return CHIP_NO_ERROR; } @@ -36,19 +38,19 @@ CHIP_ERROR SessionIDAllocator::Allocate(uint16_t & id) void SessionIDAllocator::Free(uint16_t id) { // As per spec 4.4.1.3 Session ID of 0 is reserved for Unsecure communication - if (mNextAvailable > (kUnsecuredSessionId + 1) && (mNextAvailable - 1) == id) + if (sNextAvailable > (kUnsecuredSessionId + 1) && (sNextAvailable - 1) == id) { - mNextAvailable--; + sNextAvailable--; } } CHIP_ERROR SessionIDAllocator::Reserve(uint16_t id) { VerifyOrReturnError(id < kMaxSessionID, CHIP_ERROR_NO_MEMORY); - if (id >= mNextAvailable) + if (id >= sNextAvailable) { - mNextAvailable = id; - mNextAvailable++; + sNextAvailable = id; + sNextAvailable++; } // TODO - Check if ID is already allocated in SessionIDAllocator::Reserve() @@ -59,23 +61,23 @@ CHIP_ERROR SessionIDAllocator::Reserve(uint16_t id) CHIP_ERROR SessionIDAllocator::ReserveUpTo(uint16_t id) { VerifyOrReturnError(id < kMaxSessionID, CHIP_ERROR_NO_MEMORY); - if (id >= mNextAvailable) + if (id >= sNextAvailable) { - mNextAvailable = id; - mNextAvailable++; + sNextAvailable = id; + sNextAvailable++; } // TODO - Update ReserveUpTo to mark all IDs in use // Current SessionIDAllocator only tracks the smallest unused session ID. // If/when we change it to track all in use IDs, we should also update ReserveUpTo - // to reserve all individual session IDs, instead of just setting the mNextAvailable. + // to reserve all individual session IDs, instead of just setting the sNextAvailable. return CHIP_NO_ERROR; } uint16_t SessionIDAllocator::Peek() { - return mNextAvailable; + return sNextAvailable; } } // namespace chip diff --git a/src/protocols/secure_channel/SessionIDAllocator.h b/src/protocols/secure_channel/SessionIDAllocator.h index 25cb69334db89b..c56b292c1b3ed8 100644 --- a/src/protocols/secure_channel/SessionIDAllocator.h +++ b/src/protocols/secure_channel/SessionIDAllocator.h @@ -27,6 +27,9 @@ // available keys (either session or group), and the particular encryption/message // integrity algorithm to use for the message.The Session ID field is always present. // A Session ID of 0 SHALL indicate an unsecured session with no encryption or message integrity checking. +// +// The Session ID is allocated from a global numerical space shared across all fabrics and nodes on the resident process instance. +// namespace chip { @@ -46,7 +49,7 @@ class SessionIDAllocator static constexpr uint16_t kMaxSessionID = UINT16_MAX; static constexpr uint16_t kUnsecuredSessionId = 0; - uint16_t mNextAvailable = 1; + static uint16_t sNextAvailable; }; } // namespace chip diff --git a/src/protocols/secure_channel/tests/TestSessionIDAllocator.cpp b/src/protocols/secure_channel/tests/TestSessionIDAllocator.cpp index 68aa420e02c96c..55ce38f24b30d8 100644 --- a/src/protocols/secure_channel/tests/TestSessionIDAllocator.cpp +++ b/src/protocols/secure_channel/tests/TestSessionIDAllocator.cpp @@ -24,76 +24,61 @@ using namespace chip; -void TestSessionIDAllocator_Allocate(nlTestSuite * inSuite, void * inContext) -{ - SessionIDAllocator allocator; - - NL_TEST_ASSERT(inSuite, allocator.Peek() == 1); - - uint16_t id; - - for (uint16_t i = 1; i < 16; i++) - { - CHIP_ERROR err = allocator.Allocate(id); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, id == i); - NL_TEST_ASSERT(inSuite, allocator.Peek() == i + 1); - } -} - void TestSessionIDAllocator_Free(nlTestSuite * inSuite, void * inContext) { SessionIDAllocator allocator; - - NL_TEST_ASSERT(inSuite, allocator.Peek() == 1); + uint16_t i = allocator.Peek(); uint16_t id; - for (uint16_t i = 1; i < 17; i++) + for (uint16_t j = 0; j < 17; j++) { CHIP_ERROR err = allocator.Allocate(id); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, id == i); - NL_TEST_ASSERT(inSuite, allocator.Peek() == i + 1); + NL_TEST_ASSERT(inSuite, id == static_cast(i + j)); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + j + 1)); } // Free an intermediate ID allocator.Free(10); - NL_TEST_ASSERT(inSuite, allocator.Peek() == 17); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + 17)); // Free the last allocated ID - allocator.Free(16); - NL_TEST_ASSERT(inSuite, allocator.Peek() == 16); + allocator.Free(static_cast(i + 16)); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + 16)); // Free some random unallocated ID allocator.Free(100); - NL_TEST_ASSERT(inSuite, allocator.Peek() == 16); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + 16)); } void TestSessionIDAllocator_Reserve(nlTestSuite * inSuite, void * inContext) { SessionIDAllocator allocator; - + uint16_t i = allocator.Peek(); uint16_t id; - for (uint16_t i = 1; i < 16; i++) + for (uint16_t j = 0; j < 17; j++) { CHIP_ERROR err = allocator.Allocate(id); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, id == i); - NL_TEST_ASSERT(inSuite, allocator.Peek() == i + 1); + NL_TEST_ASSERT(inSuite, id == static_cast(i + j)); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + j + 1)); } - allocator.Reserve(100); - NL_TEST_ASSERT(inSuite, allocator.Peek() == 101); + i = allocator.Peek(); + allocator.Reserve(static_cast(i + 100)); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + 101)); } void TestSessionIDAllocator_ReserveUpTo(nlTestSuite * inSuite, void * inContext) { SessionIDAllocator allocator; + uint16_t i = allocator.Peek(); - allocator.ReserveUpTo(100); - NL_TEST_ASSERT(inSuite, allocator.Peek() == 101); + i = allocator.Peek(); + allocator.Reserve(static_cast(i + 100)); + NL_TEST_ASSERT(inSuite, allocator.Peek() == static_cast(i + 101)); } // Test Suite @@ -104,7 +89,6 @@ void TestSessionIDAllocator_ReserveUpTo(nlTestSuite * inSuite, void * inContext) // clang-format off static const nlTest sTests[] = { - NL_TEST_DEF("SessionIDAllocator_Allocate", TestSessionIDAllocator_Allocate), NL_TEST_DEF("SessionIDAllocator_Free", TestSessionIDAllocator_Free), NL_TEST_DEF("SessionIDAllocator_Reserve", TestSessionIDAllocator_Reserve), NL_TEST_DEF("SessionIDAllocator_ReserveUpTo", TestSessionIDAllocator_ReserveUpTo), diff --git a/src/trace/BUILD.gn b/src/trace/BUILD.gn index 546107ad45ce67..209909432dc0bd 100644 --- a/src/trace/BUILD.gn +++ b/src/trace/BUILD.gn @@ -18,11 +18,14 @@ declare_args() { chip_build_pw_trace_lib = false } +config("config") { + defines = [ "PW_TRACE_BACKEND_SET" ] +} + source_set("trace") { sources = [ "trace.h" ] - if (chip_build_pw_trace_lib) { - cflags = [ "-DPW_TRACE_BACKEND_SET=1" ] + public_configs = [ ":config" ] public_deps = [ "${dir_pigweed}/pw_trace" ] } } diff --git a/src/transport/SecureSession.cpp b/src/transport/SecureSession.cpp index 3a9be04d8912e6..67e4378ba4e0e0 100644 --- a/src/transport/SecureSession.cpp +++ b/src/transport/SecureSession.cpp @@ -32,9 +32,9 @@ Access::SubjectDescriptor SecureSession::GetSubjectDescriptor() const } else if (IsPAKEKeyId(mPeerNodeId)) { - subjectDescriptor.authMode = Access::AuthMode::kPase; - subjectDescriptor.subject = mPeerNodeId; - // TODO(#10242): PASE *can* have fabric in some situations + subjectDescriptor.authMode = Access::AuthMode::kPase; + subjectDescriptor.subject = mPeerNodeId; + subjectDescriptor.fabricIndex = mFabric; } else { diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index 05efecc190ae32..5edcac726f96d2 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -114,6 +114,23 @@ class SecureSession : public Session uint16_t GetPeerSessionId() const { return mPeerSessionId; } FabricIndex GetFabricIndex() const { return mFabric; } + // Should only be called for PASE sessions, which start with undefined fabric, + // to migrate to a newly commissioned fabric after successful + // OperationalCredentialsCluster::AddNOC + CHIP_ERROR NewFabric(FabricIndex fabricIndex) + { +#if 0 + // TODO(#13711): this check won't work until the issue is addressed + if (mSecureSessionType == Type::kPASE) + { + mFabric = fabricIndex; + } +#else + mFabric = fabricIndex; +#endif + return CHIP_NO_ERROR; + } + System::Clock::Timestamp GetLastActivityTime() const { return mLastActivityTime; } void MarkActive() { mLastActivityTime = System::SystemClock().GetMonotonicTimestamp(); } @@ -139,7 +156,10 @@ class SecureSession : public Session const CATValues mPeerCATs; const uint16_t mLocalSessionId; const uint16_t mPeerSessionId; - const FabricIndex mFabric; + + // PASE sessions start with undefined fabric, but are migrated to a newly + // commissioned fabric after successful OperationalCredentialsCluster::AddNOC + FabricIndex mFabric; PeerAddress mPeerAddress; System::Clock::Timestamp mLastActivityTime; diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/efr32_sdk/efr32_sdk.gni index 82191ec80ca1e1..0bd7a6faf8bd9d 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/efr32_sdk/efr32_sdk.gni @@ -38,6 +38,12 @@ template("efr32_sdk") { } assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") + use_wf200 = false + if (defined(invoker.use_wf200)) { + if (invoker.use_wf200) { + use_wf200 = true + } + } sdk_target_name = target_name @@ -224,6 +230,15 @@ template("efr32_sdk") { "CHIP_KVS_SECTOR_COUNT=4", ] } + if (use_wf200) { + _include_dirs += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/firmware", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/pds/brd8022a", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link", + ] + } cflags = [] foreach(include_dir, _include_dirs) { @@ -443,6 +458,14 @@ template("efr32_sdk") { ] } } + if (use_wf200) { + sources += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus_spi.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link/sl_wfx_secure_link.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/sl_wfx.c", + ] + } if (efr32_family == "efr32mg12") { sources += [ diff --git a/third_party/jsoncpp/BUILD.gn b/third_party/jsoncpp/BUILD.gn new file mode 100644 index 00000000000000..aae8f025e2feca --- /dev/null +++ b/third_party/jsoncpp/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +config("jsoncpp_config") { + include_dirs = [ "repo/include" ] + + cflags = [ "-Wno-implicit-fallthrough" ] +} + +source_set("jsoncpp") { + sources = [ + "repo/include/json/allocator.h", + "repo/include/json/assertions.h", + "repo/include/json/config.h", + "repo/include/json/forwards.h", + "repo/include/json/json.h", + "repo/include/json/json_features.h", + "repo/include/json/reader.h", + "repo/include/json/value.h", + "repo/include/json/version.h", + "repo/include/json/writer.h", + "repo/src/lib_json/json_reader.cpp", + "repo/src/lib_json/json_tool.h", + "repo/src/lib_json/json_value.cpp", + "repo/src/lib_json/json_writer.cpp", + ] + + public_configs = [ ":jsoncpp_config" ] + + defines = [ + "JSON_USE_EXCEPTION=0", + "JSON_USE_NULLREF=0", + ] + + include_dirs = [ "repo/src/lib_json" ] +} diff --git a/third_party/jsoncpp/repo b/third_party/jsoncpp/repo new file mode 160000 index 00000000000000..42e892d96e47b1 --- /dev/null +++ b/third_party/jsoncpp/repo @@ -0,0 +1 @@ +Subproject commit 42e892d96e47b1f6e29844cc705e148ec4856448 diff --git a/third_party/openthread/platforms/qpg/BUILD.gn b/third_party/openthread/platforms/qpg/BUILD.gn index f87607b062e249..4a3c7634b2f7d9 100644 --- a/third_party/openthread/platforms/qpg/BUILD.gn +++ b/third_party/openthread/platforms/qpg/BUILD.gn @@ -64,7 +64,9 @@ source_set("libopenthread-qpg") { ] include_dirs += [ "${openthread_root}/examples/apps" ] - libs = [ "${qpg_sdk_root}/${qpg_target_ic}/lib/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ] + if (qpg_sdk_include_platform_libs) { + libs = [ "${qpg_sdk_root}/${qpg_sdk_lib_dir}/OpenThreadQorvoGlue_${qpg_target_ic}_mtd/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ] + } public_deps = [ ":openthread_core_config_qpg", diff --git a/third_party/qpg_sdk/BUILD.gn b/third_party/qpg_sdk/BUILD.gn index ce2d987151e179..c7cf2b29d0b7bc 100755 --- a/third_party/qpg_sdk/BUILD.gn +++ b/third_party/qpg_sdk/BUILD.gn @@ -33,8 +33,8 @@ group("qpg_sdk") { config("qpg_freertos_config") { include_dirs = [ - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config", - "${chip_root}/third_party/qpg_sdk/repo/${qpg_target_ic}/comps/lwip", + "${qpg_sdk_root}/Applications/Matter/shared/config/inc", + "${qpg_sdk_root}/Components/ThirdParty/Lwip", "${freertos_root}/repo/portable/GCC/ARM_CM3", ] } diff --git a/third_party/qpg_sdk/qpg_sdk.gni b/third_party/qpg_sdk/qpg_sdk.gni index 5b8385cee44a91..9cae9288e36e14 100644 --- a/third_party/qpg_sdk/qpg_sdk.gni +++ b/third_party/qpg_sdk/qpg_sdk.gni @@ -22,8 +22,16 @@ declare_args() { # Location of the QPG SDK. qpg_sdk_root = "${chip_root}/third_party/qpg_sdk/repo" + # subdirectory in qpg_sdk_root where the binary library builds (.a) are to be found + # for connectedhomeip-qpg: Binaries (default) + # for matter endnodes sdk: Work + qpg_sdk_lib_dir = "Binaries" + # Target IC for QPG SDK qpg_target_ic = "qpg6105" + + # an option to disable referencing qorvo object archive files (*.a) + qpg_sdk_include_platform_libs = true } assert(qpg_sdk_root != "", "qpg_sdk_root must be specified") @@ -57,21 +65,25 @@ template("qpg_sdk") { } include_dirs += [ - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc", - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvIO/inc", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls", + "${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc", + "${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt", + "${qpg_sdk_root}/Components/ThirdParty/Lwip", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch", "${mbedtls_root}/repo/include", "${openthread_root}/include", ] lib_dirs = [] - libs += [ - "${qpg_sdk_root}/${qpg_target_ic}/lib/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a", - "${qpg_sdk_root}/${qpg_target_ic}/lib/libQorvoStack_${qpg_target_ic}.a", - "${qpg_sdk_root}/${qpg_target_ic}/lib/libmbedtls_alt_${qpg_target_ic}.a", - ] + if (qpg_sdk_include_platform_libs) { + libs += [ + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/MatterQorvoGlue_${qpg_target_ic}_libbuild/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a", + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/QorvoStack_${qpg_target_ic}/libQorvoStack_${qpg_target_ic}.a", + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/mbedtls_alt_${qpg_target_ic}/libmbedtls_alt_${qpg_target_ic}.a", + ] + } #MBed TLS built from third_party/mbedtls tree - OT config not used defines = [ @@ -177,18 +189,19 @@ template("qpg_sdk") { "${chip_root}/third_party/mbedtls/repo/library/x509write_crt.c", "${chip_root}/third_party/mbedtls/repo/library/x509write_csr.c", "${chip_root}/third_party/mbedtls/repo/library/xtea.c", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/FreeRTOSConfig.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/hooks.c", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/${qpg_target_ic}-mbedtls-config.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/aes_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ccm_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecjpake_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecp_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/sha256_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/trng.c", #add this for + "${qpg_sdk_root}/Applications/Matter/shared/config/inc/FreeRTOSConfig.h", + "${qpg_sdk_root}/Applications/Matter/shared/config/src/hooks.c", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/aes_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ccm_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecjpake_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecp_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/sha256_alt.h", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc/${qpg_target_ic}-mbedtls-config.h", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/src/trng.c", # mbedtls_hardware_poll - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc/qvCHIP.h", + "${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc/qvIO.h", + "${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc/qvCHIP.h", ] if (defined(invoker.sources)) { diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index 6bce6f11208c77..2b463adb2a9323 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit 6bce6f11208c77dfc6bb1b9256bf01248ff002ab +Subproject commit 2b463adb2a9323fc54d435f359cd0f167845dfb1 diff --git a/third_party/wiseconnect-wifi-bt-sdk b/third_party/wiseconnect-wifi-bt-sdk new file mode 120000 index 00000000000000..11fcb1f88f5c89 --- /dev/null +++ b/third_party/wiseconnect-wifi-bt-sdk @@ -0,0 +1 @@ +../../../wiseconnect-wifi-bt-sdk \ No newline at end of file diff --git a/third_party/zap/repo b/third_party/zap/repo index 9c60a2d16c3eaf..d57a2656ed73c1 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 9c60a2d16c3eaf9bbb30256bcb798b4c348446d0 +Subproject commit d57a2656ed73c12a72e393ab65cb0a729b9593a9 diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 7a87e98863a0e6..570907f9c84f7b 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1484,7 +1484,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 615 +#define GENERATED_ATTRIBUTE_COUNT 616 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1713,6 +1713,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -2508,220 +2509,220 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(166), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(170), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(170), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(176), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003F, ZAP_ATTRIBUTE_INDEX(177), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(181), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(182), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(183), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(184), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(185), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000405, ZAP_ATTRIBUTE_INDEX(186), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(189), \ + ZAP_ATTRIBUTE_INDEX(190), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(192), \ + ZAP_ATTRIBUTE_INDEX(193), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(194), \ + ZAP_ATTRIBUTE_INDEX(195), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(200), \ + ZAP_ATTRIBUTE_INDEX(201), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x00000007, ZAP_ATTRIBUTE_INDEX(207), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000007, ZAP_ATTRIBUTE_INDEX(208), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(210), \ + ZAP_ATTRIBUTE_INDEX(211), \ 16, \ 27, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x0000000F, ZAP_ATTRIBUTE_INDEX(226), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000000F, ZAP_ATTRIBUTE_INDEX(227), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(230), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(231), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(235), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001E, ZAP_ATTRIBUTE_INDEX(236), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { \ - 0x00000025, ZAP_ATTRIBUTE_INDEX(236), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000025, ZAP_ATTRIBUTE_INDEX(237), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x0000002B, ZAP_ATTRIBUTE_INDEX(240), 2, 36, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000002B, ZAP_ATTRIBUTE_INDEX(241), 2, 36, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Localization Configuration (server) */ \ { \ - 0x0000002F, ZAP_ATTRIBUTE_INDEX(242), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000002F, ZAP_ATTRIBUTE_INDEX(243), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(253), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000031, ZAP_ATTRIBUTE_INDEX(254), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { \ - 0x00000039, ZAP_ATTRIBUTE_INDEX(263), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000039, ZAP_ATTRIBUTE_INDEX(264), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(264), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003B, ZAP_ATTRIBUTE_INDEX(265), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(269), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(270), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(271), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(272), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: User Label (server) */ \ { \ - 0x00000045, ZAP_ATTRIBUTE_INDEX(273), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000045, ZAP_ATTRIBUTE_INDEX(274), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x00000050, ZAP_ATTRIBUTE_INDEX(275), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000050, ZAP_ATTRIBUTE_INDEX(276), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x00000101, \ - ZAP_ATTRIBUTE_INDEX(281), \ + ZAP_ATTRIBUTE_INDEX(282), \ 28, \ 49, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(309), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000102, ZAP_ATTRIBUTE_INDEX(310), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x00000103, ZAP_ATTRIBUTE_INDEX(329), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000103, ZAP_ATTRIBUTE_INDEX(330), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x00000200, \ - ZAP_ATTRIBUTE_INDEX(334), \ + ZAP_ATTRIBUTE_INDEX(335), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(360), \ + ZAP_ATTRIBUTE_INDEX(361), \ 19, \ 34, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x00000204, \ - ZAP_ATTRIBUTE_INDEX(379), \ + ZAP_ATTRIBUTE_INDEX(380), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(383), \ + ZAP_ATTRIBUTE_INDEX(384), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x00000400, ZAP_ATTRIBUTE_INDEX(436), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000400, ZAP_ATTRIBUTE_INDEX(437), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(442), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(443), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(447), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000403, ZAP_ATTRIBUTE_INDEX(448), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(451), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000404, ZAP_ATTRIBUTE_INDEX(452), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(456), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000405, ZAP_ATTRIBUTE_INDEX(457), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(461), \ + ZAP_ATTRIBUTE_INDEX(462), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x00000500, \ - ZAP_ATTRIBUTE_INDEX(465), \ + ZAP_ATTRIBUTE_INDEX(466), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(471), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000503, ZAP_ATTRIBUTE_INDEX(472), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(473), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000504, ZAP_ATTRIBUTE_INDEX(474), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Channel (server) */ \ { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(475), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000505, ZAP_ATTRIBUTE_INDEX(476), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(478), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000506, ZAP_ATTRIBUTE_INDEX(479), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(485), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000507, ZAP_ATTRIBUTE_INDEX(486), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x00000508, ZAP_ATTRIBUTE_INDEX(488), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000508, ZAP_ATTRIBUTE_INDEX(489), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(489), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000509, ZAP_ATTRIBUTE_INDEX(490), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(490), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050A, ZAP_ATTRIBUTE_INDEX(491), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(493), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050B, ZAP_ATTRIBUTE_INDEX(494), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(496), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050C, ZAP_ATTRIBUTE_INDEX(497), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(498), 8, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050D, ZAP_ATTRIBUTE_INDEX(499), 8, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(506), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050E, ZAP_ATTRIBUTE_INDEX(507), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x0000050F, ZAP_ATTRIBUTE_INDEX(507), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050F, ZAP_ATTRIBUTE_INDEX(508), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x00000B04, ZAP_ATTRIBUTE_INDEX(585), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000B04, ZAP_ATTRIBUTE_INDEX(586), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(597), \ + ZAP_ATTRIBUTE_INDEX(598), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 2, Cluster: Groups (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(599), \ + ZAP_ATTRIBUTE_INDEX(600), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(606), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(607), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(611), \ + ZAP_ATTRIBUTE_INDEX(612), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2764,7 +2765,7 @@ // Array of device ids #define FIXED_DEVICE_IDS \ { \ - 22, 22, 22 \ + 22, 256, 256 \ } // Array of device versions diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index 0631b180ff8857..171a2b2391d09b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -245,7 +245,7 @@ typedef struct _ExtensionEntry // Struct for FabricDescriptor typedef struct _FabricDescriptor { - uint8_t FabricIndex; + chip::FabricIndex FabricIndex; chip::ByteSpan RootPublicKey; uint16_t VendorId; chip::FabricId FabricId; @@ -326,8 +326,9 @@ typedef struct _ModeOptionStruct // Struct for NOCStruct typedef struct _NOCStruct { - uint8_t FabricIndex; + chip::FabricIndex FabricIndex; chip::ByteSpan NOC; + chip::ByteSpan ICAC; } NOCStruct; // Struct for NeighborTable diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index aea2d23d566967..905dc465a1e454 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -590,6 +590,7 @@ // Client attributes // Server attributes +#define ZCL_NOCS_ATTRIBUTE_ID (0x0000) #define ZCL_FABRICS_ATTRIBUTE_ID (0x0001) #define ZCL_SUPPORTED_FABRICS_ATTRIBUTE_ID (0x0002) #define ZCL_COMMISSIONED_FABRICS_ATTRIBUTE_ID (0x0003) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 4afd56afd3ff67..67403a7b9719f1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -9785,6 +9785,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNoc)), noc)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIcac)), icac)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -9807,6 +9808,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kNoc): ReturnErrorOnFailure(DataModel::Decode(reader, noc)); break; + case to_underlying(Fields::kIcac): + ReturnErrorOnFailure(DataModel::Decode(reader, icac)); + break; default: break; } @@ -10309,6 +10313,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { + case Attributes::NOCs::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, NOCs)); + break; case Attributes::FabricsList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, fabricsList)); break; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 43e92032bf5ce9..64bbdcf3f43936 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -43,8 +44,8 @@ namespace Structs { namespace LabelStruct { enum class Fields { - kLabel = 1, - kValue = 2, + kLabel = 0, + kValue = 1, }; struct Type @@ -1791,9 +1792,9 @@ namespace Structs { namespace SceneExtensionFieldSet { enum class Fields { - kClusterId = 1, - kLength = 2, - kValue = 3, + kClusterId = 0, + kLength = 1, + kValue = 2, }; struct Type @@ -4534,10 +4535,10 @@ namespace Structs { namespace PowerProfileRecord { enum class Fields { - kPowerProfileId = 1, - kEnergyPhaseId = 2, - kPowerProfileRemoteControl = 3, - kPowerProfileState = 4, + kPowerProfileId = 0, + kEnergyPhaseId = 1, + kPowerProfileRemoteControl = 2, + kPowerProfileState = 3, }; struct Type @@ -4558,8 +4559,8 @@ using DecodableType = Type; namespace ScheduledPhase { enum class Fields { - kEnergyPhaseId = 1, - kScheduledTime = 2, + kEnergyPhaseId = 0, + kScheduledTime = 1, }; struct Type @@ -4578,12 +4579,12 @@ using DecodableType = Type; namespace TransferredPhase { enum class Fields { - kEnergyPhaseId = 1, - kMacroPhaseId = 2, - kExpectedDuration = 3, - kPeakPower = 4, - kEnergy = 5, - kMaxActivationDelay = 6, + kEnergyPhaseId = 0, + kMacroPhaseId = 1, + kExpectedDuration = 2, + kPeakPower = 3, + kEnergy = 4, + kMaxActivationDelay = 5, }; struct Type @@ -6112,8 +6113,8 @@ namespace Structs { namespace DeviceType { enum class Fields { - kType = 1, - kRevision = 2, + kType = 0, + kRevision = 1, }; struct Type @@ -6586,7 +6587,6 @@ struct TypeInfo namespace Events { namespace AccessControlEntryChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -6601,14 +6601,14 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlEntryChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::AccessControlEntry::Type latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -6617,21 +6617,20 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlEntryChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::AccessControlEntry::DecodableType latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; } // namespace AccessControlEntryChanged namespace AccessControlExtensionChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -6646,14 +6645,14 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlExtensionChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::ExtensionEntry::Type latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -6662,14 +6661,14 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlExtensionChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::ExtensionEntry::DecodableType latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -7066,12 +7065,12 @@ namespace Structs { namespace ActionStruct { enum class Fields { - kActionID = 1, - kName = 2, - kType = 3, - kEndpointListID = 4, - kSupportedCommands = 5, - kStatus = 6, + kActionID = 0, + kName = 1, + kType = 2, + kEndpointListID = 3, + kSupportedCommands = 4, + kStatus = 5, }; struct Type @@ -7094,10 +7093,10 @@ using DecodableType = Type; namespace EndpointListStruct { enum class Fields { - kEndpointListID = 1, - kName = 2, - kType = 3, - kEndpoints = 4, + kEndpointListID = 0, + kName = 1, + kType = 2, + kEndpoints = 3, }; struct Type @@ -7726,7 +7725,6 @@ struct TypeInfo namespace Events { namespace StateChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -7739,7 +7737,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7753,7 +7751,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7765,7 +7763,6 @@ struct DecodableType } // namespace StateChanged namespace ActionFailed { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -7779,7 +7776,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ActionFailed::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7794,7 +7791,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ActionFailed::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -8153,7 +8150,6 @@ struct TypeInfo namespace Events { namespace StartUp { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -8164,7 +8160,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StartUp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } uint32_t softwareVersion = static_cast(0); @@ -8176,7 +8172,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StartUp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } uint32_t softwareVersion = static_cast(0); @@ -8186,7 +8182,6 @@ struct DecodableType } // namespace StartUp namespace ShutDown { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -8196,7 +8191,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShutDown::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8206,7 +8201,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShutDown::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -8214,7 +8209,6 @@ struct DecodableType } // namespace ShutDown namespace Leave { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -8224,7 +8218,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leave::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8234,7 +8228,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leave::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -8242,7 +8236,6 @@ struct DecodableType } // namespace Leave namespace ReachableChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -8253,7 +8246,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ReachableChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } bool reachableNewValue = static_cast(0); @@ -8265,7 +8258,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ReachableChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } bool reachableNewValue = static_cast(0); @@ -8811,7 +8804,8 @@ struct TypeInfo Attributes::DefaultOtaProviders::TypeInfo::DecodableType defaultOtaProviders; Attributes::UpdatePossible::TypeInfo::DecodableType updatePossible = static_cast(0); - Attributes::UpdateState::TypeInfo::DecodableType updateState = static_cast(0); + Attributes::UpdateState::TypeInfo::DecodableType updateState = + static_cast(0); Attributes::UpdateStateProgress::TypeInfo::DecodableType updateStateProgress; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); @@ -8822,7 +8816,6 @@ struct TypeInfo namespace Events { namespace StateTransition { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -8836,7 +8829,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateTransition::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } DataModel::Nullable previousState; @@ -8851,7 +8844,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateTransition::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } DataModel::Nullable previousState; @@ -8864,7 +8857,6 @@ struct DecodableType } // namespace StateTransition namespace VersionApplied { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -8876,7 +8868,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::VersionApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -8889,7 +8881,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::VersionApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -8900,7 +8892,6 @@ struct DecodableType } // namespace VersionApplied namespace DownloadError { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -8914,12 +8905,12 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DownloadError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); uint64_t bytesDownloaded = static_cast(0); - uint8_t progressPercent = static_cast(0); + DataModel::Nullable progressPercent; DataModel::Nullable platformCode; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8929,12 +8920,12 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DownloadError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); uint64_t bytesDownloaded = static_cast(0); - uint8_t progressPercent = static_cast(0); + DataModel::Nullable progressPercent; DataModel::Nullable platformCode; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9699,7 +9690,7 @@ namespace Structs { namespace BasicCommissioningInfoType { enum class Fields { - kFailSafeExpiryLengthMs = 1, + kFailSafeExpiryLengthMs = 0, }; struct Type @@ -10107,8 +10098,8 @@ namespace Structs { namespace NetworkInfo { enum class Fields { - kNetworkID = 1, - kConnected = 2, + kNetworkID = 0, + kConnected = 1, }; struct Type @@ -10127,14 +10118,14 @@ using DecodableType = Type; namespace ThreadInterfaceScanResult { enum class Fields { - kPanId = 1, - kExtendedPanId = 2, - kNetworkName = 3, - kChannel = 4, - kVersion = 5, - kExtendedAddress = 6, - kRssi = 7, - kLqi = 8, + kPanId = 0, + kExtendedPanId = 1, + kNetworkName = 2, + kChannel = 3, + kVersion = 4, + kExtendedAddress = 5, + kRssi = 6, + kLqi = 7, }; struct Type @@ -10159,12 +10150,12 @@ using DecodableType = Type; namespace WiFiInterfaceScanResult { enum class Fields { - kSecurity = 1, - kSsid = 2, - kBssid = 3, - kChannel = 4, - kWiFiBand = 5, - kRssi = 6, + kSecurity = 0, + kSsid = 1, + kBssid = 2, + kChannel = 3, + kWiFiBand = 4, + kRssi = 5, }; struct Type @@ -10719,7 +10710,8 @@ struct TypeInfo Attributes::ScanMaxTimeSeconds::TypeInfo::DecodableType scanMaxTimeSeconds = static_cast(0); Attributes::ConnectMaxTimeSeconds::TypeInfo::DecodableType connectMaxTimeSeconds = static_cast(0); Attributes::InterfaceEnabled::TypeInfo::DecodableType interfaceEnabled = static_cast(0); - Attributes::LastNetworkingStatus::TypeInfo::DecodableType lastNetworkingStatus = static_cast(0); + Attributes::LastNetworkingStatus::TypeInfo::DecodableType lastNetworkingStatus = + static_cast(0); Attributes::LastNetworkID::TypeInfo::DecodableType lastNetworkID; Attributes::LastConnectErrorValue::TypeInfo::DecodableType lastConnectErrorValue = static_cast(0); Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -10994,12 +10986,12 @@ namespace Structs { namespace NetworkInterfaceType { enum class Fields { - kName = 1, - kFabricConnected = 2, - kOffPremiseServicesReachableIPv4 = 3, - kOffPremiseServicesReachableIPv6 = 4, - kHardwareAddress = 5, - kType = 6, + kName = 0, + kFabricConnected = 1, + kOffPremiseServicesReachableIPv4 = 2, + kOffPremiseServicesReachableIPv6 = 3, + kHardwareAddress = 4, + kType = 5, }; struct Type @@ -11183,7 +11175,6 @@ struct TypeInfo namespace Events { namespace HardwareFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -11195,7 +11186,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::HardwareFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11208,7 +11199,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::HardwareFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11219,7 +11210,6 @@ struct DecodableType } // namespace HardwareFaultChange namespace RadioFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -11231,7 +11221,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::RadioFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11244,7 +11234,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::RadioFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11255,7 +11245,6 @@ struct DecodableType } // namespace RadioFaultChange namespace NetworkFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -11267,7 +11256,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::NetworkFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11280,7 +11269,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::NetworkFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11291,7 +11280,6 @@ struct DecodableType } // namespace NetworkFaultChange namespace BootReason { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -11302,7 +11290,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::BootReason::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } BootReasonType bootReason = static_cast(0); @@ -11314,7 +11302,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::BootReason::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } BootReasonType bootReason = static_cast(0); @@ -11330,9 +11318,9 @@ namespace Structs { namespace SoftwareFault { enum class Fields { - kId = 1, - kName = 2, - kFaultRecording = 3, + kId = 0, + kName = 1, + kFaultRecording = 2, }; struct Type @@ -11352,11 +11340,11 @@ using DecodableType = Type; namespace ThreadMetrics { enum class Fields { - kId = 1, - kName = 2, - kStackFreeCurrent = 3, - kStackFreeMinimum = 4, - kStackSize = 5, + kId = 0, + kName = 1, + kStackFreeCurrent = 2, + kStackFreeMinimum = 3, + kStackSize = 4, }; struct Type @@ -11528,7 +11516,6 @@ struct TypeInfo namespace Events { namespace SoftwareFault { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -11539,7 +11526,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SoftwareFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } Structs::SoftwareFault::Type softwareFault; @@ -11551,7 +11538,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SoftwareFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } Structs::SoftwareFault::DecodableType softwareFault; @@ -11598,20 +11585,20 @@ namespace Structs { namespace NeighborTable { enum class Fields { - kExtAddress = 1, - kAge = 2, - kRloc16 = 3, - kLinkFrameCounter = 4, - kMleFrameCounter = 5, - kLqi = 6, - kAverageRssi = 7, - kLastRssi = 8, - kFrameErrorRate = 9, - kMessageErrorRate = 10, - kRxOnWhenIdle = 11, - kFullThreadDevice = 12, - kFullNetworkData = 13, - kIsChild = 14, + kExtAddress = 0, + kAge = 1, + kRloc16 = 2, + kLinkFrameCounter = 3, + kMleFrameCounter = 4, + kLqi = 5, + kAverageRssi = 6, + kLastRssi = 7, + kFrameErrorRate = 8, + kMessageErrorRate = 9, + kRxOnWhenIdle = 10, + kFullThreadDevice = 11, + kFullNetworkData = 12, + kIsChild = 13, }; struct Type @@ -11642,18 +11629,18 @@ using DecodableType = Type; namespace OperationalDatasetComponents { enum class Fields { - kActiveTimestampPresent = 1, - kPendingTimestampPresent = 2, - kMasterKeyPresent = 3, - kNetworkNamePresent = 4, - kExtendedPanIdPresent = 5, - kMeshLocalPrefixPresent = 6, - kDelayPresent = 7, - kPanIdPresent = 8, - kChannelPresent = 9, - kPskcPresent = 10, - kSecurityPolicyPresent = 11, - kChannelMaskPresent = 12, + kActiveTimestampPresent = 0, + kPendingTimestampPresent = 1, + kMasterKeyPresent = 2, + kNetworkNamePresent = 3, + kExtendedPanIdPresent = 4, + kMeshLocalPrefixPresent = 5, + kDelayPresent = 6, + kPanIdPresent = 7, + kChannelPresent = 8, + kPskcPresent = 9, + kSecurityPolicyPresent = 10, + kChannelMaskPresent = 11, }; struct Type @@ -11682,16 +11669,16 @@ using DecodableType = Type; namespace RouteTable { enum class Fields { - kExtAddress = 1, - kRloc16 = 2, - kRouterId = 3, - kNextHop = 4, - kPathCost = 5, - kLQIIn = 6, - kLQIOut = 7, - kAge = 8, - kAllocated = 9, - kLinkEstablished = 10, + kExtAddress = 0, + kRloc16 = 1, + kRouterId = 2, + kNextHop = 3, + kPathCost = 4, + kLQIIn = 5, + kLQIOut = 6, + kAge = 7, + kAllocated = 8, + kLinkEstablished = 9, }; struct Type @@ -11718,8 +11705,8 @@ using DecodableType = Type; namespace SecurityPolicy { enum class Fields { - kRotationTime = 1, - kFlags = 2, + kRotationTime = 0, + kFlags = 1, }; struct Type @@ -12664,7 +12651,6 @@ struct TypeInfo namespace Events { namespace ConnectionStatus { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -12675,7 +12661,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } ThreadConnectionStatus connectionStatus = static_cast(0); @@ -12687,7 +12673,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } ThreadConnectionStatus connectionStatus = static_cast(0); @@ -13011,7 +12997,6 @@ struct TypeInfo namespace Events { namespace Disconnection { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -13022,7 +13007,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Disconnection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } uint16_t reasonCode = static_cast(0); @@ -13034,7 +13019,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Disconnection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } uint16_t reasonCode = static_cast(0); @@ -13044,7 +13029,6 @@ struct DecodableType } // namespace Disconnection namespace AssociationFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -13056,7 +13040,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AssociationFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } AssociationFailureCause associationFailure = static_cast(0); @@ -13069,7 +13053,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AssociationFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } AssociationFailureCause associationFailure = static_cast(0); @@ -13080,7 +13064,6 @@ struct DecodableType } // namespace AssociationFailure namespace ConnectionStatus { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -13091,7 +13074,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } WiFiConnectionStatus connectionStatus = static_cast(0); @@ -13103,7 +13086,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } WiFiConnectionStatus connectionStatus = static_cast(0); @@ -13891,7 +13874,6 @@ struct TypeInfo namespace Events { namespace SwitchLatched { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -13902,7 +13884,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SwitchLatched::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13914,7 +13896,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SwitchLatched::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13924,7 +13906,6 @@ struct DecodableType } // namespace SwitchLatched namespace InitialPress { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -13935,7 +13916,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::InitialPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13947,7 +13928,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::InitialPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13957,7 +13938,6 @@ struct DecodableType } // namespace InitialPress namespace LongPress { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -13968,7 +13948,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13980,7 +13960,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13990,7 +13970,6 @@ struct DecodableType } // namespace LongPress namespace ShortRelease { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -14001,7 +13980,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShortRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14013,7 +13992,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShortRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14023,7 +14002,6 @@ struct DecodableType } // namespace ShortRelease namespace LongRelease { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -14034,7 +14012,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14046,7 +14024,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14056,7 +14034,6 @@ struct DecodableType } // namespace LongRelease namespace MultiPressOngoing { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000005; enum class Fields { @@ -14068,7 +14045,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressOngoing::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14081,7 +14058,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressOngoing::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14092,7 +14069,6 @@ struct DecodableType } // namespace MultiPressOngoing namespace MultiPressComplete { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000006; enum class Fields { @@ -14104,7 +14080,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressComplete::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14117,7 +14093,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressComplete::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14399,18 +14375,18 @@ namespace Structs { namespace FabricDescriptor { enum class Fields { - kFabricIndex = 1, - kRootPublicKey = 2, - kVendorId = 3, - kFabricId = 4, - kNodeId = 5, - kLabel = 6, + kFabricIndex = 0, + kRootPublicKey = 1, + kVendorId = 2, + kFabricId = 3, + kNodeId = 4, + kLabel = 5, }; struct Type { public: - uint8_t fabricIndex = static_cast(0); + chip::FabricIndex fabricIndex = static_cast(0); chip::ByteSpan rootPublicKey; uint16_t vendorId = static_cast(0); chip::FabricId fabricId = static_cast(0); @@ -14419,6 +14395,7 @@ struct Type CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); + bool MatchesFabricIndex(FabricIndex fabricIndex_) const { return fabricIndex == fabricIndex_; } }; using DecodableType = Type; @@ -14427,18 +14404,21 @@ using DecodableType = Type; namespace NOCStruct { enum class Fields { - kFabricIndex = 1, - kNoc = 2, + kFabricIndex = 0, + kNoc = 1, + kIcac = 2, }; struct Type { public: - uint8_t fabricIndex = static_cast(0); + chip::FabricIndex fabricIndex = static_cast(0); chip::ByteSpan noc; + chip::ByteSpan icac; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); + bool MatchesFabricIndex(FabricIndex fabricIndex_) const { return fabricIndex == fabricIndex_; } }; using DecodableType = Type; @@ -14964,6 +14944,20 @@ struct DecodableType namespace Attributes { +namespace NOCs { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NOCs::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NOCs namespace FabricsList { struct TypeInfo { @@ -15071,6 +15065,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + Attributes::NOCs::TypeInfo::DecodableType NOCs; Attributes::FabricsList::TypeInfo::DecodableType fabricsList; Attributes::SupportedFabrics::TypeInfo::DecodableType supportedFabrics = static_cast(0); Attributes::CommissionedFabrics::TypeInfo::DecodableType commissionedFabrics = static_cast(0); @@ -15907,7 +15902,6 @@ struct TypeInfo namespace Events { namespace StateChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -15918,7 +15912,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue = static_cast(0); @@ -15930,7 +15924,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue = static_cast(0); @@ -15946,9 +15940,9 @@ namespace Structs { namespace ModeOptionStruct { enum class Fields { - kLabel = 1, - kMode = 2, - kSemanticTag = 3, + kLabel = 0, + kMode = 1, + kSemanticTag = 2, }; struct Type @@ -15968,8 +15962,8 @@ using DecodableType = Type; namespace SemanticTag { enum class Fields { - kMfgCode = 1, - kValue = 2, + kMfgCode = 0, + kValue = 1, }; struct Type @@ -16675,8 +16669,8 @@ namespace Structs { namespace DlCredential { enum class Fields { - kCredentialType = 1, - kCredentialIndex = 2, + kCredentialType = 0, + kCredentialIndex = 1, }; struct Type @@ -19177,7 +19171,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::LockState::TypeInfo::DecodableType lockState; - Attributes::LockType::TypeInfo::DecodableType lockType = static_cast(0); + Attributes::LockType::TypeInfo::DecodableType lockType = static_cast(0); Attributes::ActuatorEnabled::TypeInfo::DecodableType actuatorEnabled = static_cast(0); Attributes::DoorState::TypeInfo::DecodableType doorState; Attributes::DoorOpenEvents::TypeInfo::DecodableType doorOpenEvents = static_cast(0); @@ -19200,11 +19194,12 @@ struct TypeInfo Attributes::CredentialRulesSupport::TypeInfo::DecodableType credentialRulesSupport = static_cast(0); Attributes::EnableLogging::TypeInfo::DecodableType enableLogging = static_cast(0); Attributes::Language::TypeInfo::DecodableType language; - Attributes::LEDSettings::TypeInfo::DecodableType LEDSettings = static_cast(0); - Attributes::AutoRelockTime::TypeInfo::DecodableType autoRelockTime = static_cast(0); - Attributes::SoundVolume::TypeInfo::DecodableType soundVolume = static_cast(0); - Attributes::OperatingMode::TypeInfo::DecodableType operatingMode = static_cast(0); - Attributes::SupportedOperatingModes::TypeInfo::DecodableType supportedOperatingModes = static_cast(0); + Attributes::LEDSettings::TypeInfo::DecodableType LEDSettings = static_cast(0); + Attributes::AutoRelockTime::TypeInfo::DecodableType autoRelockTime = static_cast(0); + Attributes::SoundVolume::TypeInfo::DecodableType soundVolume = static_cast(0); + Attributes::OperatingMode::TypeInfo::DecodableType operatingMode = + static_cast(0); + Attributes::SupportedOperatingModes::TypeInfo::DecodableType supportedOperatingModes = static_cast(0); Attributes::DefaultConfigurationRegister::TypeInfo::DecodableType defaultConfigurationRegister = static_cast(0); Attributes::EnableLocalProgramming::TypeInfo::DecodableType enableLocalProgramming = static_cast(0); Attributes::EnableOneTouchLocking::TypeInfo::DecodableType enableOneTouchLocking = static_cast(0); @@ -19233,7 +19228,6 @@ struct TypeInfo namespace Events { namespace DoorLockAlarm { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -19244,7 +19238,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorLockAlarm::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlAlarmCode alarmCode = static_cast(0); @@ -19256,7 +19250,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorLockAlarm::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlAlarmCode alarmCode = static_cast(0); @@ -19266,7 +19260,6 @@ struct DecodableType } // namespace DoorLockAlarm namespace DoorStateChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -19277,7 +19270,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorStateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlDoorState doorState = static_cast(0); @@ -19289,7 +19282,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorStateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlDoorState doorState = static_cast(0); @@ -19299,7 +19292,6 @@ struct DecodableType } // namespace DoorStateChange namespace LockOperation { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -19315,7 +19307,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19332,7 +19324,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19347,7 +19339,6 @@ struct DecodableType } // namespace LockOperation namespace LockOperationError { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -19364,7 +19355,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperationError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19382,7 +19373,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperationError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19398,7 +19389,6 @@ struct DecodableType } // namespace LockOperationError namespace LockUserChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -19415,7 +19405,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockUserChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockDataType lockDataType = static_cast(0); @@ -19433,7 +19423,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockUserChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockDataType lockDataType = static_cast(0); @@ -20774,7 +20764,6 @@ struct TypeInfo namespace Events { namespace SupplyVoltageLow { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -20784,7 +20773,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20794,7 +20783,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20802,7 +20791,6 @@ struct DecodableType } // namespace SupplyVoltageLow namespace SupplyVoltageHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -20812,7 +20800,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20822,7 +20810,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20830,7 +20818,6 @@ struct DecodableType } // namespace SupplyVoltageHigh namespace PowerMissingPhase { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -20840,7 +20827,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PowerMissingPhase::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20850,7 +20837,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PowerMissingPhase::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20858,7 +20845,6 @@ struct DecodableType } // namespace PowerMissingPhase namespace SystemPressureLow { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -20868,7 +20854,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20878,7 +20864,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20886,7 +20872,6 @@ struct DecodableType } // namespace SystemPressureLow namespace SystemPressureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -20896,7 +20881,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20906,7 +20891,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20914,7 +20899,6 @@ struct DecodableType } // namespace SystemPressureHigh namespace DryRunning { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000005; enum class Fields { @@ -20924,7 +20908,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DryRunning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20934,7 +20918,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DryRunning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20942,7 +20926,6 @@ struct DecodableType } // namespace DryRunning namespace MotorTemperatureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000006; enum class Fields { @@ -20952,7 +20935,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MotorTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20962,7 +20945,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MotorTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20970,7 +20953,6 @@ struct DecodableType } // namespace MotorTemperatureHigh namespace PumpMotorFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000007; enum class Fields { @@ -20980,7 +20962,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpMotorFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20990,7 +20972,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpMotorFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20998,7 +20980,6 @@ struct DecodableType } // namespace PumpMotorFatalFailure namespace ElectronicTemperatureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000008; enum class Fields { @@ -21008,7 +20989,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21018,7 +20999,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21026,7 +21007,6 @@ struct DecodableType } // namespace ElectronicTemperatureHigh namespace PumpBlocked { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000009; enum class Fields { @@ -21036,7 +21016,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpBlocked::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21046,7 +21026,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpBlocked::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21054,7 +21034,6 @@ struct DecodableType } // namespace PumpBlocked namespace SensorFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000A; enum class Fields { @@ -21064,7 +21043,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SensorFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21074,7 +21053,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SensorFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21082,7 +21061,6 @@ struct DecodableType } // namespace SensorFailure namespace ElectronicNonFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000B; enum class Fields { @@ -21092,7 +21070,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicNonFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21102,7 +21080,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicNonFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21110,7 +21088,6 @@ struct DecodableType } // namespace ElectronicNonFatalFailure namespace ElectronicFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x0000000C; enum class Fields { @@ -21120,7 +21097,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21130,7 +21107,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21138,7 +21115,6 @@ struct DecodableType } // namespace ElectronicFatalFailure namespace GeneralFault { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000D; enum class Fields { @@ -21148,7 +21124,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::GeneralFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21158,7 +21134,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::GeneralFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21166,7 +21142,6 @@ struct DecodableType } // namespace GeneralFault namespace Leakage { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000E; enum class Fields { @@ -21176,7 +21151,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leakage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21186,7 +21161,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leakage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21194,7 +21169,6 @@ struct DecodableType } // namespace Leakage namespace AirDetection { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000F; enum class Fields { @@ -21204,7 +21178,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AirDetection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21214,7 +21188,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AirDetection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21222,7 +21196,6 @@ struct DecodableType } // namespace AirDetection namespace TurbineOperation { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000010; enum class Fields { @@ -21232,7 +21205,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TurbineOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21242,7 +21215,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TurbineOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -29258,8 +29231,8 @@ namespace Structs { namespace IasAceZoneStatusResult { enum class Fields { - kZoneId = 1, - kZoneStatus = 2, + kZoneId = 0, + kZoneStatus = 1, }; struct Type @@ -30394,11 +30367,11 @@ namespace Structs { namespace ChannelInfo { enum class Fields { - kMajorNumber = 1, - kMinorNumber = 2, - kName = 3, - kCallSign = 4, - kAffiliateCallSign = 5, + kMajorNumber = 0, + kMinorNumber = 1, + kName = 2, + kCallSign = 3, + kAffiliateCallSign = 4, }; struct Type @@ -30420,10 +30393,10 @@ using DecodableType = Type; namespace LineupInfo { enum class Fields { - kOperatorName = 1, - kLineupName = 2, - kPostalCode = 3, - kLineupInfoType = 4, + kOperatorName = 0, + kLineupName = 1, + kPostalCode = 2, + kLineupInfoType = 3, }; struct Type @@ -30712,8 +30685,8 @@ namespace Structs { namespace TargetInfo { enum class Fields { - kIdentifier = 1, - kName = 2, + kIdentifier = 0, + kName = 1, }; struct Type @@ -30925,8 +30898,8 @@ namespace Structs { namespace PlaybackPosition { enum class Fields { - kUpdatedAt = 1, - kPosition = 2, + kUpdatedAt = 0, + kPosition = 1, }; struct Type @@ -31495,9 +31468,10 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::PlaybackState::TypeInfo::DecodableType playbackState = static_cast(0); - Attributes::StartTime::TypeInfo::DecodableType startTime = static_cast(0); - Attributes::Duration::TypeInfo::DecodableType duration = static_cast(0); + Attributes::PlaybackState::TypeInfo::DecodableType playbackState = + static_cast(0); + Attributes::StartTime::TypeInfo::DecodableType startTime = static_cast(0); + Attributes::Duration::TypeInfo::DecodableType duration = static_cast(0); Attributes::Position::TypeInfo::DecodableType position; Attributes::PlaybackSpeed::TypeInfo::DecodableType playbackSpeed = static_cast(0); Attributes::SeekRangeEnd::TypeInfo::DecodableType seekRangeEnd = static_cast(0); @@ -31537,10 +31511,10 @@ namespace Structs { namespace InputInfo { enum class Fields { - kIndex = 1, - kInputType = 2, - kName = 3, - kDescription = 4, + kIndex = 0, + kInputType = 1, + kName = 2, + kDescription = 3, }; struct Type @@ -32182,9 +32156,9 @@ namespace Structs { namespace Dimension { enum class Fields { - kWidth = 1, - kHeight = 2, - kMetric = 3, + kWidth = 0, + kHeight = 1, + kMetric = 2, }; struct Type @@ -32204,8 +32178,8 @@ using DecodableType = Type; namespace AdditionalInfo { enum class Fields { - kName = 1, - kValue = 2, + kName = 0, + kValue = 1, }; struct Type @@ -32224,9 +32198,9 @@ using DecodableType = Type; namespace Parameter { enum class Fields { - kType = 1, - kValue = 2, - kExternalIDList = 3, + kType = 0, + kValue = 1, + kExternalIDList = 2, }; struct Type @@ -32252,7 +32226,7 @@ struct DecodableType namespace ContentSearch { enum class Fields { - kParameterList = 1, + kParameterList = 0, }; struct Type @@ -32274,9 +32248,9 @@ struct DecodableType namespace StyleInformation { enum class Fields { - kImageUrl = 1, - kColor = 2, - kSize = 3, + kImageUrl = 0, + kColor = 1, + kSize = 2, }; struct Type @@ -32296,12 +32270,12 @@ using DecodableType = Type; namespace BrandingInformation { enum class Fields { - kProviderName = 1, - kBackground = 2, - kLogo = 3, - kProgressBar = 4, - kSplash = 5, - kWaterMark = 6, + kProviderName = 0, + kBackground = 1, + kLogo = 2, + kProgressBar = 3, + kSplash = 4, + kWaterMark = 5, }; struct Type @@ -32559,9 +32533,9 @@ namespace Structs { namespace OutputInfo { enum class Fields { - kIndex = 1, - kOutputType = 2, - kName = 3, + kIndex = 0, + kOutputType = 1, + kName = 2, }; struct Type @@ -32772,8 +32746,8 @@ namespace Structs { namespace ApplicationLauncherApplication { enum class Fields { - kCatalogVendorId = 1, - kApplicationId = 2, + kCatalogVendorId = 0, + kApplicationId = 1, }; struct Type @@ -32792,8 +32766,8 @@ using DecodableType = Type; namespace ApplicationEP { enum class Fields { - kApplication = 1, - kEndpoint = 2, + kApplication = 0, + kEndpoint = 1, }; struct Type @@ -33067,8 +33041,8 @@ namespace Structs { namespace ApplicationBasicApplication { enum class Fields { - kCatalogVendorId = 1, - kApplicationId = 2, + kCatalogVendorId = 0, + kApplicationId = 1, }; struct Type @@ -33234,7 +33208,8 @@ struct TypeInfo Attributes::ApplicationName::TypeInfo::DecodableType applicationName; Attributes::ProductId::TypeInfo::DecodableType productId = static_cast(0); Attributes::ApplicationApp::TypeInfo::DecodableType applicationApp; - Attributes::ApplicationStatus::TypeInfo::DecodableType applicationStatus = static_cast(0); + Attributes::ApplicationStatus::TypeInfo::DecodableType applicationStatus = + static_cast(0); Attributes::ApplicationVersion::TypeInfo::DecodableType applicationVersion; Attributes::AllowedVendorList::TypeInfo::DecodableType allowedVendorList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -33477,14 +33452,14 @@ namespace Structs { namespace SimpleStruct { enum class Fields { - kA = 1, - kB = 2, - kC = 3, - kD = 4, - kE = 5, - kF = 6, - kG = 7, - kH = 8, + kA = 0, + kB = 1, + kC = 2, + kD = 3, + kE = 4, + kF = 5, + kG = 6, + kH = 7, }; struct Type @@ -33509,18 +33484,18 @@ using DecodableType = Type; namespace NullablesAndOptionalsStruct { enum class Fields { - kNullableInt = 1, - kOptionalInt = 2, - kNullableOptionalInt = 3, - kNullableString = 4, - kOptionalString = 5, - kNullableOptionalString = 6, - kNullableStruct = 7, - kOptionalStruct = 8, - kNullableOptionalStruct = 9, - kNullableList = 10, - kOptionalList = 11, - kNullableOptionalList = 12, + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, }; struct Type @@ -33564,9 +33539,9 @@ struct DecodableType namespace NestedStruct { enum class Fields { - kA = 1, - kB = 2, - kC = 3, + kA = 0, + kB = 1, + kC = 2, }; struct Type @@ -33586,13 +33561,13 @@ using DecodableType = Type; namespace NestedStructList { enum class Fields { - kA = 1, - kB = 2, - kC = 3, - kD = 4, - kE = 5, - kF = 6, - kG = 7, + kA = 0, + kB = 1, + kC = 2, + kD = 3, + kE = 4, + kF = 5, + kG = 6, }; struct Type @@ -33626,7 +33601,7 @@ struct DecodableType namespace DoubleNestedStructList { enum class Fields { - kA = 1, + kA = 0, }; struct Type @@ -33648,8 +33623,8 @@ struct DecodableType namespace TestListStructOctet { enum class Fields { - kFabricIndex = 1, - kOperationalCert = 2, + kFabricIndex = 0, + kOperationalCert = 1, }; struct Type @@ -36031,7 +36006,7 @@ struct TypeInfo Attributes::EpochS::TypeInfo::DecodableType epochS = static_cast(0); Attributes::VendorId::TypeInfo::DecodableType vendorId = static_cast(0); Attributes::ListNullablesAndOptionalsStruct::TypeInfo::DecodableType listNullablesAndOptionalsStruct; - Attributes::EnumAttr::TypeInfo::DecodableType enumAttr = static_cast(0); + Attributes::EnumAttr::TypeInfo::DecodableType enumAttr = static_cast(0); Attributes::StructAttr::TypeInfo::DecodableType structAttr; Attributes::RangeRestrictedInt8u::TypeInfo::DecodableType rangeRestrictedInt8u = static_cast(0); Attributes::RangeRestrictedInt8s::TypeInfo::DecodableType rangeRestrictedInt8s = static_cast(0); @@ -36082,7 +36057,6 @@ struct TypeInfo namespace Events { namespace TestEvent { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -36098,7 +36072,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TestEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1 = static_cast(0); @@ -36115,7 +36089,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TestEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1 = static_cast(0); diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index b852d6334c9776..863167478b4ac1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2050,6 +2050,10 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace OperationalCredentials { namespace Attributes { +namespace NOCs { +static constexpr AttributeId Id = 0x00000000; +} // namespace NOCs + namespace FabricsList { static constexpr AttributeId Id = 0x00000001; } // namespace FabricsList diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h new file mode 100644 index 00000000000000..c63d8e453a3397 --- /dev/null +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -0,0 +1,312 @@ +/* + * + * Copyright (c) 2022 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace AccessControl { +namespace Events { + +namespace AccessControlEntryChanged { +static constexpr EventId Id = 0x00000000; +} // namespace AccessControlEntryChanged + +namespace AccessControlExtensionChanged { +static constexpr EventId Id = 0x00000001; +} // namespace AccessControlExtensionChanged + +} // namespace Events +} // namespace AccessControl + +namespace BridgedActions { +namespace Events { + +namespace StateChanged { +static constexpr EventId Id = 0x00000000; +} // namespace StateChanged + +namespace ActionFailed { +static constexpr EventId Id = 0x00000001; +} // namespace ActionFailed + +} // namespace Events +} // namespace BridgedActions + +namespace Basic { +namespace Events { + +namespace StartUp { +static constexpr EventId Id = 0x00000000; +} // namespace StartUp + +namespace ShutDown { +static constexpr EventId Id = 0x00000001; +} // namespace ShutDown + +namespace Leave { +static constexpr EventId Id = 0x00000002; +} // namespace Leave + +namespace ReachableChanged { +static constexpr EventId Id = 0x00000003; +} // namespace ReachableChanged + +} // namespace Events +} // namespace Basic + +namespace OtaSoftwareUpdateRequestor { +namespace Events { + +namespace StateTransition { +static constexpr EventId Id = 0x00000000; +} // namespace StateTransition + +namespace VersionApplied { +static constexpr EventId Id = 0x00000001; +} // namespace VersionApplied + +namespace DownloadError { +static constexpr EventId Id = 0x00000002; +} // namespace DownloadError + +} // namespace Events +} // namespace OtaSoftwareUpdateRequestor + +namespace GeneralDiagnostics { +namespace Events { + +namespace HardwareFaultChange { +static constexpr EventId Id = 0x00000000; +} // namespace HardwareFaultChange + +namespace RadioFaultChange { +static constexpr EventId Id = 0x00000001; +} // namespace RadioFaultChange + +namespace NetworkFaultChange { +static constexpr EventId Id = 0x00000002; +} // namespace NetworkFaultChange + +namespace BootReason { +static constexpr EventId Id = 0x00000003; +} // namespace BootReason + +} // namespace Events +} // namespace GeneralDiagnostics + +namespace SoftwareDiagnostics { +namespace Events { + +namespace SoftwareFault { +static constexpr EventId Id = 0x00000000; +} // namespace SoftwareFault + +} // namespace Events +} // namespace SoftwareDiagnostics + +namespace ThreadNetworkDiagnostics { +namespace Events { + +namespace ConnectionStatus { +static constexpr EventId Id = 0x00000000; +} // namespace ConnectionStatus + +} // namespace Events +} // namespace ThreadNetworkDiagnostics + +namespace WiFiNetworkDiagnostics { +namespace Events { + +namespace Disconnection { +static constexpr EventId Id = 0x00000000; +} // namespace Disconnection + +namespace AssociationFailure { +static constexpr EventId Id = 0x00000001; +} // namespace AssociationFailure + +namespace ConnectionStatus { +static constexpr EventId Id = 0x00000002; +} // namespace ConnectionStatus + +} // namespace Events +} // namespace WiFiNetworkDiagnostics + +namespace Switch { +namespace Events { + +namespace SwitchLatched { +static constexpr EventId Id = 0x00000000; +} // namespace SwitchLatched + +namespace InitialPress { +static constexpr EventId Id = 0x00000001; +} // namespace InitialPress + +namespace LongPress { +static constexpr EventId Id = 0x00000002; +} // namespace LongPress + +namespace ShortRelease { +static constexpr EventId Id = 0x00000003; +} // namespace ShortRelease + +namespace LongRelease { +static constexpr EventId Id = 0x00000004; +} // namespace LongRelease + +namespace MultiPressOngoing { +static constexpr EventId Id = 0x00000005; +} // namespace MultiPressOngoing + +namespace MultiPressComplete { +static constexpr EventId Id = 0x00000006; +} // namespace MultiPressComplete + +} // namespace Events +} // namespace Switch + +namespace BooleanState { +namespace Events { + +namespace StateChange { +static constexpr EventId Id = 0x00000000; +} // namespace StateChange + +} // namespace Events +} // namespace BooleanState + +namespace DoorLock { +namespace Events { + +namespace DoorLockAlarm { +static constexpr EventId Id = 0x00000000; +} // namespace DoorLockAlarm + +namespace DoorStateChange { +static constexpr EventId Id = 0x00000001; +} // namespace DoorStateChange + +namespace LockOperation { +static constexpr EventId Id = 0x00000002; +} // namespace LockOperation + +namespace LockOperationError { +static constexpr EventId Id = 0x00000003; +} // namespace LockOperationError + +namespace LockUserChange { +static constexpr EventId Id = 0x00000004; +} // namespace LockUserChange + +} // namespace Events +} // namespace DoorLock + +namespace PumpConfigurationAndControl { +namespace Events { + +namespace SupplyVoltageLow { +static constexpr EventId Id = 0x00000000; +} // namespace SupplyVoltageLow + +namespace SupplyVoltageHigh { +static constexpr EventId Id = 0x00000001; +} // namespace SupplyVoltageHigh + +namespace PowerMissingPhase { +static constexpr EventId Id = 0x00000002; +} // namespace PowerMissingPhase + +namespace SystemPressureLow { +static constexpr EventId Id = 0x00000003; +} // namespace SystemPressureLow + +namespace SystemPressureHigh { +static constexpr EventId Id = 0x00000004; +} // namespace SystemPressureHigh + +namespace DryRunning { +static constexpr EventId Id = 0x00000005; +} // namespace DryRunning + +namespace MotorTemperatureHigh { +static constexpr EventId Id = 0x00000006; +} // namespace MotorTemperatureHigh + +namespace PumpMotorFatalFailure { +static constexpr EventId Id = 0x00000007; +} // namespace PumpMotorFatalFailure + +namespace ElectronicTemperatureHigh { +static constexpr EventId Id = 0x00000008; +} // namespace ElectronicTemperatureHigh + +namespace PumpBlocked { +static constexpr EventId Id = 0x00000009; +} // namespace PumpBlocked + +namespace SensorFailure { +static constexpr EventId Id = 0x0000000A; +} // namespace SensorFailure + +namespace ElectronicNonFatalFailure { +static constexpr EventId Id = 0x0000000B; +} // namespace ElectronicNonFatalFailure + +namespace ElectronicFatalFailure { +static constexpr EventId Id = 0x0000000C; +} // namespace ElectronicFatalFailure + +namespace GeneralFault { +static constexpr EventId Id = 0x0000000D; +} // namespace GeneralFault + +namespace Leakage { +static constexpr EventId Id = 0x0000000E; +} // namespace Leakage + +namespace AirDetection { +static constexpr EventId Id = 0x0000000F; +} // namespace AirDetection + +namespace TurbineOperation { +static constexpr EventId Id = 0x00000010; +} // namespace TurbineOperation + +} // namespace Events +} // namespace PumpConfigurationAndControl + +namespace TestCluster { +namespace Events { + +namespace TestEvent { +static constexpr EventId Id = 0x00000001; +} // namespace TestEvent + +} // namespace Events +} // namespace TestCluster + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index eb70159b55a413..cd1593d2b6d88a 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -614,7 +614,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 185 +#define GENERATED_ATTRIBUTE_COUNT 186 #define GENERATED_ATTRIBUTES \ { \ \ @@ -796,6 +796,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -923,34 +924,34 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(141), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(145), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(145), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(151), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(152), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(153), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(154), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(155), \ + ZAP_ATTRIBUTE_INDEX(156), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(157), \ + ZAP_ATTRIBUTE_INDEX(158), \ 16, \ 27, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(173), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(174), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(178), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003B, ZAP_ATTRIBUTE_INDEX(179), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(183), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(184), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index cc180ac9db53c4..7cf3c6f4105a1e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -1514,6 +1514,14 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = LogValue("Icac", indent + 1, value.icac); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Icac'", IndentStr(indent + 1).c_str()); + return err; + } + } ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); return CHIP_NO_ERROR; } @@ -32513,6 +32521,7 @@ class ReportOnOffSwitchConfigurationClusterRevision : public ModelCommand | * UpdateNOC | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | +| * NOCs | 0x0000 | | * FabricsList | 0x0001 | | * SupportedFabrics | 0x0002 | | * CommissionedFabrics | 0x0003 | @@ -32745,6 +32754,39 @@ class OperationalCredentialsUpdateNOC : public ModelCommand chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type mRequest; }; +/* + * Attribute NOCs + */ +class ReadOperationalCredentialsNOCs : public ModelCommand +{ +public: + ReadOperationalCredentialsNOCs() : ModelCommand("read") + { + AddArgument("attr-name", "nocs"); + ModelCommand::AddArguments(); + } + + ~ReadOperationalCredentialsNOCs() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003E) ReadAttribute on endpoint %" PRIu8, endpointId); + + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + value) + { + OnGeneralAttributeEventResponse(context, "OperationalCredentials.NOCs response", value); + } +}; + /* * Attribute FabricsList */ @@ -60144,8 +60186,11 @@ void registerClusterAccessControl(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60165,6 +60210,7 @@ void registerClusterAccountLogin(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60186,6 +60232,7 @@ void registerClusterAdministratorCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60210,7 +60257,9 @@ void registerClusterApplicationBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60222,13 +60271,15 @@ void registerClusterApplicationLauncher(Commands & commands) const char * clusterName = "ApplicationLauncher"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -60241,9 +60292,11 @@ void registerClusterAudioOutput(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60266,6 +60319,7 @@ void registerClusterBarrierControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60320,6 +60374,7 @@ void registerClusterBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60348,6 +60403,7 @@ void registerClusterBinaryInputBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60362,6 +60418,7 @@ void registerClusterBinding(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60376,6 +60433,7 @@ void registerClusterBooleanState(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60402,10 +60460,13 @@ void registerClusterBridgedActions(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60422,6 +60483,7 @@ void registerClusterBridgedDeviceBasic(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60437,7 +60499,9 @@ void registerClusterChannel(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60586,6 +60650,7 @@ void registerClusterColorControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60600,10 +60665,12 @@ void registerClusterContentLauncher(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60616,10 +60683,15 @@ void registerClusterDescriptor(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60633,6 +60705,7 @@ void registerClusterDiagnosticLogs(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -60690,6 +60763,7 @@ void registerClusterDoorLock(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60734,6 +60808,7 @@ void registerClusterElectricalMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60765,6 +60840,7 @@ void registerClusterEthernetNetworkDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60779,7 +60855,9 @@ void registerClusterFixedLabel(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60800,6 +60878,7 @@ void registerClusterFlowMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60811,20 +60890,22 @@ void registerClusterGeneralCommissioning(Commands & commands) const char * clusterName = "GeneralCommissioning"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -60835,6 +60916,7 @@ void registerClusterGeneralDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60844,9 +60926,13 @@ void registerClusterGeneralDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -60871,12 +60957,15 @@ void registerClusterGroupKeyManagement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60897,6 +60986,7 @@ void registerClusterGroups(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60917,6 +61007,7 @@ void registerClusterIdentify(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60939,6 +61030,7 @@ void registerClusterIlluminanceMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -60952,6 +61044,7 @@ void registerClusterKeypadInput(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61007,6 +61100,7 @@ void registerClusterLevelControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61020,10 +61114,11 @@ void registerClusterLocalizationConfiguration(Commands & commands) const char * clusterName = "LocalizationConfiguration"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -61035,6 +61130,7 @@ void registerClusterLowPower(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61051,9 +61147,11 @@ void registerClusterMediaInput(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61089,6 +61187,7 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61104,6 +61203,7 @@ void registerClusterModeSelect(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61112,6 +61212,7 @@ void registerClusterModeSelect(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61132,6 +61233,7 @@ void registerClusterNetworkCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61162,6 +61264,7 @@ void registerClusterOtaSoftwareUpdateProvider(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61175,6 +61278,7 @@ void registerClusterOtaSoftwareUpdateRequestor(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61182,6 +61286,7 @@ void registerClusterOtaSoftwareUpdateRequestor(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61206,6 +61311,7 @@ void registerClusterOccupancySensing(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61237,6 +61343,7 @@ void registerClusterOnOff(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61256,6 +61363,7 @@ void registerClusterOnOffSwitchConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61267,26 +61375,30 @@ void registerClusterOperationalCredentials(Commands & commands) const char * clusterName = "OperationalCredentials"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -61311,9 +61423,11 @@ void registerClusterPowerSource(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61328,7 +61442,9 @@ void registerClusterPowerSourceConfiguration(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61347,6 +61463,7 @@ void registerClusterPressureMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61411,6 +61528,7 @@ void registerClusterPumpConfigurationAndControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61467,6 +61585,7 @@ void registerClusterRelativeHumidityMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61496,6 +61615,7 @@ void registerClusterScenes(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61509,6 +61629,7 @@ void registerClusterSoftwareDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61516,6 +61637,7 @@ void registerClusterSoftwareDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61538,6 +61660,7 @@ void registerClusterSwitch(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61567,9 +61690,11 @@ void registerClusterTargetNavigator(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61590,6 +61715,7 @@ void registerClusterTemperatureMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61698,8 +61824,11 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61719,6 +61848,7 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61735,6 +61865,7 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61838,6 +61969,7 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61900,6 +62032,7 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -61923,6 +62056,7 @@ void registerClusterThermostatUserInterfaceConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -61950,7 +62084,9 @@ void registerClusterThreadNetworkDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -62052,11 +62188,15 @@ void registerClusterThreadNetworkDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -62073,6 +62213,7 @@ void registerClusterUserLabel(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -62087,6 +62228,7 @@ void registerClusterWakeOnLan(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -62126,6 +62268,7 @@ void registerClusterWiFiNetworkDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -62190,6 +62333,7 @@ void registerClusterWindowCovering(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index bff0c88cffa561..1b9df2687ea5d3 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -37,6 +37,7 @@ class TestList : public Command printf("Test_TC_BI_2_2\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRAC_1_1\n"); printf("Test_TC_CC_1_1\n"); printf("Test_TC_CC_2_1\n"); printf("Test_TC_CC_3_1\n"); @@ -69,6 +70,8 @@ class TestList : public Command printf("Test_TC_DM_3_1\n"); printf("Test_TC_DM_2_2\n"); printf("Test_TC_EMR_1_1\n"); + printf("Test_TC_ETHDIAG_1_1\n"); + printf("Test_TC_ETHDIAG_2_1\n"); printf("Test_TC_FLW_1_1\n"); printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLW_2_2\n"); @@ -111,6 +114,7 @@ class TestList : public Command printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_3\n"); + printf("Test_TC_PS_1_1\n"); printf("Test_TC_PRS_1_1\n"); printf("Test_TC_PRS_2_1\n"); printf("Test_TC_PCC_1_1\n"); @@ -120,6 +124,8 @@ class TestList : public Command printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); printf("Test_TC_RH_2_2\n"); + printf("Test_TC_SWTCH_2_1\n"); + printf("Test_TC_SWTCH_2_2\n"); printf("Test_TC_TM_1_1\n"); printf("Test_TC_TM_2_1\n"); printf("Test_TC_TM_2_2\n"); @@ -130,6 +136,8 @@ class TestList : public Command printf("Test_TC_TSUIC_2_1\n"); printf("Test_TC_TSUIC_2_2\n"); printf("Test_TC_DIAGTH_1_1\n"); + printf("Test_TC_WIFIDIAG_1_1\n"); + printf("Test_TC_WIFIDIAG_3_1\n"); printf("Test_TC_WNCV_1_1\n"); printf("Test_TC_WNCV_2_1\n"); printf("Test_TC_WNCV_2_2\n"); @@ -1591,6 +1599,140 @@ class Test_TC_BOOL_2_1 : public TestCommand } }; +class Test_TC_BRAC_1_1 : public TestCommand +{ +public: + Test_TC_BRAC_1_1() : TestCommand("Test_TC_BRAC_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_BRAC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BridgedActionsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BridgedActionsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } +}; + class Test_TC_CC_1_1 : public TestCommand { public: @@ -16338,6 +16480,140 @@ class Test_TC_EMR_1_1 : public TestCommand } }; +class Test_TC_ETHDIAG_1_1 : public TestCommand +{ +public: + Test_TC_ETHDIAG_1_1() : TestCommand("Test_TC_ETHDIAG_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_ETHDIAG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + +class Test_TC_ETHDIAG_2_1 : public TestCommand +{ +public: + Test_TC_ETHDIAG_2_1() : TestCommand("Test_TC_ETHDIAG_2_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_ETHDIAG_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + class Test_TC_FLW_1_1 : public TestCommand { public: @@ -26599,6 +26875,241 @@ class Test_TC_OO_2_3 : public TestCommand void OnSuccessResponse_46() { NextTest(); } }; +class Test_TC_PS_1_1 : public TestCommand +{ +public: + Test_TC_PS_1_1() : TestCommand("Test_TC_PS_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_PS_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_4(clusterRevision); + } + + static void OnFailureCallback_5(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_5(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 1U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_3() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + class Test_TC_PRS_1_1 : public TestCommand { public: @@ -30182,6 +30693,762 @@ class Test_TC_RH_2_2 : public TestCommand } }; +class Test_TC_SWTCH_2_1 : public TestCommand +{ +public: + Test_TC_SWTCH_2_1() : TestCommand("Test_TC_SWTCH_2_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_SWTCH_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_6(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t numberOfPositions) + { + (static_cast(context))->OnSuccessResponse_1(numberOfPositions); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t numberOfPositions) + { + (static_cast(context))->OnSuccessResponse_2(numberOfPositions); + } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_3(currentPosition); + } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_4(currentPosition); + } + + static void OnFailureCallback_5(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_5(multiPressMax); + } + + static void OnFailureCallback_6(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_6(multiPressMax); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadNumberOfPositionsAttribute_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t numberOfPositions) + { + VerifyOrReturn(CheckValue("numberOfPositions", numberOfPositions, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadNumberOfPositionsAttribute_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t numberOfPositions) + { + VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", numberOfPositions, 2)); + NextTest(); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint8_t currentPosition) + { + VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentPosition", currentPosition, 0)); + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t multiPressMax) + { + VerifyOrReturn(CheckValue("multiPressMax", multiPressMax, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t multiPressMax) + { + VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("multiPressMax", multiPressMax, 2)); + NextTest(); + } +}; + +class Test_TC_SWTCH_2_2 : public TestCommand +{ +public: + Test_TC_SWTCH_2_2() : TestCommand("Test_TC_SWTCH_2_2"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_SWTCH_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); + err = TestUserInteractionNeeded_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : User interaction needed\n"); + err = TestUserInteractionNeeded_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); + err = TestUserInteractionNeeded_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); + err = TestUserInteractionNeeded_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); + err = TestUserInteractionNeeded_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); + err = TestUserInteractionNeeded_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); + err = TestUserInteractionNeeded_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); + err = TestUserInteractionNeeded_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); + err = TestUserInteractionNeeded_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); + err = TestUserInteractionNeeded_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); + err = TestUserInteractionNeeded_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); + err = TestUserInteractionNeeded_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); + err = TestWait3000ms_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); + err = TestUserInteractionNeeded_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); + err = TestUserInteractionNeeded_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); + err = TestUserInteractionNeeded_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); + err = TestUserInteractionNeeded_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); + err = TestUserInteractionNeeded_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); + err = TestUserInteractionNeeded_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); + err = TestWait3000ms_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); + err = TestUserInteractionNeeded_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); + err = TestUserInteractionNeeded_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); + err = TestUserInteractionNeeded_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); + err = TestUserInteractionNeeded_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); + err = TestUserInteractionNeeded_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); + err = TestUserInteractionNeeded_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); + err = TestUserInteractionNeeded_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); + err = TestUserInteractionNeeded_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); + err = TestUserInteractionNeeded_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); + err = TestUserInteractionNeeded_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); + err = TestUserInteractionNeeded_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); + err = TestUserInteractionNeeded_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); + err = TestUserInteractionNeeded_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); + err = TestUserInteractionNeeded_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); + err = TestUserInteractionNeeded_37(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 38; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_3(currentPosition); + } + + static void OnFailureCallback_7(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_7(currentPosition); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestUserInteractionNeeded_1() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to SwitchLatched event"); + } + + CHIP_ERROR TestUserInteractionNeeded_2() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to first position"); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestUserInteractionNeeded_4() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); + } + + CHIP_ERROR TestUserInteractionNeeded_5() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress event"); + } + + CHIP_ERROR TestUserInteractionNeeded_6() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestUserInteractionNeeded_8() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); + } + + CHIP_ERROR TestUserInteractionNeeded_9() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch (release switch)"); + } + + CHIP_ERROR TestUserInteractionNeeded_10() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress and ShortRelease events"); + } + + CHIP_ERROR TestUserInteractionNeeded_11() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_12() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_13() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_14() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); + } + + CHIP_ERROR TestWait3000ms_15() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); + } + + CHIP_ERROR TestUserInteractionNeeded_16() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_17() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + } + + CHIP_ERROR TestUserInteractionNeeded_18() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_19() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_20() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_21() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); + } + + CHIP_ERROR TestWait3000ms_22() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); + } + + CHIP_ERROR TestUserInteractionNeeded_23() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_24() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + } + + CHIP_ERROR TestUserInteractionNeeded_25() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_26() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_27() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_28() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_29() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_30() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_31() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_32() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_33() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_34() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_35() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_36() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_37() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } +}; + class Test_TC_TM_1_1 : public TestCommand { public: @@ -36216,6 +37483,215 @@ class Test_TC_DIAGTH_1_1 : public TestCommand } }; +class Test_TC_WIFIDIAG_1_1 : public TestCommand +{ +public: + Test_TC_WIFIDIAG_1_1() : TestCommand("Test_TC_WIFIDIAG_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_WIFIDIAG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads CurrentMaxRate attribute from DUT\n"); + err = TestReadsCurrentMaxRateAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentMaxRate attribute constraints\n"); + err = TestReadsCurrentMaxRateAttributeConstraints_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint64_t currentMaxRate) + { + (static_cast(context))->OnSuccessResponse_1(currentMaxRate); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint64_t currentMaxRate) + { + (static_cast(context))->OnSuccessResponse_2(currentMaxRate); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadsCurrentMaxRateAttributeFromDut_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint64_t currentMaxRate) + { + VerifyOrReturn(CheckValue("currentMaxRate", currentMaxRate, 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestReadsCurrentMaxRateAttributeConstraints_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint64_t currentMaxRate) + { + VerifyOrReturn(CheckConstraintType("currentMaxRate", "", "uint64")); + NextTest(); + } +}; + +class Test_TC_WIFIDIAG_3_1 : public TestCommand +{ +public: + Test_TC_WIFIDIAG_3_1() : TestCommand("Test_TC_WIFIDIAG_3_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_WIFIDIAG_3_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_3_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + class Test_TC_WNCV_1_1 : public TestCommand { public: @@ -66594,6 +68070,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66626,6 +68103,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66668,6 +68147,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66677,6 +68157,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66687,6 +68169,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index fecc36d4c81cda..170715059f035b 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -1535,6 +1535,27 @@ void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(TLV::TLVRea cb->mCall(cb->mContext, list); } +void OperationalCredentialsClusterNOCsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index ec54dfcb20c4bd..5d65cea0bd2746 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -443,6 +443,13 @@ void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(chip::TLV:: chip::Callback::Cancelable * onFailureCallback); typedef void (*OnOffSwitchConfigurationAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterNOCsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsNOCsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h index b2ed6f1aae5f7d..7a0994d8865813 100644 --- a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h @@ -615,7 +615,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 196 +#define GENERATED_ATTRIBUTE_COUNT 197 #define GENERATED_ATTRIBUTES \ { \ \ @@ -809,6 +809,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -937,22 +938,22 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(149), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(153), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(153), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(159), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(160), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(161), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(162), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(163), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(164), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0000002F, ZAP_ATTRIBUTE_INDEX(168), 9, 133, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000002F, ZAP_ATTRIBUTE_INDEX(169), 9, 133, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { 0x00000101, \ - ZAP_ATTRIBUTE_INDEX(177), \ + ZAP_ATTRIBUTE_INDEX(178), \ 19, \ 29, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index e4d89535e5a70c..5e86e95c68f629 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -587,7 +587,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 230 +#define GENERATED_ATTRIBUTE_COUNT 231 #define GENERATED_ATTRIBUTES \ { \ \ @@ -789,6 +789,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -977,52 +978,52 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(155), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(159), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(159), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(165), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(166), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(167), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(168), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(169), \ + ZAP_ATTRIBUTE_INDEX(170), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(172), \ + ZAP_ATTRIBUTE_INDEX(173), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(179), \ + ZAP_ATTRIBUTE_INDEX(180), \ 16, \ 27, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(195), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(196), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(200), \ + ZAP_ATTRIBUTE_INDEX(201), \ 22, \ 36, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(222), \ + ZAP_ATTRIBUTE_INDEX(223), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { \ - 0x00000006, ZAP_ATTRIBUTE_INDEX(226), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000006, ZAP_ATTRIBUTE_INDEX(227), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 2, Cluster: On/Off (client) */ \ { \ - 0x00000007, ZAP_ATTRIBUTE_INDEX(227), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000007, ZAP_ATTRIBUTE_INDEX(228), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: On/off Switch Configuration (server) */ \ } diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 940cd4d5f04bc2..cff3acdf5af1ee 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -601,7 +601,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 184 +#define GENERATED_ATTRIBUTE_COUNT 185 #define GENERATED_ATTRIBUTES \ { \ \ @@ -795,6 +795,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -904,25 +905,25 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(149), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(153), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(153), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(159), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(160), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(161), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(162), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(163), \ + ZAP_ATTRIBUTE_INDEX(164), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(170), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(171), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0000002F, ZAP_ATTRIBUTE_INDEX(175), 9, 133, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000002F, ZAP_ATTRIBUTE_INDEX(176), 9, 133, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ } diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index 0f0dec8d2fdaed..54f0aa2703303d 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -133,7 +133,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 29 +#define GENERATED_ATTRIBUTE_COUNT 30 #define GENERATED_ATTRIBUTES \ { \ \ @@ -166,6 +166,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -208,13 +209,13 @@ 0x00000031, ZAP_ATTRIBUTE_INDEX(9), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(19), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(19), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(25), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(26), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(27), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(28), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ } diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index b6ff7cb435d086..beb34abee0e70f 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -143,7 +143,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 46 +#define GENERATED_ATTRIBUTE_COUNT 47 #define GENERATED_ATTRIBUTES \ { \ \ @@ -202,6 +202,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -256,13 +257,13 @@ 0x00000031, ZAP_ATTRIBUTE_INDEX(26), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(36), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(36), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(42), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(43), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(44), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(45), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ } diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index 104762c2e4798d..26c3e57ce4d65c 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -483,7 +483,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 179 +#define GENERATED_ATTRIBUTE_COUNT 180 #define GENERATED_ATTRIBUTES \ { \ \ @@ -635,6 +635,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -786,54 +787,54 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(115), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(119), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(119), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(125), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(126), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(127), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(128), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(129), \ + ZAP_ATTRIBUTE_INDEX(130), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(131), \ + ZAP_ATTRIBUTE_INDEX(132), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(133), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(134), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ 0x00000200, \ - ZAP_ATTRIBUTE_INDEX(138), \ + ZAP_ATTRIBUTE_INDEX(139), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(164), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(165), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(165), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(166), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(169), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000403, ZAP_ATTRIBUTE_INDEX(170), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(170), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000403, ZAP_ATTRIBUTE_INDEX(171), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(174), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000404, ZAP_ATTRIBUTE_INDEX(175), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(175), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000404, ZAP_ATTRIBUTE_INDEX(176), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ } diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index afa75ebd00f201..ca3bd1b79a8d1f 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -553,7 +553,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 166 +#define GENERATED_ATTRIBUTE_COUNT 167 #define GENERATED_ATTRIBUTES \ { \ \ @@ -738,6 +738,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -836,31 +837,31 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(142), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(146), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(146), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(152), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(153), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(154), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(155), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x00000006, ZAP_ATTRIBUTE_INDEX(156), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000006, ZAP_ATTRIBUTE_INDEX(157), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: On/Off (client) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(157), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(158), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x00000200, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000200, ZAP_ATTRIBUTE_INDEX(163), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(163), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(164), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(164), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000403, ZAP_ATTRIBUTE_INDEX(165), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(165), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000404, ZAP_ATTRIBUTE_INDEX(166), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ } diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index 4ecaf943a36fda..a7f70cecbdeab3 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -279,7 +279,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 96 +#define GENERATED_ATTRIBUTE_COUNT 97 #define GENERATED_ATTRIBUTES \ { \ \ @@ -389,6 +389,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -472,19 +473,19 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(73), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(77), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(77), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(83), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(84), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(85), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(86), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(87), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(88), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(92), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(93), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ } @@ -524,7 +525,7 @@ // Array of device ids #define FIXED_DEVICE_IDS \ { \ - 22, 22 \ + 22, 770 \ } // Array of device versions diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index e2cb98a185e315..a8389277489a12 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -664,7 +664,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 213 +#define GENERATED_ATTRIBUTE_COUNT 214 #define GENERATED_ATTRIBUTES \ { \ \ @@ -868,6 +868,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -1040,46 +1041,46 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(153), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(157), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(157), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(163), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003F, ZAP_ATTRIBUTE_INDEX(164), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(166), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(167), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(168), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(169), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x00000003, ZAP_ATTRIBUTE_INDEX(170), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000003, ZAP_ATTRIBUTE_INDEX(171), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Identify (client) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(171), \ + ZAP_ATTRIBUTE_INDEX(172), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(174), \ + ZAP_ATTRIBUTE_INDEX(175), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(176), \ + ZAP_ATTRIBUTE_INDEX(177), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(182), \ + ZAP_ATTRIBUTE_INDEX(183), \ 12, \ 246, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(194), \ + ZAP_ATTRIBUTE_INDEX(195), \ 19, \ 34, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp index 364d524c96cbaf..72365cba8d105e 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.cpp @@ -176,6 +176,27 @@ void NetworkCommissioningClusterNetworksListAttributeFilter(TLV::TLVReader * tlv cb->mCall(cb->mContext, list); } +void OperationalCredentialsClusterNOCsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h index 56c4b1679dbc74..2506041e81c1fc 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h @@ -71,6 +71,13 @@ typedef void (*NetworkCommissioningNetworksListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterNOCsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsNOCsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 0cdf900844b192..c89f89f8827223 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -1010,7 +1010,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 285 +#define GENERATED_ATTRIBUTE_COUNT 286 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1219,6 +1219,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -1506,100 +1507,100 @@ 0x0000003E, ZAP_ATTRIBUTE_INDEX(158), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(159), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(159), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(165), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003F, ZAP_ATTRIBUTE_INDEX(166), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(168), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(169), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(170), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(171), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(172), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000405, ZAP_ATTRIBUTE_INDEX(173), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(176), \ + ZAP_ATTRIBUTE_INDEX(177), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(178), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(179), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(183), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000503, ZAP_ATTRIBUTE_INDEX(184), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(185), 4, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000504, ZAP_ATTRIBUTE_INDEX(186), 4, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Channel (server) */ \ { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(189), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000505, ZAP_ATTRIBUTE_INDEX(190), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(192), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000507, ZAP_ATTRIBUTE_INDEX(193), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x00000508, ZAP_ATTRIBUTE_INDEX(195), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000508, ZAP_ATTRIBUTE_INDEX(196), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(196), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000509, ZAP_ATTRIBUTE_INDEX(197), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(197), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050A, ZAP_ATTRIBUTE_INDEX(198), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(200), 3, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050C, ZAP_ATTRIBUTE_INDEX(201), 3, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(203), \ + ZAP_ATTRIBUTE_INDEX(204), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(205), \ + ZAP_ATTRIBUTE_INDEX(206), \ 16, \ 27, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 2, Cluster: Level Control (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(221), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(222), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(226), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050B, ZAP_ATTRIBUTE_INDEX(227), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Audio Output (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(229), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(230), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Descriptor (server) */ \ { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(234), 8, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000506, ZAP_ATTRIBUTE_INDEX(235), 8, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Media Playback (server) */ \ { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(242), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050A, ZAP_ATTRIBUTE_INDEX(243), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(245), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050D, ZAP_ATTRIBUTE_INDEX(246), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(254), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050E, ZAP_ATTRIBUTE_INDEX(255), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Account Login (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(255), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(256), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Descriptor (server) */ \ { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(260), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050A, ZAP_ATTRIBUTE_INDEX(261), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(263), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050D, ZAP_ATTRIBUTE_INDEX(264), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(272), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(273), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Descriptor (server) */ \ { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(277), 8, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050D, ZAP_ATTRIBUTE_INDEX(278), 8, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ } diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 40e6a557093dd6..d3430300c1c3dd 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -876,7 +876,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 413 +#define GENERATED_ATTRIBUTE_COUNT 414 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1075,6 +1075,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -1562,159 +1563,159 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(151), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(155), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(155), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(161), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003F, ZAP_ATTRIBUTE_INDEX(162), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(164), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(165), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(166), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(167), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(168), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000405, ZAP_ATTRIBUTE_INDEX(169), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(172), \ + ZAP_ATTRIBUTE_INDEX(173), \ 2, \ 4, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(174), \ + ZAP_ATTRIBUTE_INDEX(175), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(176), \ + ZAP_ATTRIBUTE_INDEX(177), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(182), \ + ZAP_ATTRIBUTE_INDEX(183), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(189), \ + ZAP_ATTRIBUTE_INDEX(190), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x0000000F, ZAP_ATTRIBUTE_INDEX(204), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000000F, ZAP_ATTRIBUTE_INDEX(205), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(208), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(209), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(213), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001E, ZAP_ATTRIBUTE_INDEX(214), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { \ - 0x00000039, ZAP_ATTRIBUTE_INDEX(214), 15, 646, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000039, ZAP_ATTRIBUTE_INDEX(215), 15, 646, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(229), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003B, ZAP_ATTRIBUTE_INDEX(230), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(232), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(233), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { 0x00000101, \ - ZAP_ATTRIBUTE_INDEX(234), \ + ZAP_ATTRIBUTE_INDEX(235), \ 28, \ 49, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(262), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000102, ZAP_ATTRIBUTE_INDEX(263), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x00000103, ZAP_ATTRIBUTE_INDEX(281), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000103, ZAP_ATTRIBUTE_INDEX(282), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(286), \ + ZAP_ATTRIBUTE_INDEX(287), \ 10, \ 17, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(296), \ + ZAP_ATTRIBUTE_INDEX(297), \ 51, \ 337, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(347), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(348), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(351), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000403, ZAP_ATTRIBUTE_INDEX(352), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(355), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000404, ZAP_ATTRIBUTE_INDEX(356), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(359), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000405, ZAP_ATTRIBUTE_INDEX(360), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x00000500, \ - ZAP_ATTRIBUTE_INDEX(363), \ + ZAP_ATTRIBUTE_INDEX(364), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(369), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000503, ZAP_ATTRIBUTE_INDEX(370), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(371), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000504, ZAP_ATTRIBUTE_INDEX(372), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Channel (client) */ \ { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(372), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000505, ZAP_ATTRIBUTE_INDEX(373), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(373), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000506, ZAP_ATTRIBUTE_INDEX(374), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(374), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000507, ZAP_ATTRIBUTE_INDEX(375), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Input (client) */ \ { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(375), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000509, ZAP_ATTRIBUTE_INDEX(376), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(376), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0000050A, ZAP_ATTRIBUTE_INDEX(377), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(377), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0000050B, ZAP_ATTRIBUTE_INDEX(378), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(378), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0000050C, ZAP_ATTRIBUTE_INDEX(379), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(379), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0000050D, ZAP_ATTRIBUTE_INDEX(380), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(380), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0000050E, ZAP_ATTRIBUTE_INDEX(381), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0x0000050F, ZAP_ATTRIBUTE_INDEX(381), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000050F, ZAP_ATTRIBUTE_INDEX(382), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(402), \ + ZAP_ATTRIBUTE_INDEX(403), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(404), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(405), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(409), \ + ZAP_ATTRIBUTE_INDEX(410), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1757,7 +1758,7 @@ // Array of device ids #define FIXED_DEVICE_IDS \ { \ - 22, 22, 22 \ + 22, 35, 263 \ } // Array of device versions diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 02a0ad09110f03..516a745035ddbb 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -609,7 +609,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 226 +#define GENERATED_ATTRIBUTE_COUNT 227 #define GENERATED_ATTRIBUTES \ { \ \ @@ -812,6 +812,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ @@ -972,31 +973,31 @@ 0x0000003C, ZAP_ATTRIBUTE_INDEX(159), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(163), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(163), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(169), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000040, ZAP_ATTRIBUTE_INDEX(170), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(171), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000041, ZAP_ATTRIBUTE_INDEX(172), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(173), \ + ZAP_ATTRIBUTE_INDEX(174), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(176), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(177), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(181), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000102, ZAP_ATTRIBUTE_INDEX(182), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(201), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000001D, ZAP_ATTRIBUTE_INDEX(202), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(206), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000102, ZAP_ATTRIBUTE_INDEX(207), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Window Covering (server) */ \ }