diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 251fa2fee90749..25c4b7b67c9c2a 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -719,6 +719,7 @@ Jupyter jupyterlab KA kAdminister +kbd kBusy kCase Kconfig diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 02ee720b05f4d7..dcf34d4ad8b125 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -171,6 +171,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \ src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/scene.xml \ src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \ diff --git a/.vscode/launch.json b/.vscode/launch.json index 83ce3d5fe494bd..ed80ae59c95e23 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -430,8 +430,8 @@ "name": "Debug Open IoT SDK example application", "type": "cortex-debug", "request": "launch", - "cwd": "${workspaceRoot}/examples/${input:openiotsdkApp}/openiotsdk", - "executable": "./build/chip-openiotsdk-${input:openiotsdkApp}-example.elf", + "cwd": "${workspaceRoot}/examples/${input:openiotsdkExample}/openiotsdk", + "executable": "./build/chip-openiotsdk-${input:openiotsdkExample}-example.elf", "armToolchainPath": "${env:PW_ENVIRONMENT_ROOT}/cipd/packages/arm/bin/", "servertype": "external", "gdbTarget": "${input:openiotsdkRemoteHost}:31627", //GDBserver port on FVP @@ -439,7 +439,7 @@ "-enable-pretty-printing", "add-symbol-file ./build/bl2.elf 0x10000000", "add-symbol-file ./build/tfm_s.elf 0x38000400", - "add-symbol-file ./build/chip-openiotsdk-${input:openiotsdkApp}-example_ns.elf 0x28060400", + "add-symbol-file ./build/chip-openiotsdk-${input:openiotsdkExample}-example_ns.elf 0x28060400", "break main_ns.cpp:main" ], "runToEntryPoint": "main", @@ -451,7 +451,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/src/test_driver/openiotsdk/unit-tests", - "executable": "./build/${input:openiotsdkUnittest}.elf", + "executable": "./build/${input:openiotsdkUnitTest}.elf", "armToolchainPath": "${env:PW_ENVIRONMENT_ROOT}/cipd/packages/arm/bin/", "servertype": "external", "gdbTarget": ":31627", //GDBserver port on FVP @@ -459,7 +459,7 @@ "-enable-pretty-printing", "add-symbol-file ./build/bl2.elf 0x10000000", "add-symbol-file ./build/tfm_s.elf 0x38000400", - "add-symbol-file ./build/${input:openiotsdkUnittest}_ns.elf 0x28060400", + "add-symbol-file ./build/${input:openiotsdkUnitTest}_ns.elf 0x28060400", "break main_ns.cpp:main" ], "runToEntryPoint": "main", @@ -522,11 +522,13 @@ "default": "CY8CPROTO_062_4343W" }, { - "type": "pickString", - "id": "openiotsdkApp", - "description": "What Open IoT SDK example do you want to use?", - "options": ["shell", "lock-app"], - "default": "shell" + "type": "command", + "id": "openiotsdkExample", + "command": "shellCommand.execute", + "args": { + "command": "cat examples/platform/openiotsdk/supported_examples.txt", + "description": "What Open IoT SDK example application do you want to use?" + } }, { "type": "promptString", @@ -535,37 +537,13 @@ "default": "" }, { - "type": "pickString", - "id": "openiotsdkUnittest", - "description": "What Open IoT SDK unit test do you want to use?", - "options": [ - "accesstest", - "AppTests", - "ASN1Tests", - "BDXTests", - "ChipCryptoTests", - "ControllerTests", - "CoreTests", - "CredentialsTest", - "DataModelTests", - "InetLayerTests", - "MdnsTests", - "MessagingLayerTests", - "MinimalMdnsCoreTests", - "MinimalMdnsRecordsTests", - "MinimalMdnsRespondersTests", - "PlatformTests", - "RawTransportTests", - "RetransmitTests", - "SecureChannelTests", - "SetupPayloadTests", - "SupportTests", - "SystemLayerTests", - "TestShell", - "TransportLayerTests", - "UserDirectedCommissioningTests" - ], - "default": "accesstest" + "type": "command", + "id": "openiotsdkUnitTest", + "command": "shellCommand.execute", + "args": { + "command": "cat src/test_driver/openiotsdk/unit-tests/test_components.txt", + "description": "What Open IoT SDK unit test application do you want to use?" + } } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d0e5fbfae284c4..2fb34adb0e8423 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -243,6 +243,19 @@ "clear": true } }, + { + "label": "Setup Open IoT SDK network", + "type": "shell", + "command": "sudo scripts/setup/openiotsdk/network_setup.sh -n${input:openiotsdkNetworkSetupName} ${input:openiotsdkNetworkSetupCmd}", + "problemMatcher": { + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "message": 5 + } + } + }, { "label": "Build Open IoT SDK example", "type": "shell", @@ -453,6 +466,19 @@ "options": ["simple", "boot", "upgrade"], "default": "simple" }, + { + "type": "pickString", + "id": "openiotsdkNetworkSetupCmd", + "description": "Which command do you wish to use?", + "options": ["up", "down", "restart"], + "default": "up" + }, + { + "type": "promptString", + "id": "openiotsdkNetworkSetupName", + "description": "Type the network namespace name that you want to use.", + "default": "ARM" + }, { "type": "pickString", "id": "openiotsdkDebugMode", @@ -468,44 +494,22 @@ "default": "false" }, { - "type": "pickString", + "type": "command", "id": "openiotsdkExample", - "description": "What Open IoT SDK example application do you want to use?", - "options": ["shell", "lock-app"], - "default": "shell" + "command": "shellCommand.execute", + "args": { + "command": "cat examples/platform/openiotsdk/supported_examples.txt", + "description": "What Open IoT SDK example application do you want to use?" + } }, { - "type": "pickString", + "type": "command", "id": "openiotsdkUnitTest", - "description": "What unit test do you want to use?", - "options": [ - "accesstest", - "AppTests", - "ASN1Tests", - "BDXTests", - "ChipCryptoTests", - "ControllerTests", - "CoreTests", - "CredentialsTest", - "DataModelTests", - "InetLayerTests", - "MdnsTests", - "MessagingLayerTests", - "MinimalMdnsCoreTests", - "MinimalMdnsRecordsTests", - "MinimalMdnsRespondersTests", - "PlatformTests", - "RawTransportTests", - "RetransmitTests", - "SecureChannelTests", - "SetupPayloadTests", - "SupportTests", - "SystemLayerTests", - "TestShell", - "TransportLayerTests", - "UserDirectedCommissioningTests" - ], - "default": "accesstest" + "command": "shellCommand.execute", + "args": { + "command": "cat src/test_driver/openiotsdk/unit-tests/test_components.txt", + "description": "What Open IoT SDK unit test application do you want to use?" + } }, { "type": "promptString", @@ -654,12 +658,12 @@ "nrf-nrf52840dk-pump", "nrf-nrf52840dk-pump-controller", "nrf-nrf52840dk-shell", - "nrf-nrf5340-light", - "nrf-nrf5340-light-rpc", - "nrf-nrf5340-lock", - "nrf-nrf5340-pump", - "nrf-nrf5340-pump-controller", - "nrf-nrf5340-shell", + "nrf-nrf5340dk-light", + "nrf-nrf5340dk-light-rpc", + "nrf-nrf5340dk-lock", + "nrf-nrf5340dk-pump", + "nrf-nrf5340dk-pump-controller", + "nrf-nrf5340dk-shell", "openiotsdk-lock", "openiotsdk-shell", "qpg-qpg6100-lock", diff --git a/config/openiotsdk/cmake/sdk.cmake b/config/openiotsdk/cmake/sdk.cmake index 7fbc7efa9561bc..61cd704a030041 100644 --- a/config/openiotsdk/cmake/sdk.cmake +++ b/config/openiotsdk/cmake/sdk.cmake @@ -194,11 +194,11 @@ if(TARGET mcu-driver-hal) DOMAIN_NS=$,1,0> ) - # Fixing the optimization issue for mcu-driver-hal target in the no-debug build. - # The default -Og optimization causes performance issues for the application. + # Fixing the optimization issue for mcu-driver-hal target in the release build. + # The default -Os optimization causes performance issues for the application. # We need to replace it with -O2 which is suitable for performance. # This fix can be removed in the future when the issue will be fixed in SDK directly. - if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") target_compile_options(mcu-driver-hal INTERFACE $<$:-O2>) target_compile_options(mcu-driver-hal INTERFACE $<$:-O2>) endif() diff --git a/docs/examples/index.md b/docs/examples/index.md index 6890ff955ec866..46482fcbe8934e 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -134,15 +134,6 @@ log-source-app/**/README minimal-mdns/README ``` -## Open IoT SDK examples - -```{toctree} -:glob: -:maxdepth: 1 - -openiotsdk_examples -``` - ## OTA Provider example ```{toctree} diff --git a/docs/examples/openiotsdk_examples.md b/docs/examples/openiotsdk_examples.md deleted file mode 100644 index 91bb27ffa9f13c..00000000000000 --- a/docs/examples/openiotsdk_examples.md +++ /dev/null @@ -1,303 +0,0 @@ -# Matter Open IoT SDK Example Application - -These examples are built using -[Open IoT SDK](https://gitlab.arm.com/iot/open-iot-sdk) and runs inside an -emulated target through the -[Arm FVP model for the Corstone-300 MPS3](https://developer.arm.com/downloads/-/arm-ecosystem-fvps). - -You can use these example as a reference for creating your own applications. - -## Environment setup - -Before building the examples, check out the Matter repository and sync -submodules using the following command: - -``` -$ git submodule update --init -``` - -The VSCode devcontainer has all dependencies pre-installed. Using the VSCode -devcontainer is the recommended way to interact with Open IoT SDK port of the -Matter Project. Please read this [README.md](../VSCODE_DEVELOPMENT.md) for more -information. - -### Networking setup - -Running ARM Fast Model with TAP/TUN device networking mode requires setup proper -network interfaces. Special scripts were designed to make setup easy. In -`scripts/setup/openiotsdk` directory you can find: - -- **network_setup.sh** - script to create the specific network namespace and - Virtual Ethernet interface to connect with host network. Both host and - namespace sides have linked IP addresses. Inside the network namespace the - TAP device interface is created and bridged with Virtual Ethernet peer. - There is also option to enable Internet connection in namespace by - forwarding traffic to host default interface. - - To enable Open IoT SDK networking environment: - - ``` - ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh up - ``` - - To disable Open IoT SDK networking environment: - - ``` - ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh down - ``` - - Use `--help` to get more information about the script options. - -- **connect_if.sh** - script that connects specified network interfaces with - the default route interface. It creates a bridge and links all interfaces to - it. The bridge becomes the default interface. - - Example: - - ``` - ${MATTER_ROOT}/scripts/setup/openiotsdk/connect_if.sh ARMhveth - ``` - - Use `--help` to get more information about the script options. - -Open IoT SDK network setup scripts contain commands that require root -permissions. Use `sudo` to run the scripts in user account with root privileges. - -After setting up the Open IoT SDK network environment the user will be able to -run Matter examples on `FVP` in an isolated network namespace in TAP device -mode. - -To execute a command in a specific network namespace use the helper script -`scripts/run_in_ns.sh`. - -Example: - -``` -${MATTER_ROOT}/scripts/run_in_ns.sh ARMns -``` - -Use `--help` to get more information about the script options. - -**NOTE** - -For Docker environment users it's recommended to use the -[default bridge network](https://docs.docker.com/network/bridge/#use-the-default-bridge-network) -for a running container. This guarantees full isolation of the Open IoT SDK -network from host settings. - -### Debugging setup - -Debugging Matter application running on `FVP` model requires GDB Remote -Connection Plugin for Fast Model. More details -[GDBRemoteConnection](https://developer.arm.com/documentation/100964/1116/Plug-ins-for-Fast-Models/GDBRemoteConnection). - -The Third-Party IP add-on package can be downloaded from ARM developer website -[Fast models](https://developer.arm.com/downloads/-/fast-models). Currently -required version is `11.16`. - -To install Fast Model Third-Party IP package: - -- unpack the installation package in a temporary location -- execute the command `./setup.bin` (Linux) or `Setup.exe` (Windows), and - follow the installation instructions. - -After installation the GDB Remote Connection Plugin should be visible in -`FastModelsPortfolio_11.16/plugins` directory. - -Then add the GDB plugin to your development environment: - -- host environment - add GDB plugin path to environment variable as - FAST_MODEL_PLUGINS_PATH. - - Example - - ``` - export FAST_MODEL_PLUGINS_PATH=/opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3 - ``` - -- Docker container environment - mount the Fast Model Third-Party IP directory - into the `/opt/FastModelsPortfolio_11.16` directory in container. - - The Vscode devcontainer users should add a volume bound to this directory - [Add local file mount](https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount). - - You can edit the `.devcontainer/devcontainer.json` file, for example: - - ``` - ... - "mounts": [ - ... - "source=/opt/FastModelsPortfolio_11.16,target=/opt/FastModelsPortfolio_11.16,type=bind,consistency=cached" - ... - ], - ... - ``` - - In this case, the FAST MODEL PLUGINS PATH environment variable is already - created. - - If you launch the Docker container directly from CLI, use the above - arguments with `docker run` command. Remember add GDB plugin path to - environment variable as FAST_MODEL_PLUGINS_PATH inside container. - -## Configuration - -### Trusted Firmware-M - -To add [TF-M](https://tf-m-user-guide.trustedfirmware.org) support to Matter -example you need to set `TFM_SUPPORT` variable inside main application -`CMakeLists.txt` file. - -``` -set(TFM_SUPPORT YES) -``` - -This causes the Matter example to be built as non-secure application in -Non-secure Processing Environment (`NSPE`). The bootloader and the secure part -are also built from `TF-M` sources. All components are merged into a single -executable file at the end of the building process. - -You can also provide the own version of Matter example by setting -`TFM_NS_APP_VERSION` variable. - -``` -set(TFM_NS_APP_VERSION "0.0.1") -``` - -### Trusted Firmware-M Protected Storage - -There is an option to add -[TF-M Protected Storage Service](https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_ps_integration_guide.html) -support for `key-value` storage component in Matter examples. You need to set -`CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS` variable inside main application -`CMakeLists.txt` fi - -``` -set(CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS YES) -``` - -This option causes `key-value` objects will be stored in a secure part of flash -memory and the Protected Storage Service takes care of their encryption and -authentication. - -**NOTE** - -The `TF-M Protected Storage` option requires enabling -[TF-M](#trusted-firmware-m) support. - -## Building - -You build using a vscode task or call the script directly from the command line. - -### Building using vscode task - -``` -Command Palette (F1) => Run Task... => Build Open IoT SDK example => (debug on/off) => -``` - -This will call the scripts with the selected parameters. - -### Building using CLI - -You can call the script directly yourself. - -``` -${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -``` - -Use `--help` to get more information about the script options. - -## Running - -The application runs in the background and opens a telnet session. The script -will open telnet for you and connect to the port used by the `FVP`. When the -telnet process is terminated it will also terminate the `FVP` instance. - -You can run the application script from a vscode task or call the script -directly. - -### Running using vscode task - -``` -Command Palette (F1) => Run Task... => Run Open IoT SDK example => (network namespace) => (network interface) => -``` - -This will call the scripts with the selected example name. - -### Running using CLI - -You can call the script directly yourself. - -``` -${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run -``` - -Run example in specific network namespace with TAP device mode: - -``` -${MATTER_ROOT}/scripts/run_in_ns.sh ARMns ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run -n ARMtap -``` - -### Commissioning - -Once booted the application can be commissioned, please refer to -[docs/guides/openiotsdk_commissioning.md](../guides/openiotsdk_commissioning.md) -for further instructions. - -## Testing - -Run the Pytest integration test for specific application. - -The test result can be found in -`src/test_driver/openiotsdk/integration-tests//test_report.json` -file. - -You run testing using a vscode task or call the script directly from the command -line. - -### Testing using vscode task - -``` -Command Palette (F1) => Run Task... => Test Open IoT SDK example => (network namespace) => (network interface) => -``` - -This will call the scripts with the selected example name. - -### Testing using CLI - -You can call the script directly yourself. - -``` -${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test -``` - -Test example in specific network namespace with TAP device mode: - -``` -${MATTER_ROOT}/scripts/run_in_ns.sh ARMns ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test -n ARMtap -``` - -## Debugging - -Debugging can be started using a VS code launch task: - -``` -Run and Debug (Ctrl+Shift+D) => Debug Open IoT SDK example application => Start -Debugging (F5) => => (GDB target address) => (network namespace) => (network interface) => -``` - -For debugging remote targets (i.e. run in other network namespaces) you need to -pass hostname/IP address of external GDB target that you want to connect to -(_GDB target address_). In case of using the -[Open IoT SDK network environment](#networking-setup) the GDB server runs inside -a namespace and has the same IP address as bridge interface. - -``` -${MATTER_ROOT}/scripts/run_in_ns.sh ifconfig -``` - -**NOTE** - -As you can see above, you will need to select the name of the example twice. -This is because the debug task needs to launch the run task and currently VS -code has no way of passing parameters between tasks. diff --git a/docs/guides/README.md b/docs/guides/README.md index 67bb8b66001830..451a2c6d2fdff7 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -22,6 +22,10 @@ - [Silicon Labs - Building](./silabs_efr32_building.md) - [Silicon Labs - Software Update](./silabs_efr32_software_update.md) - [TI - Platform Overview](./ti_platform_overview.md) +- [Open IoT SDK - Platform Overview](./openiotsdk_platform_overview.md) +- [Open IoT SDK - Examples](./openiotsdk_examples.md) +- [Open IoT SDK - Unit Tests](./openiotsdk_unit_tests.md) +- [Open IoT SDK - Commissioning](./openiotsdk_commissioning.md) ## Development Guides diff --git a/docs/guides/openiotsdk_commissioning.md b/docs/guides/openiotsdk_commissioning.md index 596184fd27a961..520cff033d611d 100644 --- a/docs/guides/openiotsdk_commissioning.md +++ b/docs/guides/openiotsdk_commissioning.md @@ -7,41 +7,82 @@ the device becomes available on the Matter network. Open IoT SDK Matter devices, due to the connectivity setup, start already connected to the IP network and do not require credentials provisioning. -## Building and installing the Python Device Controller +## Building Matter controller -To make provisioning possible and to control the Matter device with a Python -application, you can build and run the Python controller application. Please -read the guide -[Python Device Controller guide](python_chip_controller_building.md) for further -instructions. +The [Matter controller](../../src/controller/README.md) is a client application +that allows commission and control of the Matter node. + +The [POSIX CLI chip-tool](../../examples/chip-tool/README.md) is the recommended +Matter controller to use with Open IoT SDK devices. + +To build `chip-tool` execute command: + +``` +scripts/examples/gn_build_example.sh examples/chip-tool out/chip-tool +``` ## Device commissioning -Run chip-device-ctrl and use the interactive prompt to commission the device. +Open IoT SDK examples require to setup a specific +[network environment](./openiotsdk_examples.md#networking-setup): + +``` +export TEST_NETWORK_NAME=OIStest +sudo ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME restart +``` + +Both the device application and the controller should be started in a separate +terminal sessions and inside the created network namespace. Use the +`{MATTER_ROOT}/scripts/examples/scripts/run_in_ns.sh` helper script to execute +the specific shell command inside the network namespace. + +Run the application in `device terminal` and use the network namespace: + +``` +${MATTER_ROOT}/scripts/examples/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run -n ${TEST_NETWORK_NAME}tap + +``` After the device boots, it's in ready for commissioning mode and starts the mDNS -advertisement. This can be discovered by the controller using: +advertisement. + +To commission the node in `client terminal` run Matter controller in the same +network namespace with pairing command: + +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns ./out/chip-tool/chip-tool pairing onnetwork-long +``` + +The `node_id` is chosen by the user. `pin_code` and `discriminator` are node +parameters printed when running the application in the `device terminal`. + +Example: ``` -discover -all +${MATTER_ROOT}/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns ./out/chip-tool/chip-tool pairing onnetwork-long 123 20202021 3840 ``` -This will list the devices and their addresses. To commission the device use: +The application output a trace when commissioning succeeds. This trace is +displayed in the `device terminal`: ``` -connect -ip
[] +[INF] [SVR] Commissioning completed successfully ``` -The setup pin code is printed in the log of the device. The `` can be -chosen by the user, if left blank it will be automatically picked. +## Sending ZCL cluster commands -## Sending ZCL commands +Before sending cluster commands [commission](#device-commissioning) the device. -If the commissioning process was successful, it is possible to send a ZCL -command to the device which initiates a certain action. +To perform cluster action, run the Matter controller in the `client terminal` +and use the same network namespace: -`zcl [arguments]` +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns ./out/chip-tool/chip-tool [param1 param2 ...] +``` Example: - chip-device-ctrl > zcl LevelControl MoveWithOnOff 12344321 1 0 moveMode=1 rate=2 +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns ./out/chip-tool/chip-tool basicinformation read vendor-id 123 0 +``` diff --git a/docs/guides/openiotsdk_examples.md b/docs/guides/openiotsdk_examples.md new file mode 100644 index 00000000000000..2de1915f3ecf43 --- /dev/null +++ b/docs/guides/openiotsdk_examples.md @@ -0,0 +1,766 @@ +# Matter Open IoT SDK Example Application + +These examples are built using +[Open IoT SDK](https://gitlab.arm.com/iot/open-iot-sdk) and runs inside an +emulated target through the +[Arm FVP model for the Corstone-300 MPS3](https://developer.arm.com/downloads/-/arm-ecosystem-fvps). + +The list of currently supported Matter examples: + +``` +shell +lock-app +``` + +You can use these examples as a reference for creating your own applications. + +## Environment setup + +The VSCode devcontainer has all the dependencies pre-installed. It is the +recommended way to build, run and develop with the Open IoT SDK port of the +Matter Project. Please read this +[VSCode development guide](../VSCODE_DEVELOPMENT.md) for more information. + +Before building the examples, check out the Matter repository and sync Open IoT +SDK submodules using the following command: + +``` +scripts/checkout_submodules.py --shallow --recursive --platform openiotsdk +``` + +Next, bootstrap the source tree to install Pigweed (CIPD and Python packages) +components inside your environment (only once). + +To bootstrap: + +**using CLI** + +``` +$ bash scripts/bootstrap.sh +``` + +**using VSCode tasks** + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Bootstrap` + +### Networking setup + +Running ARM Fast Model with the TAP/TUN device networking mode requires the +setting up of proper network interfaces. Special scripts were designed to make +the setup easy. In the `scripts/setup/openiotsdk` directory you can find: + +- **network_setup.sh** - script to create the specific network namespace and + Virtual Ethernet interface to connect with the host network. Both host and + namespace sides have linked IP addresses. Inside the network namespace the + TAP device interface is created and bridged with a Virtual Ethernet peer. + There is also an option to enable an Internet connection in the namespace by + forwarding traffic to the host default interface. + + To enable the Open IoT SDK networking environment: + + ``` + ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh up + ``` + + To disable the Open IoT SDK networking environment: + + ``` + ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh down + ``` + + To restart the Open IoT SDK networking environment: + + ``` + ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh restart + ``` + + The default scripts settings are: + + - `ARM` - network base name + - `current session user` - network namespace user + - `fe00::1` - host side IPv6 address + - `fe00::2` - namespace side IPv6 address + - `10.200.1.1` - host side IPv4 address + - `10.200.1.2` - namespace side IPv4 address + - no Internet connection support to network namespace + + Example of the `OIS` network environment settings: + + ``` + ARMns namespace configuration + ARMbr: flags=4163 mtu 1500 + inet 10.200.1.2 netmask 255.255.255.0 broadcast 0.0.0.0 + inet6 fe00::2 prefixlen 64 scopeid 0x0 + inet6 fe80::1809:17ff:fe6c:f566 prefixlen 64 scopeid 0x20 + ether 1a:09:17:6c:f5:66 txqueuelen 1000 (Ethernet) + RX packets 1 bytes 72 (72.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + + ARMnveth: flags=4163 mtu 1500 + ether 46:66:29:a6:91:4b txqueuelen 1000 (Ethernet) + RX packets 2 bytes 216 (216.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 3 bytes 270 (270.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + + ARMtap: flags=4419 mtu 1500 + ether 1a:09:17:6c:f5:66 txqueuelen 1000 (Ethernet) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + + lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + inet6 ::1 prefixlen 128 scopeid 0x10 + loop txqueuelen 1000 (Local Loopback) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + + Host configuration + ARMhveth: flags=4163 mtu 1500 + inet 10.200.1.1 netmask 255.255.255.0 broadcast 0.0.0.0 + inet6 fe80::147c:c9ff:fe4a:c6d2 prefixlen 64 scopeid 0x20 + inet6 fe00::1 prefixlen 64 scopeid 0x0 + ether 16:7c:c9:4a:c6:d2 txqueuelen 1000 (Ethernet) + RX packets 3 bytes 270 (270.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 2 bytes 216 (216.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + ``` + + Use `--help` to get more information about the script options. + + Open IoT SDK network setup is also supported via `VScode tasks`: + + - Open the Command Palette: F1 + - Select `Tasks: Run Task` + - Select `Setup Open IoT SDK network` + - Enter the network namespace name + - Choose command + + The VSCode task invokes `network_setup.sh` with the selected parameters. + +- **connect_if.sh** - script that connects specified network interfaces with + the default route interface. It creates a bridge and links all interfaces to + it. The bridge becomes the default interface. + + Example: + + ``` + ${MATTER_ROOT}/scripts/setup/openiotsdk/connect_if.sh ARMhveth + ``` + + Use `--help` to get more information about the script options. + +Open IoT SDK network setup scripts contain commands that require root +permissions. Use `sudo` to run the scripts in a user account with root +privileges. + +After setting up the Open IoT SDK network environment the user will be able to +run Matter examples on `FVP` in an isolated network namespace in TAP device +mode. + +To execute a command in a specific network namespace use the helper script +`scripts/run_in_ns.sh`. + +Example: + +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ARMns +``` + +Use `--help` to get more information about the script options. + +> 💡 **Notes**: +> +> For Docker environment users it's recommended to use the +> [default bridge network](https://docs.docker.com/network/bridge/>#use-the-default-bridge-network) +> for a running container. This guarantees full isolation of the Open IoT SDK +> network from host settings. + +### Debugging setup + +Debugging the Matter application running on `FVP` model requires GDB Remote +Connection Plugin for Fast Model. More details +[GDBRemoteConnection](https://developer.arm.com/documentation/100964/1116/Plug-ins-for-Fast-Models/GDBRemoteConnection). + +The `Fast Models FVP` add-on package can be downloaded from the ARM developer +website [Fast models](https://developer.arm.com/downloads/-/fast-models). After +login in to the `ARM developer` platform search for `Fast Models`, choose +`Fast Models (FM000A)` on the list of results, then choose the revision +`r11p16-16rel0` and download the +`Third Party Add-ons for Fast Models 11.16 (Linux)` package. Then unpack the +package in the selected location on the host machine. + +Now you should add the GDB Remote Connection Plugin to your development +environment: + +- Linux host environment: + + - install Fast Model Extension package by executing the command + `./setup.bin`, and follow the installation instructions. After + installation, the GDB Remote Connection Plugin should be visible in + `/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3` + directory. + - add GDB plugin path to environment variable as + `FAST_MODEL_PLUGINS_PATH`. + + Example: + + ``` + export FAST_MODEL_PLUGINS_PATH=/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3 + ``` + +- Docker container environment: + + - pass the Fast Model Extension package to Docker container development + environment by mounting it into the + `/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64` directory in the + container. Add a volume bound to this directory + [Add local file mount](https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount). + + You can edit the `.devcontainer/devcontainer.json` file, for example: + + ``` + ... + "mounts": [ ... + "source=/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64,target=/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64,type=bind,consistency=cached" + ... ], + ... + ``` + + Or if you launch the Docker container directly from CLI, use the above + arguments with `docker run` command: + + ``` + docker run ... --mount type=bind,source=/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64,target=/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64 ... + ``` + + - install the Fast Model Extension package via setup script inside Docker + container: + + ``` + ${MATTER_ROOT}/scripts/setup/openiotsdk/debugging_setup.sh + ``` + + - the GDB Remote Connection Plugin should be visible in + `/opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3` directory. + - For `VScode devcontainer` use the environment variable + `FAST_MODEL_PLUGINS_PATH` to point to the correct directory. + - If the Docker container is directly launched remember to add the GDB + Remote Connection Plugin path to the environment variable + `FAST_MODEL_PLUGINS_PATH` inside the container: + ``` + export FAST_MODEL_PLUGINS_PATH=/opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3 + ``` + +### Testing setup + +The Matter Python packages are required for the integration test suite. They are +not provided as part of the VSCode devcontainer. To install these run the +following command from the CLI: + +``` +${MATTER_ROOT}/scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel +build-env' +``` + +More information about the Python tools you can find +[here](../../src/controller/python/README.md). + +## Configuration + +### Trusted Firmware-M + +To add [TF-M](https://tf-m-user-guide.trustedfirmware.org) support to Matter +example you need to set `TFM_SUPPORT` variable inside main application +`CMakeLists.txt` file. + +``` +set(TFM_SUPPORT YES) +``` + +This causes the Matter example to be built as non-secure application in +Non-secure Processing Environment (`NSPE`). The bootloader and the secure part +are also built from `TF-M` sources. All components are merged into a single +executable file at the end of the building process. + +You can also provide the own version of Matter example by setting +`TFM_NS_APP_VERSION` variable. + +``` +set(TFM_NS_APP_VERSION "0.0.1") +``` + +### Trusted Firmware-M Protected Storage + +By default, the +[Block Device storage](./openiotsdk_platform_overview.md#storage) is used for +storing Matter key-value data. + +There is an option to add +[TF-M Protected Storage Service](https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_ps_integration_guide.html) +support for `key-value` storage component in the Matter examples. Set the +variable `CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS` to `YES` to add +`TF-M Protected Storage` support to your application. You can put it inside the +main application `CMakeLists.txt` file: + +``` +set(CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS YES) +``` + +or add as a Cmake command-line parameter: + +``` +cmake -G <...> -DCONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS=YES <...> +``` + +This option causes `key-value` objects will be stored in a secure part of flash +memory and the Protected Storage Service takes care of their encryption and +authentication. + +> 💡 **Notes**: +> +> The `TF-M Protected Storage` option requires enabling +> [TF-M](#trusted-firmware-m) support. +> +> The `-k/--kvsstore` option in +> [Open IoT SDK build script](../../scripts/examples/openiotsdk_example.sh) +> selects key-value storage implementation for the Matter's examples. It +> demonstrates how to use the `CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS` variable. + +### Storing persistent memory block in external files + +The persistent storage is required to store key-value data of the Matter +examples. + +Two storage types are supported: + +- Block device storage: The memory partition is located in `non-secure SRAM` +- `TF-M` protected storage: The memory partition is located in + `secure QSPI_RAM` + +Fast models offers option to load and dump memory content. More details are +available +[here](./openiotsdk_platform_overview.md#fast-model-persistent-memory-via-files). +Depending on the storage implementation, different flags are used in the `FVP` +options. + +For block device storage use: + +``` +--dump mps3_board.sram=@0:0x0,0x100000 +--data mps3_board.sram=@0:0x0 +``` + +For `TF-M` protected storage use: + +``` +--dump mps3_board.qspi_sram=@0:0x660000,0x12000 +--data mps3_board.qspi_sram=@0:0x660000 +``` + +> 💡 **Notes**: +> +> The `file-path` must exist to use the `--data` option. + +[Open IoT SDK build script](../../scripts/examples/openiotsdk_example.sh) +provides the `-K,--kvsfile` option to use the persistence options listed above. + +## Building + +You can build examples using the dedicated VSCode task or by calling directly +the build script from the command line. + +### Building using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Build Open IoT SDK example` +- Decide on debug mode support +- Decide on LwIP debug logs support +- Choose example name + +This will call the script with the selected parameters. + +### Building using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh +``` + +Use `--help` to get more information about the script options. + +## Running + +The application runs in the background and opens a telnet session. The telnet +client connects to the port used by the `FVP`. When the telnet process is +terminated it also terminates the `FVP` instance. + +To exit the telnet session, type CTRL + ]. This changes the command +prompt to show as: + +``` +telnet> +``` + +Back in the terminal, type in the word 'close' to terminate the session. + +``` +telnet> close +``` + +You can run an example by using a VSCode task or by calling the run script +directly from the command line. + +### Running using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Run Open IoT SDK example` +- Enter network namespace +- Enter network interface +- Choose example name + +This will call the script with the selected example name. + +### Running using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run +``` + +Run example in specific network namespace with TAP device mode: + +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ARMns ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run -n ARMtap +``` + +## Testing + +Run the Pytest integration test for the specific application. + +The test result can be found in the +`src/test_driver/openiotsdk/integration-tests//test_report.json` +file. + +You can test an example by using a VSCode task or by calling the test script +directly from the command line. + +### Testing using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Test Open IoT SDK example` +- Enter network namespace +- Enter network interface +- Choose example name + +This will call the scripts with the selected example name. + +### Testing using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test +``` + +Testing an example in a specific network namespace with TAP device mode: + +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ARMns ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test -n ARMtap +``` + +## Debugging + +Before debugging ensure the following: + +1. The debug environment is correctly setup: + [debugging setup](#debugging-setup). + +2. The example is compiled with debug symbols enabled: + + For CLI: + + ``` + ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -d true + ``` + + For the VSCode task: + + ``` + => Use debug mode (true) + ``` + +3. The test network is correctly setup (if required): see + [networking setup](#networking-setup). + +### General instructions + +- Click `Run and Debug` from the primary side menu or press + Ctrl+Shift+D +- Select `Debug Open IoT SDK example application` from the drop down list +- Click `Start Debugging`(green triangle) or press F5 +- Choose example name +- Enter GDB target address +- Enter network namespace +- Enter network interface +- Choose example name + +As soon as a debugging session starts, the `DEBUG CONSOLE` panel is displayed +and shows the debugging output. Use debug controls to debug the current +application. + +For debugging remote targets (i.e. run in other network namespaces) you need to +pass the hostname/IP address of the external GDB target that you want to connect +to (_GDB target address_). + +In the case of using the [Open IoT SDK network environment](#networking-setup) +the GDB server runs inside a namespace and has the same IP address as the bridge +interface. + +``` +${MATTER_ROOT}/scripts/run_in_ns.sh ifconfig +``` + +The network namespace name and TAP interface name are also required then. + +The application with GDB Remote Connection Plugin runs in the background and +opens a telnet session in terminal. The telnet client connects to the port used +by the `FVP`. When the telnet process is terminated it will also terminate the +`FVP` instance. + +To exit the telnet session, type CTRL + ]. This changes the command +prompt to show as: + +``` +telnet> +``` + +Back in the terminal, type in the word 'close' to terminate the session. + +``` +telnet> close +``` + +> 💡 **Notes**: +> +> As you can see above, you will need to select the name of the example twice. +> This is because the debug task needs to launch the run task and currently VS +> code has no way of passing parameters between tasks. +> +> There are issues with debugging examples when the Docker container use the +> [network host](https://docs.docker.com/network/host/) and VPN connection is +> established. Changing routing negatively affects debugging process. It is +> recommended not to use VPN connections while debugging. + +## Specific examples + +### Build lock-app example and run it in the network namespace + +**Using CLI** + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh lock-app + +export TEST_NETWORK_NAME=OIStest + +sudo ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME restart + +${MATTER_ROOT}/scripts/examples/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run -n ${TEST_NETWORK_NAME}tap +lock-app +``` + +**Using the VSCode task** + +Build example: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Build Open IoT SDK example` +- Deny debug mode support `false` +- Deny LwIP debug logs support `false` +- Choose example name `lock-app` + +Setup network environment: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Setup Open IoT SDK network` +- Enter the network namespace name `OIStest` +- Choose command `restart` + +Run example: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Run Open IoT SDK example` +- Enter network namespace `OIStestns` +- Enter network interface `OIStesttap` +- Choose example name `lock-app` + +The example output should be seen in the terminal window. + +### Build lock-app example and execute its test in the network namespace + +**Using CLI** + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh lock-app + +export TEST_NETWORK_NAME=OIStest + +sudo ${MATTER_ROOT}/scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME restart + +${MATTER_ROOT}/scripts/examples/scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test -n ${TEST_NETWORK_NAME}tap +lock-app +``` + +**Using the VSCode task** + +Build example: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Build Open IoT SDK example` +- Deny debug mode support `false` +- Deny LwIP debug logs support `false` +- Choose example name `lock-app` + +Setup network environment: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Setup Open IoT SDK network` +- Enter the network namespace name `OIStest` +- Choose command `restart` + +Test example: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Test Open IoT SDK example` +- Enter network namespace `OIStestns` +- Enter network interface `OIStesttap` +- Choose example name `lock-app` + +### Build lock-app example in debug mode and debug it in the network namespace using the VSCode task + +Build example: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Build Open IoT SDK example` +- Confirm debug mode support `true` +- Deny LwIP debug logs support `false` +- Choose example name `lock-app` + +Setup network environment: + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Setup Open IoT SDK network` +- Enter the network namespace name `OIStest` +- Choose command `restart` + +Debug example: + +- Click `Run and Debug` from the primary side menu or press + Ctrl+Shift+D +- Select `Debug Open IoT SDK example application` from the drop down list +- Click `Start Debugging`(green triangle) or press F5 +- Choose example name `lock-app` +- Enter GDB target address `10.200.1.2` +- Enter network namespace `OIStestns` +- Enter network interface `OIStesttap` +- Choose example name `lock-app` + +Use debug controls to debug the application. + +## Add new example + +This chapter describes how to add a new Matter example based on Open IoT SDK +platform. + +In the description below we use the placeholder `example_name` as the name of +the example to create. Replace it with the name of your example. + +> 💡 **Notes**: +> +> Remember to update the list of currently supported Matter examples at the top +> of this document. + +### Files structure + +A new example should be put into `examples//openiotsdk` directory. +It should contain: + +- application source files and headers in the `main` sub-directory +- application `CMakeLists.txt` file +- `.gitignore` file with with all sources to skip +- `README.md` file with example description +- additional directories with required configuration for used components. Use + `component_name-config` pattern, e.g `freertos-config` + +### Target name + +A new application target name should be created with +`chip-openiotsdk--example(_ns)` pattern. The `_ns` suffix is +required for [TF-M applications](#trusted-firmware-m). + +Example: + +``` +set(APP_TARGET chip-openiotsdk-new-example-example_ns) +``` + +### Example tools + +Add a new example name to the list in the +`examples/platform/openiotsdk/supported_examples.txt` file. After that the new +example is available in all necessary tools such as helper script +`scripts/examples/openiotsdk_example.sh` or VSCode tasks. + +Example: + +``` +... +example_name +... +``` + +### CI + +To add a new example to the Matter CI edit the +`.github/workflows/examples-openiotsdk.yaml` file and add the next step for +`openiotsdk` job step that build this example. + +Example: + +``` +... +- name: Build new-example example + id: build_new_example + timeout-minutes: 10 + run: | + scripts/examples/openiotsdk_example.sh new-example + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release new-example \ + examples/new-example/openiotsdk/build/chip-openiotsdk-new-example-example.elf \ + /tmp/bloat_reports/ +... +``` diff --git a/docs/guides/openiotsdk_platform_overview.md b/docs/guides/openiotsdk_platform_overview.md index 211cd1af852179..f52d18b4e65aa0 100644 --- a/docs/guides/openiotsdk_platform_overview.md +++ b/docs/guides/openiotsdk_platform_overview.md @@ -68,17 +68,42 @@ Configuration of Mbed TLS is in Storage in Open IoT SDK is provided by [TDBStore](https://gitlab.arm.com/iot/open-iot-sdk/storage) which is a simple -Key-Value Storage over a block device. +key-value storage over a block device. + +If the application uses +[Trusted Firmware-M](https://tf-m-user-guide.trustedfirmware.org) then +[TF-M Protected Storage Service](https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_ps_integration_guide.html) +can be used as an alternative for persistence in secure memory. --- **NOTE** -On the Corstone targets this currently is implemented as a RAM memory region -emulating a Flash device. This does not offer persistence between launches. +On `FVP` Corstone targets, memory content is lost after the program exits. To +achieve persistence memory regions used for the key-value storage must be saved +when the execution ends. --- +### Fast model persistent memory via files + +Two command lines options can be used to achieve persistence of a specific +memory regions: + +- `--dump` store the content of a memory region into a file when the model + ends its execution +- `--data` load the content of a file into a specific memory region at startup + +Use the `--list-memory` flag to see the list of instances and memory spaces for +your `FVP` model. + +Visit the +[FVP command line documentation](https://developer.arm.com/documentation/100966/1116/Getting-Started-with-Fixed-Virtual-Platforms/FVP-command-line-options) +for more details about these flags. + +Depending on your application, choose the right memory instance, memory space, +address and size. + ## Clocks Open IoT SDK does not currently offer an RTC. Matter configuration has been set diff --git a/docs/guides/openiotsdk_unit_tests.md b/docs/guides/openiotsdk_unit_tests.md new file mode 100644 index 00000000000000..7b9bba56707870 --- /dev/null +++ b/docs/guides/openiotsdk_unit_tests.md @@ -0,0 +1,249 @@ +# Matter Open IoT SDK unit tests + +The unit testing approach is to create a separate application with Matter test +library dependence. Each Matter project component implements the set of unit +tests that are located in the `test` directory, e.g. `src/inet/tests`. Those +sources are built as a static library that can be linked to the unit test +application separately or as a monolithic test library. The common Matter test +library collects all test cases and provides the engine based on +[Nest Labs Unit Test](https://github.com/nestlabs/nlunit-test) to run them in +the application. + +The Open IoT SDK unit tests implementation are located in the +`src/test_driver/openiotsdk/unit-tests` directory. This project builds a +separate application for each Matter component that is tested. It's built using +[Open IoT SDK](https://gitlab.arm.com/iot/open-iot-sdk) and run inside an +emulated target through the +[Arm FVP model for the Corstone-300 MPS3](https://developer.arm.com/downloads/-/arm-ecosystem-fvps). + +The list of currently supported Matter's component tests: + +``` +accesstest +AppTests +ASN1Tests +BDXTests +ChipCryptoTests +CoreTests +CredentialsTest +DataModelTests +InetLayerTests +MdnsTests +MessagingLayerTests +MinimalMdnsCoreTests +MinimalMdnsRecordsTests +MinimalMdnsRespondersTests +PlatformTests +RawTransportTests +RetransmitTests +SecureChannelTests +SetupPayloadTests +SupportTests +SystemLayerTests +TestShell +TransportLayerTests +UserDirectedCommissioningTests +``` + +Each application links the specific Matter test library, executes registered +tests and prints the result which is the number of tests that failed. + +## Environment setup + +The required environment is the same as for the Matter examples. For information +on how to set it up see +[Open IoT SDK examples environment](./openiotsdk_examples.md#environment-setup). + +## Configuration + +The configuration options are the same as for the Matter examples. For +information on how to configure unit-tests applications see +[Open IoT SDK examples configuration](./openiotsdk_examples.md#configuration). + +## Building + +The build process means creating a separate executable file for each Matter +tested component. It assumes the use of all supported test libraries and +creating independent applications from them. + +You can build unit tests by using a VSCode task or by calling the build script +directly from the command line. + +### Building using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Build Open IoT SDK unit-tests` +- Decide on debug mode support +- Decide on LwIP debug logs support +- Choose crypto algorithm +- Choose socket API + +This will call the script with the selected parameters. + +### Building using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh unit-tests +``` + +Use `--help` to get more information about the script options. + +## Running + +Unit-tests applications are run independently. It runs in the background and +opens a telnet session. The telnet client connects to the port used by the +`FVP`. When the telnet process is terminated it will also terminate the `FVP` +instance. + +To exit the telnet session, type CTRL + ]. This changes the command +prompt to show as: + +``` +telnet> +``` + +Back in the terminal, type in the word 'close' to terminate the session. + +``` +telnet> close +``` + +You can run specific unit test by using a VSCode task or by calling the run +script directly from the command line. + +### Running using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Run Open IoT SDK unit-tests` +- Choose unit test name + +This will call the script with the selected example name. + +### Running using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run unit-tests +``` + +## Testing + +Run the Pytest integration test for the specific unit test application. + +The test result can be found in the +`src/test_driver/openiotsdk/integration-tests/unit-tests/test_report_.json` +file. + +You can execute the integration test for specific unit test by using a VSCode +task or by calling the run script directly from the command line. + +### Testing using the VSCode task + +- Open the Command Palette: F1 +- Select `Tasks: Run Task` +- Select `Test Open IoT SDK unit-tests` +- Choose unit test name + +This will call the scripts with the selected example name. + +### Testing using CLI + +You can call the script directly yourself. + +``` +${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test unit-tests +``` + +> 💡 **Notes**: +> +> Use `test` command without a specific test name, runs all supported unit +> tests: +> +> `${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C test unit-tests` + +## Debugging + +Before debugging ensure the following: + +1. The debug environment is correctly setup: + [debugging setup](./openiotsdk_examples.md#debugging-setup). + +2. The unit tests are compiled with debug symbols enabled: + + For CLI: + + ``` + ${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -d true unit-tests + ``` + + For the VSCode task: + + ``` + => Use debug mode (true) + ``` + +You can debug the specific unit test by using a VSCode launch task: + +- Click `Run and Debug` from the primary side menu or press + Ctrl+Shift+D +- Select `Debug Open IoT SDK unit-tests application` from the drop down list +- Click `Start Debugging`(green triangle) or press F5 +- Choose unit test name twice + +As soon as a debugging session starts, the `DEBUG CONSOLE` panel is displayed +and shows the debugging output. Use debug controls to debug the current +application. + +The application with GDB Remote Connection Plugin runs in the background and +opens a telnet session in terminal. The telnet client connects to the port used +by the `FVP`. When the telnet process is terminated it will also terminate the +`FVP` instance. + +To exit the telnet session, type CTRL + ]. This changes the command +prompt to show as: + +``` +telnet> +``` + +Back in the terminal, type in the word 'close' to terminate the session. + +``` +telnet> close +``` + +> 💡 **Notes**: +> +> As you can see above, you will need to select the name of the unit test twice. +> This is because the debug task needs to launch the run task and currently VS +> code has no way of passing parameters between tasks. + +## Add existing Matter's component test + +To to add an existing Matter's component test to unit tests project, extend the +list in the `src/test_driver/openiotsdk/unit-tests/test_components.txt` file +with a test name (`test_name`). After that, the new test is built and available +in all necessary tools such as helper script +`scripts/examples/openiotsdk_example.sh` or VSCode tasks. + +Example: + +``` +... +test_name +... +``` + +> 💡 **Notes**: +> +> The existing Matter's component tests are built as a separate libraries. The +> `src/BUILD.gn` GN project collects them in the target group. Make sure that +> the test you want to add is not skipped for the Open IoT SDK platform. +> +> Remember to update the list of supported Matter's component tests at the top +> of this document. 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 e5c88e10a5e5e3..453ccbeb43063e 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 @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,12 +124,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -262,12 +262,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -330,12 +330,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -393,7 +393,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -999,7 +999,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -1203,7 +1203,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1344,7 +1344,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1601,7 +1601,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1657,7 +1657,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1828,7 +1828,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1884,7 +1884,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1912,7 +1912,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2240,7 +2240,7 @@ server cluster BooleanState = 69 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap ICDManagementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kCheckInProtocolSupport = 0x1; } @@ -2287,7 +2287,7 @@ server cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2644,7 +2644,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; @@ -2917,6 +2917,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -2945,14 +2953,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute int16u physicalClosedLimitLift = 1; readonly attribute int16u physicalClosedLimitTilt = 2; @@ -3046,7 +3046,7 @@ server cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -3196,12 +3196,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -3210,6 +3205,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -3266,7 +3266,7 @@ server cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -3377,14 +3377,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -3392,6 +3384,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; @@ -3680,7 +3680,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } @@ -3776,7 +3776,7 @@ server cluster Channel = 1284 { kMso = 0; } - bitmap ChannelFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -3858,7 +3858,7 @@ server cluster MediaPlayback = 1286 { kBuffering = 3; } - bitmap MediaPlaybackFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -3899,7 +3899,7 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap MediaInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -4043,7 +4043,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -4097,7 +4097,7 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -4164,7 +4164,7 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap AudioOutputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -4192,7 +4192,7 @@ server cluster ApplicationLauncher = 1292 { kSystemBusy = 2; } - bitmap ApplicationLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kApplicationPlatform = 0x1; } diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp index 1a794d80f8c16a..1dd6a389abbba8 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp @@ -18,8 +18,8 @@ #include "AllClustersCommandDelegate.h" -#include #include +#include #include #include #include diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 39a4bf381a710b..dcce3f14ad12d5 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -20,9 +20,9 @@ #include "AllClustersCommandDelegate.h" #include "WindowCoveringManager.h" #include "include/tv-callbacks.h" -#include #include #include +#include #include #include #include diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 256f2299e2c686..e2d103ea7bd982 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -118,12 +118,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -256,12 +256,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -289,7 +289,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -859,7 +859,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -1062,7 +1062,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1200,7 +1200,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1451,7 +1451,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1501,7 +1501,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1624,7 +1624,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1670,7 +1670,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1698,7 +1698,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2020,7 +2020,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2374,7 +2374,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; @@ -2511,6 +2511,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -2539,14 +2547,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute ConfigStatus configStatus = 7; readonly attribute OperationalStatus operationalStatus = 10; @@ -2582,7 +2582,7 @@ server cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -2718,12 +2718,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -2732,6 +2727,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -2778,7 +2778,7 @@ server cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -2881,14 +2881,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -2896,6 +2888,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute enum8 colorMode = 8; attribute bitmap8 options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; @@ -2957,7 +2957,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } @@ -3050,7 +3050,7 @@ server cluster Channel = 1284 { kMso = 0; } - bitmap ChannelFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -3083,7 +3083,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; @@ -3142,7 +3142,7 @@ server cluster MediaPlayback = 1286 { kBuffering = 3; } - bitmap MediaPlaybackFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -3187,7 +3187,7 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap MediaInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -3325,7 +3325,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3379,7 +3379,7 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -3444,7 +3444,7 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap AudioOutputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -3478,7 +3478,7 @@ server cluster ApplicationLauncher = 1292 { kSystemBusy = 2; } - bitmap ApplicationLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kApplicationPlatform = 0x1; } diff --git a/examples/all-clusters-minimal-app/linux/main-common.cpp b/examples/all-clusters-minimal-app/linux/main-common.cpp index 43c98dd207f7d9..7ff4635b7ce9ed 100644 --- a/examples/all-clusters-minimal-app/linux/main-common.cpp +++ b/examples/all-clusters-minimal-app/linux/main-common.cpp @@ -17,9 +17,9 @@ */ #include "include/tv-callbacks.h" -#include #include #include +#include #include #include #include diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 6a7d96dd7752aa..d558ae34047de1 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -80,12 +80,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -113,7 +113,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -636,7 +636,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -739,7 +739,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -996,7 +996,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1050,7 +1050,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1219,7 +1219,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1273,7 +1273,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1301,7 +1301,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/bridge-app/linux/include/Device.h b/examples/bridge-app/linux/include/Device.h index 8fb55101917381..2b1c110c1b1ab3 100644 --- a/examples/bridge-app/linux/include/Device.h +++ b/examples/bridge-app/linux/include/Device.h @@ -180,7 +180,7 @@ class DevicePowerSource : public Device } Changed; DevicePowerSource(const char * szDeviceName, std::string szLocation, - chip::BitFlags aFeatureMap) : + chip::BitFlags aFeatureMap) : Device(szDeviceName, szLocation), mFeatureMap(aFeatureMap){}; @@ -204,7 +204,7 @@ class DevicePowerSource : public Device uint8_t mOrder = 0; uint8_t mStatus = 0; std::string mDescription = "Primary Battery"; - chip::BitFlags mFeatureMap; + chip::BitFlags mFeatureMap; DeviceCallback_fn mChanged_CB; }; diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 314036a83c5dcd..c589800547d076 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -992,7 +992,7 @@ int main(int argc, char * argv[]) // Setup composed device with two temperature sensors and a power source ComposedDevice ComposedDevice("Composed Device", "Bedroom"); - DevicePowerSource ComposedPowerSource("Composed Power Source", "Bedroom", PowerSource::PowerSourceFeature::kBattery); + DevicePowerSource ComposedPowerSource("Composed Power Source", "Bedroom", PowerSource::Feature::kBattery); ComposedDevice.SetReachable(true); ComposedTempSensor1.SetReachable(true); diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 71b16a0f2d6fef..8ff93234ef2895 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -176,7 +176,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -873,7 +873,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -929,7 +929,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1100,7 +1100,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1156,7 +1156,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1184,7 +1184,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 7f83d419ed05bb..ef9a4d53af6fe5 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -703,7 +703,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -960,7 +960,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1277,14 +1277,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1292,6 +1284,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int16u remainingTime = 2; readonly attribute int16u colorTemperatureMireds = 7; readonly attribute enum8 colorMode = 8; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index ded5178c5ee201..a356d411099d0d 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -606,7 +606,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -863,7 +863,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -899,7 +899,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 8f64d3a3c765dc..f486c7bfa6bcae 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -176,7 +176,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -755,7 +755,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1012,7 +1012,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1048,7 +1048,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index fc73fb38ad1729..ab8a6a47db56a8 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -606,7 +606,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -863,7 +863,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -899,7 +899,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1514,7 +1514,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 0d59a951762910..6e8ea74316488d 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -176,7 +176,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -755,7 +755,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1012,7 +1012,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1048,7 +1048,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1398,14 +1398,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1413,6 +1405,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 806546549a9f6f..851b45db1b8f32 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -593,7 +593,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -850,7 +850,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -886,7 +886,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1201,7 +1201,7 @@ server cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 86996b5ed6e777..53d445c699253c 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 1d6715ca7bf6f9..165dcef3ba859e 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -172,7 +172,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -749,7 +749,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1006,7 +1006,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1042,7 +1042,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1382,12 +1382,7 @@ client cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1396,6 +1391,11 @@ client cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -1513,7 +1513,7 @@ server cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 8dc61f017adcea..27382f831a45e9 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 1eabc4a86d3d96..16743eba1d7914 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index bb44cd84394001..1fefc725bc8028 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 549e69d48576e0..bfe31a8d7e6690 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -176,7 +176,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -755,7 +755,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1012,7 +1012,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1048,7 +1048,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 4a0f3b6496df09..d4931fcbc21ef0 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -207,12 +207,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -718,7 +718,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -975,7 +975,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1011,7 +1011,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index abed57a9256e33..5650ccf8855554 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -654,7 +654,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -911,7 +911,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -947,7 +947,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index dba7298c1a33d8..a4029fc04c28c1 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1282,7 +1282,7 @@ server cluster UserLabel = 65 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index b4842483068952..aa1a118d2b0c16 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -172,7 +172,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -749,7 +749,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1006,7 +1006,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1042,7 +1042,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 5a608865b67404..828375a4f5324d 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,7 +124,7 @@ client cluster Groups = 4 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -677,7 +677,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -934,7 +934,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -970,7 +970,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 661c82ffcda78f..8953a2ccc3ea2a 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -606,7 +606,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -863,7 +863,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -899,7 +899,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1239,12 +1239,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1253,6 +1248,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -1322,7 +1322,7 @@ client cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 753344467092fb..62168a4c7a5ff1 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -606,7 +606,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -863,7 +863,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -899,7 +899,7 @@ server cluster SoftwareDiagnostics = 52 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1247,6 +1247,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -1275,14 +1283,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute int16u physicalClosedLimitLift = 1; readonly attribute int16u physicalClosedLimitTilt = 2; diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp index e22b3e4cc279c2..49e817dfe5db9f 100644 --- a/examples/chef/esp32/main/main.cpp +++ b/examples/chef/esp32/main/main.cpp @@ -38,9 +38,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/examples/chip-tool/templates/tests/commands.zapt b/examples/chip-tool/templates/tests/commands.zapt index 64b9b349372e76..060539a66ba090 100644 --- a/examples/chip-tool/templates/tests/commands.zapt +++ b/examples/chip-tool/templates/tests/commands.zapt @@ -18,7 +18,7 @@ public: TestList() : Command("list") {}; CHIP_ERROR Run() override { - {{#chip_tests "../../../../src/app/tests/suites/ciTests.json"}}printf("{{filename}}\n");{{/chip_tests}} + {{#chip_tests "../../../../src/app/tests/suites/ciTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} return CHIP_NO_ERROR; } @@ -30,7 +30,7 @@ public: ManualTestList() : Command("list-manual") {}; CHIP_ERROR Run() override { - {{#chip_tests "../../../../src/app/tests/suites/manualTests.json"}}printf("{{filename}}\n");{{/chip_tests}} + {{#chip_tests "../../../../src/app/tests/suites/manualTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} return CHIP_NO_ERROR; } @@ -49,10 +49,10 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds #if CONFIG_ENABLE_YAML_TESTS make_unique(), make_unique(), - {{#chip_tests "../../../../src/app/tests/suites/ciTests.json"}} + {{#chip_tests "../../../../src/app/tests/suites/ciTests.json" includeAllClusters=true}} make_unique<{{filename}}Suite>(credsIssuerConfig), {{/chip_tests}} - {{#chip_tests "../../../../src/app/tests/suites/manualTests.json"}} + {{#chip_tests "../../../../src/app/tests/suites/manualTests.json" includeAllClusters=true}} make_unique<{{filename}}Suite>(credsIssuerConfig), {{/chip_tests}} #endif // CONFIG_ENABLE_YAML_TESTS diff --git a/examples/chip-tool/templates/tests/partials/test_cluster.zapt b/examples/chip-tool/templates/tests/partials/test_cluster.zapt index a968b9f1241839..52185498a336ad 100644 --- a/examples/chip-tool/templates/tests/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/tests/partials/test_cluster.zapt @@ -1,4 +1,4 @@ -{{#chip_tests tests}} +{{#chip_tests tests includeAllClusters=true}} class {{filename}}Suite: public TestCommand { public: diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 2392eae700b844..0da59f91f3d219 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -593,7 +593,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -850,7 +850,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -906,7 +906,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1077,7 +1077,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1133,7 +1133,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } diff --git a/examples/darwin-framework-tool/templates/tests/commands.zapt b/examples/darwin-framework-tool/templates/tests/commands.zapt index 4040d94975a8be..ce44db1f69f82a 100644 --- a/examples/darwin-framework-tool/templates/tests/commands.zapt +++ b/examples/darwin-framework-tool/templates/tests/commands.zapt @@ -19,7 +19,7 @@ public: TestList() : Command("list") {}; CHIP_ERROR Run() override { - {{#chip_tests "ciTests.json"}}printf("{{filename}}\n");{{/chip_tests}} + {{#chip_tests "ciTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} return CHIP_NO_ERROR; } @@ -31,7 +31,7 @@ public: ManualTestList() : Command("list-manual") {}; CHIP_ERROR Run() override { - {{#chip_tests "manualTests.json"}}printf("{{filename}}\n");{{/chip_tests}} + {{#chip_tests "manualTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} return CHIP_NO_ERROR; } @@ -50,10 +50,10 @@ void registerCommandsTests(Commands & commands) #if CONFIG_ENABLE_YAML_TESTS make_unique(), make_unique(), - {{#chip_tests "ciTests.json"}} + {{#chip_tests "ciTests.json" includeAllClusters=true}} make_unique<{{filename}}>(), {{/chip_tests}} - {{#chip_tests "manualTests.json"}} + {{#chip_tests "manualTests.json" includeAllClusters=true}} make_unique<{{filename}}>(), {{/chip_tests}} #endif // CONFIG_ENABLE_YAML_TESTS diff --git a/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt b/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt index 439b7228212872..ddc1b909ca0b29 100644 --- a/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt +++ b/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt @@ -1,4 +1,4 @@ -{{#chip_tests tests useSynthesizeWaitForReport=true}} +{{#chip_tests tests useSynthesizeWaitForReport=true includeAllClusters=true}} class {{filename}}: public TestCommandBridge { public: diff --git a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter index e388939cfa02a4..658114c33da5b4 100644 --- a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter +++ b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter @@ -80,12 +80,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -113,7 +113,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -636,7 +636,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -739,7 +739,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -996,7 +996,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1050,7 +1050,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1219,7 +1219,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1273,7 +1273,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1301,7 +1301,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index b05ef0db02b8a3..6b68c5f8367c9f 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -107,7 +107,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -172,12 +172,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ client cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -366,12 +366,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -901,7 +901,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1158,7 +1158,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1214,7 +1214,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1385,7 +1385,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1441,7 +1441,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1469,7 +1469,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1835,14 +1835,6 @@ client cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1850,6 +1842,14 @@ client cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; diff --git a/examples/light-switch-app/silabs/SiWx917/.gn b/examples/light-switch-app/silabs/SiWx917/.gn deleted file mode 100644 index 0adefc6ff99c6a..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/.gn +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") - -# The location of the build configuration file. -buildconfig = "${build_root}/config/BUILDCONFIG.gn" - -# CHIP uses angle bracket includes. -check_system_includes = true - -default_args = { - target_cpu = "arm" - target_os = "freertos" - import("//args.gni") -} diff --git a/examples/light-switch-app/silabs/SiWx917/BUILD.gn b/examples/light-switch-app/silabs/SiWx917/BUILD.gn deleted file mode 100644 index 62ddb969e9b594..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/BUILD.gn +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/SiWx917_sdk.gni") -import("${efr32_sdk_build_root}/silabs_executable.gni") - -import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") -import("${chip_root}/src/platform/device.gni") - -if (chip_enable_pw_rpc) { - import("//build_overrides/pigweed.gni") - import("$dir_pw_build/target_types.gni") -} - -assert(current_os == "freertos") - -efr32_project_dir = "${chip_root}/examples/light-switch-app/silabs/SiWx917" -examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" -examples_common_plat_dir = "${chip_root}/examples/platform/silabs" - -import("${examples_plat_dir}/args.gni") - -declare_args() { - # Dump memory usage at link time. - chip_print_memory_usage = false -} - -siwx917_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] - - include_dirs = [ - "${chip_root}/examples/light-switch-app/silabs/common", - "${chip_root}/src/platform/silabs/SiWx917", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] - - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", - ] - } -} - -silabs_executable("light_switch_app") { - output_name = "chip-siwx917-light-switch-example.out" - include_dirs = [ "include" ] - defines = [] - - sources = [ - "${chip_root}/examples/light-switch-app/silabs/common/BindingHandler.cpp", - "${chip_root}/examples/light-switch-app/silabs/common/LightSwitchMgr.cpp", - "${examples_common_plat_dir}/main.cpp", - "src/AppTask.cpp", - "src/ZclCallbacks.cpp", - ] - - deps = [ - ":sdk", - "${examples_plat_dir}:siwx917-common", - app_data_model, - ] - - if (chip_build_libshell) { - sources += [ - "${chip_root}/examples/light-switch-app/silabs/common/ShellCommands.cpp", - ] - } - - if (chip_enable_pw_rpc) { - defines += [ - "PW_RPC_ENABLED", - "PW_RPC_ATTRIBUTE_SERVICE=1", - "PW_RPC_BUTTON_SERVICE=1", - "PW_RPC_DESCRIPTOR_SERVICE=1", - "PW_RPC_DEVICE_SERVICE=1", - "PW_RPC_LIGHTING_SERVICE=1", - ] - - sources += [ - "${chip_root}/examples/common/pigweed/RpcService.cpp", - "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", - "${examples_common_plat_dir}/PigweedLogger.cpp", - "${examples_common_plat_dir}/Rpc.cpp", - ] - - deps += [ - "$dir_pw_hdlc:rpc_channel_output", - "$dir_pw_stream:sys_io_stream", - "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", - "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917", - ] - - deps += pw_build_LINK_DEPS - - include_dirs += [ - "${chip_root}/examples/common", - "${chip_root}/examples/common/pigweed/efr32", - ] - } - - ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld" - - inputs = [ ldscript ] - - ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] - - if (chip_print_memory_usage) { - ldflags += [ - "-Wl,--print-memory-usage", - "-fstack-usage", - ] - } - - # WiFi Settings - if (chip_enable_wifi) { - ldflags += [ - "-Wl,--defsym", - "-Wl,SILABS_WIFI=1", - ] - } - - output_dir = root_out_dir -} - -group("siwx917") { - deps = [ ":light_switch_app" ] -} - -group("default") { - deps = [ ":siwx917" ] -} diff --git a/examples/light-switch-app/silabs/SiWx917/README.md b/examples/light-switch-app/silabs/SiWx917/README.md deleted file mode 100644 index a785640f5ec47f..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/README.md +++ /dev/null @@ -1,222 +0,0 @@ -# Matter SiWx917 Light Switch Example - -An example showing the use of CHIP on the -[Silicon Labs SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) -SoC device. - -
- -- [Matter SiWx917 Light Switch Example](#matter-siwx917-light-switch-example) - - [Introduction](#introduction) - - [Building](#building) - - [Linux](#linux) - - [Mac OS X](#mac-os-x) - - [Flashing the Application](#flashing-the-application) - - [Viewing Logging Output](#viewing-logging-output) - - [Running the Complete Example](#running-the-complete-example) - - [Notes](#notes) - - [On PC(Linux):](#on-pclinux) - - [Memory settings](#memory-settings) - - [Building options](#building-options) - - [Disabling logging](#disabling-logging) - - [Debug build / release build](#debug-build--release-build) - - [Disabling LCD](#disabling-lcd) - - [KVS maximum entry count](#kvs-maximum-entry-count) - -
- -> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with -> frequent releases thoroughly tested and validated. Developers looking to -> develop matter products with silabs hardware are encouraged to use our latest -> release with added tools and documentation. -> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) - -## Introduction - -The [SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) light -switch example provides a baseline demonstration of an on-off light switch -device, built using Matter, the Silicon Labs Gecko SDK, and the Silicon Labs -WiseMCU SDK. It can be controlled by a Chip controller over a Wi-Fi network. - -The [SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) -device can be commissioned over Bluetooth Low Energy where the device and the -Chip controller will exchange security information with the rendezvous -procedure. Wi-Fi Network credentials are then provided to the -[SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) device -which will then join the Wi-Fi network. - -If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the -needed commissioning information for the BLE connection and starting the -rendezvous procedure. - -The light switch example is intended to serve both as a means to explore the -workings of Matter as well as a template for creating real products based on the -Silicon Labs platform. - -## Building - -- Download the - [Simplicity Commander](https://www.silabs.com/mcu/programming-options) - command line tool, and ensure that `commander` is your shell search path. - (For Mac OS X, `commander` is located inside - `Commander.app/Contents/MacOS/`.) - -- Download and install a suitable ARM gcc tool chain: - [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) - -- Install some additional tools(likely already present for CHIP developers): - -#### Linux - - $ sudo apt-get install git ninja-build - -#### Mac OS X - - $ brew install ninja - -- Supported hardware: - - - > For the latest supported hardware please refer to the - > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) - > in the Silicon Labs Matter Github Repo - -* Build the example application: - - cd ~/connectedhomeip - ./scripts/examples/gn_efr32_example.sh ./examples/light-switch-app/silabs/SiWx917/ ./out/light-switch-app BRD4325B - -- To delete generated executable, libraries and object files use: - - $ cd ~/connectedhomeip - $ rm -rf ./out/ - - - -## Flashing the Application - -- Flashing requires the - [SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) SoC - device to be configured in the Ozone Debugger. - -- Once it's configured, it can be run with the Ozone Debugger by loading the - .out file. - - > For detailed instructions, please refer to - > [Running the Matter Demo on SiWx917 SoC](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/wifi/RUN_DEMO_SiWx917_SoC.md) - > in the Silicon Labs Matter Github Repo - -## Viewing Logging Output - -The example application's logging output can be viewed in the Ozone Debugger. - -## Running the Complete Example - -- For this example to work, it is necessary to have a second - [SiWx917](https://www.silabs.com/wireless/wi-fi/siwx917-wireless-socs) - device running the - [lighting app example](https://github.com/project-chip/connectedhomeip/blob/master/examples/lighting-app/silabs/SiWx917/README.md) - commissioned on the same Wi-Fi network. - -* You can provision and control the Chip device using the - [chip-tool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) - standalone - - Here is an example with the chip-tool for unicast commands only: - - - > $SSID and $PSK are the SSID and passcode of your Wi-Fi Access Point. - - ``` - chip-tool pairing ble-wifi 1122 $SSID $PSK 20202021 3840 - - chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [], "targets": null }{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' 0 - - chip-tool binding write binding '[{"fabricIndex": 1, "node": , "endpoint": 1, "cluster":6}]' 1 1 - ``` - - Here is an example with the chip-tool for groups commands only: - - ``` - chip-tool pairing ble-wifi 1122 $SSID $PSK 20202021 3840 - - chip-tool tests TestGroupDemoConfig --nodeId 1 - - chip-tool tests TestGroupDemoConfig --nodeId - - chip-tool binding write binding '[{"fabricIndex": 1, "group": 257}]' 1 1 - ``` - - To run the example with unicast and groups commands, run the group - configuration commands and replace the last one with binding this command - - ``` - chip-tool binding write binding '[{"fabricIndex": 1, "group": 257},{"fabricIndex": 1, "node": , "endpoint": 1, "cluster":6} ]' 1 1 - ``` - - To acquire the chip-tool node id, read the acl table right after - commissioning - - ``` - ./connectedhomeip/out/chip-tool/chip-tool accesscontrol read acl 0 - ``` - -### Notes - -- Depending on your network settings your router might not provide native IPv6 - addresses to your devices (Router / PC). If this is the case, you need to - add a static IPv6 addresses on both devices and then an IPv6 route to the - border router on your PC - -#### On PC(Linux): - -`$ sudo ip addr add dev 2002::1/64` - -#Add IPv6 route on PC(Linux) \$ sudo ip route add /64 -via 2002::2 - -## Memory settings - -While most of the RAM usage in CHIP is static, allowing easier debugging and -optimization with symbols analysis, we still need some HEAP for the crypto and -Wi-Fi stack. Size of the HEAP can be modified by changing the value of the -`configTOTAL_HEAP_SIZE` define inside of the FreeRTOSConfig.h file of this -example. Please take note that a HEAP size smaller than 13k can and will cause -an Mbedtls failure during the BLE rendezvous or CASE session - -To track memory usage you can set `enable_heap_monitoring = true` either in the -BUILD.gn file or pass it as a build argument to gn. This will print on the RTT -console the RAM usage of each individual task and the number of Memory -allocation and Free. While this is not extensive monitoring you're welcome to -modify `examples/platform/silabs/SiWx917/MemMonitoring.cpp` to add your own -memory tracking code inside the `trackAlloc` and `trackFree` function - -## Building options - -All of Silabs's examples within the Matter repo have all the features enabled by -default, as to provide the best end user experience. However some of those -features can easily be toggled on or off. Here is a short list of options : - -### Disabling logging - -chip_progress_logging, chip_detail_logging, chip_automation_logging - - $ ./scripts/examples/gn_efr32_example.sh ./examples/light-switch-app/silabs/SiWx917 ./out/light-switch-app BRD4325B "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" - -### Debug build / release build - -is_debug - - $ ./scripts/examples/gn_efr32_example.sh ./examples/light-switch-app/silabs/SiWx917 ./out/light-switch-app BRD4325B "is_debug=false" - -### Disabling LCD - -show_qr_code - - $ ./scripts/examples/gn_efr32_example.sh ./examples/light-switch-app/silabs/SiWx917 ./out/light-switch-app BRD4325B "show_qr_code=false" - -### KVS maximum entry count - -kvs_max_entries - - Set the maximum Kvs entries that can be stored in NVM (Default 75) - Thresholds: 30 <= kvs_max_entries <= 255 - - $ ./scripts/examples/gn_efr32_example.sh ./examples/light-switch-app/silabs/SiWx917 ./out/light-switch-app BRD4325B kvs_max_entries=50 diff --git a/examples/light-switch-app/silabs/SiWx917/args.gni b/examples/light-switch-app/silabs/SiWx917/args.gni deleted file mode 100644 index 89e0768ff5eb6a..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/args.gni +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/args.gni") - -silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") - -app_data_model = "${chip_root}/examples/light-switch-app/light-switch-common" -chip_enable_ota_requestor = true diff --git a/examples/light-switch-app/silabs/SiWx917/build_overrides b/examples/light-switch-app/silabs/SiWx917/build_overrides deleted file mode 120000 index 995884e6163eb5..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/build_overrides +++ /dev/null @@ -1 +0,0 @@ -../../../build_overrides \ No newline at end of file diff --git a/examples/light-switch-app/silabs/SiWx917/include/AppConfig.h b/examples/light-switch-app/silabs/SiWx917/include/AppConfig.h deleted file mode 100644 index 0b6308b9f1eb61..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/include/AppConfig.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "silabs_utils.h" - -// ---- Lighting Example App Config ---- - -#define APP_TASK_NAME "Lit" - -#define BLE_DEV_NAME "SiLabs-Light-Switch" - -// Time it takes in ms for the simulated actuator to move from one -// state to another. -#define ACTUATOR_MOVEMENT_PERIOS_MS 10 diff --git a/examples/light-switch-app/silabs/SiWx917/include/AppEvent.h b/examples/light-switch-app/silabs/SiWx917/include/AppEvent.h deleted file mode 100644 index 7a19b719edad25..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/include/AppEvent.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2018 Nest Labs, Inc. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -struct AppEvent; -typedef void (*EventHandler)(AppEvent *); - -struct AppEvent -{ - enum AppEventTypes - { - kEventType_Button = 0, - kEventType_Timer, - kEventType_Light, - kEventType_Install, - }; - - uint16_t Type; - - union - { - struct - { - uint8_t Action; - } ButtonEvent; - struct - { - void * Context; - } TimerEvent; - struct - { - uint8_t Action; - int32_t Actor; - } LightEvent; - }; - - EventHandler Handler; -}; diff --git a/examples/light-switch-app/silabs/SiWx917/include/AppTask.h b/examples/light-switch-app/silabs/SiWx917/include/AppTask.h deleted file mode 100644 index cd4ea4d557e74a..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/include/AppTask.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -/********************************************************** - * Includes - *********************************************************/ - -#include -#include - -#include "AppEvent.h" -#include "BaseApplication.h" -#include "FreeRTOS.h" -#include "timers.h" // provides FreeRTOS timer support -#include -#include -#include -#include - -/********************************************************** - * Defines - *********************************************************/ -// Button specific defines for SiWx917 -#define SL_SIMPLE_BUTTON_PRESSED 1U -#define SL_SIMPLE_BUTTON_RELEASED 0U - -#define SIWx917_BTN0 0 -#define SIWx917_BTN1 1 - -// Application-defined error codes in the CHIP_ERROR space. -#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) -#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) -#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) -#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) -#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) -#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) - -/********************************************************** - * AppTask Declaration - *********************************************************/ - -class AppTask : public BaseApplication -{ - -public: - AppTask() = default; - - static AppTask & GetAppTask() { return sAppTask; } - - /** - * @brief AppTask task main loop function - * - * @param pvParameter FreeRTOS task parameter - */ - static void AppTaskMain(void * pvParameter); - - CHIP_ERROR StartAppTask(); - - /** - * @brief Event handler when a button is pressed - * Function posts an event for button processing - * - * @param button - btn0 or btn1 - * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, - * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED - */ - void ButtonEventHandler(uint8_t button, uint8_t btnAction); - - /** - * @brief Callback called by the identify-server when an identify command is received - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStart(Identify * identify); - - /** - * @brief Callback called by the identify-server when an identify command is stopped or finished - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStop(Identify * identify); - -private: - static AppTask sAppTask; - - /** - * @brief AppTask initialisation function - * - * @return CHIP_ERROR - */ - CHIP_ERROR Init(); - - /** - * @brief PB0 Button event processing function - * Press and hold will trigger a factory reset timer start - * Press and release will restart BLEAdvertising if not commisionned - * - * @param aEvent button event being processed - */ - static void ButtonHandler(AppEvent * aEvent); - - /** - * @brief PB1 Button event processing function - * Function triggers a switch action sent to the CHIP task - * - * @param aEvent button event being processed - */ - static void SwitchActionEventHandler(AppEvent * aEvent); -}; diff --git a/examples/light-switch-app/silabs/SiWx917/include/CHIPProjectConfig.h b/examples/light-switch-app/silabs/SiWx917/include/CHIPProjectConfig.h deleted file mode 100644 index 3141defe9c5133..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/include/CHIPProjectConfig.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Example project configuration file for CHIP. - * - * This is a place to put application or project-specific overrides - * to the default configuration values for general CHIP features. - * - */ - -#pragma once - -// Use a default pairing code if one hasn't been provisioned in flash. -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#endif - -// For convenience, Chip Security Test Mode can be enabled and the -// requirement for authentication in various protocols can be disabled. -// -// WARNING: These options make it possible to circumvent basic Chip security functionality, -// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. -// -#define CHIP_CONFIG_SECURITY_TEST_MODE 0 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID - * - * 0xFFF1: Test vendor - */ -#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID - * - * 0x8005: example lighting app - */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8004 - -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - -/** - * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER - * - * Enables the use of a hard-coded default serial number if none - * is found in Chip NV storage. - */ -#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS - * - * Enable recording UTC timestamps. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE - * - * A size, in bytes, of the individual debug event logging buffer. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) - -/** - * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL - * - * @brief - * Active retransmit interval, or time to wait before retransmission after - * subsequent failures in milliseconds. - * - * This is the default value, that might be adjusted by end device depending on its - * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. - * - */ -#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/light-switch-app/silabs/SiWx917/include/DeviceConfig.h b/examples/light-switch-app/silabs/SiWx917/include/DeviceConfig.h deleted file mode 100644 index 350fbb4a904351..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/include/DeviceConfig.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#ifdef SIWX917_USE_COMISSIONABLE_DATA - -uint32_t discriminatorValue = 3840; -uint64_t passcode = 20202021; -uint32_t spake2Interation = 1000; -char spake2Salt[] = "U1BBS0UyUCBLZXkgU2FsdA=="; -char spake2Verifier[] = "uWFwqugDNGiEck/po7KHwwMwwqZgN10XuyBajPGuyzUEV/iree4lOrao5GuwnlQ65CJzbeUB49s31EH+NEkg0JVI5MGCQGMMT/" - "SRPFNRODm3wH/MBiehuFc6FJ/NH6Rmzw=="; -char genSpake2Path[] = ""; -uint32_t productId = 32773; -uint32_t vendorId = 65521; -char productName[] = "silabs_product"; -char vendorName[] = "silabs_vendor"; -char hwVersionString[] = "1.0"; -uint32_t rotatingId; -uint32_t commissionableFlow = 1; -uint8_t rendezvousFlag = 2; - -#endif \ No newline at end of file diff --git a/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp b/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp deleted file mode 100644 index d76dc9de2526e4..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/********************************************************** - * Includes - *********************************************************/ - -#include "AppTask.h" -#include "AppConfig.h" -#include "AppEvent.h" -#include "BindingHandler.h" - -#include "LEDWidget.h" - -#include "LightSwitchMgr.h" - -#ifdef DISPLAY_ENABLED -#include "lcd.h" -#ifdef QR_CODE_ENABLED -#include "qrcodegen.h" -#endif // QR_CODE_ENABLED -#endif // DISPLAY_ENABLED - -#if defined(ENABLE_CHIP_SHELL) -#include "ShellCommands.h" -#endif // defined(ENABLE_CHIP_SHELL) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -/********************************************************** - * Defines and Constants - *********************************************************/ - -#define SYSTEM_STATE_LED &sl_led_led0 - -namespace { - -constexpr chip::EndpointId kLightSwitchEndpoint = 1; -constexpr chip::EndpointId kGenericSwitchEndpoint = 2; - -} // namespace - -using namespace chip; -using namespace ::chip::DeviceLayer; -using namespace ::chip::DeviceLayer::Silabs; - -namespace { - -/********************************************************** - * Variable declarations - *********************************************************/ - -EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - -/********************************************************** - * Identify Callbacks - *********************************************************/ - -namespace { -void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) -{ - ChipLogProgress(Zcl, "Trigger Identify Complete"); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StopStatusLEDTimer(); -#endif -} -} // namespace - -void OnTriggerIdentifyEffect(Identify * identify) -{ - ChipLogProgress(Zcl, "Trigger Identify Effect"); - sIdentifyEffect = identify->mCurrentEffectIdentifier; - - if (identify->mCurrentEffectIdentifier == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE) - { - ChipLogProgress(Zcl, "IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE - Not supported, use effect varriant %d", - identify->mEffectVariant); - sIdentifyEffect = static_cast(identify->mEffectVariant); - } - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StartStatusLEDTimer(); -#endif - - switch (sIdentifyEffect) - { - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(5), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_FINISH_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(1), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - break; - default: - ChipLogProgress(Zcl, "No identifier effect"); - } -} - -Identify gIdentify = { - chip::EndpointId{ 1 }, - AppTask::GetAppTask().OnIdentifyStart, - AppTask::GetAppTask().OnIdentifyStop, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, - OnTriggerIdentifyEffect, -}; - -} // namespace - -using namespace chip::TLV; -using namespace ::chip::DeviceLayer; - -/********************************************************** - * AppTask Definitions - *********************************************************/ - -AppTask AppTask::sAppTask; - -CHIP_ERROR AppTask::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); - -#ifdef DISPLAY_ENABLED - GetLCD().Init((uint8_t *) "Light Switch"); -#endif - - err = BaseApplication::Init(&gIdentify); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("BaseApplication::Init() failed"); - appError(err); - } - - err = LightSwitchMgr::GetInstance().Init(kLightSwitchEndpoint, kGenericSwitchEndpoint); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("LightSwitchMgr Init failed!"); - appError(err); - } - -#if defined(ENABLE_CHIP_SHELL) - LightSwtichCommands::RegisterSwitchCommands(); -#endif // defined(ENABLE_CHIP_SHELL) - - return err; -} - -CHIP_ERROR AppTask::StartAppTask() -{ - return BaseApplication::StartAppTask(AppTaskMain); -} - -void AppTask::AppTaskMain(void * pvParameter) -{ - AppEvent event; - QueueHandle_t sAppEventQueue = *(static_cast(pvParameter)); - - CHIP_ERROR err = sAppTask.Init(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("AppTask.Init() failed"); - appError(err); - } - -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) - sAppTask.StartStatusLEDTimer(); -#endif - - SILABS_LOG("App Task started"); - while (true) - { - BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); - while (eventReceived == pdTRUE) - { - sAppTask.DispatchEvent(&event); - eventReceived = xQueueReceive(sAppEventQueue, &event, 0); - } - } -} - -void AppTask::OnIdentifyStart(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStart"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StartStatusLEDTimer(); -#endif -} - -void AppTask::OnIdentifyStop(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStop"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StopStatusLEDTimer(); -#endif -} - -void AppTask::SwitchActionEventHandler(AppEvent * aEvent) -{ - VerifyOrReturn(aEvent->Type == AppEvent::kEventType_Button); - - static bool mCurrentButtonState = false; - - if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - mCurrentButtonState = !mCurrentButtonState; - LightSwitchMgr::LightSwitchAction action = - mCurrentButtonState ? LightSwitchMgr::LightSwitchAction::On : LightSwitchMgr::LightSwitchAction::Off; - - LightSwitchMgr::GetInstance().TriggerLightSwitchAction(action); - LightSwitchMgr::GetInstance().GenericSwitchOnInitialPress(); - -#ifdef DISPLAY_ENABLED - sAppTask.GetLCD().WriteDemoUI(mCurrentButtonState); -#endif - } - else if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonReleased)) - { - LightSwitchMgr::GetInstance().GenericSwitchOnShortRelease(); - } -} - -void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) -{ - AppEvent button_event = {}; - button_event.Type = AppEvent::kEventType_Button; - button_event.ButtonEvent.Action = btnAction; - if (button == SIWx917_BTN1) - { - button_event.Handler = SwitchActionEventHandler; - sAppTask.PostEvent(&button_event); - } - else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - button_event.Handler = BaseApplication::ButtonHandler; - sAppTask.PostEvent(&button_event); - } -} diff --git a/examples/light-switch-app/silabs/SiWx917/src/ZclCallbacks.cpp b/examples/light-switch-app/silabs/SiWx917/src/ZclCallbacks.cpp deleted file mode 100644 index 52542ca88fb390..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/src/ZclCallbacks.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * 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. - */ - -/** - * @file - * This file implements the handler for data model messages. - */ - -#include "AppConfig.h" - -#include -#include -#include -#include - -using namespace ::chip; -using namespace ::chip::app::Clusters; - -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, - uint8_t * value) -{ - ClusterId clusterId = attributePath.mClusterId; - AttributeId attributeId = attributePath.mAttributeId; - ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - - if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) - { - ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - } -} - -/** @brief OnOff Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - * TODO Issue #3841 - * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster - * attributes to the default value. - * The logic here expects something similar to the deprecated Plugins callback - * emberAfPluginOnOffClusterServerPostInitCallback. - * - */ -void emberAfOnOffClusterInitCallback(EndpointId endpoint) -{ - // TODO: implement any additional Cluster Server init actions -} diff --git a/examples/light-switch-app/silabs/SiWx917/third_party/connectedhomeip b/examples/light-switch-app/silabs/SiWx917/third_party/connectedhomeip deleted file mode 120000 index 59307833b4fee9..00000000000000 --- a/examples/light-switch-app/silabs/SiWx917/third_party/connectedhomeip +++ /dev/null @@ -1 +0,0 @@ -../../../../.. \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index e7ee0a37995e04..998de0fd9c685c 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -763,7 +763,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1020,7 +1020,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1076,7 +1076,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1217,7 +1217,7 @@ server cluster ThreadNetworkDiagnostics = 53 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1583,14 +1583,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1598,6 +1590,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 357b26a4b301f6..9b29c95ad74972 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -763,7 +763,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1020,7 +1020,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1083,7 +1083,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1126,7 +1126,7 @@ server cluster WiFiNetworkDiagnostics = 54 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1492,14 +1492,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1507,6 +1499,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp index fbb88faa5ef00c..b7fa437127bacb 100644 --- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp +++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp @@ -18,8 +18,8 @@ */ #include "LightingManager.h" -#include #include +#include #include #include diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index d3569ce26c1874..4b936d4078c212 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -763,7 +763,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1020,7 +1020,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1076,7 +1076,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1247,7 +1247,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1303,7 +1303,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1331,7 +1331,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1697,14 +1697,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1712,6 +1704,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index b3228bd4b1f59c..fc34993bb6a99f 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -697,7 +697,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -904,7 +904,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -960,7 +960,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 8ecceae4110b58..8b57da10b365cf 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -707,7 +707,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -964,7 +964,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1020,7 +1020,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1474,14 +1474,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1489,6 +1481,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lighting-app/silabs/SiWx917/.gn b/examples/lighting-app/silabs/SiWx917/.gn deleted file mode 100644 index 3d48789e30ab3d..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/.gn +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") - -# The location of the build configuration file. -buildconfig = "${build_root}/config/BUILDCONFIG.gn" - -# CHIP uses angle bracket includes. -check_system_includes = true - -default_args = { - target_cpu = "arm" - target_os = "freertos" - - import("//args.gni") -} diff --git a/examples/lighting-app/silabs/SiWx917/BUILD.gn b/examples/lighting-app/silabs/SiWx917/BUILD.gn deleted file mode 100644 index b0bcf56032f81a..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/BUILD.gn +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -import("${build_root}/config/defaults.gni") -import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") -import("${efr32_sdk_build_root}/silabs_executable.gni") - -import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") -import("${chip_root}/src/platform/device.gni") - -if (chip_enable_pw_rpc) { - import("//build_overrides/pigweed.gni") - import("$dir_pw_build/target_types.gni") -} - -assert(current_os == "freertos") - -efr32_project_dir = "${chip_root}/examples/lighting-app/silabs/SiWx917" -examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" -examples_common_plat_dir = "${chip_root}/examples/platform/silabs" - -import("${examples_plat_dir}/args.gni") -declare_args() { - # Dump memory usage at link time. - chip_print_memory_usage = false -} - -siwx917_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] - - include_dirs = [ - "${chip_root}/src/platform/silabs/SiWx917", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] - - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", - ] - } -} - -silabs_executable("lighting_app") { - output_name = "chip-siwx917-lighting-example.out" - include_dirs = [ "include" ] - defines = [] - - sources = [ - "${examples_common_plat_dir}/main.cpp", - "src/AppTask.cpp", - "src/LightingManager.cpp", - "src/ZclCallbacks.cpp", - ] - - deps = [ - ":sdk", - "${examples_plat_dir}:siwx917-common", - app_data_model, - ] - - if (chip_enable_pw_rpc) { - defines += [ - "PW_RPC_ENABLED", - "PW_RPC_ATTRIBUTE_SERVICE=1", - "PW_RPC_BUTTON_SERVICE=1", - "PW_RPC_DESCRIPTOR_SERVICE=1", - "PW_RPC_DEVICE_SERVICE=1", - "PW_RPC_LIGHTING_SERVICE=1", - "PW_RPC_OTCLI_SERVICE=1", - "PW_RPC_THREAD_SERVICE=1", - "PW_RPC_TRACING_SERVICE=1", - ] - - sources += [ - "${chip_root}/examples/common/pigweed/RpcService.cpp", - "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", - "${examples_common_plat_dir}/PigweedLogger.cpp", - "${examples_common_plat_dir}/Rpc.cpp", - ] - - deps += [ - "$dir_pw_hdlc:rpc_channel_output", - "$dir_pw_stream:sys_io_stream", - "$dir_pw_trace", - "$dir_pw_trace_tokenized", - "$dir_pw_trace_tokenized:trace_rpc_service", - "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", - "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917", - ] - - deps += pw_build_LINK_DEPS - - include_dirs += [ - "${chip_root}/examples/common", - "${chip_root}/examples/common/pigweed/efr32", - ] - } - - ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld" - - inputs = [ ldscript ] - - ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] - - if (chip_print_memory_usage) { - ldflags += [ - "-Wl,--print-memory-usage", - "-fstack-usage", - ] - } - - # WiFi Settings - if (chip_enable_wifi) { - ldflags += [ - "-Wl,--defsym", - "-Wl,SILABS_WIFI=1", - ] - } - - output_dir = root_out_dir -} - -group("siwx917") { - deps = [ ":lighting_app" ] -} - -group("default") { - deps = [ ":siwx917" ] -} diff --git a/examples/lighting-app/silabs/SiWx917/README.md b/examples/lighting-app/silabs/SiWx917/README.md deleted file mode 100644 index a8d588271aae84..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/README.md +++ /dev/null @@ -1,191 +0,0 @@ -# Matter SiWx917 Lighting Example - -An example showing the use of CHIP on the Silicon Labs SiWx917. - -
- -- [Matter SiWx917 Lighting Example](#matter-siwx917-lighting-example) - - [Introduction](#introduction) - - [Building](#building) - - [Flashing the Application](#flashing-the-application) - - [Viewing Logging Output](#viewing-logging-output) - - [Running the Complete Example](#running-the-complete-example) - - [Notes](#notes) - - [Memory settings](#memory-settings) - - [Group Communication (Multicast)](#group-communication-multicast) - - [Building options](#building-options) - - [Disabling logging](#disabling-logging) - - [Debug build / release build](#debug-build--release-build) - - [Disabling LCD](#disabling-lcd) - - [KVS maximum entry count](#kvs-maximum-entry-count) - -
- -> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with -> frequent releases thoroughly tested and validated. Developers looking to -> develop matter products with silabs hardware are encouraged to use our latest -> release with added tools and documentation. -> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) - - - -## Introduction - -The SiWx917 lighting example provides a baseline demonstration of a Light -control device, built using Matter, the Silicon Labs Gecko SDK, and the Silicon -Labs WiseMCU SDK. It can be controlled by a Chip controller over a Wi-Fi -network. - -The SiWx917 device can be commissioned over Bluetooth Low Energy where the -device and the Chip controller will exchange security information with the -rendezvous procedure. Wi-Fi Network credentials are then provided to the SiWx917 -device which will then join the Wi-Fi network. - -If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the -needed commissioning information for the BLE connection and starting the -rendezvous procedure. - -The lighting example is intended to serve both as a means to explore the -workings of Matter as well as a template for creating real products based on the -Silicon Labs platform. - - - -## Building - -- Download the - [Simplicity Commander](https://www.silabs.com/mcu/programming-options) - command line tool, and ensure that `commander` is your shell search path. - (For Mac OS X, `commander` is located inside - `Commander.app/Contents/MacOS/`.) - -- Download and install a suitable ARM gcc tool chain: - [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) - -- Install some additional tools (likely already present for CHIP developers): - - - Linux: `sudo apt-get install git ninja-build` - - - Mac OS X: `brew install ninja` - -- Supported hardware: - - - > For the latest supported hardware please refer to the - > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) - > in the Silicon Labs Matter Github Repo - -* Build the example application: - - cd ~/connectedhomeip - ./scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/SiWx917/ out/lighting-app BRD4325B - -- To delete generated executable, libraries and object files use: - - $ cd ~/connectedhomeip - $ rm -rf ./out/ - - - -## Flashing the Application - -- Flashing requires the SiWx917 SoC device to be configured in the Ozone - Debugger. -- Once it's configured, it can be run with the Ozone Debugger by loading the - .out file. - - > For detailed instructions, please refer to - > [Running the Matter Demo on SiWx917 SoC](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/wifi/RUN_DEMO_SiWx917_SoC.md) - > in the Silicon Labs Matter Github Repo - - - -## Viewing Logging Output - -The example application's logging output can be viewed in the Ozone Debugger. - - - -## Running the Complete Example - -- You can provision and control the Chip device using the chip-tool standalone - - [chip-tool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) - - Here is an example with the chip-tool: - - - > $SSID and $PSK are the SSID and passcode of your Wi-Fi Access Point. - - ``` - chip-tool pairing ble-wifi 1122 $SSID $PSK 20202021 3840 - - chip-tool onoff on 1 1 - ``` - -### Notes - -- Depending on your network settings your router might not provide native IPv6 - addresses to your devices (Router / PC). If this is the case, you need to - add a static IPv6 addresses on both devices and then an IPv6 route to your - router on your PC - - - On PC(Linux): `sudo ip addr add dev 2002::1/64` - - - Add IPv6 route on PC(Linux) - `sudo ip route add /64 via 2002::2` - -## Memory settings - -While most of the RAM usage in CHIP is static, allowing easier debugging and -optimization with symbols analysis, we still need some HEAP for the crypto and -Wi-Fi stack. Size of the HEAP can be modified by changing the value of the -`configTOTAL_HEAP_SIZE` define inside of the FreeRTOSConfig.h file of this -example. Please take note that a HEAP size smaller than 13k can and will cause a -Mbedtls failure during the BLE rendez-vous or CASE session - -To track memory usage you can set `enable_heap_monitoring = true` either in the -BUILD.gn file or pass it as a build argument to gn. This will print on the RTT -console the RAM usage of each individual task and the number of Memory -allocation and Free. While this is not extensive monitoring you're welcome to -modify `examples/platform/silabs/SiWx917/MemMonitoring.cpp` to add your own -memory tracking code inside the `trackAlloc` and `trackFree` function - -## Group Communication (Multicast) - -With this lighting example you can also use group communication to send Lighting -commands to multiples devices at once. Please refer to the -[chip-tool documentation](../../../chip-tool/README.md) _Configuring the server -side for Group Commands_ and _Using the Client to Send Group (Multicast) Matter -Commands_ - -## Building options - -All of Silabs's examples within the Matter repo have all the features enabled by -default, as to provide the best end user experience. However some of those -features can easily be toggled on or off. Here is a short list of options to be -passed to the build scripts. - -### Disabling logging - -`chip_progress_logging, chip_detail_logging, chip_automation_logging` - - $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/silabs/SiWx917 ./out/lighting-app BRD4325B "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" - -### Debug build / release build - -`is_debug` - - $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/silabs/SiWx917 ./out/lighting-app BRD4325B "is_debug=false" - -### Disabling LCD - -`show_qr_code` - - $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/silabs/SiWx917 ./out/lighting-app BRD4325B "show_qr_code=false" - -### KVS maximum entry count - -`kvs_max_entries` - - Set the maximum Kvs entries that can be stored in NVM (Default 75) - Thresholds: 30 <= kvs_max_entries <= 255 - - $ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/silabs/SiWx917 ./out/lighting-app BRD4325B kvs_max_entries=50 diff --git a/examples/lighting-app/silabs/SiWx917/build_overrides b/examples/lighting-app/silabs/SiWx917/build_overrides deleted file mode 120000 index 995884e6163eb5..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/build_overrides +++ /dev/null @@ -1 +0,0 @@ -../../../build_overrides \ No newline at end of file diff --git a/examples/lighting-app/silabs/SiWx917/data_model/BUILD.gn b/examples/lighting-app/silabs/SiWx917/data_model/BUILD.gn deleted file mode 100644 index f6dae30253e64b..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/data_model/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("${chip_root}/src/app/chip_data_model.gni") -import("${chip_root}/src/platform/device.gni") - -chip_data_model("silabs-lighting") { - zap_file = "lighting-wifi-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" - is_server = true -} diff --git a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter deleted file mode 100644 index aacd7361c3fe2c..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter +++ /dev/null @@ -1,1920 +0,0 @@ -// This IDL was generated automatically by ZAP. -// It is for view/code review purposes only. - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ -server cluster Identify = 3 { - enum IdentifyEffectIdentifier : ENUM8 { - kBlink = 0; - kBreathe = 1; - kOkay = 2; - kChannelChange = 11; - kFinishEffect = 254; - kStopEffect = 255; - } - - enum IdentifyEffectVariant : ENUM8 { - kDefault = 0; - } - - enum IdentifyIdentifyType : ENUM8 { - kNone = 0; - kVisibleLight = 1; - kVisibleLED = 2; - kAudibleBeep = 3; - kDisplay = 4; - kActuator = 5; - } - - attribute int16u identifyTime = 0; - readonly attribute enum8 identifyType = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct IdentifyRequest { - INT16U identifyTime = 0; - } - - request struct TriggerEffectRequest { - IdentifyEffectIdentifier effectIdentifier = 0; - IdentifyEffectVariant effectVariant = 1; - } - - command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; - command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; -} - -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { - kGroupNames = 0x1; - } - - readonly attribute bitmap8 nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - -/** Attributes and commands for switching devices between 'On' and 'Off' states. */ -server cluster OnOff = 6 { - enum OnOffDelayedAllOffEffectVariant : ENUM8 { - kFadeToOffIn0p8Seconds = 0; - kNoFade = 1; - k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; - } - - enum OnOffDyingLightEffectVariant : ENUM8 { - k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; - } - - enum OnOffEffectIdentifier : ENUM8 { - kDelayedAllOff = 0; - kDyingLight = 1; - } - - enum OnOffStartUpOnOff : ENUM8 { - kOff = 0; - kOn = 1; - kTogglePreviousOnOff = 2; - } - - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; - } - - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; - } - - readonly attribute boolean onOff = 0; - readonly attribute boolean globalSceneControl = 16384; - attribute int16u onTime = 16385; - attribute int16u offWaitTime = 16386; - attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct OffWithEffectRequest { - OnOffEffectIdentifier effectIdentifier = 0; - int8u effectVariant = 1; - } - - request struct OnWithTimedOffRequest { - OnOffControl onOffControl = 0; - int16u onTime = 1; - int16u offWaitTime = 2; - } - - command Off(): DefaultSuccess = 0; - command On(): DefaultSuccess = 1; - command Toggle(): DefaultSuccess = 2; - command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; - command OnWithRecallGlobalScene(): DefaultSuccess = 65; - command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; -} - -/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ -server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { - kUp = 0; - kDown = 1; - } - - enum StepMode : ENUM8 { - kUp = 0; - kDown = 1; - } - - bitmap LevelControlFeature : BITMAP32 { - kOnOff = 0x1; - kLighting = 0x2; - kFrequency = 0x4; - } - - bitmap LevelControlOptions : BITMAP8 { - kExecuteIfOff = 0x1; - kCoupleColorTempToLevel = 0x2; - } - - readonly attribute nullable int8u currentLevel = 0; - readonly attribute int16u remainingTime = 1; - readonly attribute int8u minLevel = 2; - readonly attribute int8u maxLevel = 3; - readonly attribute int16u currentFrequency = 4; - readonly attribute int16u minFrequency = 5; - readonly attribute int16u maxFrequency = 6; - attribute LevelControlOptions options = 15; - attribute int16u onOffTransitionTime = 16; - attribute nullable int8u onLevel = 17; - attribute nullable int16u onTransitionTime = 18; - attribute nullable int16u offTransitionTime = 19; - attribute nullable int8u defaultMoveRate = 20; - attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct MoveToLevelRequest { - INT8U level = 0; - nullable INT16U transitionTime = 1; - LevelControlOptions optionsMask = 2; - LevelControlOptions optionsOverride = 3; - } - - request struct MoveRequest { - MoveMode moveMode = 0; - nullable INT8U rate = 1; - LevelControlOptions optionsMask = 2; - LevelControlOptions optionsOverride = 3; - } - - request struct StepRequest { - StepMode stepMode = 0; - INT8U stepSize = 1; - nullable INT16U transitionTime = 2; - LevelControlOptions optionsMask = 3; - LevelControlOptions optionsOverride = 4; - } - - request struct StopRequest { - LevelControlOptions optionsMask = 0; - LevelControlOptions optionsOverride = 1; - } - - request struct MoveToLevelWithOnOffRequest { - INT8U level = 0; - nullable INT16U transitionTime = 1; - LevelControlOptions optionsMask = 2; - LevelControlOptions optionsOverride = 3; - } - - request struct MoveWithOnOffRequest { - MoveMode moveMode = 0; - nullable INT8U rate = 1; - LevelControlOptions optionsMask = 2; - LevelControlOptions optionsOverride = 3; - } - - request struct StepWithOnOffRequest { - StepMode stepMode = 0; - INT8U stepSize = 1; - nullable INT16U transitionTime = 2; - LevelControlOptions optionsMask = 3; - LevelControlOptions optionsOverride = 4; - } - - request struct StopWithOnOffRequest { - LevelControlOptions optionsMask = 0; - LevelControlOptions optionsOverride = 1; - } - - command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; - command Move(MoveRequest): DefaultSuccess = 1; - command Step(StepRequest): DefaultSuccess = 2; - command Stop(StopRequest): DefaultSuccess = 3; - command MoveToLevelWithOnOff(MoveToLevelWithOnOffRequest): DefaultSuccess = 4; - command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; - command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; - command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; -} - -/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ -server cluster Descriptor = 29 { - struct DeviceTypeStruct { - devtype_id deviceType = 0; - int16u revision = 1; - } - - readonly attribute DeviceTypeStruct deviceTypeList[] = 0; - readonly attribute CLUSTER_ID serverList[] = 1; - readonly attribute CLUSTER_ID clientList[] = 2; - readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** The Access Control Cluster exposes a data model view of a - Node's Access Control List (ACL), which codifies the rules used to manage - and enforce Access Control for the Node's endpoints and their associated - cluster instances. */ -server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { - kPase = 1; - kCase = 2; - kGroup = 3; - } - - enum AccessControlEntryPrivilegeEnum : ENUM8 { - kView = 1; - kProxyView = 2; - kOperate = 3; - kManage = 4; - kAdminister = 5; - } - - enum ChangeTypeEnum : ENUM8 { - kChanged = 0; - kAdded = 1; - kRemoved = 2; - } - - struct Target { - nullable cluster_id cluster = 0; - nullable endpoint_no endpoint = 1; - nullable devtype_id deviceType = 2; - } - - fabric_scoped struct AccessControlEntryStruct { - fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; - fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; - nullable fabric_sensitive int64u subjects[] = 3; - nullable fabric_sensitive Target targets[] = 4; - fabric_idx fabricIndex = 254; - } - - fabric_scoped struct AccessControlExtensionStruct { - fabric_sensitive octet_string<128> data = 1; - fabric_idx fabricIndex = 254; - } - - fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { - nullable node_id adminNodeID = 1; - nullable INT16U adminPasscodeID = 2; - ChangeTypeEnum changeType = 3; - nullable AccessControlEntryStruct latestValue = 4; - fabric_idx fabricIndex = 254; - } - - fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { - nullable node_id adminNodeID = 1; - nullable INT16U adminPasscodeID = 2; - ChangeTypeEnum changeType = 3; - nullable AccessControlExtensionStruct latestValue = 4; - fabric_idx fabricIndex = 254; - } - - attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; - attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; - readonly attribute int16u subjectsPerAccessControlEntry = 2; - readonly attribute int16u targetsPerAccessControlEntry = 3; - readonly attribute int16u accessControlEntriesPerFabric = 4; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** This cluster provides attributes and events for determining basic information about Nodes, which supports both - Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, - which apply to the whole Node. Also allows setting user device information such as location. */ -server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { - kBlack = 0; - kNavy = 1; - kGreen = 2; - kTeal = 3; - kMaroon = 4; - kPurple = 5; - kOlive = 6; - kGray = 7; - kBlue = 8; - kLime = 9; - kAqua = 10; - kRed = 11; - kFuchsia = 12; - kYellow = 13; - kWhite = 14; - kNickel = 15; - kChrome = 16; - kBrass = 17; - kCopper = 18; - kSilver = 19; - kGold = 20; - } - - enum ProductFinishEnum : ENUM8 { - kOther = 0; - kMatte = 1; - kSatin = 2; - kPolished = 3; - kRugged = 4; - kFabric = 5; - } - - struct CapabilityMinimaStruct { - int16u caseSessionsPerFabric = 0; - int16u subscriptionsPerFabric = 1; - } - - struct ProductAppearanceStruct { - ProductFinishEnum finish = 0; - nullable ColorEnum primaryColor = 1; - } - - critical event StartUp = 0 { - INT32U softwareVersion = 0; - } - - critical event ShutDown = 1 { - } - - info event Leave = 2 { - fabric_idx fabricIndex = 0; - } - - info event ReachableChanged = 3 { - boolean reachableNewValue = 0; - } - - readonly attribute int16u dataModelRevision = 0; - readonly attribute char_string<32> vendorName = 1; - readonly attribute vendor_id vendorID = 2; - readonly attribute char_string<32> productName = 3; - readonly attribute int16u productID = 4; - attribute access(write: manage) char_string<32> nodeLabel = 5; - attribute access(write: administer) char_string<2> location = 6; - readonly attribute int16u hardwareVersion = 7; - readonly attribute char_string<64> hardwareVersionString = 8; - readonly attribute int32u softwareVersion = 9; - readonly attribute char_string<64> softwareVersionString = 10; - readonly attribute char_string<16> manufacturingDate = 11; - readonly attribute char_string<32> partNumber = 12; - readonly attribute long_char_string<256> productURL = 13; - readonly attribute char_string<64> productLabel = 14; - readonly attribute char_string<32> serialNumber = 15; - attribute access(write: manage) boolean localConfigDisabled = 16; - readonly attribute char_string<32> uniqueID = 18; - readonly attribute CapabilityMinimaStruct capabilityMinima = 19; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** Provides an interface for providing OTA software updates */ -client cluster OtaSoftwareUpdateProvider = 41 { - enum OTAApplyUpdateAction : ENUM8 { - kProceed = 0; - kAwaitNextAction = 1; - kDiscontinue = 2; - } - - enum OTADownloadProtocol : ENUM8 { - kBDXSynchronous = 0; - kBDXAsynchronous = 1; - kHttps = 2; - kVendorSpecific = 3; - } - - enum OTAQueryStatus : ENUM8 { - kUpdateAvailable = 0; - kBusy = 1; - kNotAvailable = 2; - kDownloadProtocolNotSupported = 3; - } - - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct QueryImageRequest { - vendor_id vendorID = 0; - INT16U productID = 1; - INT32U softwareVersion = 2; - OTADownloadProtocol protocolsSupported[] = 3; - optional INT16U hardwareVersion = 4; - optional CHAR_STRING<2> location = 5; - optional BOOLEAN requestorCanConsent = 6; - optional OCTET_STRING<512> metadataForProvider = 7; - } - - response struct QueryImageResponse = 1 { - OTAQueryStatus status = 0; - optional INT32U delayedActionTime = 1; - optional CHAR_STRING<256> imageURI = 2; - optional INT32U softwareVersion = 3; - optional CHAR_STRING<64> softwareVersionString = 4; - optional OCTET_STRING<32> updateToken = 5; - optional BOOLEAN userConsentNeeded = 6; - optional OCTET_STRING<512> metadataForRequestor = 7; - } - - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - response struct ApplyUpdateResponse = 3 { - OTAApplyUpdateAction action = 0; - INT32U delayedActionTime = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - - /** Determine availability of a new Software Image */ - command QueryImage(QueryImageRequest): QueryImageResponse = 0; - /** Determine next action to take for a downloaded Software Image */ - command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; - /** Notify OTA Provider that an update was applied */ - command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; -} - -/** Provides an interface for downloading and applying OTA software updates */ -server cluster OtaSoftwareUpdateRequestor = 42 { - enum OTAAnnouncementReason : ENUM8 { - kSimpleAnnouncement = 0; - kUpdateAvailable = 1; - kUrgentUpdateAvailable = 2; - } - - enum OTAChangeReasonEnum : ENUM8 { - kUnknown = 0; - kSuccess = 1; - kFailure = 2; - kTimeOut = 3; - kDelayByProvider = 4; - } - - enum OTAUpdateStateEnum : ENUM8 { - kUnknown = 0; - kIdle = 1; - kQuerying = 2; - kDelayedOnQuery = 3; - kDownloading = 4; - kApplying = 5; - kDelayedOnApply = 6; - kRollingBack = 7; - kDelayedOnUserConsent = 8; - } - - fabric_scoped struct ProviderLocation { - node_id providerNodeID = 1; - endpoint_no endpoint = 2; - fabric_idx fabricIndex = 254; - } - - info event StateTransition = 0 { - OTAUpdateStateEnum previousState = 0; - OTAUpdateStateEnum newState = 1; - OTAChangeReasonEnum reason = 2; - nullable INT32U targetSoftwareVersion = 3; - } - - critical event VersionApplied = 1 { - INT32U softwareVersion = 0; - INT16U productID = 1; - } - - info event DownloadError = 2 { - INT32U softwareVersion = 0; - INT64U bytesDownloaded = 1; - nullable INT8U progressPercent = 2; - nullable INT64S platformCode = 3; - } - - attribute ProviderLocation defaultOTAProviders[] = 0; - readonly attribute boolean updatePossible = 1; - readonly attribute OTAUpdateStateEnum updateState = 2; - readonly attribute nullable int8u updateStateProgress = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AnnounceOTAProviderRequest { - node_id providerNodeID = 0; - vendor_id vendorID = 1; - OTAAnnouncementReason announcementReason = 2; - optional OCTET_STRING<512> metadataForNode = 3; - endpoint_no endpoint = 4; - } - - command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; -} - -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; - readonly attribute CHAR_STRING supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing preferences for how dates and times are conveyed. As such, Nodes that visually - or audibly convey time information need a mechanism by which they can be configured to use a - user’s preferred format. */ -server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { - kBuddhist = 0; - kChinese = 1; - kCoptic = 2; - kEthiopian = 3; - kGregorian = 4; - kHebrew = 5; - kIndian = 6; - kIslamic = 7; - kJapanese = 8; - kKorean = 9; - kPersian = 10; - kTaiwanese = 11; - } - - enum HourFormatEnum : ENUM8 { - k12hr = 0; - k24hr = 1; - } - - attribute HourFormatEnum hourFormat = 0; - attribute CalendarTypeEnum activeCalendarType = 1; - readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** This cluster is used to manage global aspects of the Commissioning flow. */ -server cluster GeneralCommissioning = 48 { - enum CommissioningError : ENUM8 { - kOk = 0; - kValueOutsideRange = 1; - kInvalidAuthentication = 2; - kNoFailSafe = 3; - kBusyWithOtherAdmin = 4; - } - - enum RegulatoryLocationType : ENUM8 { - kIndoor = 0; - kOutdoor = 1; - kIndoorOutdoor = 2; - } - - struct BasicCommissioningInfo { - int16u failSafeExpiryLengthSeconds = 0; - int16u maxCumulativeFailsafeSeconds = 1; - } - - attribute access(write: administer) int64u breadcrumb = 0; - readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; - readonly attribute RegulatoryLocationType regulatoryConfig = 2; - readonly attribute RegulatoryLocationType locationCapability = 3; - readonly attribute boolean supportsConcurrentConnection = 4; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct ArmFailSafeRequest { - INT16U expiryLengthSeconds = 0; - INT64U breadcrumb = 1; - } - - request struct SetRegulatoryConfigRequest { - RegulatoryLocationType newRegulatoryConfig = 0; - CHAR_STRING countryCode = 1; - INT64U breadcrumb = 2; - } - - response struct ArmFailSafeResponse = 1 { - CommissioningError errorCode = 0; - CHAR_STRING debugText = 1; - } - - response struct SetRegulatoryConfigResponse = 3 { - CommissioningError errorCode = 0; - CHAR_STRING debugText = 1; - } - - response struct CommissioningCompleteResponse = 5 { - CommissioningError errorCode = 0; - CHAR_STRING debugText = 1; - } - - command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; - command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; -} - -/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ -server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatus : ENUM8 { - kSuccess = 0; - kOutOfRange = 1; - kBoundsExceeded = 2; - kNetworkIDNotFound = 3; - kDuplicateNetworkID = 4; - kNetworkNotFound = 5; - kRegulatoryError = 6; - kAuthFailure = 7; - kUnsupportedSecurity = 8; - kOtherConnectionFailure = 9; - kIPV6Failed = 10; - kIPBindFailed = 11; - kUnknownError = 12; - } - - enum WiFiBand : ENUM8 { - k2g4 = 0; - k3g65 = 1; - k5g = 2; - k6g = 3; - k60g = 4; - } - - bitmap NetworkCommissioningFeature : BITMAP32 { - kWiFiNetworkInterface = 0x1; - kThreadNetworkInterface = 0x2; - kEthernetNetworkInterface = 0x4; - } - - bitmap WiFiSecurity : BITMAP8 { - kUnencrypted = 0x1; - kWep = 0x2; - kWpaPersonal = 0x4; - kWpa2Personal = 0x8; - kWpa3Personal = 0x10; - } - - struct NetworkInfo { - octet_string<32> networkID = 0; - boolean connected = 1; - } - - struct ThreadInterfaceScanResult { - int16u panId = 0; - int64u extendedPanId = 1; - char_string<16> networkName = 2; - int16u channel = 3; - int8u version = 4; - octet_string<8> extendedAddress = 5; - int8s rssi = 6; - int8u lqi = 7; - } - - struct WiFiInterfaceScanResult { - WiFiSecurity security = 0; - octet_string<32> ssid = 1; - octet_string<6> bssid = 2; - int16u channel = 3; - WiFiBand wiFiBand = 4; - int8s rssi = 5; - } - - readonly attribute access(read: administer) int8u maxNetworks = 0; - readonly attribute access(read: administer) NetworkInfo networks[] = 1; - readonly attribute int8u scanMaxTimeSeconds = 2; - readonly attribute int8u connectMaxTimeSeconds = 3; - attribute access(write: administer) boolean interfaceEnabled = 4; - readonly attribute access(read: administer) nullable NetworkCommissioningStatus lastNetworkingStatus = 5; - readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; - readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct ScanNetworksRequest { - optional nullable OCTET_STRING<32> ssid = 0; - optional INT64U breadcrumb = 1; - } - - request struct AddOrUpdateWiFiNetworkRequest { - OCTET_STRING<32> ssid = 0; - OCTET_STRING<64> credentials = 1; - optional INT64U breadcrumb = 2; - } - - request struct AddOrUpdateThreadNetworkRequest { - OCTET_STRING<254> operationalDataset = 0; - optional INT64U breadcrumb = 1; - } - - request struct RemoveNetworkRequest { - OCTET_STRING<32> networkID = 0; - optional INT64U breadcrumb = 1; - } - - request struct ConnectNetworkRequest { - OCTET_STRING<32> networkID = 0; - optional INT64U breadcrumb = 1; - } - - request struct ReorderNetworkRequest { - OCTET_STRING<32> networkID = 0; - INT8U networkIndex = 1; - optional INT64U breadcrumb = 2; - } - - response struct ScanNetworksResponse = 1 { - NetworkCommissioningStatus networkingStatus = 0; - optional CHAR_STRING debugText = 1; - optional WiFiInterfaceScanResult wiFiScanResults[] = 2; - optional ThreadInterfaceScanResult threadScanResults[] = 3; - } - - response struct NetworkConfigResponse = 5 { - NetworkCommissioningStatus networkingStatus = 0; - optional CHAR_STRING<512> debugText = 1; - optional INT8U networkIndex = 2; - } - - response struct ConnectNetworkResponse = 7 { - NetworkCommissioningStatus networkingStatus = 0; - optional CHAR_STRING debugText = 1; - nullable INT32S errorValue = 2; - } - - command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; - command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; - command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; - command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; - command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; - command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; -} - -/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ -server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { - kEndUserSupport = 0; - kNetworkDiag = 1; - kCrashLogs = 2; - } - - enum StatusEnum : ENUM8 { - kSuccess = 0; - kExhausted = 1; - kNoLogs = 2; - kBusy = 3; - kDenied = 4; - } - - enum TransferProtocolEnum : ENUM8 { - kResponsePayload = 0; - kBdx = 1; - } - - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct RetrieveLogsRequestRequest { - IntentEnum intent = 0; - TransferProtocolEnum requestedProtocol = 1; - optional CHAR_STRING<32> transferFileDesignator = 2; - } - - command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; -} - -/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ -server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { - kUnspecified = 0; - kPowerOnReboot = 1; - kBrownOutReset = 2; - kSoftwareWatchdogReset = 3; - kHardwareWatchdogReset = 4; - kSoftwareUpdateCompleted = 5; - kSoftwareReset = 6; - } - - enum HardwareFaultEnum : ENUM8 { - kUnspecified = 0; - kRadio = 1; - kSensor = 2; - kResettableOverTemp = 3; - kNonResettableOverTemp = 4; - kPowerSource = 5; - kVisualDisplayFault = 6; - kAudioOutputFault = 7; - kUserInterfaceFault = 8; - kNonVolatileMemoryError = 9; - kTamperDetected = 10; - } - - enum InterfaceTypeEnum : ENUM8 { - kUnspecified = 0; - kWiFi = 1; - kEthernet = 2; - kCellular = 3; - kThread = 4; - } - - enum NetworkFaultEnum : ENUM8 { - kUnspecified = 0; - kHardwareFailure = 1; - kNetworkJammed = 2; - kConnectionFailed = 3; - } - - enum RadioFaultEnum : ENUM8 { - kUnspecified = 0; - kWiFiFault = 1; - kCellularFault = 2; - kThreadFault = 3; - kNFCFault = 4; - kBLEFault = 5; - kEthernetFault = 6; - } - - struct NetworkInterface { - char_string<32> name = 0; - boolean isOperational = 1; - nullable boolean offPremiseServicesReachableIPv4 = 2; - nullable boolean offPremiseServicesReachableIPv6 = 3; - octet_string<8> hardwareAddress = 4; - octet_string IPv4Addresses[] = 5; - octet_string IPv6Addresses[] = 6; - InterfaceTypeEnum type = 7; - } - - critical event HardwareFaultChange = 0 { - HardwareFaultEnum current[] = 0; - HardwareFaultEnum previous[] = 1; - } - - critical event RadioFaultChange = 1 { - RadioFaultEnum current[] = 0; - RadioFaultEnum previous[] = 1; - } - - critical event NetworkFaultChange = 2 { - NetworkFaultEnum current[] = 0; - NetworkFaultEnum previous[] = 1; - } - - critical event BootReason = 3 { - BootReasonEnum bootReason = 0; - } - - readonly attribute NetworkInterface networkInterfaces[] = 0; - readonly attribute int16u rebootCount = 1; - readonly attribute int64u upTime = 2; - readonly attribute int32u totalOperationalHours = 3; - readonly attribute BootReasonEnum bootReason = 4; - readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; - readonly attribute RadioFaultEnum activeRadioFaults[] = 6; - readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; - readonly attribute boolean testEventTriggersEnabled = 8; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct TestEventTriggerRequest { - OCTET_STRING<16> enableKey = 0; - INT64U eventTrigger = 1; - } - - command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; -} - -/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ -server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { - kWaterMarks = 0x1; - } - - struct ThreadMetricsStruct { - int64u id = 0; - optional char_string<8> name = 1; - optional int32u stackFreeCurrent = 2; - optional int32u stackFreeMinimum = 3; - optional int32u stackSize = 4; - } - - info event SoftwareFault = 0 { - INT64U id = 0; - optional CHAR_STRING name = 1; - optional OCTET_STRING faultRecording = 2; - } - - readonly attribute ThreadMetricsStruct threadMetrics[] = 0; - readonly attribute int64u currentHeapFree = 1; - readonly attribute int64u currentHeapUsed = 2; - readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - command ResetWatermarks(): DefaultSuccess = 0; -} - -/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ -server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { - kUnknown = 0; - kAssociationFailed = 1; - kAuthenticationFailed = 2; - kSsidNotFound = 3; - } - - enum ConnectionStatusEnum : ENUM8 { - kConnected = 0; - kNotConnected = 1; - } - - enum SecurityTypeEnum : ENUM8 { - kUnspecified = 0; - kNone = 1; - kWep = 2; - kWpa = 3; - kWpa2 = 4; - kWpa3 = 5; - } - - enum WiFiVersionEnum : ENUM8 { - kA = 0; - kB = 1; - kG = 2; - kN = 3; - kAc = 4; - kAx = 5; - } - - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { - kPacketCounts = 0x1; - kErrorCounts = 0x2; - } - - info event Disconnection = 0 { - INT16U reasonCode = 0; - } - - info event AssociationFailure = 1 { - AssociationFailureCauseEnum associationFailure = 0; - INT16U status = 1; - } - - info event ConnectionStatus = 2 { - ConnectionStatusEnum connectionStatus = 0; - } - - readonly attribute nullable octet_string<6> bssid = 0; - readonly attribute nullable SecurityTypeEnum securityType = 1; - readonly attribute nullable WiFiVersionEnum wiFiVersion = 2; - readonly attribute nullable int16u channelNumber = 3; - readonly attribute nullable int8s rssi = 4; - readonly attribute nullable int32u beaconLostCount = 5; - readonly attribute nullable int32u beaconRxCount = 6; - readonly attribute nullable int32u packetMulticastRxCount = 7; - readonly attribute nullable int32u packetMulticastTxCount = 8; - readonly attribute nullable int32u packetUnicastRxCount = 9; - readonly attribute nullable int32u packetUnicastTxCount = 10; - readonly attribute nullable int64u currentMaxRate = 11; - readonly attribute nullable int64u overrunCount = 12; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - command ResetCounts(): DefaultSuccess = 0; -} - -/** Commands to trigger a Node to allow a new Administrator to commission it. */ -server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { - kWindowNotOpen = 0; - kEnhancedWindowOpen = 1; - kBasicWindowOpen = 2; - } - - enum StatusCode : ENUM8 { - kBusy = 2; - kPAKEParameterError = 3; - kWindowNotOpen = 4; - } - - readonly attribute CommissioningWindowStatusEnum windowStatus = 0; - readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct OpenCommissioningWindowRequest { - INT16U commissioningTimeout = 0; - OCTET_STRING PAKEPasscodeVerifier = 1; - INT16U discriminator = 2; - INT32U iterations = 3; - OCTET_STRING salt = 4; - } - - request struct OpenBasicCommissioningWindowRequest { - INT16U commissioningTimeout = 0; - } - - timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; - timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; -} - -/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ -server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { - kDACCertificate = 1; - kPAICertificate = 2; - } - - enum NodeOperationalCertStatusEnum : ENUM8 { - kOk = 0; - kInvalidPublicKey = 1; - kInvalidNodeOpId = 2; - kInvalidNOC = 3; - kMissingCsr = 4; - kTableFull = 5; - kInvalidAdminSubject = 6; - kFabricConflict = 9; - kLabelConflict = 10; - kInvalidFabricIndex = 11; - } - - fabric_scoped struct FabricDescriptorStruct { - octet_string<65> rootPublicKey = 1; - vendor_id vendorID = 2; - fabric_id fabricID = 3; - node_id nodeID = 4; - char_string<32> label = 5; - fabric_idx fabricIndex = 254; - } - - fabric_scoped struct NOCStruct { - fabric_sensitive octet_string noc = 1; - nullable fabric_sensitive octet_string icac = 2; - fabric_idx fabricIndex = 254; - } - - readonly attribute access(read: administer) NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptorStruct fabrics[] = 1; - readonly attribute int8u supportedFabrics = 2; - readonly attribute int8u commissionedFabrics = 3; - readonly attribute OCTET_STRING trustedRootCertificates[] = 4; - readonly attribute int8u currentFabricIndex = 5; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AttestationRequestRequest { - OCTET_STRING attestationNonce = 0; - } - - request struct CertificateChainRequestRequest { - CertificateChainTypeEnum certificateType = 0; - } - - request struct CSRRequestRequest { - OCTET_STRING CSRNonce = 0; - optional boolean isForUpdateNOC = 1; - } - - request struct AddNOCRequest { - OCTET_STRING NOCValue = 0; - optional OCTET_STRING ICACValue = 1; - OCTET_STRING IPKValue = 2; - Int64u caseAdminSubject = 3; - VENDOR_ID adminVendorId = 4; - } - - request struct UpdateNOCRequest { - OCTET_STRING NOCValue = 0; - optional OCTET_STRING ICACValue = 1; - } - - request struct UpdateFabricLabelRequest { - CHAR_STRING<32> label = 0; - } - - request struct RemoveFabricRequest { - fabric_idx fabricIndex = 0; - } - - request struct AddTrustedRootCertificateRequest { - OCTET_STRING rootCACertificate = 0; - } - - response struct AttestationResponse = 1 { - OCTET_STRING attestationElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct CertificateChainResponse = 3 { - OCTET_STRING certificate = 0; - } - - response struct CSRResponse = 5 { - OCTET_STRING NOCSRElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct NOCResponse = 8 { - NodeOperationalCertStatusEnum statusCode = 0; - optional fabric_idx fabricIndex = 1; - optional CHAR_STRING debugText = 2; - } - - command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; - command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; - command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; - command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; - command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; - command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; -} - -/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ -server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { - kTrustFirst = 0; - kCacheAndSync = 1; - } - - fabric_scoped struct GroupInfoMapStruct { - group_id groupId = 1; - endpoint_no endpoints[] = 2; - optional char_string<16> groupName = 3; - fabric_idx fabricIndex = 254; - } - - fabric_scoped struct GroupKeyMapStruct { - group_id groupId = 1; - int16u groupKeySetID = 2; - fabric_idx fabricIndex = 254; - } - - struct GroupKeySetStruct { - int16u groupKeySetID = 0; - GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; - nullable octet_string<16> epochKey0 = 2; - nullable epoch_us epochStartTime0 = 3; - nullable octet_string<16> epochKey1 = 4; - nullable epoch_us epochStartTime1 = 5; - nullable octet_string<16> epochKey2 = 6; - nullable epoch_us epochStartTime2 = 7; - } - - attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; - readonly attribute GroupInfoMapStruct groupTable[] = 1; - readonly attribute int16u maxGroupsPerFabric = 2; - readonly attribute int16u maxGroupKeysPerFabric = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct KeySetWriteRequest { - GroupKeySetStruct groupKeySet = 0; - } - - request struct KeySetReadRequest { - INT16U groupKeySetID = 0; - } - - request struct KeySetRemoveRequest { - INT16U groupKeySetID = 0; - } - - request struct KeySetReadAllIndicesRequest { - INT16U groupKeySetIDs[] = 0; - } - - response struct KeySetReadResponse = 2 { - GroupKeySetStruct groupKeySet = 0; - } - - response struct KeySetReadAllIndicesResponse = 5 { - INT16U groupKeySetIDs[] = 0; - } - - fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - fabric command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; -} - -/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only -labels. */ -server cluster FixedLabel = 64 { - struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; - } - - readonly attribute LabelStruct labelList[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ -server cluster UserLabel = 65 { - struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; - } - - attribute access(write: manage) LabelStruct labelList[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** Attributes and commands for controlling the color properties of a color-capable light. */ -server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { - kDeactivate = 0; - kActivateFromColorLoopStartEnhancedHue = 1; - kActivateFromEnhancedCurrentHue = 2; - } - - enum ColorLoopDirection : ENUM8 { - kDecrementHue = 0; - kIncrementHue = 1; - } - - enum ColorMode : ENUM8 { - kCurrentHueAndCurrentSaturation = 0; - kCurrentXAndCurrentY = 1; - kColorTemperature = 2; - } - - enum HueDirection : ENUM8 { - kShortestDistance = 0; - kLongestDistance = 1; - kUp = 2; - kDown = 3; - } - - enum HueMoveMode : ENUM8 { - kStop = 0; - kUp = 1; - kDown = 3; - } - - enum HueStepMode : ENUM8 { - kUp = 1; - kDown = 3; - } - - enum SaturationMoveMode : ENUM8 { - kStop = 0; - kUp = 1; - kDown = 3; - } - - enum SaturationStepMode : ENUM8 { - kUp = 1; - kDown = 3; - } - - bitmap ColorCapabilities : BITMAP16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - - bitmap ColorLoopUpdateFlags : BITMAP8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; - } - - readonly attribute int8u currentHue = 0; - readonly attribute int8u currentSaturation = 1; - readonly attribute int16u remainingTime = 2; - readonly attribute int16u currentX = 3; - readonly attribute int16u currentY = 4; - readonly attribute int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; - readonly attribute nullable int8u numberOfPrimaries = 16; - readonly attribute int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; - readonly attribute int8u colorLoopActive = 16386; - readonly attribute int8u colorLoopDirection = 16387; - readonly attribute int16u colorLoopTime = 16388; - readonly attribute int16u colorLoopStartEnhancedHue = 16389; - readonly attribute int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; - readonly attribute int16u colorTempPhysicalMinMireds = 16395; - readonly attribute int16u colorTempPhysicalMaxMireds = 16396; - readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct MoveToHueRequest { - INT8U hue = 0; - HueDirection direction = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveHueRequest { - HueMoveMode moveMode = 0; - INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct StepHueRequest { - HueStepMode stepMode = 0; - INT8U stepSize = 1; - INT8U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveToSaturationRequest { - INT8U saturation = 0; - INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; - INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; - INT8U stepSize = 1; - INT8U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveToHueAndSaturationRequest { - INT8U hue = 0; - INT8U saturation = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveToColorRequest { - INT16U colorX = 0; - INT16U colorY = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveColorRequest { - INT16S rateX = 0; - INT16S rateY = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct StepColorRequest { - INT16S stepX = 0; - INT16S stepY = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct MoveToColorTemperatureRequest { - INT16U colorTemperatureMireds = 0; - INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct EnhancedMoveToHueRequest { - INT16U enhancedHue = 0; - HueDirection direction = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; - INT16U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; - } - - request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; - INT16U stepSize = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct EnhancedMoveToHueAndSaturationRequest { - INT16U enhancedHue = 0; - INT8U saturation = 1; - INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; - } - - request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; - INT16U time = 3; - INT16U startHue = 4; - BITMAP8 optionsMask = 5; - BITMAP8 optionsOverride = 6; - } - - request struct StopMoveStepRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; - } - - request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; - INT16U rate = 1; - INT16U colorTemperatureMinimumMireds = 2; - INT16U colorTemperatureMaximumMireds = 3; - BITMAP8 optionsMask = 4; - BITMAP8 optionsOverride = 5; - } - - request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; - INT16U stepSize = 1; - INT16U transitionTime = 2; - INT16U colorTemperatureMinimumMireds = 3; - INT16U colorTemperatureMaximumMireds = 4; - BITMAP8 optionsMask = 5; - BITMAP8 optionsOverride = 6; - } - - command MoveToHue(MoveToHueRequest): DefaultSuccess = 0; - command MoveHue(MoveHueRequest): DefaultSuccess = 1; - command StepHue(StepHueRequest): DefaultSuccess = 2; - command MoveToSaturation(MoveToSaturationRequest): DefaultSuccess = 3; - command MoveSaturation(MoveSaturationRequest): DefaultSuccess = 4; - command StepSaturation(StepSaturationRequest): DefaultSuccess = 5; - command MoveToHueAndSaturation(MoveToHueAndSaturationRequest): DefaultSuccess = 6; - command MoveToColor(MoveToColorRequest): DefaultSuccess = 7; - command MoveColor(MoveColorRequest): DefaultSuccess = 8; - command StepColor(StepColorRequest): DefaultSuccess = 9; - command MoveToColorTemperature(MoveToColorTemperatureRequest): DefaultSuccess = 10; - command EnhancedMoveToHue(EnhancedMoveToHueRequest): DefaultSuccess = 64; - command EnhancedMoveHue(EnhancedMoveHueRequest): DefaultSuccess = 65; - command EnhancedStepHue(EnhancedStepHueRequest): DefaultSuccess = 66; - command EnhancedMoveToHueAndSaturation(EnhancedMoveToHueAndSaturationRequest): DefaultSuccess = 67; - command ColorLoopSet(ColorLoopSetRequest): DefaultSuccess = 68; - command StopMoveStep(StopMoveStepRequest): DefaultSuccess = 71; - command MoveColorTemperature(MoveColorTemperatureRequest): DefaultSuccess = 75; - command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; -} - -endpoint 0 { - device type rootdevice = 22, version 1; - binding cluster OtaSoftwareUpdateProvider; - - server cluster Descriptor { - callback attribute deviceTypeList; - callback attribute serverList; - callback attribute clientList; - callback attribute partsList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; - } - - server cluster AccessControl { - callback attribute acl; - callback attribute extension; - callback attribute subjectsPerAccessControlEntry default = 4; - callback attribute targetsPerAccessControlEntry default = 3; - callback attribute accessControlEntriesPerFabric default = 4; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster BasicInformation { - callback attribute dataModelRevision default = 10; - callback attribute vendorName; - callback attribute vendorID; - callback attribute productName; - callback attribute productID; - persist attribute nodeLabel; - callback attribute location default = "XX"; - callback attribute hardwareVersion default = 0; - callback attribute hardwareVersionString; - callback attribute softwareVersion default = 0; - callback attribute softwareVersionString; - callback attribute manufacturingDate default = "20210614123456ZZ"; - callback attribute partNumber; - callback attribute productURL; - callback attribute productLabel; - callback attribute serialNumber; - persist attribute localConfigDisabled default = 0; - callback attribute uniqueID; - callback attribute capabilityMinima; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster OtaSoftwareUpdateRequestor { - callback attribute defaultOTAProviders default = 0; - ram attribute updatePossible default = 1; - ram attribute updateState default = 0; - ram attribute updateStateProgress default = 0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - persist attribute activeCalendarType default = 0; - callback attribute supportedCalendarTypes; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster GeneralCommissioning { - ram attribute breadcrumb default = 0x0000000000000000; - callback attribute basicCommissioningInfo; - callback attribute regulatoryConfig default = 0; - callback attribute locationCapability default = 0; - callback attribute supportsConcurrentConnection default = 1; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster NetworkCommissioning { - ram attribute maxNetworks; - callback attribute networks; - ram attribute scanMaxTimeSeconds; - ram attribute connectMaxTimeSeconds; - ram attribute interfaceEnabled; - ram attribute lastNetworkingStatus; - ram attribute lastNetworkID; - ram attribute lastConnectErrorValue; - ram attribute featureMap default = 2; - ram attribute clusterRevision default = 1; - } - - server cluster DiagnosticLogs { - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster GeneralDiagnostics { - callback attribute networkInterfaces; - callback attribute rebootCount default = 0x0000; - callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; - callback attribute bootReason; - callback attribute activeHardwareFaults; - callback attribute activeRadioFaults; - callback attribute activeNetworkFaults; - callback attribute testEventTriggersEnabled default = false; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster SoftwareDiagnostics { - callback attribute threadMetrics; - callback attribute currentHeapFree default = 0x0000000000000000; - callback attribute currentHeapUsed default = 0x0000000000000000; - callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; - ram attribute clusterRevision default = 1; - } - - server cluster WiFiNetworkDiagnostics { - callback attribute bssid; - callback attribute securityType; - callback attribute wiFiVersion; - callback attribute channelNumber default = 0x0000; - callback attribute rssi default = 0x00; - callback attribute beaconLostCount default = 0x00000000; - callback attribute beaconRxCount default = 0x00000000; - callback attribute packetMulticastRxCount default = 0x00000000; - callback attribute packetMulticastTxCount default = 0x00000000; - callback attribute packetUnicastRxCount default = 0x00000000; - callback attribute packetUnicastTxCount default = 0x00000000; - callback attribute currentMaxRate default = 0x0000000000000000; - callback attribute overrunCount default = 0x0000000000000000; - ram attribute featureMap default = 3; - ram attribute clusterRevision default = 1; - } - - server cluster AdministratorCommissioning { - callback attribute windowStatus default = 0; - callback attribute adminFabricIndex default = 1; - callback attribute adminVendorId default = 0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster OperationalCredentials { - callback attribute NOCs; - callback attribute fabrics; - callback attribute supportedFabrics; - callback attribute commissionedFabrics; - callback attribute trustedRootCertificates; - callback attribute currentFabricIndex; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster GroupKeyManagement { - callback attribute groupKeyMap; - callback attribute groupTable; - callback attribute maxGroupsPerFabric; - callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster FixedLabel { - callback attribute labelList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } -} -endpoint 1 { - device type dimmablelight = 257, version 1; - - server cluster Identify { - ram attribute identifyTime default = 0x0000; - ram attribute identifyType default = 0x0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - - server cluster OnOff { - persist attribute onOff default = 0x00; - ram attribute globalSceneControl default = 0x01; - ram attribute onTime default = 0x0000; - ram attribute offWaitTime default = 0x0000; - persist attribute startUpOnOff default = 0xFF; - ram attribute featureMap default = 1; - ram attribute clusterRevision default = 4; - } - - server cluster LevelControl { - persist attribute currentLevel default = 0x01; - ram attribute remainingTime default = 0x0000; - ram attribute minLevel default = 0x01; - ram attribute maxLevel default = 0xFE; - ram attribute currentFrequency default = 0x0000; - ram attribute minFrequency default = 0x0000; - ram attribute maxFrequency default = 0x0000; - ram attribute options default = 0x00; - ram attribute onOffTransitionTime default = 0x0000; - ram attribute onLevel default = 0xFF; - ram attribute onTransitionTime; - ram attribute offTransitionTime; - ram attribute defaultMoveRate default = 50; - persist attribute startUpCurrentLevel default = 255; - ram attribute featureMap default = 3; - ram attribute clusterRevision default = 5; - } - - server cluster Descriptor { - callback attribute deviceTypeList; - callback attribute serverList; - callback attribute clientList; - callback attribute partsList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; - } - - server cluster ColorControl { - ram attribute currentHue default = 0x00; - ram attribute currentSaturation default = 0x00; - ram attribute remainingTime default = 0x0000; - ram attribute currentX default = 0x616B; - ram attribute currentY default = 0x607D; - ram attribute colorTemperatureMireds default = 0x00FA; - ram attribute colorMode default = 0x01; - ram attribute options default = 0x00; - ram attribute numberOfPrimaries; - ram attribute enhancedCurrentHue default = 0x0000; - ram attribute enhancedColorMode default = 0x01; - ram attribute colorLoopActive default = 0x00; - ram attribute colorLoopDirection default = 0x00; - ram attribute colorLoopTime default = 0x0019; - ram attribute colorLoopStartEnhancedHue default = 0x2300; - ram attribute colorLoopStoredEnhancedHue default = 0x0000; - ram attribute colorCapabilities default = 0x1F; - ram attribute colorTempPhysicalMinMireds default = 0x0000; - ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; - ram attribute coupleColorTempToLevelMinMireds; - ram attribute startUpColorTemperatureMireds; - ram attribute featureMap default = 0x1F; - ram attribute clusterRevision default = 5; - } -} - - diff --git a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.zap deleted file mode 100644 index a7b2737e97f4f6..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.zap +++ /dev/null @@ -1,8199 +0,0 @@ -{ - "featureLevel": 96, - "creator": "zap", - "keyValuePairs": [ - { - "key": "commandDiscovery", - "value": "1" - }, - { - "key": "defaultResponsePolicy", - "value": "always" - }, - { - "key": "manufacturerCodes", - "value": "0x1002" - } - ], - "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../../../src/app/zap-templates/zcl/zcl.json", - "type": "zcl-properties", - "category": "matter", - "version": 1, - "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - } - ], - "endpointTypes": [ - { - "name": "MA-rootdevice", - "deviceTypeName": "MA-rootdevice", - "deviceTypeCode": 22, - "deviceTypeProfileId": 259, - "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddGroup", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewGroup", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetGroupMembership", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveGroup", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllGroups", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddGroupIfIdentifying", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "AddGroupResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewGroupResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetGroupMembershipResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveGroupResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "NameSupport", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "AddSceneResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewSceneResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "SceneCount", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentScene", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentGroup", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "group_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SceneValid", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "OnOff", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off Switch Configuration", - "code": 7, - "mfgCode": null, - "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off Switch Configuration", - "code": 7, - "mfgCode": null, - "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "switch type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "switch actions", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToLevel", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Move", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Step", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Stop", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveToLevelWithOnOff", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveWithOnOff", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepWithOnOff", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StopWithOnOff", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "CurrentLevel", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "DeviceTypeList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ServerList", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClientList", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PartsList", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Access Control", - "code": 31, - "mfgCode": null, - "define": "ACCESS_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Access Control", - "code": 31, - "mfgCode": null, - "define": "ACCESS_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ACL", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Extension", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SubjectsPerAccessControlEntry", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "TargetsPerAccessControlEntry", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AccessControlEntriesPerFabric", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic Information", - "code": 40, - "mfgCode": null, - "define": "BASIC_INFORMATION_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic Information", - "code": 40, - "mfgCode": null, - "define": "BASIC_INFORMATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "DataModelRevision", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorName", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorID", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "vendor_id", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductName", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductID", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NodeLabel", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "NVM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Location", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "XX", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersion", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersionString", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "20210614123456ZZ", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "type": "long_char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LocalConfigDisabled", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "NVM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 0, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UniqueID", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CapabilityMinima", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "CapabilityMinimaStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "OTA Software Update Provider", - "code": 41, - "mfgCode": null, - "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", - "side": "client", - "enabled": 1, - "commands": [ - { - "name": "QueryImage", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ApplyUpdateRequest", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "NotifyUpdateApplied", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "OTA Software Update Provider", - "code": 41, - "mfgCode": null, - "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "QueryImageResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ApplyUpdateResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "OTA Software Update Requestor", - "code": 42, - "mfgCode": null, - "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AnnounceOTAProvider", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "OTA Software Update Requestor", - "code": 42, - "mfgCode": null, - "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "DefaultOTAProviders", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "UpdatePossible", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UpdateState", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "OTAUpdateStateEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UpdateStateProgress", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "en-US", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Time Format Localization", - "code": 44, - "mfgCode": null, - "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "Time Format Localization", - "code": 44, - "mfgCode": null, - "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "HourFormat", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "HourFormatEnum", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ActiveCalendarType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "CalendarTypeEnum", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedCalendarTypes", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Unit Localization", - "code": 45, - "mfgCode": null, - "define": "UNIT_LOCALIZATION_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "Unit Localization", - "code": 45, - "mfgCode": null, - "define": "UNIT_LOCALIZATION_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "TemperatureUnit", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "TempUnitEnum", - "included": 0, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ArmFailSafe", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfig", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "CommissioningComplete", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ArmFailSafeResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfigResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "CommissioningCompleteResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "Breadcrumb", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "BasicCommissioningInfo", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "BasicCommissioningInfo", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RegulatoryConfig", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "RegulatoryLocationType", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "LocationCapability", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "RegulatoryLocationType", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportsConcurrentConnection", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ScanNetworks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddOrUpdateWiFiNetwork", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddOrUpdateThreadNetwork", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveNetwork", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ConnectNetwork", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ReorderNetwork", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ScanNetworksResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "NetworkConfigResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ConnectNetworkResponse", - "code": 7, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "MaxNetworks", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Networks", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ScanMaxTimeSeconds", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ConnectMaxTimeSeconds", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "InterfaceEnabled", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "LastNetworkingStatus", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "NetworkCommissioningStatus", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "LastNetworkID", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "LastConnectErrorValue", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Diagnostic Logs", - "code": 50, - "mfgCode": null, - "define": "DIAGNOSTIC_LOGS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "RetrieveLogsRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "General Diagnostics", - "code": 51, - "mfgCode": null, - "define": "GENERAL_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "General Diagnostics", - "code": 51, - "mfgCode": null, - "define": "GENERAL_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "TestEventTrigger", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "NetworkInterfaces", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RebootCount", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UpTime", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "TotalOperationalHours", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "BootReason", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "BootReasonEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ActiveHardwareFaults", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ActiveRadioFaults", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ActiveNetworkFaults", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "TestEventTriggersEnabled", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "false", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetWatermarks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ThreadMetrics", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapFree", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapUsed", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapHighWatermark", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "Channel", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RoutingRole", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "RoutingRole", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NetworkName", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PanId", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ExtendedPanId", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "MeshLocalPrefix", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OverrunCount", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NeighborTable", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RouteTable", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartitionId", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Weighting", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DataVersion", - "code": 11, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "StableDataVersion", - "code": 12, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LeaderRouterId", - "code": 13, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DetachedRoleCount", - "code": 14, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChildRoleCount", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RouterRoleCount", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LeaderRoleCount", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "AttachAttemptCount", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartitionIdChangeCount", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "BetterPartitionAttachAttemptCount", - "code": 20, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ParentChangeCount", - "code": 21, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxTotalCount", - "code": 22, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxUnicastCount", - "code": 23, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBroadcastCount", - "code": 24, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxAckRequestedCount", - "code": 25, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxAckedCount", - "code": 26, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxNoAckRequestedCount", - "code": 27, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDataCount", - "code": 28, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDataPollCount", - "code": 29, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBeaconCount", - "code": 30, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBeaconRequestCount", - "code": 31, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxOtherCount", - "code": 32, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxRetryCount", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDirectMaxRetryExpiryCount", - "code": 34, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxIndirectMaxRetryExpiryCount", - "code": 35, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrCcaCount", - "code": 36, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrAbortCount", - "code": 37, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrBusyChannelCount", - "code": 38, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxTotalCount", - "code": 39, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxUnicastCount", - "code": 40, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBroadcastCount", - "code": 41, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDataCount", - "code": 42, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDataPollCount", - "code": 43, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBeaconCount", - "code": 44, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBeaconRequestCount", - "code": 45, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxOtherCount", - "code": 46, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxAddressFilteredCount", - "code": 47, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDestAddrFilteredCount", - "code": 48, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDuplicatedCount", - "code": 49, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrNoFrameCount", - "code": 50, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrUnknownNeighborCount", - "code": 51, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrInvalidSrcAddrCount", - "code": 52, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrSecCount", - "code": 53, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrFcsCount", - "code": 54, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrOtherCount", - "code": 55, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ActiveTimestamp", - "code": 56, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PendingTimestamp", - "code": 57, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Delay", - "code": 58, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SecurityPolicy", - "code": 59, - "mfgCode": null, - "side": "server", - "type": "SecurityPolicy", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChannelPage0Mask", - "code": 60, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OperationalDatasetComponents", - "code": 61, - "mfgCode": null, - "side": "server", - "type": "OperationalDatasetComponents", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ActiveNetworkFaultsList", - "code": 62, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000F", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "WiFi Network Diagnostics", - "code": 54, - "mfgCode": null, - "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "WiFi Network Diagnostics", - "code": 54, - "mfgCode": null, - "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "BSSID", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SecurityType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "SecurityTypeEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "WiFiVersion", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "WiFiVersionEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChannelNumber", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RSSI", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "BeaconLostCount", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "BeaconRxCount", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketMulticastRxCount", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketMulticastTxCount", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketUnicastRxCount", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketUnicastTxCount", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentMaxRate", - "code": 11, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OverrunCount", - "code": 12, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Ethernet Network Diagnostics", - "code": 55, - "mfgCode": null, - "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Ethernet Network Diagnostics", - "code": 55, - "mfgCode": null, - "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "PHYRate", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "PHYRateEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FullDuplex", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketRxCount", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PacketTxCount", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrCount", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CollisionCount", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OverrunCount", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CarrierDetect", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "TimeSinceReset", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Switch", - "code": 59, - "mfgCode": null, - "define": "SWITCH_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "Switch", - "code": 59, - "mfgCode": null, - "define": "SWITCH_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Administrator Commissioning", - "code": 60, - "mfgCode": null, - "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "OpenCommissioningWindow", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "OpenBasicCommissioningWindow", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RevokeCommissioning", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Administrator Commissioning", - "code": 60, - "mfgCode": null, - "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "WindowStatus", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "CommissioningWindowStatusEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AdminFabricIndex", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "fabric_idx", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AdminVendorId", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AttestationRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "CertificateChainRequest", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "CSRRequest", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddNOC", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UpdateNOC", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "UpdateFabricLabel", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveFabric", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddTrustedRootCertificate", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Operational Credentials", - "code": 62, - "mfgCode": null, - "define": "OPERATIONAL_CREDENTIALS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "AttestationResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "CertificateChainResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "CSRResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "NOCResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "NOCs", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Fabrics", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SupportedFabrics", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CommissionedFabrics", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TrustedRootCertificates", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentFabricIndex", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Group Key Management", - "code": 63, - "mfgCode": null, - "define": "GROUP_KEY_MANAGEMENT_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "KeySetWrite", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "KeySetRead", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "KeySetRemove", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "KeySetReadAllIndices", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ] - }, - { - "name": "Group Key Management", - "code": 63, - "mfgCode": null, - "define": "GROUP_KEY_MANAGEMENT_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "KeySetReadResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "KeySetReadAllIndicesResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "GroupKeyMap", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GroupTable", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxGroupsPerFabric", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxGroupKeysPerFabric", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "client", - "enabled": 0 - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - } - ] - }, - { - "name": "MA-dimmablelight", - "deviceTypeName": "MA-dimmablelight", - "deviceTypeCode": 257, - "deviceTypeProfileId": 259, - "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddGroup", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewGroup", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetGroupMembership", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveGroup", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllGroups", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddGroupIfIdentifying", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "AddGroupResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewGroupResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetGroupMembershipResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveGroupResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "NameSupport", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedAddScene", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedViewScene", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "CopyScene", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "AddSceneResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewSceneResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "SceneCount", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentScene", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentGroup", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "group_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SceneValid", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "OffWithEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "OnWithRecallGlobalScene", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "OnWithTimedOff", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "OnOff", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GlobalSceneControl", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OnTime", - "code": 16385, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OffWaitTime", - "code": 16386, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "StartUpOnOff", - "code": 16387, - "mfgCode": null, - "side": "server", - "type": "OnOffStartUpOnOff", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFF", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToLevel", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Move", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Step", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "Stop", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveToLevelWithOnOff", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveWithOnOff", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepWithOnOff", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StopWithOnOff", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "CurrentLevel", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RemainingTime", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "MinLevel", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxLevel", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFE", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentFrequency", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinFrequency", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxFrequency", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Options", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "LevelControlOptions", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OnOffTransitionTime", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OnLevel", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFF", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OnTransitionTime", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OffTransitionTime", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "DefaultMoveRate", - "code": 20, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "50", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "StartUpCurrentLevel", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "255", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "DeviceTypeList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ServerList", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClientList", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PartsList", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic Information", - "code": 40, - "mfgCode": null, - "define": "BASIC_INFORMATION_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic Information", - "code": 40, - "mfgCode": null, - "define": "BASIC_INFORMATION_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "DataModelRevision", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorName", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorID", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "vendor_id", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductName", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductID", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NodeLabel", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "NVM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Location", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "XX", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersion", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersionString", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "20210614123456ZZ", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "type": "long_char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LocalConfigDisabled", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "NVM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UniqueID", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "External", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CapabilityMinima", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "CapabilityMinimaStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToHue", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveHue", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepHue", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveToSaturation", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveSaturation", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepSaturation", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveToHueAndSaturation", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveToColor", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveColor", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepColor", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToColorTemperature", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveToHue", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveHue", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedStepHue", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveToHueAndSaturation", - "code": 67, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ColorLoopSet", - "code": 68, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StopMoveStep", - "code": 71, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveColorTemperature", - "code": 75, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepColorTemperature", - "code": 76, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "CurrentHue", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentSaturation", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RemainingTime", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentX", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x616B", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CurrentY", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x607D", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DriftCompensation", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CompensationText", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorTemperatureMireds", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00FA", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorMode", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Options", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NumberOfPrimaries", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Primary1X", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary1Y", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary1Intensity", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary2X", - "code": 21, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary2Y", - "code": 22, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary2Intensity", - "code": 23, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary3X", - "code": 25, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary3Y", - "code": 26, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary3Intensity", - "code": 27, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary4X", - "code": 32, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary4Y", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary4Intensity", - "code": 34, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary5X", - "code": 36, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary5Y", - "code": 37, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary5Intensity", - "code": 38, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary6X", - "code": 40, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary6Y", - "code": 41, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Primary6Intensity", - "code": 42, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WhitePointX", - "code": 48, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WhitePointY", - "code": 49, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointRX", - "code": 50, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointRY", - "code": 51, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointRIntensity", - "code": 52, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointGX", - "code": 54, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointGY", - "code": 55, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointGIntensity", - "code": 56, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointBX", - "code": 58, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointBY", - "code": 59, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ColorPointBIntensity", - "code": 60, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EnhancedCurrentHue", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "EnhancedColorMode", - "code": 16385, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorLoopActive", - "code": 16386, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorLoopDirection", - "code": 16387, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorLoopTime", - "code": 16388, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0019", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorLoopStartEnhancedHue", - "code": 16389, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x2300", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorLoopStoredEnhancedHue", - "code": 16390, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorCapabilities", - "code": 16394, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x1F", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorTempPhysicalMinMireds", - "code": 16395, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ColorTempPhysicalMaxMireds", - "code": 16396, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFEFF", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "CoupleColorTempToLevelMinMireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "StartUpColorTemperatureMireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x1F", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Occupancy Sensing", - "code": 1030, - "mfgCode": null, - "define": "OCCUPANCY_SENSING_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Occupancy Sensing", - "code": 1030, - "mfgCode": null, - "define": "OCCUPANCY_SENSING_CLUSTER", - "side": "server", - "enabled": 0, - "attributes": [ - { - "name": "Occupancy", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "OccupancyBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OccupancySensorType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "OccupancySensorTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OccupancySensorTypeBitmap", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "OccupancySensorTypeBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - } - ] - } - ], - "endpoints": [ - { - "endpointTypeName": "MA-rootdevice", - "endpointTypeIndex": 0, - "profileId": 259, - "endpointId": 0, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 22 - }, - { - "endpointTypeName": "MA-dimmablelight", - "endpointTypeIndex": 1, - "profileId": 259, - "endpointId": 1, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 257 - } - ], - "log": [] -} \ No newline at end of file diff --git a/examples/lighting-app/silabs/SiWx917/include/AppConfig.h b/examples/lighting-app/silabs/SiWx917/include/AppConfig.h deleted file mode 100644 index 5352f6742a8e76..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/AppConfig.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "silabs_utils.h" - -// ---- Lighting Example App Config ---- - -#define APP_TASK_NAME "Lit" - -#define BLE_DEV_NAME "SiLabs-Light" - -// Time it takes in ms for the simulated actuator to move from one -// state to another. -#define ACTUATOR_MOVEMENT_PERIOS_MS 10 diff --git a/examples/lighting-app/silabs/SiWx917/include/AppEvent.h b/examples/lighting-app/silabs/SiWx917/include/AppEvent.h deleted file mode 100644 index 7a19b719edad25..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/AppEvent.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2018 Nest Labs, Inc. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -struct AppEvent; -typedef void (*EventHandler)(AppEvent *); - -struct AppEvent -{ - enum AppEventTypes - { - kEventType_Button = 0, - kEventType_Timer, - kEventType_Light, - kEventType_Install, - }; - - uint16_t Type; - - union - { - struct - { - uint8_t Action; - } ButtonEvent; - struct - { - void * Context; - } TimerEvent; - struct - { - uint8_t Action; - int32_t Actor; - } LightEvent; - }; - - EventHandler Handler; -}; diff --git a/examples/lighting-app/silabs/SiWx917/include/AppTask.h b/examples/lighting-app/silabs/SiWx917/include/AppTask.h deleted file mode 100644 index b77a033773b53b..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/AppTask.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -/********************************************************** - * Includes - *********************************************************/ - -#include -#include - -#include "AppEvent.h" -#include "BaseApplication.h" -#include "FreeRTOS.h" -#include "LightingManager.h" -#include "timers.h" // provides FreeRTOS timer support -#include -#include -#include -#include - -/********************************************************** - * Defines - *********************************************************/ -// Button specific defines for SiWx917 -#define SL_SIMPLE_BUTTON_PRESSED 1 -#define SIWx917_BTN0 0 -#define SIWx917_BTN1 1 - -// Application-defined error codes in the CHIP_ERROR space. -#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) -#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) -#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) -#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) -#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) -#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) - -/********************************************************** - * AppTask Declaration - *********************************************************/ - -class AppTask : public BaseApplication -{ - -public: - AppTask() = default; - - static AppTask & GetAppTask() { return sAppTask; } - - /** - * @brief AppTask task main loop function - * - * @param pvParameter FreeRTOS task parameter - */ - static void AppTaskMain(void * pvParameter); - - CHIP_ERROR StartAppTask(); - - /** - * @brief Event handler when a button is pressed - * Function posts an event for button processing - * - * @param button - btn0 or btn1 - * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, - * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED - */ - static void ButtonEventHandler(uint8_t button, uint8_t btnAction); - - /** - * @brief Callback called by the identify-server when an identify command is received - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStart(Identify * identify); - - /** - * @brief Callback called by the identify-server when an identify command is stopped or finished - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStop(Identify * identify); - - void PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction); - -private: - static AppTask sAppTask; - - static void ActionInitiated(LightingManager::Action_t aAction, int32_t aActor); - static void ActionCompleted(LightingManager::Action_t aAction); - static void LightActionEventHandler(AppEvent * aEvent); - - static void UpdateClusterState(intptr_t context); - - /** - * @brief AppTask initialisation function - * - * @return CHIP_ERROR - */ - CHIP_ERROR Init(); - - /** - * @brief PB0 Button event processing function - * Press and hold will trigger a factory reset timer start - * Press and release will restart BLEAdvertising if not commisionned - * - * @param aEvent button event being processed - */ - static void ButtonHandler(AppEvent * aEvent); - - /** - * @brief PB1 Button event processing function - * Function triggers a switch action sent to the CHIP task - * - * @param aEvent button event being processed - */ - static void SwitchActionEventHandler(AppEvent * aEvent); -}; diff --git a/examples/lighting-app/silabs/SiWx917/include/CHIPProjectConfig.h b/examples/lighting-app/silabs/SiWx917/include/CHIPProjectConfig.h deleted file mode 100644 index 00df921596102a..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/CHIPProjectConfig.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Example project configuration file for CHIP. - * - * This is a place to put application or project-specific overrides - * to the default configuration values for general CHIP features. - * - */ - -#pragma once - -// Use a default pairing code if one hasn't been provisioned in flash. -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#endif - -// For convenience, Chip Security Test Mode can be enabled and the -// requirement for authentication in various protocols can be disabled. -// -// WARNING: These options make it possible to circumvent basic Chip security functionality, -// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. -// -#define CHIP_CONFIG_SECURITY_TEST_MODE 0 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID - * - * 0xFFF1: Test vendor - */ -#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID - * - * 0x8005: example lighting app - */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 - -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - -/** - * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER - * - * Enables the use of a hard-coded default serial number if none - * is found in Chip NV storage. - */ -#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS - * - * Enable recording UTC timestamps. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE - * - * A size, in bytes, of the individual debug event logging buffer. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) - -/** - * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL - * - * @brief - * Active retransmit interval, or time to wait before retransmission after - * subsequent failures in milliseconds. - * - * This is the default value, that might be adjusted by end device depending on its - * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. - * - */ -#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/silabs/SiWx917/include/DeviceConfig.h b/examples/lighting-app/silabs/SiWx917/include/DeviceConfig.h deleted file mode 100644 index 350fbb4a904351..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/DeviceConfig.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#ifdef SIWX917_USE_COMISSIONABLE_DATA - -uint32_t discriminatorValue = 3840; -uint64_t passcode = 20202021; -uint32_t spake2Interation = 1000; -char spake2Salt[] = "U1BBS0UyUCBLZXkgU2FsdA=="; -char spake2Verifier[] = "uWFwqugDNGiEck/po7KHwwMwwqZgN10XuyBajPGuyzUEV/iree4lOrao5GuwnlQ65CJzbeUB49s31EH+NEkg0JVI5MGCQGMMT/" - "SRPFNRODm3wH/MBiehuFc6FJ/NH6Rmzw=="; -char genSpake2Path[] = ""; -uint32_t productId = 32773; -uint32_t vendorId = 65521; -char productName[] = "silabs_product"; -char vendorName[] = "silabs_vendor"; -char hwVersionString[] = "1.0"; -uint32_t rotatingId; -uint32_t commissionableFlow = 1; -uint8_t rendezvousFlag = 2; - -#endif \ No newline at end of file diff --git a/examples/lighting-app/silabs/SiWx917/include/LightingManager.h b/examples/lighting-app/silabs/SiWx917/include/LightingManager.h deleted file mode 100644 index 6d286faa30ef96..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/include/LightingManager.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "AppEvent.h" - -#include "FreeRTOS.h" -#include "timers.h" // provides FreeRTOS timer support -#include - -#include - -class LightingManager -{ -public: - enum Action_t - { - ON_ACTION = 0, - OFF_ACTION, - - INVALID_ACTION - } Action; - - enum State_t - { - kState_OffInitiated = 0, - kState_OffCompleted, - kState_OnInitiated, - kState_OnCompleted, - } State; - - CHIP_ERROR Init(); - bool IsLightOn(); - void EnableAutoTurnOff(bool aOn); - void SetAutoTurnOffDuration(uint32_t aDurationInSecs); - bool IsActionInProgress(); - bool InitiateAction(int32_t aActor, Action_t aAction); - - typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); - typedef void (*Callback_fn_completed)(Action_t); - void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - - static void OnTriggerOffWithEffect(OnOffEffect * effect); - -private: - friend LightingManager & LightMgr(void); - State_t mState; - - Callback_fn_initiated mActionInitiated_CB; - Callback_fn_completed mActionCompleted_CB; - - bool mAutoTurnOff; - uint32_t mAutoTurnOffDuration; - bool mAutoTurnOffTimerArmed; - bool mOffEffectArmed; - - void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); - - static void TimerEventHandler(TimerHandle_t xTimer); - static void AutoTurnOffTimerEventHandler(AppEvent * aEvent); - static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - static void OffEffectTimerEventHandler(AppEvent * aEvent); - - static LightingManager sLight; -}; - -inline LightingManager & LightMgr(void) -{ - return LightingManager::sLight; -} diff --git a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp deleted file mode 100644 index d57caba69674f0..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AppTask.h" -#include "AppConfig.h" -#include "AppEvent.h" - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include - -#include - -#include "LEDWidget.h" -#define APP_ACTION_LED 1 - -using namespace chip; -using namespace ::chip::DeviceLayer; -using namespace ::chip::DeviceLayer::Silabs; - -namespace { - -LEDWidget sLightLED; - -EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - -/********************************************************** - * Identify Callbacks - *********************************************************/ - -namespace { -void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) -{ - ChipLogProgress(Zcl, "Trigger Identify Complete"); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StopStatusLEDTimer(); -#endif -} -} // namespace - -void OnTriggerIdentifyEffect(Identify * identify) -{ - sIdentifyEffect = identify->mCurrentEffectIdentifier; - - if (identify->mCurrentEffectIdentifier == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE) - { - ChipLogProgress(Zcl, "IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE - Not supported, use effect varriant %d", - identify->mEffectVariant); - sIdentifyEffect = static_cast(identify->mEffectVariant); - } - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StartStatusLEDTimer(); -#endif - - switch (sIdentifyEffect) - { - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(5), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_FINISH_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(1), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - break; - default: - ChipLogProgress(Zcl, "No identifier effect"); - } -} - -Identify gIdentify = { - chip::EndpointId{ 1 }, - AppTask::GetAppTask().OnIdentifyStart, - AppTask::GetAppTask().OnIdentifyStop, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, - OnTriggerIdentifyEffect, -}; - -} // namespace - -using namespace chip::TLV; -using namespace ::chip::DeviceLayer; - -AppTask AppTask::sAppTask; - -CHIP_ERROR AppTask::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); - -#ifdef DISPLAY_ENABLED - GetLCD().Init((uint8_t *) "Lighting-App"); -#endif - - err = BaseApplication::Init(&gIdentify); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("BaseApplication::Init() failed"); - appError(err); - } - - err = LightMgr().Init(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("LightMgr::Init() failed"); - appError(err); - } - - LightMgr().SetCallbacks(ActionInitiated, ActionCompleted); - - sLightLED.Init(APP_ACTION_LED); - sLightLED.Set(LightMgr().IsLightOn()); - - return err; -} - -CHIP_ERROR AppTask::StartAppTask() -{ - return BaseApplication::StartAppTask(AppTaskMain); -} - -void AppTask::AppTaskMain(void * pvParameter) -{ - AppEvent event; - QueueHandle_t sAppEventQueue = *(static_cast(pvParameter)); - - CHIP_ERROR err = sAppTask.Init(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("AppTask.Init() failed"); - appError(err); - } - -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) - sAppTask.StartStatusLEDTimer(); -#endif - - SILABS_LOG("App Task started"); - - while (true) - { - BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); - while (eventReceived == pdTRUE) - { - sAppTask.DispatchEvent(&event); - eventReceived = xQueueReceive(sAppEventQueue, &event, 0); - } - } -} - -void AppTask::OnIdentifyStart(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStart"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StartStatusLEDTimer(); -#endif -} - -void AppTask::OnIdentifyStop(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStop"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StopStatusLEDTimer(); -#endif -} - -void AppTask::LightActionEventHandler(AppEvent * aEvent) -{ - bool initiated = false; - LightingManager::Action_t action; - int32_t actor; - CHIP_ERROR err = CHIP_NO_ERROR; - - if (aEvent->Type == AppEvent::kEventType_Light) - { - action = static_cast(aEvent->LightEvent.Action); - actor = aEvent->LightEvent.Actor; - } - else if (aEvent->Type == AppEvent::kEventType_Button) - { - action = (LightMgr().IsLightOn()) ? LightingManager::OFF_ACTION : LightingManager::ON_ACTION; - actor = AppEvent::kEventType_Button; - } - else - { - err = APP_ERROR_UNHANDLED_EVENT; - } - - if (err == CHIP_NO_ERROR) - { - initiated = LightMgr().InitiateAction(actor, action); - - if (!initiated) - { - SILABS_LOG("Action is already in progress or active."); - } - } -} - -void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) -{ - AppEvent button_event = {}; - button_event.Type = AppEvent::kEventType_Button; - button_event.ButtonEvent.Action = btnAction; - if (button == SIWx917_BTN1 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - button_event.Handler = LightActionEventHandler; - sAppTask.PostEvent(&button_event); - } - else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - button_event.Handler = BaseApplication::ButtonHandler; - sAppTask.PostEvent(&button_event); - } -} - -void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) -{ - // Action initiated, update the light led - bool lightOn = aAction == LightingManager::ON_ACTION; - SILABS_LOG("Turning light %s", (lightOn) ? "On" : "Off"); - sLightLED.Set(lightOn); - -#ifdef DISPLAY_ENABLED - sAppTask.GetLCD().WriteDemoUI(lightOn); -#endif - - if (aActor == AppEvent::kEventType_Button) - { - sAppTask.mSyncClusterToButtonAction = true; - } -} - -void AppTask::ActionCompleted(LightingManager::Action_t aAction) -{ - // action has been completed bon the light - if (aAction == LightingManager::ON_ACTION) - { - SILABS_LOG("Light ON") - } - else if (aAction == LightingManager::OFF_ACTION) - { - SILABS_LOG("Light OFF") - } - - if (sAppTask.mSyncClusterToButtonAction) - { - chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast(nullptr)); - sAppTask.mSyncClusterToButtonAction = false; - } -} - -void AppTask::PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction) -{ - AppEvent event; - event.Type = AppEvent::kEventType_Light; - event.LightEvent.Actor = aActor; - event.LightEvent.Action = aAction; - event.Handler = LightActionEventHandler; - PostEvent(&event); -} - -void AppTask::UpdateClusterState(intptr_t context) -{ - uint8_t newValue = LightMgr().IsLightOn(); - - // write the new on/off value - EmberAfStatus status = OnOffServer::Instance().setOnOffValue(1, newValue, false); - - if (status != EMBER_ZCL_STATUS_SUCCESS) - { - SILABS_LOG("ERR: updating on/off %x", status); - } -} diff --git a/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp b/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp deleted file mode 100644 index 2c5807f4ea693e..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "LightingManager.h" - -#include "AppConfig.h" -#include "AppTask.h" -#include - -#include - -using namespace chip; -using namespace ::chip::app::Clusters::OnOff; -using namespace ::chip::DeviceLayer; - -LightingManager LightingManager::sLight; - -TimerHandle_t sLightTimer; - -namespace { - -/********************************************************** - * OffWithEffect Callbacks - *********************************************************/ - -OnOffEffect gEffect = { - chip::EndpointId{ 1 }, - LightMgr().OnTriggerOffWithEffect, - OnOffEffectIdentifier::kDelayedAllOff, - to_underlying(OnOffDelayedAllOffEffectVariant::kFadeToOffIn0p8Seconds), -}; - -} // namespace - -CHIP_ERROR LightingManager::Init() -{ - // Create FreeRTOS sw timer for light timer. - sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel - pdMS_TO_TICKS(1), // == default timer period - false, // no timer reload (==one-shot) - (void *) this, // init timer id = light obj context - TimerEventHandler // timer callback handler - ); - - if (sLightTimer == NULL) - { - SILABS_LOG("sLightTimer timer create failed"); - return APP_ERROR_CREATE_TIMER_FAILED; - } - - bool currentLedState; - // read current on/off value on endpoint one. - chip::DeviceLayer::PlatformMgr().LockChipStack(); - OnOffServer::Instance().getOnOffValue(1, ¤tLedState); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - - mState = currentLedState ? kState_OnCompleted : kState_OffCompleted; - mAutoTurnOffTimerArmed = false; - mAutoTurnOff = false; - mAutoTurnOffDuration = 0; - mOffEffectArmed = false; - - return CHIP_NO_ERROR; -} - -void LightingManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) -{ - mActionInitiated_CB = aActionInitiated_CB; - mActionCompleted_CB = aActionCompleted_CB; -} - -bool LightingManager::IsActionInProgress() -{ - return (mState == kState_OffInitiated || mState == kState_OnInitiated); -} - -bool LightingManager::IsLightOn() -{ - return (mState == kState_OnCompleted); -} - -void LightingManager::EnableAutoTurnOff(bool aOn) -{ - mAutoTurnOff = aOn; -} - -void LightingManager::SetAutoTurnOffDuration(uint32_t aDurationInSecs) -{ - mAutoTurnOffDuration = aDurationInSecs; -} - -bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction) -{ - bool action_initiated = false; - State_t new_state; - - // Initiate Turn On/Off Action only when the previous one is complete. - if (((mState == kState_OffCompleted) || mOffEffectArmed) && aAction == ON_ACTION) - { - action_initiated = true; - - new_state = kState_OnInitiated; - } - else if (mState == kState_OnCompleted && aAction == OFF_ACTION && mOffEffectArmed == false) - { - action_initiated = true; - - new_state = kState_OffInitiated; - } - - if (action_initiated) - { - if (mAutoTurnOffTimerArmed && new_state == kState_OffInitiated) - { - // If auto turn off timer has been armed and someone initiates turning off, - // cancel the timer and continue as normal. - mAutoTurnOffTimerArmed = false; - - CancelTimer(); - } - - if (mOffEffectArmed && new_state == kState_OnInitiated) - { - CancelTimer(); - mOffEffectArmed = false; - } - - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); - - // Since the timer started successfully, update the state and trigger callback - mState = new_state; - - if (mActionInitiated_CB) - { - mActionInitiated_CB(aAction, aActor); - } - } - - return action_initiated; -} - -void LightingManager::StartTimer(uint32_t aTimeoutMs) -{ - if (xTimerIsTimerActive(sLightTimer)) - { - SILABS_LOG("app timer already started!"); - CancelTimer(); - } - - // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ms if the change period command - // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sLightTimer, pdMS_TO_TICKS(aTimeoutMs), pdMS_TO_TICKS(100)) != pdPASS) - { - SILABS_LOG("sLightTimer timer start() failed"); - appError(APP_ERROR_START_TIMER_FAILED); - } -} - -void LightingManager::CancelTimer(void) -{ - if (xTimerStop(sLightTimer, pdMS_TO_TICKS(0)) == pdFAIL) - { - SILABS_LOG("sLightTimer stop() failed"); - appError(APP_ERROR_STOP_TIMER_FAILED); - } -} - -void LightingManager::TimerEventHandler(TimerHandle_t xTimer) -{ - // Get light obj context from timer id. - LightingManager * light = static_cast(pvTimerGetTimerID(xTimer)); - - // The timer event handler will be called in the context of the timer task - // once sLightTimer expires. Post an event to apptask queue with the actual handler - // so that the event can be handled in the context of the apptask. - AppEvent event; - event.Type = AppEvent::kEventType_Timer; - event.TimerEvent.Context = light; - if (light->mAutoTurnOffTimerArmed) - { - event.Handler = AutoTurnOffTimerEventHandler; - } - else if (light->mOffEffectArmed) - { - event.Handler = OffEffectTimerEventHandler; - } - else - { - event.Handler = ActuatorMovementTimerEventHandler; - } - AppTask::GetAppTask().PostEvent(&event); -} - -void LightingManager::AutoTurnOffTimerEventHandler(AppEvent * aEvent) -{ - LightingManager * light = static_cast(aEvent->TimerEvent.Context); - int32_t actor = AppEvent::kEventType_Timer; - - // Make sure auto turn off timer is still armed. - if (!light->mAutoTurnOffTimerArmed) - { - return; - } - - light->mAutoTurnOffTimerArmed = false; - - SILABS_LOG("Auto Turn Off has been triggered!"); - - light->InitiateAction(actor, OFF_ACTION); -} - -void LightingManager::OffEffectTimerEventHandler(AppEvent * aEvent) -{ - LightingManager * light = static_cast(aEvent->TimerEvent.Context); - int32_t actor = AppEvent::kEventType_Timer; - - // Make sure auto turn off timer is still armed. - if (!light->mOffEffectArmed) - { - return; - } - - light->mOffEffectArmed = false; - - SILABS_LOG("OffEffect completed"); - - light->InitiateAction(actor, OFF_ACTION); -} - -void LightingManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) -{ - Action_t actionCompleted = INVALID_ACTION; - - LightingManager * light = static_cast(aEvent->TimerEvent.Context); - - if (light->mState == kState_OffInitiated) - { - light->mState = kState_OffCompleted; - actionCompleted = OFF_ACTION; - } - else if (light->mState == kState_OnInitiated) - { - light->mState = kState_OnCompleted; - actionCompleted = ON_ACTION; - } - - if (actionCompleted != INVALID_ACTION) - { - if (light->mActionCompleted_CB) - { - light->mActionCompleted_CB(actionCompleted); - } - - if (light->mAutoTurnOff && actionCompleted == ON_ACTION) - { - // Start the timer for auto turn off - light->StartTimer(light->mAutoTurnOffDuration * 1000); - - light->mAutoTurnOffTimerArmed = true; - - SILABS_LOG("Auto Turn off enabled. Will be triggered in %u seconds", light->mAutoTurnOffDuration); - } - } -} - -void LightingManager::OnTriggerOffWithEffect(OnOffEffect * effect) -{ - auto effectId = effect->mEffectIdentifier; - auto effectVariant = effect->mEffectVariant; - uint32_t offEffectDuration = 0; - - // Temporary print outs and delay to test OffEffect behaviour - // Until dimming is supported for dev boards. - if (effectId == OnOffEffectIdentifier::kDelayedAllOff) - { - auto typedEffectVariant = static_cast(effectVariant); - if (typedEffectVariant == OnOffDelayedAllOffEffectVariant::kFadeToOffIn0p8Seconds) - { - offEffectDuration = 800; - ChipLogProgress(Zcl, "OnOffDelayedAllOffEffectVariant::kFadeToOffIn0p8Seconds"); - } - else if (typedEffectVariant == OnOffDelayedAllOffEffectVariant::kNoFade) - { - offEffectDuration = 800; - ChipLogProgress(Zcl, "OnOffDelayedAllOffEffectVariant::kNoFade"); - } - else if (typedEffectVariant == OnOffDelayedAllOffEffectVariant::k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds) - { - offEffectDuration = 12800; - ChipLogProgress(Zcl, "OnOffDelayedAllOffEffectVariant::k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds"); - } - } - else if (effectId == OnOffEffectIdentifier::kDyingLight) - { - auto typedEffectVariant = static_cast(effectVariant); - if (typedEffectVariant == OnOffDyingLightEffectVariant::k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second) - { - offEffectDuration = 1500; - ChipLogProgress(Zcl, "OnOffDyingLightEffectVariant::k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second"); - } - } - - LightMgr().mOffEffectArmed = true; - LightMgr().StartTimer(offEffectDuration); -} diff --git a/examples/lighting-app/silabs/SiWx917/src/ZclCallbacks.cpp b/examples/lighting-app/silabs/SiWx917/src/ZclCallbacks.cpp deleted file mode 100644 index cfbcbc8a191411..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/src/ZclCallbacks.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * 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. - */ - -/** - * @file - * This file implements the handler for data model messages. - */ - -#include "AppConfig.h" -#include "LightingManager.h" - -#include -#include -#include -#include - -using namespace ::chip; -using namespace ::chip::app::Clusters; - -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, - uint8_t * value) -{ - ClusterId clusterId = attributePath.mClusterId; - AttributeId attributeId = attributePath.mAttributeId; - ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - - if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) - { - LightMgr().InitiateAction(AppEvent::kEventType_Light, *value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION); - } - else if (clusterId == LevelControl::Id) - { - ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == ColorControl::Id) - { - ChipLogProgress(Zcl, "Color Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) - { - ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - } -} - -/** @brief OnOff Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - * TODO Issue #3841 - * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster - * attributes to the default value. - * The logic here expects something similar to the deprecated Plugins callback - * emberAfPluginOnOffClusterServerPostInitCallback. - * - */ -void emberAfOnOffClusterInitCallback(EndpointId endpoint) -{ - // TODO: implement any additional Cluster Server init actions -} diff --git a/examples/lighting-app/silabs/SiWx917/third_party/connectedhomeip b/examples/lighting-app/silabs/SiWx917/third_party/connectedhomeip deleted file mode 120000 index 59307833b4fee9..00000000000000 --- a/examples/lighting-app/silabs/SiWx917/third_party/connectedhomeip +++ /dev/null @@ -1 +0,0 @@ -../../../../.. \ No newline at end of file diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter index 2bf7df26909899..1807e3174d5ca9 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -763,7 +763,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1020,7 +1020,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1076,7 +1076,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1479,7 +1479,7 @@ server cluster UserLabel = 65 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap ICDManagementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kCheckInProtocolSupport = 0x1; } @@ -1580,14 +1580,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1595,6 +1587,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter index aacd7361c3fe2c..5678a95a50c440 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -763,7 +763,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1020,7 +1020,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1084,7 +1084,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1443,14 +1443,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -1458,6 +1450,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int8u currentHue = 0; readonly attribute int8u currentSaturation = 1; readonly attribute int16u remainingTime = 2; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 6711806aa657cf..5fd26c2a019a9b 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -74,12 +74,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -671,7 +671,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -814,7 +814,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1071,7 +1071,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1127,7 +1127,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1298,7 +1298,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1354,7 +1354,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1961,7 +1961,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index a68dac1f00fab9..ea66c465e17a39 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -320,7 +320,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -527,7 +527,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -583,7 +583,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1264,7 +1264,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/lock-app/openiotsdk/CMakeLists.txt b/examples/lock-app/openiotsdk/CMakeLists.txt index 289ecbc893fc54..492e5cb3b1f971 100644 --- a/examples/lock-app/openiotsdk/CMakeLists.txt +++ b/examples/lock-app/openiotsdk/CMakeLists.txt @@ -29,7 +29,6 @@ set(APP_TARGET chip-openiotsdk-lock-app-example_ns) set(TFM_SUPPORT YES) set(TFM_PROJECT_CONFIG_HEADER_FILE "${CMAKE_CURRENT_SOURCE_DIR}/tf-m-config/TfmProjectConfig.h") set(TFM_NS_APP_VERSION "0.0.1") -set(CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS YES) # Toolchain files need to exist before first call to project include(toolchain) diff --git a/examples/lock-app/openiotsdk/README.md b/examples/lock-app/openiotsdk/README.md index 4ff38ecc3a1445..69e569b9be2888 100644 --- a/examples/lock-app/openiotsdk/README.md +++ b/examples/lock-app/openiotsdk/README.md @@ -6,18 +6,17 @@ device with one basic bolt. The example behaves as a Matter accessory, device that can be paired into an existing Matter network and can be controlled by it. -## Build and run +## Build-run-test-debug -For information on how to build and run this example and further information -about the platform it is run on see -[Open IoT SDK examples](../../../docs/examples/openiotsdk_examples.md). +For information on how to build, run, test and debug this example and further +information about the platform it is run on see +[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). The example name to use in the scripts is `lock-app`. -## Using the example +## Example output -Communication with the application goes through the active telnet session. When -the application runs these lines should be visible: +When the example runs, these lines should be visible: ``` [INF] [-] Open IoT SDK lock-app example application start @@ -25,8 +24,8 @@ the application runs these lines should be visible: [INF] [-] Open IoT SDK lock-app example application run ``` -The lock-app application launched correctly and you can follow traces in the -terminal. +This means the lock-app application launched correctly and you can follow traces +in the terminal. ### Commissioning @@ -44,11 +43,16 @@ you used to perform the commissioning step above. Example command: ``` -zcl DoorLock LockDoor 1234 1 pinCode=str:12345 +chip-tool doorlock lock-door 123 1 --timedInteractionTimeoutMs 100 ``` In response the device will output this line to the terminal: ``` -[INF] [ZC] Lock App: specified PIN code was found in the database, setting door lock state to "Locked" [endpointId=1] +[INF] [ZCL] Door Lock App: setting door lock state to "Locked" [endpointId=1] ``` + +**NOTE** + +More details about the `chip-tool` controller can be found +[here](../../chip-tool/README.md). diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 9bad58cf0a9894..be43704a7ffebb 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -541,7 +541,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -798,7 +798,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -854,7 +854,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1573,7 +1573,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/lock-app/silabs/SiWx917/.gn b/examples/lock-app/silabs/SiWx917/.gn deleted file mode 100644 index 0adefc6ff99c6a..00000000000000 --- a/examples/lock-app/silabs/SiWx917/.gn +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") - -# The location of the build configuration file. -buildconfig = "${build_root}/config/BUILDCONFIG.gn" - -# CHIP uses angle bracket includes. -check_system_includes = true - -default_args = { - target_cpu = "arm" - target_os = "freertos" - import("//args.gni") -} diff --git a/examples/lock-app/silabs/SiWx917/BUILD.gn b/examples/lock-app/silabs/SiWx917/BUILD.gn deleted file mode 100644 index 8c531d0ee62608..00000000000000 --- a/examples/lock-app/silabs/SiWx917/BUILD.gn +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/SiWx917_sdk.gni") -import("${efr32_sdk_build_root}/silabs_executable.gni") - -import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") -import("${chip_root}/src/platform/device.gni") - -if (chip_enable_pw_rpc) { - import("//build_overrides/pigweed.gni") - import("$dir_pw_build/target_types.gni") -} - -assert(current_os == "freertos") - -efr32_project_dir = "${chip_root}/examples/lock-app/silabs/SiWx917" -examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" -examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -import("${examples_plat_dir}/args.gni") - -declare_args() { - # Dump memory usage at link time. - chip_print_memory_usage = false -} - -siwx917_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] - - include_dirs = [ - "${chip_root}/src/platform/silabs/SiWx917", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] - - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", - ] - } -} - -silabs_executable("lock_app") { - output_name = "chip-siwx917-lock-example.out" - include_dirs = [ "include" ] - defines = [] - - sources = [ - "${examples_common_plat_dir}/main.cpp", - "src/AppTask.cpp", - "src/LockManager.cpp", - "src/ZclCallbacks.cpp", - ] - - if (chip_build_libshell) { - sources += [ "src/EventHandlerLibShell.cpp" ] - } - - deps = [ - ":sdk", - "${examples_plat_dir}:siwx917-common", - app_data_model, - ] - - if (chip_enable_pw_rpc) { - defines += [ - "PW_RPC_ENABLED", - "PW_RPC_ATTRIBUTE_SERVICE=1", - "PW_RPC_BUTTON_SERVICE=1", - "PW_RPC_DESCRIPTOR_SERVICE=1", - "PW_RPC_DEVICE_SERVICE=1", - "PW_RPC_LOCKING_SERVICE=1", - "PW_RPC_OTCLI_SERVICE=1", - "PW_RPC_THREAD_SERVICE=1", - ] - - sources += [ - "${chip_root}/examples/common/pigweed/RpcService.cpp", - "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", - "${examples_common_plat_dir}/PigweedLogger.cpp", - "${examples_common_plat_dir}/Rpc.cpp", - ] - - deps += [ - "$dir_pw_hdlc:rpc_channel_output", - "$dir_pw_stream:sys_io_stream", - "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", - "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:locking_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917", - ] - - deps += pw_build_LINK_DEPS - - include_dirs += [ - "${chip_root}/examples/common", - "${chip_root}/examples/common/pigweed/efr32", - ] - } - - ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld" - - inputs = [ ldscript ] - - ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] - - if (chip_print_memory_usage) { - ldflags += [ - "-Wl,--print-memory-usage", - "-fstack-usage", - ] - } - - # WiFi Settings - if (chip_enable_wifi) { - ldflags += [ - "-Wl,--defsym", - "-Wl,SILABS_WIFI=1", - ] - } - - output_dir = root_out_dir -} - -group("siwx917") { - deps = [ ":lock_app" ] -} - -group("default") { - deps = [ ":siwx917" ] -} diff --git a/examples/lock-app/silabs/SiWx917/README.md b/examples/lock-app/silabs/SiWx917/README.md deleted file mode 100644 index 9f4c9f6a42005f..00000000000000 --- a/examples/lock-app/silabs/SiWx917/README.md +++ /dev/null @@ -1,223 +0,0 @@ -# Matter SiWx917 Lock Example - -An example showing the use of CHIP on the Silicon Labs SiWx917 SoC device. - -
- -- [Matter SiWx917 Lock Example](#matter-siwx917-lock-example) - - [Introduction](#introduction) - - [Building](#building) - - [Flashing the Application](#flashing-the-application) - - [Viewing Logging Output](#viewing-logging-output) - - [Running the Complete Example](#running-the-complete-example) - - [Notes](#notes) - - [Memory settings](#memory-settings) - - [Building options](#building-options) - - [Disabling logging](#disabling-logging) - - [Debug build / release build](#debug-build--release-build) - - [Disabling LCD](#disabling-lcd) - - [KVS maximum entry count](#kvs-maximum-entry-count) - -
- -> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with -> frequent releases thoroughly tested and validated. Developers looking to -> develop matter products with silabs hardware are encouraged to use our latest -> release with added tools and documentation. -> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) - -## Introduction - -The SiWx917 Lock example provides a baseline demonstration of a door lock -control device, built using Matter, the Silicon Labs Gecko SDK, and the Silicon -Labs WiseMCU SDK. It can be controlled by a Chip controller over a Wi-Fi -network. - -The SiWx917 device can be commissioned over Bluetooth Low Energy where the -device and the Chip controller will exchange security information with the -Rendez-vous procedure. Wi-Fi Network SSID and passcode are then provided to the -SiWx917 device which will then join the Wi-Fi network. - -If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the -needed commissioning information for the BLE connection and starting the -rendezvous procedure. - -The lock example is intended to serve both as a means to explore the workings of -Matter as well as a template for creating real products based on the Silicon -Labs platform. - -## Building - -- Download the - [Simplicity Commander](https://www.silabs.com/mcu/programming-options) - command line tool, and ensure that `commander` is your shell search path. - (For Mac OS X, `commander` is located inside - `Commander.app/Contents/MacOS/`.) - -- Download and install a suitable ARM gcc tool chain: - [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) - -- Install some additional tools(likely already present for CHIP developers): - -Linux - - sudo apt-get install git ninja-build - -Mac OS X - - brew install ninja - -- Supported hardware: - - - > For the latest supported hardware please refer to the - > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) - > in the Silicon Labs Matter Github Repo - -* Build the example application: - - ``` - cd ~/connectedhomeip - ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/silabs/SiWx917/ ./out/lock_app BRD4325B - ``` - -- To delete generated executable, libraries and object files use: - - ``` - $ cd ~/connectedhomeip - $ rm -rf ./out/ - ``` - - - -## Flashing the Application - -- Flashing requires the SiWx917 SoC device to be configured in the Ozone - Debugger. -- Once it's configured, it can be run with the Ozone Debugger by loading the - .out file. - - > For detailed instructions, please refer to - > [Running the Matter Demo on SiWx917 SoC](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/wifi/RUN_DEMO_SiWx917_SoC.md) - > in the Silicon Labs Matter Github Repo - -## Viewing Logging Output - -The example application's logging output can be viewed in the Ozone Debugger. - -## Running the Complete Example - -- You can provision and control the Chip device using the chip-tool standalone - - [chip-tool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) - -Here are some chip-tool examples: - - Pairing with chip-tool: - ``` - chip-tool pairing ble-wifi 1122 $SSID $PSK 20202021 3840 - ``` - - > $SSID and $PSK are the SSID and passcode of your Wi-Fi Access Point. - - Set a user: - ``` - ./out/chip-tool doorlock set-user OperationType UserIndex UserName UserUniqueId UserStatus UserType CredentialRule node-id/group-id - ./out/chip-tool doorlock set-user 0 1 "mike" 5 1 0 0 1 1 --timedInteractionTimeoutMs 1000 - ``` - - Set a credential: - ``` - ./out/chip-tool doorlock set-credential OperationType Credential CredentialData UserIndex UserStatus UserType node-id/group-id - ./out/chip-tool doorlock set-credential 0 '{ "credentialType": 1, "credentialIndex": 1 }' "123456" 1 null null 1 1 --timedInteractionTimeoutMs 1000 - ``` - - Changing a credential: - ``` - ./out/chip-tool doorlock set-credential OperationType Credential CredentialData UserIndex UserStatus UserType node-id/group-id - ./out/chip-tool doorlock set-credential 2 '{ "credentialType": 1, "credentialIndex": 1 }' "123457" 1 null null 1 1 --timedInteractionTimeoutMs 1000 - ``` - - Get a user: - ``` - ./out/chip-tool doorlock get-user UserIndex node-id/group-id - ./out/chip-tool doorlock get-user 1 1 1 - ``` - - Unlock door: - ``` - ./out/chip-tool doorlock unlock-door node-id/group-id - ./out/chip-tool doorlock unlock-door 1 1 - ``` - - Lock door: - ``` - ./out/chip-tool doorlock lock-door node-id/group-id - ./out/chip-tool doorlock lock-door 1 1 - ``` - -### Notes - -- Depending on your network settings your router might not provide native IPv6 - addresses to your devices (Router / PC). If this is the case, you need to - add a static IPv6 addresses on both devices and then an IPv6 route to the - router on your PC - -#On PC(Linux): \$ sudo ip addr add dev 2002::1/64 - -#Add IPv6 route on PC(Linux) \$ sudo ip route add /64 -via 2002::2 - -## Memory settings - -While most of the RAM usage in CHIP is static, allowing easier debugging and -optimization with symbols analysis, we still need some HEAP for the crypto and -Wi-Fi stack. Size of the HEAP can be modified by changing the value of the -`configTOTAL_HEAP_SIZE` define inside of the FreeRTOSConfig.h file of this -example. Please take note that a HEAP size smaller than 13k can and will cause -an Mbedtls failure during the BLE rendezvous or CASE session - -To track memory usage you can set `enable_heap_monitoring = true` either in the -BUILD.gn file or pass it as a build argument to gn. This will print on the RTT -console the RAM usage of each individual task and the number of Memory -allocation and Free. While this is not extensive monitoring you're welcome to -modify `examples/platform/silabs/SiWx917/MemMonitoring.cpp` to add your own -memory tracking code inside the `trackAlloc` and `trackFree` function - -## Building options - -All of Silabs's examples within the Matter repo have all the features enabled by -default, as to provide the best end user experience. However some of those -features can easily be toggled on or off. Here is a short list of options : - -### Disabling logging - -`chip_progress_logging, chip_detail_logging, chip_automation_logging` - - ``` - $ ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/silabs/SiWx917 ./out/lock-app BRD4325B "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" - ``` - -### Debug build / release build - -`is_debug` - - ``` - $ ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/silabs/SiWx917 ./out/lock-app BRD4325B "is_debug=false" - ``` - -### Disabling LCD - -`show_qr_code` - - ``` - $ ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/silabs/SiWx917 ./out/lock-app BRD4325B "show_qr_code=false" - ``` - -### KVS maximum entry count - -`kvs_max_entries` - - ``` - Set the maximum Kvs entries that can be stored in NVM (Default 75) - Thresholds: 30 <= kvs_max_entries <= 255 - - $ ./scripts/examples/gn_efr32_example.sh ./examples/lock-app/silabs/SiWx917 ./out/lock-app BRD4325B kvs_max_entries=50 - ``` diff --git a/examples/lock-app/silabs/SiWx917/args.gni b/examples/lock-app/silabs/SiWx917/args.gni deleted file mode 100644 index e4bfe4d5dc7811..00000000000000 --- a/examples/lock-app/silabs/SiWx917/args.gni +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/args.gni") - -silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") - -app_data_model = "${chip_root}/examples/lock-app/lock-common" -chip_enable_ota_requestor = true diff --git a/examples/lock-app/silabs/SiWx917/build_overrides b/examples/lock-app/silabs/SiWx917/build_overrides deleted file mode 120000 index 995884e6163eb5..00000000000000 --- a/examples/lock-app/silabs/SiWx917/build_overrides +++ /dev/null @@ -1 +0,0 @@ -../../../build_overrides \ No newline at end of file diff --git a/examples/lock-app/silabs/SiWx917/include/AppConfig.h b/examples/lock-app/silabs/SiWx917/include/AppConfig.h deleted file mode 100644 index 62cff5df0aa336..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/AppConfig.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "silabs_utils.h" - -// ---- Door lock Example App Config ---- - -#define APP_TASK_NAME "Lock" - -#define BLE_DEV_NAME "SiLabs-Door-Lock" - -// Time it takes in ms for the simulated actuator to move from one -// state to another. -#define ACTUATOR_MOVEMENT_PERIOS_MS 10 diff --git a/examples/lock-app/silabs/SiWx917/include/AppEvent.h b/examples/lock-app/silabs/SiWx917/include/AppEvent.h deleted file mode 100644 index 7724687d3ef96c..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/AppEvent.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2018 Nest Labs, Inc. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -struct AppEvent; -typedef void (*EventHandler)(AppEvent *); - -struct AppEvent -{ - enum AppEventTypes - { - kEventType_Button = 0, - kEventType_Timer, - kEventType_Lock, - kEventType_Install, - }; - - uint16_t Type; - - union - { - struct - { - uint8_t Action; - } ButtonEvent; - struct - { - void * Context; - } TimerEvent; - struct - { - uint8_t Action; - int32_t Actor; - } LockEvent; - }; - - EventHandler Handler; -}; diff --git a/examples/lock-app/silabs/SiWx917/include/AppTask.h b/examples/lock-app/silabs/SiWx917/include/AppTask.h deleted file mode 100644 index 9ad4a2cd134773..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/AppTask.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -/********************************************************** - * Includes - *********************************************************/ - -#include -#include - -#include "AppEvent.h" -#include "BaseApplication.h" -#include "FreeRTOS.h" -#include "LockManager.h" -#include "timers.h" // provides FreeRTOS timer support -#include -#include -#include -#include - -/********************************************************** - * Defines - *********************************************************/ -// Button specific defines for SiWx917 -#define SL_SIMPLE_BUTTON_PRESSED 1 -#define SIWx917_BTN0 0 -#define SIWx917_BTN1 1 - -// Application-defined error codes in the CHIP_ERROR space. -#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) -#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) -#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) -#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) -#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) -#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) -#define APP_ERROR_ALLOCATION_FAILED CHIP_APPLICATION_ERROR(0x07) -#if defined(ENABLE_CHIP_SHELL) -#define APP_ERROR_TOO_MANY_SHELL_ARGUMENTS CHIP_APPLICATION_ERROR(0x08) -#endif // ENABLE_CHIP_SHELL - -/********************************************************** - * AppTask Declaration - *********************************************************/ - -class AppTask : public BaseApplication -{ - -public: - AppTask() = default; - - static AppTask & GetAppTask() { return sAppTask; } - - /** - * @brief AppTask task main loop function - * - * @param pvParameter FreeRTOS task parameter - */ - static void AppTaskMain(void * pvParameter); - - CHIP_ERROR StartAppTask(); - - void ActionRequest(int32_t aActor, LockManager::Action_t aAction); - static void ActionInitiated(LockManager::Action_t aAction, int32_t aActor); - static void ActionCompleted(LockManager::Action_t aAction); - - /** - * @brief Event handler when a button is pressed - * Function posts an event for button processing - * - * @param buttonHandle APP_LIGHT_SWITCH or APP_FUNCTION_BUTTON - * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, - * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED - */ - void ButtonEventHandler(uint8_t button, uint8_t btnAction); - - /** - * @brief Callback called by the identify-server when an identify command is received - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStart(Identify * identify); - - /** - * @brief Callback called by the identify-server when an identify command is stopped or finished - * - * @param identify identify structure the command applies on - */ - static void OnIdentifyStop(Identify * identify); - -private: - static AppTask sAppTask; - - /** - * @brief AppTask initialisation function - * - * @return CHIP_ERROR - */ - CHIP_ERROR Init(); - - /** - * @brief PB0 Button event processing function - * Press and hold will trigger a factory reset timer start - * Press and release will restart BLEAdvertising if not commisionned - * - * @param aEvent button event being processed - */ - static void ButtonHandler(AppEvent * aEvent); - - /** - * @brief PB1 Button event processing function - * Function triggers a switch action sent to the CHIP task - * - * @param aEvent button event being processed - */ - static void SwitchActionEventHandler(AppEvent * aEvent); - - /** - * @brief Update Cluster State - * - * @param context current context - */ - static void UpdateClusterState(intptr_t context); - - /** - * @brief Handle lock update event - * - * @param aEvent event received - */ - static void LockActionEventHandler(AppEvent * aEvent); -}; diff --git a/examples/lock-app/silabs/SiWx917/include/CHIPProjectConfig.h b/examples/lock-app/silabs/SiWx917/include/CHIPProjectConfig.h deleted file mode 100644 index 1cfb6e7b0ac82c..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/CHIPProjectConfig.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Example project configuration file for CHIP. - * - * This is a place to put application or project-specific overrides - * to the default configuration values for general CHIP features. - * - */ - -#pragma once - -// Use a default pairing code if one hasn't been provisioned in flash. -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#endif - -// For convenience, Chip Security Test Mode can be enabled and the -// requirement for authentication in various protocols can be disabled. -// -// WARNING: These options make it possible to circumvent basic Chip security functionality, -// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. -// -#define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID - * - * 0xFFF1: Test vendor - */ -#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 - -/** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID - * - * 0x8006: example lock app - */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006 - -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - -/** - * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER - * - * Enables the use of a hard-coded default serial number if none - * is found in Chip NV storage. - */ -#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS - * - * Enable recording UTC timestamps. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - -/** - * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE - * - * A size, in bytes, of the individual debug event logging buffer. - */ -#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) - -/** - * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL - * - * @brief - * Active retransmit interval, or time to wait before retransmission after - * subsequent failures in milliseconds. - * - * This is the default value, that might be adjusted by end device depending on its - * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. - * - */ -#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/lock-app/silabs/SiWx917/include/DeviceConfig.h b/examples/lock-app/silabs/SiWx917/include/DeviceConfig.h deleted file mode 100644 index 350fbb4a904351..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/DeviceConfig.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#ifdef SIWX917_USE_COMISSIONABLE_DATA - -uint32_t discriminatorValue = 3840; -uint64_t passcode = 20202021; -uint32_t spake2Interation = 1000; -char spake2Salt[] = "U1BBS0UyUCBLZXkgU2FsdA=="; -char spake2Verifier[] = "uWFwqugDNGiEck/po7KHwwMwwqZgN10XuyBajPGuyzUEV/iree4lOrao5GuwnlQ65CJzbeUB49s31EH+NEkg0JVI5MGCQGMMT/" - "SRPFNRODm3wH/MBiehuFc6FJ/NH6Rmzw=="; -char genSpake2Path[] = ""; -uint32_t productId = 32773; -uint32_t vendorId = 65521; -char productName[] = "silabs_product"; -char vendorName[] = "silabs_vendor"; -char hwVersionString[] = "1.0"; -uint32_t rotatingId; -uint32_t commissionableFlow = 1; -uint8_t rendezvousFlag = 2; - -#endif \ No newline at end of file diff --git a/examples/lock-app/silabs/SiWx917/include/EventHandlerLibShell.h b/examples/lock-app/silabs/SiWx917/include/EventHandlerLibShell.h deleted file mode 100644 index e915e472750da4..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/EventHandlerLibShell.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * 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. - */ -#pragma once - -#include - -class EventData -{ -public: - chip::EventId eventId; -}; - -class AlarmEventData : public EventData -{ -public: - AlarmCodeEnum alarmCode; -}; - -class DoorStateEventData : public EventData -{ -public: - DoorStateEnum doorState; -}; - -CHIP_ERROR RegisterLockEvents(); -void EventWorkerFunction(intptr_t context); diff --git a/examples/lock-app/silabs/SiWx917/include/LockManager.h b/examples/lock-app/silabs/SiWx917/include/LockManager.h deleted file mode 100644 index c149ffdd34b727..00000000000000 --- a/examples/lock-app/silabs/SiWx917/include/LockManager.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include - -#include -#include - -#include "AppEvent.h" - -#include "FreeRTOS.h" -#include "timers.h" // provides FreeRTOS timer support - -#include - -struct WeekDaysScheduleInfo -{ - DlScheduleStatus status; - EmberAfPluginDoorLockWeekDaySchedule schedule; -}; - -struct YearDayScheduleInfo -{ - DlScheduleStatus status; - EmberAfPluginDoorLockYearDaySchedule schedule; -}; - -struct HolidayScheduleInfo -{ - DlScheduleStatus status; - EmberAfPluginDoorLockHolidaySchedule schedule; -}; - -namespace SI917DoorLock { -namespace ResourceRanges { -// Used to size arrays -static constexpr uint16_t kMaxUsers = 10; -static constexpr uint8_t kMaxCredentialsPerUser = 10; -static constexpr uint8_t kMaxWeekdaySchedulesPerUser = 10; -static constexpr uint8_t kMaxYeardaySchedulesPerUser = 10; -static constexpr uint8_t kMaxHolidaySchedules = 10; -static constexpr uint8_t kMaxCredentialSize = 20; -static constexpr uint8_t kNumCredentialTypes = 6; - -static constexpr uint8_t kMaxCredentials = kMaxUsers * kMaxCredentialsPerUser; - -} // namespace ResourceRanges - -namespace LockInitParams { - -struct LockParam -{ - // Read from zap attributes - uint16_t numberOfUsers = 0; - uint8_t numberOfCredentialsPerUser = 0; - uint8_t numberOfWeekdaySchedulesPerUser = 0; - uint8_t numberOfYeardaySchedulesPerUser = 0; - uint8_t numberOfHolidaySchedules = 0; -}; - -class ParamBuilder -{ -public: - ParamBuilder & SetNumberOfUsers(uint16_t numberOfUsers) - { - lockParam_.numberOfUsers = numberOfUsers; - return *this; - } - ParamBuilder & SetNumberOfCredentialsPerUser(uint8_t numberOfCredentialsPerUser) - { - lockParam_.numberOfCredentialsPerUser = numberOfCredentialsPerUser; - return *this; - } - ParamBuilder & SetNumberOfWeekdaySchedulesPerUser(uint8_t numberOfWeekdaySchedulesPerUser) - { - lockParam_.numberOfWeekdaySchedulesPerUser = numberOfWeekdaySchedulesPerUser; - return *this; - } - ParamBuilder & SetNumberOfYeardaySchedulesPerUser(uint8_t numberOfYeardaySchedulesPerUser) - { - lockParam_.numberOfYeardaySchedulesPerUser = numberOfYeardaySchedulesPerUser; - return *this; - } - ParamBuilder & SetNumberOfHolidaySchedules(uint8_t numberOfHolidaySchedules) - { - lockParam_.numberOfHolidaySchedules = numberOfHolidaySchedules; - return *this; - } - LockParam GetLockParam() { return lockParam_; } - -private: - LockParam lockParam_; -}; - -} // namespace LockInitParams -} // namespace SI917DoorLock - -using namespace ::chip; -using namespace SI917DoorLock::ResourceRanges; - -class LockManager -{ -public: - enum Action_t - { - LOCK_ACTION = 0, - UNLOCK_ACTION, - - INVALID_ACTION - } Action; - - enum State_t - { - kState_LockInitiated = 0, - kState_LockCompleted, - kState_UnlockInitiated, - kState_UnlockCompleted, - } State; - - CHIP_ERROR Init(chip::app::DataModel::Nullable state, - SI917DoorLock::LockInitParams::LockParam lockParam); - bool NextState(); - bool IsActionInProgress(); - bool InitiateAction(int32_t aActor, Action_t aAction); - - typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); - typedef void (*Callback_fn_completed)(Action_t); - void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - - bool Lock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err); - bool Unlock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err); - - bool GetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user); - bool SetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, - const chip::CharSpan & userName, uint32_t uniqueId, UserStatusEnum userStatus, UserTypeEnum usertype, - CredentialRuleEnum credentialRule, const CredentialStruct * credentials, size_t totalCredentials); - - bool GetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, CredentialTypeEnum credentialType, - EmberAfPluginDoorLockCredentialInfo & credential); - - bool SetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, chip::FabricIndex modifier, - DlCredentialStatus credentialStatus, CredentialTypeEnum credentialType, - const chip::ByteSpan & credentialData); - - DlStatus GetWeekdaySchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, - EmberAfPluginDoorLockWeekDaySchedule & schedule); - - DlStatus SetWeekdaySchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, DlScheduleStatus status, - DaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute); - - DlStatus GetYeardaySchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, - EmberAfPluginDoorLockYearDaySchedule & schedule); - - DlStatus SetYeardaySchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime); - - DlStatus GetHolidaySchedule(chip::EndpointId endpointId, uint8_t holidayIndex, EmberAfPluginDoorLockHolidaySchedule & schedule); - - DlStatus SetHolidaySchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, uint32_t localStartTime, - uint32_t localEndTime, OperatingModeEnum operatingMode); - - bool IsValidUserIndex(uint16_t userIndex); - bool IsValidCredentialIndex(uint16_t credentialIndex, CredentialTypeEnum type); - bool IsValidCredentialType(CredentialTypeEnum type); - bool IsValidWeekdayScheduleIndex(uint8_t scheduleIndex); - bool IsValidYeardayScheduleIndex(uint8_t scheduleIndex); - bool IsValidHolidayScheduleIndex(uint8_t scheduleIndex); - - bool setLockState(chip::EndpointId endpointId, DlLockState lockState, const Optional & pin, - OperationErrorEnum & err); - const char * lockStateToString(DlLockState lockState) const; - - bool ReadConfigValues(); - -private: - friend LockManager & LockMgr(); - State_t mState; - - Callback_fn_initiated mActionInitiated_CB; - Callback_fn_completed mActionCompleted_CB; - - void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); - - static void TimerEventHandler(TimerHandle_t xTimer); - static void AutoLockTimerEventHandler(AppEvent * aEvent); - static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - - EmberAfPluginDoorLockUserInfo mLockUsers[kMaxUsers]; - EmberAfPluginDoorLockCredentialInfo mLockCredentials[kNumCredentialTypes][kMaxCredentials]; - WeekDaysScheduleInfo mWeekdaySchedule[kMaxUsers][kMaxWeekdaySchedulesPerUser]; - YearDayScheduleInfo mYeardaySchedule[kMaxUsers][kMaxYeardaySchedulesPerUser]; - HolidayScheduleInfo mHolidaySchedule[kMaxHolidaySchedules]; - - char mUserNames[ArraySize(mLockUsers)][DOOR_LOCK_MAX_USER_NAME_SIZE]; - uint8_t mCredentialData[kNumCredentialTypes][kMaxCredentials][kMaxCredentialSize]; - CredentialStruct mCredentials[kMaxUsers][kMaxCredentials]; - - static LockManager sLock; - SI917DoorLock::LockInitParams::LockParam LockParams; -}; - -inline LockManager & LockMgr() -{ - return LockManager::sLock; -} diff --git a/examples/lock-app/silabs/SiWx917/src/AppTask.cpp b/examples/lock-app/silabs/SiWx917/src/AppTask.cpp deleted file mode 100644 index 006d81ef66d0b0..00000000000000 --- a/examples/lock-app/silabs/SiWx917/src/AppTask.cpp +++ /dev/null @@ -1,429 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AppTask.h" -#include "AppConfig.h" -#include "AppEvent.h" -#if defined(ENABLE_CHIP_SHELL) -#include "EventHandlerLibShell.h" -#endif // ENABLE_CHIP_SHELL - -#include "LEDWidget.h" - -#ifdef DISPLAY_ENABLED -#include "lcd.h" -#ifdef QR_CODE_ENABLED -#include "qrcodegen.h" -#endif // QR_CODE_ENABLED -#endif // DISPLAY_ENABLED - -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include - -#include - -#define LOCK_STATE_LED 1 - -using chip::app::Clusters::DoorLock::DlLockState; -using chip::app::Clusters::DoorLock::OperationErrorEnum; -using chip::app::Clusters::DoorLock::OperationSourceEnum; - -using namespace chip; -using namespace ::chip::DeviceLayer; -using namespace ::chip::DeviceLayer::Silabs; -using namespace ::chip::DeviceLayer::Internal; -using namespace SI917DoorLock::LockInitParams; - -namespace { -LEDWidget sLockLED; - -EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; -} // namespace -/********************************************************** - * Identify Callbacks - *********************************************************/ - -namespace { -void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) -{ - ChipLogProgress(Zcl, "Trigger Identify Complete"); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StopStatusLEDTimer(); -#endif -} - -void OnTriggerIdentifyEffect(Identify * identify) -{ - sIdentifyEffect = identify->mCurrentEffectIdentifier; - - if (identify->mCurrentEffectIdentifier == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE) - { - ChipLogProgress(Zcl, "IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE - Not supported, use effect varriant %d", - identify->mEffectVariant); - sIdentifyEffect = static_cast(identify->mEffectVariant); - } - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - AppTask::GetAppTask().StartStatusLEDTimer(); -#endif - - switch (sIdentifyEffect) - { - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(5), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_FINISH_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - (void) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(1), OnTriggerIdentifyEffectCompleted, - identify); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT: - (void) chip::DeviceLayer::SystemLayer().CancelTimer(OnTriggerIdentifyEffectCompleted, identify); - sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; - break; - default: - ChipLogProgress(Zcl, "No identifier effect"); - } -} - -Identify gIdentify = { - chip::EndpointId{ 1 }, - AppTask::GetAppTask().OnIdentifyStart, - AppTask::GetAppTask().OnIdentifyStop, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, - OnTriggerIdentifyEffect, -}; - -} // namespace - -using namespace chip::TLV; -using namespace ::chip::DeviceLayer; - -AppTask AppTask::sAppTask; - -CHIP_ERROR AppTask::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); - -#ifdef DISPLAY_ENABLED - GetLCD().Init((uint8_t *) "Lock-App", true); -#endif - - err = BaseApplication::Init(&gIdentify); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("BaseApplication::Init() failed"); - appError(err); - } - -#if defined(ENABLE_CHIP_SHELL) - err = RegisterLockEvents(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("RegisterLockEvents() failed"); - appError(err); - } -#endif // ENABLE_CHIP_SHELL - - // Initial lock state - chip::app::DataModel::Nullable state; - chip::EndpointId endpointId{ 1 }; - chip::DeviceLayer::PlatformMgr().LockChipStack(); - chip::app::Clusters::DoorLock::Attributes::LockState::Get(endpointId, state); - - uint8_t numberOfCredentialsPerUser = 0; - if (!DoorLockServer::Instance().GetNumberOfCredentialsSupportedPerUser(endpointId, numberOfCredentialsPerUser)) - { - ChipLogError(Zcl, - "Unable to get number of credentials supported per user when initializing lock endpoint, defaulting to 5 " - "[endpointId=%d]", - endpointId); - numberOfCredentialsPerUser = 5; - } - - uint16_t numberOfUsers = 0; - if (!DoorLockServer::Instance().GetNumberOfUserSupported(endpointId, numberOfUsers)) - { - ChipLogError(Zcl, - "Unable to get number of supported users when initializing lock endpoint, defaulting to 10 [endpointId=%d]", - endpointId); - numberOfUsers = 10; - } - - uint8_t numberOfWeekdaySchedulesPerUser = 0; - if (!DoorLockServer::Instance().GetNumberOfWeekDaySchedulesPerUserSupported(endpointId, numberOfWeekdaySchedulesPerUser)) - { - ChipLogError( - Zcl, - "Unable to get number of supported weekday schedules when initializing lock endpoint, defaulting to 10 [endpointId=%d]", - endpointId); - numberOfWeekdaySchedulesPerUser = 10; - } - - uint8_t numberOfYeardaySchedulesPerUser = 0; - if (!DoorLockServer::Instance().GetNumberOfYearDaySchedulesPerUserSupported(endpointId, numberOfYeardaySchedulesPerUser)) - { - ChipLogError( - Zcl, - "Unable to get number of supported yearday schedules when initializing lock endpoint, defaulting to 10 [endpointId=%d]", - endpointId); - numberOfYeardaySchedulesPerUser = 10; - } - - uint8_t numberOfHolidaySchedules = 0; - if (!DoorLockServer::Instance().GetNumberOfHolidaySchedulesSupported(endpointId, numberOfHolidaySchedules)) - { - ChipLogError( - Zcl, - "Unable to get number of supported holiday schedules when initializing lock endpoint, defaulting to 10 [endpointId=%d]", - endpointId); - numberOfHolidaySchedules = 10; - } - - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - - err = LockMgr().Init(state, - ParamBuilder() - .SetNumberOfUsers(numberOfUsers) - .SetNumberOfCredentialsPerUser(numberOfCredentialsPerUser) - .SetNumberOfWeekdaySchedulesPerUser(numberOfWeekdaySchedulesPerUser) - .SetNumberOfYeardaySchedulesPerUser(numberOfYeardaySchedulesPerUser) - .SetNumberOfHolidaySchedules(numberOfHolidaySchedules) - .GetLockParam()); - - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("LockMgr().Init() failed"); - appError(err); - } - - LockMgr().SetCallbacks(ActionInitiated, ActionCompleted); - - sLockLED.Init(LOCK_STATE_LED); - sLockLED.Set(state.Value() == DlLockState::kUnlocked); - - chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast(nullptr)); - - ConfigurationMgr().LogDeviceConfig(); - - return err; -} - -CHIP_ERROR AppTask::StartAppTask() -{ - return BaseApplication::StartAppTask(AppTaskMain); -} - -void AppTask::AppTaskMain(void * pvParameter) -{ - AppEvent event; - QueueHandle_t sAppEventQueue = *(static_cast(pvParameter)); - - CHIP_ERROR err = sAppTask.Init(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("AppTask.Init() failed"); - appError(err); - } - -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) - sAppTask.StartStatusLEDTimer(); -#endif - - SILABS_LOG("App Task started"); - - // Users and credentials should be checked once from nvm flash on boot - LockMgr().ReadConfigValues(); - - while (true) - { - BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); - while (eventReceived == pdTRUE) - { - sAppTask.DispatchEvent(&event); - eventReceived = xQueueReceive(sAppEventQueue, &event, 0); - } - } -} - -void AppTask::OnIdentifyStart(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStart"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StartStatusLEDTimer(); -#endif -} - -void AppTask::OnIdentifyStop(Identify * identify) -{ - ChipLogProgress(Zcl, "onIdentifyStop"); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - sAppTask.StopStatusLEDTimer(); -#endif -} - -void AppTask::LockActionEventHandler(AppEvent * aEvent) -{ - bool initiated = false; - LockManager::Action_t action; - int32_t actor; - CHIP_ERROR err = CHIP_NO_ERROR; - - if (aEvent->Type == AppEvent::kEventType_Lock) - { - action = static_cast(aEvent->LockEvent.Action); - actor = aEvent->LockEvent.Actor; - } - else if (aEvent->Type == AppEvent::kEventType_Button) - { - if (LockMgr().NextState() == true) - { - action = LockManager::LOCK_ACTION; - } - else - { - action = LockManager::UNLOCK_ACTION; - } - actor = AppEvent::kEventType_Button; - } - else - { - err = APP_ERROR_UNHANDLED_EVENT; - } - - if (err == CHIP_NO_ERROR) - { - initiated = LockMgr().InitiateAction(actor, action); - - if (!initiated) - { - SILABS_LOG("Action is already in progress or active."); - } - } -} - -void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) -{ - - AppEvent button_event = {}; - button_event.Type = AppEvent::kEventType_Button; - button_event.ButtonEvent.Action = btnAction; - - if (button == SIWx917_BTN1 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - button_event.Handler = LockActionEventHandler; - sAppTask.PostEvent(&button_event); - } - else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) - { - button_event.Handler = BaseApplication::ButtonHandler; - sAppTask.PostEvent(&button_event); - } -} - -void AppTask::ActionInitiated(LockManager::Action_t aAction, int32_t aActor) -{ - if (aAction == LockManager::UNLOCK_ACTION || aAction == LockManager::LOCK_ACTION) - { - bool locked = (aAction == LockManager::LOCK_ACTION); - SILABS_LOG("%s Action has been initiated", (locked) ? "Lock" : "Unlock"); - sLockLED.Set(!locked); - -#ifdef DISPLAY_ENABLED - sAppTask.GetLCD().WriteDemoUI(locked); -#endif // DISPLAY_ENABLED - } - - if (aActor == AppEvent::kEventType_Button) - { - sAppTask.mSyncClusterToButtonAction = true; - } -} - -void AppTask::ActionCompleted(LockManager::Action_t aAction) -{ - // if the action has been completed by the lock, update the lock trait. - // Turn off the lock LED if in a LOCKED state OR - // Turn on the lock LED if in an UNLOCKED state. - if (aAction == LockManager::LOCK_ACTION) - { - SILABS_LOG("Lock Action has been completed") - } - else if (aAction == LockManager::UNLOCK_ACTION) - { - SILABS_LOG("Unlock Action has been completed") - } - - if (sAppTask.mSyncClusterToButtonAction) - { - chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast(nullptr)); - sAppTask.mSyncClusterToButtonAction = false; - } -} - -void AppTask::ActionRequest(int32_t aActor, LockManager::Action_t aAction) -{ - AppEvent event; - event.Type = AppEvent::kEventType_Lock; - event.LockEvent.Actor = aActor; - event.LockEvent.Action = aAction; - event.Handler = LockActionEventHandler; - PostEvent(&event); -} - -void AppTask::UpdateClusterState(intptr_t context) -{ - bool unlocked = LockMgr().NextState(); - DlLockState newState = unlocked ? DlLockState::kUnlocked : DlLockState::kLocked; - - OperationSourceEnum source = OperationSourceEnum::kUnspecified; - - // write the new lock value - EmberAfStatus status = - DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; - - if (status != EMBER_ZCL_STATUS_SUCCESS) - { - SILABS_LOG("ERR: updating lock state %x", status); - } -} diff --git a/examples/lock-app/silabs/SiWx917/src/EventHandlerLibShell.cpp b/examples/lock-app/silabs/SiWx917/src/EventHandlerLibShell.cpp deleted file mode 100644 index ef79290bd1961f..00000000000000 --- a/examples/lock-app/silabs/SiWx917/src/EventHandlerLibShell.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * - * 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 "EventHandlerLibShell.h" -#include "AppTask.h" -#include "lib/shell/Engine.h" -#include "lib/shell/commands/Help.h" - -#include "app/server/Server.h" -#include "platform/CHIPDeviceLayer.h" -#include - -constexpr uint8_t lockEndpoint = 1; - -using namespace chip; -using namespace chip::app; -using namespace Clusters::DoorLock; -using Shell::Engine; -using Shell::shell_command_t; -using Shell::streamer_get; -using Shell::streamer_printf; - -Engine sShellDoorlockSubCommands; -Engine sShellDoorlockEventSubCommands; -Engine sShellDoorlockEventAlarmSubCommands; -Engine sShellDoorlockEventDoorStateSubCommands; - -/******************************************************** - * Doorlock shell functions - *********************************************************/ - -CHIP_ERROR DoorlockHelpHandler(int argc, char ** argv) -{ - sShellDoorlockSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DoorlockCommandHandler(int argc, char ** argv) -{ - if (argc == 0) - { - return DoorlockHelpHandler(argc, argv); - } - - return sShellDoorlockSubCommands.ExecCommand(argc, argv); -} - -/******************************************************** - * Event shell functions - *********************************************************/ - -CHIP_ERROR EventHelpHandler(int argc, char ** argv) -{ - sShellDoorlockEventSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); - return CHIP_NO_ERROR; -} - -CHIP_ERROR EventDoorlockCommandHandler(int argc, char ** argv) -{ - if (argc == 0) - { - return EventHelpHandler(argc, argv); - } - - return sShellDoorlockEventSubCommands.ExecCommand(argc, argv); -} - -/******************************************************** - * Alarm shell functions - *********************************************************/ - -CHIP_ERROR AlarmHelpHandler(int argc, char ** argv) -{ - sShellDoorlockEventAlarmSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); - return CHIP_NO_ERROR; -} - -CHIP_ERROR AlarmEventHandler(int argc, char ** argv) -{ - - if (argc == 0) - { - return AlarmHelpHandler(argc, argv); - } - if (argc >= 2) - { - ChipLogError(Zcl, "Too many arguments provided to function %s, line %d", __func__, __LINE__); - return APP_ERROR_TOO_MANY_SHELL_ARGUMENTS; - } - - AlarmEventData * data = Platform::New(); - data->eventId = Events::DoorLockAlarm::Id; - data->alarmCode = static_cast(atoi(argv[0])); - - DeviceLayer::PlatformMgr().ScheduleWork(EventWorkerFunction, reinterpret_cast(data)); - - return CHIP_NO_ERROR; -} - -/******************************************************** - * Door state shell functions - *********************************************************/ - -CHIP_ERROR DoorStateHelpHandler(int argc, char ** argv) -{ - sShellDoorlockEventDoorStateSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DoorStateEventHandler(int argc, char ** argv) -{ - - if (argc == 0) - { - return DoorStateHelpHandler(argc, argv); - } - if (argc >= 2) - { - ChipLogError(Zcl, "Too many arguments provided to function %s, line %d", __func__, __LINE__); - return APP_ERROR_TOO_MANY_SHELL_ARGUMENTS; - } - - DoorStateEventData * data = Platform::New(); - data->eventId = Events::DoorStateChange::Id; - data->doorState = static_cast(atoi(argv[0])); - - DeviceLayer::PlatformMgr().ScheduleWork(EventWorkerFunction, reinterpret_cast(data)); - - return CHIP_NO_ERROR; -} - -/** - * @brief configures lock matter shell - * - */ - -CHIP_ERROR RegisterLockEvents() -{ - static const shell_command_t sDoorlockSubCommands[] = { { &DoorlockHelpHandler, "help", "Usage: doorlock " }, - { &EventDoorlockCommandHandler, "event", - " Usage: doorlock event " } }; - - static const shell_command_t sDoorlockEventSubCommands[] = { - { &EventHelpHandler, "help", "Usage : doorlock event " }, - { &AlarmEventHandler, "lock-alarm", "Sends lock alarm event to lock app" }, - { &DoorStateEventHandler, "door-state-change", "Sends door state change event to lock app" } - }; - - static const shell_command_t sDoorlockEventAlarmSubCommands[] = { { &AlarmHelpHandler, "help", - "Usage : doorlock event lock-alarm AlarmCode" } }; - - static const shell_command_t sDoorlockEventDoorStateSubCommands[] = { - { &DoorStateHelpHandler, "help", "Usage : doorlock event door-state-change DoorState" } - }; - - static const shell_command_t sDoorLockCommand = { &DoorlockCommandHandler, "doorlock", - "doorlock commands. Usage: doorlock " }; - - sShellDoorlockEventAlarmSubCommands.RegisterCommands(sDoorlockEventAlarmSubCommands, ArraySize(sDoorlockEventAlarmSubCommands)); - - sShellDoorlockEventDoorStateSubCommands.RegisterCommands(sDoorlockEventDoorStateSubCommands, - ArraySize(sDoorlockEventDoorStateSubCommands)); - - sShellDoorlockEventSubCommands.RegisterCommands(sDoorlockEventSubCommands, ArraySize(sDoorlockEventSubCommands)); - sShellDoorlockSubCommands.RegisterCommands(sDoorlockSubCommands, ArraySize(sDoorlockSubCommands)); - - Engine::Root().RegisterCommands(&sDoorLockCommand, 1); - - return CHIP_NO_ERROR; -} - -void EventWorkerFunction(intptr_t context) -{ - VerifyOrReturn(context != 0, ChipLogError(NotSpecified, "EventWorkerFunction - Invalid work data")); - - EventData * data = reinterpret_cast(context); - - switch (data->eventId) - { - case Events::DoorLockAlarm::Id: { - AlarmEventData * alarmData = reinterpret_cast(context); - DoorLockServer::Instance().SendLockAlarmEvent(lockEndpoint, alarmData->alarmCode); - break; - } - - case Events::DoorStateChange::Id: { - DoorStateEventData * doorStateData = reinterpret_cast(context); - DoorLockServer::Instance().SetDoorState(lockEndpoint, doorStateData->doorState); - break; - } - - default: { - ChipLogError(Zcl, "Invalid Event Id %s, line %d", __func__, __LINE__); - break; - } - } -} diff --git a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp b/examples/lock-app/silabs/SiWx917/src/LockManager.cpp deleted file mode 100644 index c1a5b2ae627067..00000000000000 --- a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp +++ /dev/null @@ -1,719 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "LockManager.h" - -#include "AppConfig.h" -#include "AppTask.h" -#include -#include -#include -#include - -LockManager LockManager::sLock; - -TimerHandle_t sLockTimer; - -using namespace ::chip::DeviceLayer::Internal; -using namespace SI917DoorLock::LockInitParams; - -CHIP_ERROR LockManager::Init(chip::app::DataModel::Nullable state, LockParam lockParam) -{ - - LockParams = lockParam; - - if (LockParams.numberOfUsers > kMaxUsers) - { - SILABS_LOG("Max number of users is greater than %d, the maximum amount of users currently supported on this platform", - kMaxUsers); - return APP_ERROR_ALLOCATION_FAILED; - } - - if (LockParams.numberOfCredentialsPerUser > kMaxCredentialsPerUser) - { - SILABS_LOG("Max number of credentials per user is greater than %d, the maximum amount of users currently supported on this " - "platform", - kMaxCredentialsPerUser); - return APP_ERROR_ALLOCATION_FAILED; - } - - if (LockParams.numberOfWeekdaySchedulesPerUser > kMaxWeekdaySchedulesPerUser) - { - SILABS_LOG( - "Max number of schedules is greater than %d, the maximum amount of schedules currently supported on this platform", - kMaxWeekdaySchedulesPerUser); - return APP_ERROR_ALLOCATION_FAILED; - } - - if (LockParams.numberOfYeardaySchedulesPerUser > kMaxYeardaySchedulesPerUser) - { - SILABS_LOG( - "Max number of schedules is greater than %d, the maximum amount of schedules currently supported on this platform", - kMaxYeardaySchedulesPerUser); - return APP_ERROR_ALLOCATION_FAILED; - } - - if (LockParams.numberOfHolidaySchedules > kMaxHolidaySchedules) - { - SILABS_LOG( - "Max number of schedules is greater than %d, the maximum amount of schedules currently supported on this platform", - kMaxHolidaySchedules); - return APP_ERROR_ALLOCATION_FAILED; - } - - // Create FreeRTOS sw timer for lock timer. - sLockTimer = xTimerCreate("lockTmr", // Just a text name, not used by the RTOS kernel - pdMS_TO_TICKS(1), // == default timer period - false, // no timer reload (==one-shot) - (void *) this, // init timer id = lock obj context - TimerEventHandler // timer callback handler - ); - - if (sLockTimer == NULL) - { - SILABS_LOG("sLockTimer timer create failed"); - return APP_ERROR_CREATE_TIMER_FAILED; - } - - if (state.Value() == DlLockState::kUnlocked) - mState = kState_UnlockCompleted; - else - mState = kState_LockCompleted; - - return CHIP_NO_ERROR; -} - -bool LockManager::IsValidUserIndex(uint16_t userIndex) -{ - return (userIndex < kMaxUsers); -} - -bool LockManager::IsValidCredentialIndex(uint16_t credentialIndex, CredentialTypeEnum type) -{ - if (CredentialTypeEnum::kProgrammingPIN == type) - { - return (0 == credentialIndex); // 0 is required index for Programming PIN - } - return (credentialIndex < kMaxCredentialsPerUser); -} - -bool LockManager::IsValidCredentialType(CredentialTypeEnum type) -{ - return (to_underlying(type) < kNumCredentialTypes); -} - -bool LockManager::IsValidWeekdayScheduleIndex(uint8_t scheduleIndex) -{ - return (scheduleIndex < kMaxWeekdaySchedulesPerUser); -} - -bool LockManager::IsValidYeardayScheduleIndex(uint8_t scheduleIndex) -{ - return (scheduleIndex < kMaxYeardaySchedulesPerUser); -} - -bool LockManager::IsValidHolidayScheduleIndex(uint8_t scheduleIndex) -{ - return (scheduleIndex < kMaxHolidaySchedules); -} - -bool LockManager::ReadConfigValues() -{ - size_t outLen; - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_LockUser, reinterpret_cast(&mLockUsers), - sizeof(EmberAfPluginDoorLockUserInfo) * ArraySize(mLockUsers), outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_Credential, reinterpret_cast(&mLockCredentials), - sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials * kNumCredentialTypes, outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_LockUserName, reinterpret_cast(mUserNames), - sizeof(mUserNames), outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_CredentialData, reinterpret_cast(mCredentialData), - sizeof(mCredentialData), outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_UserCredentials, reinterpret_cast(mCredentials), - sizeof(CredentialStruct) * LockParams.numberOfUsers * LockParams.numberOfCredentialsPerUser, - outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_WeekDaySchedules, reinterpret_cast(mWeekdaySchedule), - sizeof(EmberAfPluginDoorLockWeekDaySchedule) * LockParams.numberOfWeekdaySchedulesPerUser * - LockParams.numberOfUsers, - outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_YearDaySchedules, reinterpret_cast(mYeardaySchedule), - sizeof(EmberAfPluginDoorLockYearDaySchedule) * LockParams.numberOfYeardaySchedulesPerUser * - LockParams.numberOfUsers, - outLen); - - SilabsConfig::ReadConfigValueBin(SilabsConfig::kConfigKey_HolidaySchedules, reinterpret_cast(&(mHolidaySchedule)), - sizeof(EmberAfPluginDoorLockHolidaySchedule) * LockParams.numberOfHolidaySchedules, outLen); - - return true; -} - -void LockManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) -{ - mActionInitiated_CB = aActionInitiated_CB; - mActionCompleted_CB = aActionCompleted_CB; -} - -bool LockManager::IsActionInProgress() -{ - return (mState == kState_LockInitiated || mState == kState_UnlockInitiated); -} - -bool LockManager::NextState() -{ - return (mState == kState_UnlockCompleted); -} - -bool LockManager::InitiateAction(int32_t aActor, Action_t aAction) -{ - bool action_initiated = false; - State_t new_state; - - // Initiate Turn Lock/Unlock Action only when the previous one is complete. - if (mState == kState_LockCompleted && aAction == UNLOCK_ACTION) - { - action_initiated = true; - - new_state = kState_UnlockInitiated; - } - else if (mState == kState_UnlockCompleted && aAction == LOCK_ACTION) - { - action_initiated = true; - - new_state = kState_LockInitiated; - } - - if (action_initiated) - { - - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); - - // Since the timer started successfully, update the state and trigger callback - mState = new_state; - - if (mActionInitiated_CB) - { - mActionInitiated_CB(aAction, aActor); - } - } - - return action_initiated; -} - -void LockManager::StartTimer(uint32_t aTimeoutMs) -{ - if (xTimerIsTimerActive(sLockTimer)) - { - SILABS_LOG("app timer already started!"); - CancelTimer(); - } - - // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ms if the change period command - // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sLockTimer, pdMS_TO_TICKS(aTimeoutMs), pdMS_TO_TICKS(100)) != pdPASS) - { - SILABS_LOG("sLockTimer timer start() failed"); - appError(APP_ERROR_START_TIMER_FAILED); - } -} - -void LockManager::CancelTimer(void) -{ - if (xTimerStop(sLockTimer, pdMS_TO_TICKS(0)) == pdFAIL) - { - SILABS_LOG("sLockTimer stop() failed"); - appError(APP_ERROR_STOP_TIMER_FAILED); - } -} - -void LockManager::TimerEventHandler(TimerHandle_t xTimer) -{ - // Get lock obj context from timer id. - LockManager * lock = static_cast(pvTimerGetTimerID(xTimer)); - - // The timer event handler will be called in the context of the timer task - // once sLockTimer expires. Post an event to apptask queue with the actual handler - // so that the event can be handled in the context of the apptask. - AppEvent event; - event.Type = AppEvent::kEventType_Timer; - event.TimerEvent.Context = lock; - event.Handler = ActuatorMovementTimerEventHandler; - AppTask::GetAppTask().PostEvent(&event); -} - -void LockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) -{ - Action_t actionCompleted = INVALID_ACTION; - - LockManager * lock = static_cast(aEvent->TimerEvent.Context); - - if (lock->mState == kState_LockInitiated) - { - lock->mState = kState_LockCompleted; - actionCompleted = LOCK_ACTION; - } - else if (lock->mState == kState_UnlockInitiated) - { - lock->mState = kState_UnlockCompleted; - actionCompleted = UNLOCK_ACTION; - } - - if (actionCompleted != INVALID_ACTION) - { - if (lock->mActionCompleted_CB) - { - lock->mActionCompleted_CB(actionCompleted); - } - } -} - -bool LockManager::Lock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err) -{ - return setLockState(endpointId, DlLockState::kLocked, pin, err); -} - -bool LockManager::Unlock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err) -{ - return setLockState(endpointId, DlLockState::kUnlocked, pin, err); -} - -bool LockManager::GetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) -{ - VerifyOrReturnValue(userIndex > 0, false); // indices are one-indexed - - userIndex--; - - VerifyOrReturnValue(IsValidUserIndex(userIndex), false); - - ChipLogProgress(Zcl, "Door Lock App: LockManager::GetUser [endpoint=%d,userIndex=%hu]", endpointId, userIndex); - - const auto & userInDb = mLockUsers[userIndex]; - - user.userStatus = userInDb.userStatus; - if (UserStatusEnum::kAvailable == user.userStatus) - { - ChipLogDetail(Zcl, "Found unoccupied user [endpoint=%d]", endpointId); - return true; - } - - user.userName = chip::CharSpan(userInDb.userName.data(), userInDb.userName.size()); - user.credentials = chip::Span(mCredentials[userIndex], userInDb.credentials.size()); - user.userUniqueId = userInDb.userUniqueId; - user.userType = userInDb.userType; - user.credentialRule = userInDb.credentialRule; - // So far there's no way to actually create the credential outside Matter, so here we always set the creation/modification - // source to Matter - user.creationSource = DlAssetSource::kMatterIM; - user.createdBy = userInDb.createdBy; - user.modificationSource = DlAssetSource::kMatterIM; - user.lastModifiedBy = userInDb.lastModifiedBy; - - ChipLogDetail(Zcl, - "Found occupied user " - "[endpoint=%d,name=\"%.*s\",credentialsCount=%u,uniqueId=%lx,type=%u,credentialRule=%u," - "createdBy=%d,lastModifiedBy=%d]", - endpointId, static_cast(user.userName.size()), user.userName.data(), user.credentials.size(), - user.userUniqueId, to_underlying(user.userType), to_underlying(user.credentialRule), user.createdBy, - user.lastModifiedBy); - - return true; -} - -bool LockManager::SetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, - const chip::CharSpan & userName, uint32_t uniqueId, UserStatusEnum userStatus, UserTypeEnum usertype, - CredentialRuleEnum credentialRule, const CredentialStruct * credentials, size_t totalCredentials) -{ - ChipLogProgress(Zcl, - "Door Lock App: LockManager::SetUser " - "[endpoint=%d,userIndex=%d,creator=%d,modifier=%d,userName=%s,uniqueId=%ld " - "userStatus=%u,userType=%u,credentialRule=%u,credentials=%p,totalCredentials=%u]", - endpointId, userIndex, creator, modifier, userName.data(), uniqueId, to_underlying(userStatus), - to_underlying(usertype), to_underlying(credentialRule), credentials, totalCredentials); - - VerifyOrReturnValue(userIndex > 0, false); // indices are one-indexed - - userIndex--; - - VerifyOrReturnValue(IsValidUserIndex(userIndex), false); - - auto & userInStorage = mLockUsers[userIndex]; - - if (userName.size() > DOOR_LOCK_MAX_USER_NAME_SIZE) - { - ChipLogError(Zcl, "Cannot set user - user name is too long [endpoint=%d,index=%d]", endpointId, userIndex); - return false; - } - - if (totalCredentials > LockParams.numberOfCredentialsPerUser) - { - ChipLogError(Zcl, "Cannot set user - total number of credentials is too big [endpoint=%d,index=%d,totalCredentials=%u]", - endpointId, userIndex, totalCredentials); - return false; - } - - chip::Platform::CopyString(mUserNames[userIndex], userName); - userInStorage.userName = chip::CharSpan(mUserNames[userIndex], userName.size()); - userInStorage.userUniqueId = uniqueId; - userInStorage.userStatus = userStatus; - userInStorage.userType = usertype; - userInStorage.credentialRule = credentialRule; - userInStorage.lastModifiedBy = modifier; - userInStorage.createdBy = creator; - - for (size_t i = 0; i < totalCredentials; ++i) - { - mCredentials[userIndex][i] = credentials[i]; - } - - userInStorage.credentials = chip::Span(mCredentials[userIndex], totalCredentials); - - // Save user information in NVM flash - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_LockUser, reinterpret_cast(&mLockUsers), - sizeof(EmberAfPluginDoorLockUserInfo) * LockParams.numberOfUsers); - - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_UserCredentials, reinterpret_cast(mCredentials), - sizeof(CredentialStruct) * LockParams.numberOfUsers * LockParams.numberOfCredentialsPerUser); - - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_LockUserName, reinterpret_cast(mUserNames), - sizeof(mUserNames)); - - ChipLogProgress(Zcl, "Successfully set the user [mEndpointId=%d,index=%d]", endpointId, userIndex); - - return true; -} - -bool LockManager::GetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, CredentialTypeEnum credentialType, - EmberAfPluginDoorLockCredentialInfo & credential) -{ - - VerifyOrReturnValue(IsValidCredentialType(credentialType), false); - - if (CredentialTypeEnum::kProgrammingPIN == credentialType) - { - VerifyOrReturnValue(IsValidCredentialIndex(credentialIndex, credentialType), - false); // programming pin index is only index allowed to contain 0 - } - else - { - VerifyOrReturnValue(IsValidCredentialIndex(--credentialIndex, credentialType), false); // otherwise, indices are one-indexed - } - - ChipLogProgress(Zcl, "Lock App: LockManager::GetCredential [credentialType=%u], credentialIndex=%d", - to_underlying(credentialType), credentialIndex); - - const auto & credentialInStorage = mLockCredentials[to_underlying(credentialType)][credentialIndex]; - - credential.status = credentialInStorage.status; - ChipLogDetail(Zcl, "CredentialStatus: %d, CredentialIndex: %d ", (int) credential.status, credentialIndex); - - if (DlCredentialStatus::kAvailable == credential.status) - { - ChipLogDetail(Zcl, "Found unoccupied credential "); - return true; - } - credential.credentialType = credentialInStorage.credentialType; - credential.credentialData = credentialInStorage.credentialData; - credential.createdBy = credentialInStorage.createdBy; - credential.lastModifiedBy = credentialInStorage.lastModifiedBy; - // So far there's no way to actually create the credential outside Matter, so here we always set the creation/modification - // source to Matter - credential.creationSource = DlAssetSource::kMatterIM; - credential.modificationSource = DlAssetSource::kMatterIM; - - ChipLogDetail(Zcl, "Found occupied credential [type=%u,dataSize=%u]", to_underlying(credential.credentialType), - credential.credentialData.size()); - - return true; -} - -bool LockManager::SetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, - chip::FabricIndex modifier, DlCredentialStatus credentialStatus, CredentialTypeEnum credentialType, - const chip::ByteSpan & credentialData) -{ - - VerifyOrReturnValue(IsValidCredentialType(credentialType), false); - - if (CredentialTypeEnum::kProgrammingPIN == credentialType) - { - VerifyOrReturnValue(IsValidCredentialIndex(credentialIndex, credentialType), - false); // programming pin index is only index allowed to contain 0 - } - else - { - VerifyOrReturnValue(IsValidCredentialIndex(--credentialIndex, credentialType), false); // otherwise, indices are one-indexed - } - - ChipLogProgress(Zcl, - "Door Lock App: LockManager::SetCredential " - "[credentialStatus=%u,credentialType=%u,credentialDataSize=%u,creator=%d,modifier=%d]", - to_underlying(credentialStatus), to_underlying(credentialType), credentialData.size(), creator, modifier); - - auto & credentialInStorage = mLockCredentials[to_underlying(credentialType)][credentialIndex]; - - credentialInStorage.status = credentialStatus; - credentialInStorage.credentialType = credentialType; - credentialInStorage.createdBy = creator; - credentialInStorage.lastModifiedBy = modifier; - - memcpy(mCredentialData[to_underlying(credentialType)][credentialIndex], credentialData.data(), credentialData.size()); - credentialInStorage.credentialData = - chip::ByteSpan{ mCredentialData[to_underlying(credentialType)][credentialIndex], credentialData.size() }; - - // Save credential information in NVM flash - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_Credential, reinterpret_cast(&mLockCredentials), - sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials * kNumCredentialTypes); - - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_CredentialData, reinterpret_cast(&mCredentialData), - sizeof(mCredentialData)); - - ChipLogProgress(Zcl, "Successfully set the credential [credentialType=%u]", to_underlying(credentialType)); - - return true; -} - -DlStatus LockManager::GetWeekdaySchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, - EmberAfPluginDoorLockWeekDaySchedule & schedule) -{ - - VerifyOrReturnValue(weekdayIndex > 0, DlStatus::kFailure); // indices are one-indexed - VerifyOrReturnValue(userIndex > 0, DlStatus::kFailure); // indices are one-indexed - - weekdayIndex--; - userIndex--; - - VerifyOrReturnValue(IsValidWeekdayScheduleIndex(weekdayIndex), DlStatus::kFailure); - VerifyOrReturnValue(IsValidUserIndex(userIndex), DlStatus::kFailure); - - const auto & scheduleInStorage = mWeekdaySchedule[userIndex][weekdayIndex]; - if (DlScheduleStatus::kAvailable == scheduleInStorage.status) - { - return DlStatus::kNotFound; - } - - schedule = scheduleInStorage.schedule; - - return DlStatus::kSuccess; -} - -DlStatus LockManager::SetWeekdaySchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, - DlScheduleStatus status, DaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, - uint8_t endHour, uint8_t endMinute) -{ - - VerifyOrReturnValue(weekdayIndex > 0, DlStatus::kFailure); // indices are one-indexed - VerifyOrReturnValue(userIndex > 0, DlStatus::kFailure); // indices are one-indexed - - weekdayIndex--; - userIndex--; - - VerifyOrReturnValue(IsValidWeekdayScheduleIndex(weekdayIndex), DlStatus::kFailure); - VerifyOrReturnValue(IsValidUserIndex(userIndex), DlStatus::kFailure); - - auto & scheduleInStorage = mWeekdaySchedule[userIndex][weekdayIndex]; - - scheduleInStorage.schedule.daysMask = daysMask; - scheduleInStorage.schedule.startHour = startHour; - scheduleInStorage.schedule.startMinute = startMinute; - scheduleInStorage.schedule.endHour = endHour; - scheduleInStorage.schedule.endMinute = endMinute; - scheduleInStorage.status = status; - - // Save schedule information in NVM flash - SilabsConfig::WriteConfigValueBin( - SilabsConfig::kConfigKey_WeekDaySchedules, reinterpret_cast(mWeekdaySchedule), - sizeof(EmberAfPluginDoorLockWeekDaySchedule) * LockParams.numberOfWeekdaySchedulesPerUser * LockParams.numberOfUsers); - - return DlStatus::kSuccess; -} - -DlStatus LockManager::GetYeardaySchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, - EmberAfPluginDoorLockYearDaySchedule & schedule) -{ - VerifyOrReturnValue(yearDayIndex > 0, DlStatus::kFailure); // indices are one-indexed - VerifyOrReturnValue(userIndex > 0, DlStatus::kFailure); // indices are one-indexed - - yearDayIndex--; - userIndex--; - - VerifyOrReturnValue(IsValidYeardayScheduleIndex(yearDayIndex), DlStatus::kFailure); - VerifyOrReturnValue(IsValidUserIndex(userIndex), DlStatus::kFailure); - - const auto & scheduleInStorage = mYeardaySchedule[userIndex][yearDayIndex]; - if (DlScheduleStatus::kAvailable == scheduleInStorage.status) - { - return DlStatus::kNotFound; - } - - schedule = scheduleInStorage.schedule; - - return DlStatus::kSuccess; -} - -DlStatus LockManager::SetYeardaySchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, - DlScheduleStatus status, uint32_t localStartTime, uint32_t localEndTime) -{ - VerifyOrReturnValue(yearDayIndex > 0, DlStatus::kFailure); // indices are one-indexed - VerifyOrReturnValue(userIndex > 0, DlStatus::kFailure); // indices are one-indexed - - yearDayIndex--; - userIndex--; - - VerifyOrReturnValue(IsValidYeardayScheduleIndex(yearDayIndex), DlStatus::kFailure); - VerifyOrReturnValue(IsValidUserIndex(userIndex), DlStatus::kFailure); - - auto & scheduleInStorage = mYeardaySchedule[userIndex][yearDayIndex]; - - scheduleInStorage.schedule.localStartTime = localStartTime; - scheduleInStorage.schedule.localEndTime = localEndTime; - scheduleInStorage.status = status; - - // Save schedule information in NVM flash - SilabsConfig::WriteConfigValueBin( - SilabsConfig::kConfigKey_YearDaySchedules, reinterpret_cast(mYeardaySchedule), - sizeof(EmberAfPluginDoorLockYearDaySchedule) * LockParams.numberOfYeardaySchedulesPerUser * LockParams.numberOfUsers); - - return DlStatus::kSuccess; -} - -DlStatus LockManager::GetHolidaySchedule(chip::EndpointId endpointId, uint8_t holidayIndex, - EmberAfPluginDoorLockHolidaySchedule & schedule) -{ - VerifyOrReturnValue(holidayIndex > 0, DlStatus::kFailure); // indices are one-indexed - - holidayIndex--; - - VerifyOrReturnValue(IsValidHolidayScheduleIndex(holidayIndex), DlStatus::kFailure); - - const auto & scheduleInStorage = mHolidaySchedule[holidayIndex]; - if (DlScheduleStatus::kAvailable == scheduleInStorage.status) - { - return DlStatus::kNotFound; - } - - schedule = scheduleInStorage.schedule; - - return DlStatus::kSuccess; -} - -DlStatus LockManager::SetHolidaySchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime, OperatingModeEnum operatingMode) -{ - VerifyOrReturnValue(holidayIndex > 0, DlStatus::kFailure); // indices are one-indexed - - holidayIndex--; - - VerifyOrReturnValue(IsValidHolidayScheduleIndex(holidayIndex), DlStatus::kFailure); - - auto & scheduleInStorage = mHolidaySchedule[holidayIndex]; - - scheduleInStorage.schedule.localStartTime = localStartTime; - scheduleInStorage.schedule.localEndTime = localEndTime; - scheduleInStorage.schedule.operatingMode = operatingMode; - scheduleInStorage.status = status; - - // Save schedule information in NVM flash - SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_HolidaySchedules, - reinterpret_cast(&(mHolidaySchedule)), - sizeof(EmberAfPluginDoorLockHolidaySchedule) * LockParams.numberOfHolidaySchedules); - - return DlStatus::kSuccess; -} - -const char * LockManager::lockStateToString(DlLockState lockState) const -{ - switch (lockState) - { - case DlLockState::kNotFullyLocked: - return "Not Fully Locked"; - case DlLockState::kLocked: - return "Locked"; - case DlLockState::kUnlocked: - return "Unlocked"; - case DlLockState::kUnlatched: - return "Unlatched"; - case DlLockState::kUnknownEnumValue: - break; - } - - return "Unknown"; -} - -bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockState, const Optional & pin, - OperationErrorEnum & err) -{ - - // Assume pin is required until told otherwise - bool requirePin = true; - chip::app::Clusters::DoorLock::Attributes::RequirePINforRemoteOperation::Get(endpointId, &requirePin); - - // If a pin code is not given - if (!pin.HasValue()) - { - ChipLogDetail(Zcl, "Door Lock App: PIN code is not specified [endpointId=%d]", endpointId); - - // If a pin code is not required - if (!requirePin) - { - ChipLogDetail(Zcl, "Door Lock App: setting door lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), - endpointId); - - DoorLockServer::Instance().SetLockState(endpointId, lockState); - - return true; - } - - ChipLogError(Zcl, "Door Lock App: PIN code is not specified, but it is required [endpointId=%d]", endpointId); - - return false; - } - - // Check the PIN code - for (const auto & currentCredential : mLockCredentials[to_underlying(CredentialTypeEnum::kPin)]) - { - - if (currentCredential.status == DlCredentialStatus::kAvailable) - { - continue; - } - - if (currentCredential.credentialData.data_equal(pin.Value())) - { - ChipLogDetail(Zcl, - "Lock App: specified PIN code was found in the database, setting lock state to \"%s\" [endpointId=%d]", - lockStateToString(lockState), endpointId); - - DoorLockServer::Instance().SetLockState(endpointId, lockState); - - return true; - } - } - - ChipLogDetail(Zcl, - "Door Lock App: specified PIN code was not found in the database, ignoring command to set lock state to \"%s\" " - "[endpointId=%d]", - lockStateToString(lockState), endpointId); - - err = OperationErrorEnum::kInvalidCredential; - return false; -} diff --git a/examples/lock-app/silabs/SiWx917/src/ZclCallbacks.cpp b/examples/lock-app/silabs/SiWx917/src/ZclCallbacks.cpp deleted file mode 100644 index 778637e250a5a5..00000000000000 --- a/examples/lock-app/silabs/SiWx917/src/ZclCallbacks.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * - * 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. - */ - -/** - * @file - * This file implements the handler for data model messages. - */ - -#include "AppConfig.h" -#include "LockManager.h" -#include - -#include -#include -#include -#include - -using namespace ::chip::app::Clusters; -using namespace ::chip::DeviceLayer::Internal; - -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, - uint8_t * value) -{ - ClusterId clusterId = attributePath.mClusterId; - AttributeId attributeId = attributePath.mAttributeId; - ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - - if (clusterId == DoorLock::Id && attributeId == DoorLock::Attributes::LockState::Id) - { - DoorLock::DlLockState lockState = *(reinterpret_cast(value)); - ChipLogProgress(Zcl, "Door lock cluster: " ChipLogFormatMEI " state %d", ChipLogValueMEI(clusterId), - to_underlying(lockState)); - } -} - -/** @brief DoorLock Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfDoorLockClusterInitCallback(EndpointId endpoint) {} - -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, - OperationErrorEnum & err) -{ - ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); - bool status = LockMgr().Lock(endpointId, pinCode, err); - if (status == true) - { - LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::LOCK_ACTION); - } - return status; -} - -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, - OperationErrorEnum & err) -{ - ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); - bool status = LockMgr().Unlock(endpointId, pinCode, err); - if (status == true) - { - LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::UNLOCK_ACTION); - } - - return status; -} - -bool emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, CredentialTypeEnum credentialType, - EmberAfPluginDoorLockCredentialInfo & credential) -{ - return LockMgr().GetCredential(endpointId, credentialIndex, credentialType, credential); -} - -bool emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, - chip::FabricIndex modifier, DlCredentialStatus credentialStatus, - CredentialTypeEnum credentialType, const chip::ByteSpan & credentialData) -{ - return LockMgr().SetCredential(endpointId, credentialIndex, creator, modifier, credentialStatus, credentialType, - credentialData); -} - -bool emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) -{ - return LockMgr().GetUser(endpointId, userIndex, user); -} - -bool emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, - chip::FabricIndex modifier, const chip::CharSpan & userName, uint32_t uniqueId, - UserStatusEnum userStatus, UserTypeEnum usertype, CredentialRuleEnum credentialRule, - const CredentialStruct * credentials, size_t totalCredentials) -{ - - return LockMgr().SetUser(endpointId, userIndex, creator, modifier, userName, uniqueId, userStatus, usertype, credentialRule, - credentials, totalCredentials); -} - -DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, - EmberAfPluginDoorLockWeekDaySchedule & schedule) -{ - return LockMgr().GetWeekdaySchedule(endpointId, weekdayIndex, userIndex, schedule); -} - -DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, - EmberAfPluginDoorLockYearDaySchedule & schedule) -{ - return LockMgr().GetYeardaySchedule(endpointId, yearDayIndex, userIndex, schedule); -} - -DlStatus emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, - EmberAfPluginDoorLockHolidaySchedule & holidaySchedule) -{ - return LockMgr().GetHolidaySchedule(endpointId, holidayIndex, holidaySchedule); -} - -DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, - DlScheduleStatus status, DaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, - uint8_t endHour, uint8_t endMinute) -{ - return LockMgr().SetWeekdaySchedule(endpointId, weekdayIndex, userIndex, status, daysMask, startHour, startMinute, endHour, - endMinute); -} - -DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, - DlScheduleStatus status, uint32_t localStartTime, uint32_t localEndTime) -{ - return LockMgr().SetYeardaySchedule(endpointId, yearDayIndex, userIndex, status, localStartTime, localEndTime); -} - -DlStatus emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime, OperatingModeEnum operatingMode) -{ - return LockMgr().SetHolidaySchedule(endpointId, holidayIndex, status, localStartTime, localEndTime, operatingMode); -} - -void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId) -{ - // Apply the relock state in the application control - LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::LOCK_ACTION); -} diff --git a/examples/lock-app/silabs/SiWx917/third_party/connectedhomeip b/examples/lock-app/silabs/SiWx917/third_party/connectedhomeip deleted file mode 120000 index 59307833b4fee9..00000000000000 --- a/examples/lock-app/silabs/SiWx917/third_party/connectedhomeip +++ /dev/null @@ -1 +0,0 @@ -../../../../.. \ No newline at end of file diff --git a/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni b/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni deleted file mode 100644 index 8a4c77792c4616..00000000000000 --- a/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# add this gni as import in your build args to use pigweed in the example -# 'import("//with_pw_rpc.gni")' - -import("//build_overrides/chip.gni") -import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/Siwx917/args.gni") - -silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") - -app_data_model = "${chip_root}/examples/lock-app/lock-common" -chip_enable_pw_rpc = true -chip_enable_openthread = true -chip_openthread_ftd = true - -cpp_standard = "gnu++17" - -# To fit in flash -chip_detail_logging = false -show_qr_code = false 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 2ba2b4be9cf231..8d2cdf1ede6d19 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 @@ -172,7 +172,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; 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 60ba29378fb02a..ad45ed456c163f 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 @@ -477,7 +477,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; 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 c71b13938be727..80cfa9376dfabb 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 @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -145,12 +145,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -655,7 +655,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index eefd492aea1e31..fe00f39babd7ea 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,12 +124,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -262,12 +262,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -330,12 +330,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -381,7 +381,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -811,7 +811,7 @@ client cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -835,7 +835,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -1039,7 +1039,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1272,7 +1272,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1492,7 +1492,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1556,7 +1556,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1612,7 +1612,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1640,7 +1640,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ client cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1693,7 +1693,7 @@ client cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2089,7 +2089,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2127,7 +2127,7 @@ client cluster ModeSelect = 80 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2215,6 +2215,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -2243,14 +2251,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute nullable int16u currentPositionLift = 3; readonly attribute nullable int16u currentPositionTilt = 4; @@ -2319,7 +2319,7 @@ server cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -2469,12 +2469,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -2483,6 +2478,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -2595,14 +2595,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -2610,6 +2602,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int16u currentX = 3; readonly attribute int16u currentY = 4; attribute bitmap8 options = 15; @@ -2700,7 +2700,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } @@ -2970,7 +2970,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3092,7 +3092,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3146,7 +3146,7 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -3254,7 +3254,7 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 4fc58eb00c4dc4..06a656a0bf8432 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,12 +124,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -262,12 +262,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -330,12 +330,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -381,7 +381,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -796,7 +796,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -1000,7 +1000,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1233,7 +1233,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1453,7 +1453,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1517,7 +1517,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1573,7 +1573,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1601,7 +1601,7 @@ server cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ client cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1654,7 +1654,7 @@ client cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2050,7 +2050,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2088,7 +2088,7 @@ client cluster ModeSelect = 80 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2176,6 +2176,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -2204,14 +2212,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute nullable int16u currentPositionLift = 3; readonly attribute nullable int16u currentPositionTilt = 4; @@ -2280,7 +2280,7 @@ server cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -2430,12 +2430,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -2444,6 +2439,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -2556,14 +2556,6 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -2571,6 +2563,14 @@ server cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute int16u currentX = 3; readonly attribute int16u currentY = 4; attribute bitmap8 options = 15; @@ -2661,7 +2661,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } @@ -2931,7 +2931,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3053,7 +3053,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3107,7 +3107,7 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -3215,7 +3215,7 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } diff --git a/examples/placeholder/templates/tests-commands.zapt b/examples/placeholder/templates/tests-commands.zapt index f7bcbe375e802a..c1d87417bc5906 100644 --- a/examples/placeholder/templates/tests-commands.zapt +++ b/examples/placeholder/templates/tests-commands.zapt @@ -10,7 +10,7 @@ std::unique_ptrGetTestCommand(std::string testName) { - {{#chip_tests "../linux/apps/app1/ciTests.json"}} + {{#chip_tests "../linux/apps/app1/ciTests.json" includeAllClusters=true}} if (testName == "{{filename}}") { return std::unique_ptr<{{filename}}Suite>(new {{filename}}Suite()); @@ -22,7 +22,7 @@ std::unique_ptrGetTestCommand(std::string testName) void PrintTestCommands() { - {{#chip_tests "../linux/apps/app1/ciTests.json"}} + {{#chip_tests "../linux/apps/app1/ciTests.json" includeAllClusters=true}} {{#first}} ChipLogError(chipTool, "Supported commands:"); {{/first}} diff --git a/examples/platform/openiotsdk/supported_examples.txt b/examples/platform/openiotsdk/supported_examples.txt new file mode 100644 index 00000000000000..18e91e2080c38c --- /dev/null +++ b/examples/platform/openiotsdk/supported_examples.txt @@ -0,0 +1,2 @@ +shell +lock-app diff --git a/examples/platform/openiotsdk/tf-m/targets/an552/partition/flash_layout.h b/examples/platform/openiotsdk/tf-m/targets/an552/partition/flash_layout.h index 5adc3dcf35daff..68a33048e7b44b 100644 --- a/examples/platform/openiotsdk/tf-m/targets/an552/partition/flash_layout.h +++ b/examples/platform/openiotsdk/tf-m/targets/an552/partition/flash_layout.h @@ -24,30 +24,30 @@ * * QSPI SRAM S * 0x0000_0000 Secure image primary slot (384 KB) - * 0x0006_0000 Non-secure image primary slot (2 MB) - * 0x0026_0000 Secure image secondary slot (384 KB) - * 0x002C_0000 Non-secure image secondary slot (2 MB) - * 0x004C_0000 Scratch area (2 MB) - * 0x006C_0000 Protected Storage Area (64 KB) - * 0x006D_0000 Internal Trusted Storage Area (64 KB) - * 0x006E_0000 OTP / NV counters area (8 KB) - * 0x006E_2000 Unused + * 0x0006_0000 Non-secure image primary slot (2.25 MB) + * 0x002A_0000 Secure image secondary slot (384 KB) + * 0x0030_0000 Non-secure image secondary slot (2.25 MB) + * 0x0054_0000 Scratch area (1.125 MB) + * 0x0066_0000 Protected Storage Area (64 KB) + * 0x0067_0000 OTP / NV counters area (8 KB) + * 0x0067_2000 Internal Trusted Storage Area (64 KB) + * 0x0068_2000 Unused * * Flash layout on AN552 with BL2 (single image boot): * * QSPI SRAM S (part1) - * 0x0000_0000 Primary image area (2MB + 384 KB): + * 0x0000_0000 Primary image area (2.25MB + 384 KB): * 0x0000_0000 Secure image primary (384 KB) - * 0x0006_0000 Non-secure image primary (2 MB) + * 0x0006_0000 Non-secure image primary (2.25 MB) * QSPI SRAM S (part2) - * 0x0026_0000 Secondary image area (2MB + 384 KB): - * 0x0026_0000 Secure image secondary (384 KB) - * 0x002C_0000 Non-secure image secondary (384 KB) - * 0x004C_0000 Scratch area (2 MB) - * 0x006C_0000 Protected Storage Area (64 KB) - * 0x006D_0000 Internal Trusted Storage Area (64 KB) - * 0x006E_0000 OTP / NV counters area (8 KB) - * 0x006E_2000 Unused + * 0x002A_0000 Secondary image area (2.25MB + 384 KB): + * 0x002A_0000 Secure image secondary (384 KB) + * 0x0030_0000 Non-secure image secondary (2.25 KB) + * 0x0054_0000 Scratch area (1.125 MB) + * 0x0066_0000 Protected Storage Area (64 KB) + * 0x0067_0000 OTP / NV counters area (8 KB) + * 0x0067_2000 Internal Trusted Storage Area (64 KB) + * 0x0068_2000 Unused */ /* This header file is included from linker scatter file as well, where only a @@ -59,7 +59,7 @@ /* Size of a Secure and of a Non-secure image */ #define FLASH_S_PARTITION_SIZE (0x60000) /* S partition: 384 KB */ -#define FLASH_NS_PARTITION_SIZE (0x200000) /* NS partition: 2 MB */ +#define FLASH_NS_PARTITION_SIZE (0x240000) /* NS partition: 2.25 MB */ #define FLASH_MAX_PARTITION_SIZE \ ((FLASH_S_PARTITION_SIZE > FLASH_NS_PARTITION_SIZE) ? FLASH_S_PARTITION_SIZE : FLASH_NS_PARTITION_SIZE) @@ -145,16 +145,16 @@ #define FLASH_PS_AREA_OFFSET (FLASH_AREA_SCRATCH_OFFSET + FLASH_AREA_SCRATCH_SIZE) #define FLASH_PS_AREA_SIZE (0x10000) /* 64 KB */ -/* Internal Trusted Storage (ITS) Service definitions */ -#define FLASH_ITS_AREA_OFFSET (FLASH_PS_AREA_OFFSET + FLASH_PS_AREA_SIZE) -#define FLASH_ITS_AREA_SIZE (0x10000) /* 64 KB */ - /* OTP_definitions */ -#define FLASH_OTP_NV_COUNTERS_AREA_OFFSET (FLASH_ITS_AREA_OFFSET + FLASH_ITS_AREA_SIZE) +#define FLASH_OTP_NV_COUNTERS_AREA_OFFSET (FLASH_PS_AREA_OFFSET + FLASH_PS_AREA_SIZE) #define FLASH_OTP_NV_COUNTERS_AREA_SIZE (FLASH_AREA_IMAGE_SECTOR_SIZE * 2) #define FLASH_OTP_NV_COUNTERS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE -#if (FLASH_OTP_NV_COUNTERS_AREA_OFFSET + FLASH_OTP_NV_COUNTERS_AREA_SIZE > QSPI_SRAM_SIZE) +/* Internal Trusted Storage (ITS) Service definitions */ +#define FLASH_ITS_AREA_OFFSET (FLASH_OTP_NV_COUNTERS_AREA_OFFSET + FLASH_OTP_NV_COUNTERS_AREA_SIZE) +#define FLASH_ITS_AREA_SIZE (0x10000) /* 64 KB */ + +#if (FLASH_ITS_AREA_OFFSET + FLASH_ITS_AREA_SIZE > QSPI_SRAM_SIZE) #error "Out of QSPI SRAM memory!" #endif diff --git a/examples/platform/silabs/SilabsDeviceDataProvider.cpp b/examples/platform/silabs/SilabsDeviceDataProvider.cpp index 53e3e5fa3da259..eb0f8fee82ff1c 100644 --- a/examples/platform/silabs/SilabsDeviceDataProvider.cpp +++ b/examples/platform/silabs/SilabsDeviceDataProvider.cpp @@ -18,6 +18,7 @@ #include "SilabsDeviceDataProvider.h" #include #include +#include #include #include #include @@ -313,7 +314,17 @@ CHIP_ERROR SilabsDeviceDataProvider::GetSetupPayload(MutableCharSpan & payloadBu CHIP_ERROR SilabsDeviceDataProvider::GetVendorName(char * buf, size_t bufSize) { size_t vendorNameLen = 0; // without counting null-terminator - return SilabsConfig::ReadConfigValueStr(SilabsConfig::kConfigKey_VendorName, buf, bufSize, vendorNameLen); + CHIP_ERROR err = SilabsConfig::ReadConfigValueStr(SilabsConfig::kConfigKey_VendorName, buf, bufSize, vendorNameLen); +#if defined(CHIP_DEVICE_CONFIG_TEST_VENDOR_NAME) + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + { + VerifyOrReturnError(buf != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(bufSize > strlen(CHIP_DEVICE_CONFIG_TEST_VENDOR_NAME), CHIP_ERROR_BUFFER_TOO_SMALL); + Platform::CopyString(buf, bufSize, CHIP_DEVICE_CONFIG_TEST_VENDOR_NAME); + err = CHIP_NO_ERROR; + } +#endif + return err; } CHIP_ERROR SilabsDeviceDataProvider::GetVendorId(uint16_t & vendorId) @@ -339,7 +350,17 @@ CHIP_ERROR SilabsDeviceDataProvider::GetVendorId(uint16_t & vendorId) CHIP_ERROR SilabsDeviceDataProvider::GetProductName(char * buf, size_t bufSize) { size_t productNameLen = 0; // without counting null-terminator - return SilabsConfig::ReadConfigValueStr(SilabsConfig::kConfigKey_ProductName, buf, bufSize, productNameLen); + CHIP_ERROR err = SilabsConfig::ReadConfigValueStr(SilabsConfig::kConfigKey_ProductName, buf, bufSize, productNameLen); +#if defined(CHIP_DEVICE_CONFIG_TEST_PRODUCT_NAME) + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + { + VerifyOrReturnError(buf != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(bufSize > strlen(CHIP_DEVICE_CONFIG_TEST_VENDOR_NAME), CHIP_ERROR_BUFFER_TOO_SMALL); + Platform::CopyString(buf, bufSize, CHIP_DEVICE_CONFIG_TEST_PRODUCT_NAME); + err = CHIP_NO_ERROR; + } +#endif + return err; } CHIP_ERROR SilabsDeviceDataProvider::GetProductId(uint16_t & productId) @@ -370,7 +391,10 @@ CHIP_ERROR SilabsDeviceDataProvider::GetHardwareVersionString(char * buf, size_t #if defined(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING) if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { - memcpy(buf, CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING, bufSize); + VerifyOrReturnError(buf != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(bufSize > strlen(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING), + CHIP_ERROR_BUFFER_TOO_SMALL); + Platform::CopyString(buf, bufSize, CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING); err = CHIP_NO_ERROR; } #endif // CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 0f01768c57a550..47bd66c357f9c9 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -74,12 +74,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -107,7 +107,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -631,7 +631,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -860,7 +860,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1200,7 +1200,7 @@ server cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1320,7 +1320,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } 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 197a8f44784a43..5c3920bcca5318 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 @@ -74,12 +74,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -556,7 +556,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -785,7 +785,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1125,7 +1125,7 @@ client cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1245,7 +1245,7 @@ client cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ client cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } diff --git a/examples/shell/openiotsdk/README.md b/examples/shell/openiotsdk/README.md index 3acf66098b0094..b633fa7b0143a3 100644 --- a/examples/shell/openiotsdk/README.md +++ b/examples/shell/openiotsdk/README.md @@ -8,18 +8,17 @@ operations. For more details see [Common shell commands](../README.md#matter-shell-command-details). -## Build and run +## Build-run-test-debug -For information on how to build and run this example and further information -about the platform it is run on see -[Open IoT SDK examples](../../../docs/examples/openiotsdk_examples.md). +For information on how to build, run, test and debug this example and further +information about the platform it is run on see +[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). The example name to use in the scripts is `shell`. -## Using the example +## Example output -Communication with the application goes through the active telnet session. When -the application runs these lines should be visible: +When the example runs, these lines should be visible: ``` [INF] [SH] Open IoT SDK shell example application start @@ -27,7 +26,7 @@ the application runs these lines should be visible: > ``` -The shell application launched correctly. +This means the shell application launched correctly. Pass commands to the terminal and wait for the response. The application supports common Matter shell commands. They are used to control the basic diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index d5baf418af4728..c2a700b182f560 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -254,7 +254,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -357,7 +357,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -608,7 +608,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -667,7 +667,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -721,7 +721,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index a4190214247cd9..85fd54ea0e540a 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -107,7 +107,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -172,12 +172,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -698,7 +698,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -801,7 +801,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1058,7 +1058,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1112,7 +1112,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1283,7 +1283,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1339,7 +1339,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1669,12 +1669,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1683,6 +1678,11 @@ server cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index 84b13eea5a55be..4a8c3524431fd3 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -330,7 +330,7 @@ bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, c return static_cast(ret); } -bool ChannelManager::HandleSkipChannel(const uint16_t & count) +bool ChannelManager::HandleSkipChannel(const int16_t & count) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h index 0439900f7c37f2..77221069c30fc1 100644 --- a/examples/tv-app/android/java/ChannelManager.h +++ b/examples/tv-app/android/java/ChannelManager.h @@ -38,7 +38,7 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; - bool HandleSkipChannel(const uint16_t & count) override; + bool HandleSkipChannel(const int16_t & count) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/linux/include/channel/ChannelManager.cpp b/examples/tv-app/linux/include/channel/ChannelManager.cpp index bc517928e80e4a..9d7c2556e4ece9 100644 --- a/examples/tv-app/linux/include/channel/ChannelManager.cpp +++ b/examples/tv-app/linux/include/channel/ChannelManager.cpp @@ -111,13 +111,19 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper((count + mCurrentChannelIndex) % mChannels.size()); - mCurrentChannelIndex = newChannelIndex; - mCurrentChannel = mChannels[mCurrentChannelIndex]; + int32_t newChannelIndex = static_cast(count) + static_cast(mCurrentChannelIndex); + uint16_t channelsSize = static_cast(mChannels.size()); + + // handle newChannelIndex out of range. + newChannelIndex = newChannelIndex % channelsSize; + + if (newChannelIndex < 0) + { + newChannelIndex = newChannelIndex + channelsSize; + } + + mCurrentChannelIndex = static_cast(newChannelIndex); + mCurrentChannel = mChannels[mCurrentChannelIndex]; return true; } diff --git a/examples/tv-app/linux/include/channel/ChannelManager.h b/examples/tv-app/linux/include/channel/ChannelManager.h index 0557624a3c408a..326edddc53cc77 100644 --- a/examples/tv-app/linux/include/channel/ChannelManager.h +++ b/examples/tv-app/linux/include/channel/ChannelManager.h @@ -39,7 +39,7 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; - bool HandleSkipChannel(const uint16_t & count) override; + bool HandleSkipChannel(const int16_t & count) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index eb909228662b9c..0f5a0b997709ec 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -34,12 +34,12 @@ server cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -67,7 +67,7 @@ server cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -515,7 +515,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -685,7 +685,7 @@ client cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -830,7 +830,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1087,7 +1087,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1141,7 +1141,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1310,7 +1310,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1364,7 +1364,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1810,7 +1810,7 @@ server cluster Channel = 1284 { kMso = 0; } - bitmap ChannelFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -1850,7 +1850,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } response struct ChangeChannelResponse = 1 { @@ -1916,7 +1916,7 @@ server cluster MediaPlayback = 1286 { kBuffering = 3; } - bitmap MediaPlaybackFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -1987,7 +1987,7 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap MediaInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -2131,7 +2131,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -2185,7 +2185,7 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -2272,7 +2272,7 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap AudioOutputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -2312,7 +2312,7 @@ server cluster ApplicationLauncher = 1292 { kSystemBusy = 2; } - bitmap ApplicationLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kApplicationPlatform = 0x1; } 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 cb5ee908d264c7..5042f6d3dbad94 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 @@ -53,7 +53,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -139,12 +139,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -196,7 +196,7 @@ client cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -601,7 +601,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -704,7 +704,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -924,7 +924,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -986,7 +986,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1040,7 +1040,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1325,7 +1325,7 @@ client cluster Channel = 1284 { kMso = 0; } - bitmap ChannelFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -1370,7 +1370,7 @@ client cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ @@ -1435,7 +1435,7 @@ client cluster MediaPlayback = 1286 { kBuffering = 3; } - bitmap MediaPlaybackFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -1517,7 +1517,7 @@ client cluster MediaInput = 1287 { kOther = 11; } - bitmap MediaInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -1666,7 +1666,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -1721,7 +1721,7 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -1810,7 +1810,7 @@ client cluster AudioOutput = 1291 { kOther = 5; } - bitmap AudioOutputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -1852,7 +1852,7 @@ client cluster ApplicationLauncher = 1292 { kSystemBusy = 2; } - bitmap ApplicationLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kApplicationPlatform = 0x1; } diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index e48d6d2d0f87f3..88211bcee71282 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -59,7 +59,7 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -124,12 +124,12 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ server cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -631,7 +631,7 @@ server cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -823,7 +823,7 @@ server cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -967,7 +967,7 @@ server cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1187,7 +1187,7 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1243,7 +1243,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1414,7 +1414,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1470,7 +1470,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1808,6 +1808,14 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -1836,14 +1844,6 @@ server cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute int16u physicalClosedLimitLift = 1; readonly attribute int16u physicalClosedLimitTilt = 2; diff --git a/integrations/docker/images/chip-build-ti/Dockerfile b/integrations/docker/images/chip-build-ti/Dockerfile index 20eb5889c16f36..649c8a4fc831b6 100644 --- a/integrations/docker/images/chip-build-ti/Dockerfile +++ b/integrations/docker/images/chip-build-ti/Dockerfile @@ -11,9 +11,9 @@ RUN set -x \ # Install Sysconfig RUN set -x \ - && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.13.0.2553/sysconfig-1.13.0_2553-setup.run \ - && chmod +x sysconfig-1.13.0_2553-setup.run \ - && ./sysconfig-1.13.0_2553-setup.run --mode unattended \ + && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run \ + && chmod +x sysconfig-1.15.0_2826-setup.run \ + && ./sysconfig-1.15.0_2826-setup.run --mode unattended \ && : # last line -ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.13.0 +ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.15.0 diff --git a/integrations/docker/images/chip-build-tizen/tizen-sdk-installer/install.sh b/integrations/docker/images/chip-build-tizen/tizen-sdk-installer/install.sh index d072e936b14a64..e206e71c19a3a6 100755 --- a/integrations/docker/images/chip-build-tizen/tizen-sdk-installer/install.sh +++ b/integrations/docker/images/chip-build-tizen/tizen-sdk-installer/install.sh @@ -229,10 +229,18 @@ function install_tizen_sdk() { 'capi-network-bluetooth-devel-*.armv7l.rpm' 'capi-network-nsd-*.armv7l.rpm' 'capi-network-thread-*.armv7l.rpm' + 'capi-system-peripheral-io-*.armv7l.rpm' + 'capi-system-peripheral-io-devel-*.armv7l.rpm' 'capi-system-resource-1*.armv7l.rpm' 'libnsd-dns-sd-*.armv7l.rpm') download "$URL" "${PKG_ARR[@]}" + # Tizen Developer Platform Certificate + URL="http://download.tizen.org/sdk/extensions/Tizen_IoT_Headless/binary/" + PKG_ARR=( + "$TIZEN_VERSION-iot-things-add-ons_*_ubuntu-64.zip") + download "$URL" "${PKG_ARR[@]}" + # Install all info "Installing Tizen SDK..." @@ -254,6 +262,10 @@ function install_tizen_sdk() { echo "TIZEN_SDK_DATA_PATH=$TIZEN_SDK_DATA_PATH" >>"$TIZEN_SDK_ROOT/sdk.info" ln -sf "$TIZEN_SDK_DATA_PATH/.tizen-cli-config" "$TIZEN_SDK_ROOT/tools/.tizen-cli-config" + # Use Tizen developer platform certificate as default + cp "$TIZEN_SDK_ROOT"/tools/certificate-generator/certificates/distributor/sdk-platform/* \ + "$TIZEN_SDK_ROOT"/tools/certificate-generator/certificates/distributor/ + # Make symbolic links relative find "$TIZEN_SDK_SYSROOT/usr/lib" -maxdepth 1 -type l | while IFS= read -r LNK; do ln -sf "$(basename "$(readlink "$LNK")")" "$LNK" diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile index 276c5959f8e812..b6c4f2747f7963 100644 --- a/integrations/docker/images/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/chip-build-vscode/Dockerfile @@ -48,7 +48,7 @@ COPY --from=k32w /opt/sdk /opt/k32w_sdk COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland -COPY --from=ti /opt/ti/sysconfig_1.13.0 /opt/ti/sysconfig_1.13.0 +COPY --from=ti /opt/ti/sysconfig_1.15.0 /opt/ti/sysconfig_1.15.0 COPY --from=openiotsdk /opt/FVP_Corstone_SSE-300/ /opt/FVP_Corstone_SSE-300/ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 41c06f97e195e2..72fe38cbd1a08c 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.7.11 Version bump reason: [Telink] Update Docker image (Zephyr update) +0.7.13 Version bump reason: [TI] Update TI Sysconfig Version diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 51f1bfcf8252b9..31ea9711475967 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb # ZAP Development install, so that it runs on both x64 and arm64 # Generally this should match with the ZAP version that is used for codegen within the # specified SHA -ARG ZAP_VERSION=v2023.05.16-nightly +ARG ZAP_VERSION=v2023.05.22-nightly # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index de9184ec58a10c..32edf5b966606e 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -216,7 +216,7 @@ def __init__(self, ['git', 'describe', '--always', '--dirty', '--exclude', '*']).decode('ascii').strip() branchName = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('ascii').strip() self.extra_gn_options.append( - 'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha)) + 'sl_matter_version_str="v1.1-%s-%s"' % (branchName, shortCommitSha)) if "GSDK_ROOT" in os.environ: # EFR32 SDK is very large. If the SDK path is already known (the diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index e19f031184da0c..4b00c3aff8fb60 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -276,7 +276,7 @@ else { ShortCommitSha=$(git describe --always --dirty --exclude '*') branchName=$(git rev-parse --abbrev-ref HEAD) - optArgs+="sl_matter_version_str=\"v1.0-$branchName-$ShortCommitSha\" " + optArgs+="sl_matter_version_str=\"v1.1-$branchName-$ShortCommitSha\" " } &>/dev/null fi diff --git a/scripts/examples/openiotsdk_example.sh b/scripts/examples/openiotsdk_example.sh index 11aeffbe08601f..6b19a8be7f04e7 100755 --- a/scripts/examples/openiotsdk_example.sh +++ b/scripts/examples/openiotsdk_example.sh @@ -41,14 +41,17 @@ TELNET_CONNECTION_PORT="" FAILED_TESTS=0 IS_UNIT_TEST=0 FVP_NETWORK="user" +KVS_STORAGE_TYPE="tdb" +KVS_STORAGE_FILE="" -readarray -t TEST_NAMES <"$CHIP_ROOT"/src/test_driver/openiotsdk/unit-tests/testnames.txt +declare -A tdb_storage_param=([instance]=sram [memspace]=0 [address]=0x0 [size]=0x100000) +declare -A ps_storage_param=([instance]=qspi_sram [memspace]=0 [address]=0x660000 [size]=0x12000) -declare -a SUPPORTED_APP_NAMES -SUPPORTED_APP_NAMES+=("shell") -SUPPORTED_APP_NAMES+=("lock-app") +readarray -t SUPPORTED_APP_NAMES <"$CHIP_ROOT"/examples/platform/openiotsdk/supported_examples.txt SUPPORTED_APP_NAMES+=("unit-tests") +readarray -t TEST_NAMES <"$CHIP_ROOT"/src/test_driver/openiotsdk/unit-tests/test_components.txt + function show_usage() { cat < Action to execute -d,--debug Build in debug mode -l,--lwipdebug Build with LwIP debug logs support + -k,--kvsstore Select KVS storage type -p,--path Build path + -K,--kvsfile Path to KVS storage file which will be used to ensure persistence -n,--network FVP network interface name Examples: @@ -77,8 +82,13 @@ EOF You run or test individual test suites of unit tests by using their names [test_name] with the specified command: EOF - cat "$CHIP_ROOT"/src/test_driver/openiotsdk/unit-tests/testnames.txt + + for test in "${TEST_NAMES[@]}"; do + echo " $test" + done + cat <&2 + echo "Error: $GDB_PLUGIN does not exist." >&2 exit 1 fi @@ -156,6 +173,18 @@ function run_fvp() { RUN_OPTIONS+=(-C mps3_board.hostbridge.interfaceName="$FVP_NETWORK") fi + if [ -n "$KVS_STORAGE_FILE" ]; then + if [[ $KVS_STORAGE_TYPE == "ps" ]]; then + declare -n storage_param=ps_storage_param + else + declare -n storage_param=tdb_storage_param + fi + if [ -f "$KVS_STORAGE_FILE" ]; then + RUN_OPTIONS+=(--data "mps3_board.${storage_param[instance]}=$KVS_STORAGE_FILE@${storage_param[memspace]}:${storage_param[address]}") + fi + RUN_OPTIONS+=(--dump "mps3_board.${storage_param[instance]}=$KVS_STORAGE_FILE@${storage_param[memspace]}:${storage_param[address]},${storage_param[size]}") + fi + echo "Running $EXAMPLE_EXE_PATH with options: ${RUN_OPTIONS[@]}" # Run the FVP @@ -239,8 +268,8 @@ function run_test() { fi } -SHORT=C:,p:,d:,l:,n:,c,s,h -LONG=command:,path:,debug:,lwipdebug:,network:,clean,scratch,help +SHORT=C:,p:,d:,l:,n:,k:,K:,c,s,h +LONG=command:,path:,debug:,lwipdebug:,network:,kvsstore:,kvsfile:,clean,scratch,help OPTS=$(getopt -n build --options "$SHORT" --longoptions "$LONG" -- "$@") eval set -- "$OPTS" @@ -271,6 +300,14 @@ while :; do LWIP_DEBUG=$2 shift 2 ;; + -k | --kvsstore) + KVS_STORAGE_TYPE=$2 + shift 2 + ;; + -K | --kvsfile) + KVS_STORAGE_FILE=$2 + shift 2 + ;; -p | --path) BUILD_PATH=$CHIP_ROOT/$2 shift 2 @@ -334,6 +371,15 @@ else EXAMPLE_PATH="$CHIP_ROOT/examples/$EXAMPLE/openiotsdk" fi +case "$KVS_STORAGE_TYPE" in + ps | tdb) ;; + *) + echo "Wrong KVS storage type definition" + show_usage + exit 2 + ;; +esac + TOOLCHAIN_PATH="toolchains/toolchain-$TOOLCHAIN.cmake" if [ -z "$BUILD_PATH" ]; then diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja index 596cc5d4feef67..85428e4e056934 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja @@ -77,8 +77,10 @@ {%- endfor -%} {%- elif encodable.is_enum -%} {{target}} = static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive({{source}})); - {%- elif encodable.is_bitmap -%} + {%- elif encodable.is_untyped_bitmap -%} {{target}} = static_cast>(chip::JniReferences::GetInstance().{{encodable.boxed_java_type}}ToPrimitive({{source}})); + {%- elif encodable.is_bitmap -%} + {{target}}.SetRaw(static_cast::IntegerType>(chip::JniReferences::GetInstance().{{encodable.boxed_java_type}}ToPrimitive({{source}}))); {% else -%} {{target}} = static_cast>(chip::JniReferences::GetInstance().{{encodable.boxed_java_type}}ToPrimitive({{source}})); {% endif -%} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index e52913bc1d194b..b513493bb13dea 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -381,7 +381,11 @@ def is_enum(self): @property def is_bitmap(self): - self.context.is_bitmap_type(self.data_type.name) + return self.context.is_bitmap_type(self.data_type.name) + + @property + def is_untyped_bitmap(self): + return self.context.is_untyped_bitmap_type(self.data_type.name) def clone(self): return EncodableValue(self.context, self.data_type, self.attrs) diff --git a/scripts/py_matter_idl/matter_idl/generators/types.py b/scripts/py_matter_idl/matter_idl/generators/types.py index 960d73f28ea707..393c444ae46060 100644 --- a/scripts/py_matter_idl/matter_idl/generators/types.py +++ b/scripts/py_matter_idl/matter_idl/generators/types.py @@ -344,6 +344,10 @@ def is_struct_type(self, name: str): """ return any(map(lambda s: s.name == name, self.all_structs)) + def is_untyped_bitmap_type(self, name: str): + """Determine if the given type is a untyped bitmap (just an interger size).""" + return name.lower() in {"bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64"} + def is_bitmap_type(self, name: str): """ Determine if the given type name is type that is known to be a bitmap. @@ -351,7 +355,7 @@ def is_bitmap_type(self, name: str): Handles both standard/zcl names (like bitmap32) and types defined within the current lookup context. """ - if name.lower() in ["bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64"]: + if self.is_untyped_bitmap_type(name): return True return any(map(lambda s: s.name == name, self.all_bitmaps)) diff --git a/scripts/py_matter_yamltests/matter_yamltests/runner.py b/scripts/py_matter_yamltests/matter_yamltests/runner.py index f87f94d53dc993..6f201c8ea6ad74 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/runner.py +++ b/scripts/py_matter_yamltests/matter_yamltests/runner.py @@ -144,8 +144,8 @@ def run(self, parser_builder_config: TestParserBuilderConfig, runner_config: Tes continue loop = asyncio.get_event_loop() - result = loop.run_until_complete(asyncio.wait_for( - self._run(parser, runner_config), parser.timeout)) + result = loop.run_until_complete( + self._run_with_timeout(parser, runner_config)) if isinstance(result, Exception): raise (result) elif not result: @@ -157,11 +157,20 @@ def run(self, parser_builder_config: TestParserBuilderConfig, runner_config: Tes return parser_builder.done - async def _run(self, parser: TestParser, config: TestRunnerConfig): + async def _run_with_timeout(self, parser: TestParser, config: TestRunnerConfig): status = True try: await self.start() + status = await asyncio.wait_for(self._run(parser, config), parser.timeout) + except Exception as exception: + status = exception + finally: + await self.stop() + return status + async def _run(self, parser: TestParser, config: TestRunnerConfig): + status = True + try: hooks = config.hooks hooks.test_start(parser.filename, parser.name, parser.tests.count) @@ -214,5 +223,4 @@ async def _run(self, parser: TestParser, config: TestRunnerConfig): except Exception as exception: status = exception finally: - await self.stop() return status diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 8ef273aec70477..98b9f085b573ba 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -72,6 +72,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml"; load "../src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml"; load "../src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml"; diff --git a/scripts/setup/openiotsdk/debugging_setup.sh b/scripts/setup/openiotsdk/debugging_setup.sh new file mode 100755 index 00000000000000..09a199b19fbf7b --- /dev/null +++ b/scripts/setup/openiotsdk/debugging_setup.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Installing FVP Fast Model extension in /opt directory + +FAST_MODEL_EXT_DIR=/opt/FastModels_ThirdParty_IP_11-16_b16_Linux64 + +if [ ! -d "$FAST_MODEL_EXT_DIR" ]; then + echo "Fast Model Extension package directory: $FAST_MODEL_EXT_DIR does not exists. Ensure it is mounted." >&2 + exit 1 +fi + +echo "Install Fast Model extension in /opt" >&2 +cd "$FAST_MODEL_EXT_DIR" +sudo ./setup.bin --i-accept-the-license-agreement --basepath /opt +cd - diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 0b24ea7deff214..48e3ac92c77d51 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -9,7 +9,7 @@ "mac-arm64", "windows-amd64" ], - "tags": ["version:2@v2023.05.16-nightly.1"] + "tags": ["version:2@v2023.05.22-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 7482c5f526c684..5faf7f12b62949 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.05.16-nightly +v2023.05.22-nightly diff --git a/scripts/tests/yaml/tests_logger.py b/scripts/tests/yaml/tests_logger.py index bdfed70030fd83..0f718e243dbbb8 100755 --- a/scripts/tests/yaml/tests_logger.py +++ b/scripts/tests/yaml/tests_logger.py @@ -186,12 +186,13 @@ def test_stop(self, duration: int): def step_skipped(self, name: str, expression: str): print(self.__strings.step_skipped.format(index=self.__index, name=_strikethrough(name))) - self.__index += 1 - self.__skipped += 1 - if self.__use_test_harness_log_format: + print(self.__strings.test_harness_step_start.format(index=self.__index, name=name)) print(self.__strings.test_harness_step_skipped.format(expression=expression)) + self.__index += 1 + self.__skipped += 1 + def step_start(self, name: str): if self.__use_test_harness_log_format: print(self.__strings.test_harness_step_start.format(index=self.__index, name=name)) diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h index fba215552b81e7..0a04bdceb3d257 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClientCallbacks.h @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - #pragma once #include diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h index 9af15232480836..8601882bb35715 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h @@ -16,8 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion #pragma once #include diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h index fba215552b81e7..0a04bdceb3d257 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClientCallbacks.h @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - #pragma once #include diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h index 9af15232480836..8601882bb35715 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h @@ -16,8 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion #pragma once #include diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 116ed9c9ad4bb4..a91fe56ae972a4 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.5.16' +MIN_ZAP_VERSION = '2023.5.22' class ZapTool: diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp index 4e1275686689b4..6c45055c3933b0 100644 --- a/src/app/AttributePathExpandIterator.cpp +++ b/src/app/AttributePathExpandIterator.cpp @@ -18,11 +18,11 @@ #include -#include #include #include #include #include +#include #include #include #include diff --git a/zzz_generated/app-common/app-common/zap-generated/att-storage.h b/src/app/att-storage.h similarity index 95% rename from zzz_generated/app-common/app-common/zap-generated/att-storage.h rename to src/app/att-storage.h index 60559813a3fc99..9befaacf7cc160 100644 --- a/zzz_generated/app-common/app-common/zap-generated/att-storage.h +++ b/src/app/att-storage.h @@ -14,10 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -// THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion #pragma once // Cluster masks modify how clusters are used by the framework diff --git a/src/app/clusters/application-launcher-server/application-launcher-delegate.h b/src/app/clusters/application-launcher-server/application-launcher-delegate.h index d8b15c4673d4f9..1a945e8714db71 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-delegate.h +++ b/src/app/clusters/application-launcher-server/application-launcher-delegate.h @@ -43,9 +43,9 @@ class Delegate Delegate() : Delegate(false){}; Delegate(bool featureMapContentPlatform) { mFeatureMapContentPlatform = featureMapContentPlatform; }; - inline bool HasFeature(ApplicationLauncherFeature feature) + inline bool HasFeature(Feature feature) { - if (feature == ApplicationLauncherFeature::kApplicationPlatform) + if (feature == Feature::kApplicationPlatform) { return mFeatureMapContentPlatform; } diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 24ac02589babd9..e3ed24e0ad39ea 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -107,7 +107,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool HasFeature(chip::EndpointId endpoint, ApplicationLauncherFeature feature) +bool HasFeature(chip::EndpointId endpoint, Feature feature) { bool hasFeature = false; uint32_t featureMap = 0; @@ -125,7 +125,7 @@ bool HasFeature(chip::EndpointId endpoint, ApplicationLauncherFeature feature) CHIP_ERROR Delegate::HandleGetCurrentApp(app::AttributeValueEncoder & aEncoder) { #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - if (HasFeature(ApplicationLauncherFeature::kApplicationPlatform)) + if (HasFeature(Feature::kApplicationPlatform)) { auto & platform = ContentAppPlatform::GetInstance(); if (platform.HasCurrentApp()) @@ -246,7 +246,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co // 2. Set current app to Content App // 3. Set Content App status (basic cluster) to ACTIVE_VISIBLE_FOCUS // 4. Call launch app command on Content App - if (delegate->HasFeature(ApplicationLauncherFeature::kApplicationPlatform)) + if (delegate->HasFeature(Feature::kApplicationPlatform)) { ChipLogError(Zcl, "ApplicationLauncher has content platform feature"); ContentApp * app = ContentAppPlatform::GetInstance().LoadContentApp(&vendorApp); @@ -340,7 +340,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm // 3. If this was the current app then stop it // 2. Set Content App status (basic cluster) to ACTIVE_STOPPED // 4. Call stop app command on Content App - if (delegate->HasFeature(ApplicationLauncherFeature::kApplicationPlatform)) + if (delegate->HasFeature(Feature::kApplicationPlatform)) { ChipLogError(Zcl, "ApplicationLauncher has content platform feature"); ContentApp * app = ContentAppPlatform::GetInstance().LoadContentApp(&vendorApp); @@ -429,7 +429,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm // 3. If this was the current app then hide it // 2. Set Content App status (basic cluster) to ACTIVE_VISIBLE_NOT_FOCUS // 4. Call stop app command on Content App - if (delegate->HasFeature(ApplicationLauncherFeature::kApplicationPlatform)) + if (delegate->HasFeature(Feature::kApplicationPlatform)) { ChipLogError(Zcl, "ApplicationLauncher has content platform feature"); ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(&vendorApp); diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 4e3b329289df86..81b94192fbb2d7 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -84,7 +84,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool HasFeature(chip::EndpointId endpoint, AudioOutputFeature feature) +bool HasFeature(chip::EndpointId endpoint, Feature feature) { bool hasFeature = false; uint32_t featureMap = 0; @@ -181,7 +181,7 @@ bool emberAfAudioOutputClusterRenameOutputCallback(app::CommandHandler * command Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - if (!HasFeature(endpoint, AudioOutputFeature::kNameUpdates)) + if (!HasFeature(endpoint, Feature::kNameUpdates)) { ChipLogError(Zcl, "AudioOutput no name updates feature"); err = CHIP_ERROR_INCORRECT_STATE; diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index 60f5aba15af1c3..f5fbbadda7ae16 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -42,9 +42,9 @@ class Delegate virtual void HandleChangeChannel(CommandResponseHelper & helper, const chip::CharSpan & match) = 0; virtual bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) = 0; - virtual bool HandleSkipChannel(const uint16_t & count) = 0; + virtual bool HandleSkipChannel(const int16_t & count) = 0; - bool HasFeature(chip::EndpointId endpoint, ChannelFeature feature); + bool HasFeature(chip::EndpointId endpoint, Feature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; virtual ~Delegate() = default; diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index a5c5a9f28995e0..72c0f59b06a66d 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -94,7 +94,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool Delegate::HasFeature(chip::EndpointId endpoint, ChannelFeature feature) +bool Delegate::HasFeature(chip::EndpointId endpoint, Feature feature) { uint32_t featureMap = GetFeatureMap(endpoint); return (featureMap & chip::to_underlying(feature)); @@ -134,7 +134,7 @@ CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, switch (aPath.mAttributeId) { case app::Clusters::Channel::Attributes::ChannelList::Id: { - if (isDelegateNull(delegate, endpoint) || !delegate->HasFeature(endpoint, ChannelFeature::kChannelList)) + if (isDelegateNull(delegate, endpoint) || !delegate->HasFeature(endpoint, Feature::kChannelList)) { return aEncoder.EncodeEmptyList(); } @@ -142,7 +142,7 @@ CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, return ReadChannelListAttribute(aEncoder, delegate); } case app::Clusters::Channel::Attributes::Lineup::Id: { - if (isDelegateNull(delegate, endpoint) || !delegate->HasFeature(endpoint, ChannelFeature::kLineupInfo)) + if (isDelegateNull(delegate, endpoint) || !delegate->HasFeature(endpoint, Feature::kLineupInfo)) { return CHIP_NO_ERROR; } diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 6247cd3c03770d..e80e87b0ea9440 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -79,7 +79,7 @@ ColorControlServer & ColorControlServer::Instance() return instance; } -bool ColorControlServer::HasFeature(chip::EndpointId endpoint, ColorControlFeature feature) +bool ColorControlServer::HasFeature(chip::EndpointId endpoint, Feature feature) { bool success; uint32_t featureMap; diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index d82fabc88fb8e2..e9a87182770fb8 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -55,8 +55,6 @@ #define REPORT_FAILED 0xFF -using chip::app::Clusters::ColorControl::ColorControlFeature; - /** * @brief color-control-server class */ @@ -69,6 +67,7 @@ class ColorControlServer using HueStepMode = chip::app::Clusters::ColorControl::HueStepMode; using HueMoveMode = chip::app::Clusters::ColorControl::HueMoveMode; using HueDirection = chip::app::Clusters::ColorControl::HueDirection; + using Feature = chip::app::Clusters::ColorControl::Feature; enum ColorMode { @@ -128,7 +127,7 @@ class ColorControlServer *********************************************************/ static ColorControlServer & Instance(); - bool HasFeature(chip::EndpointId endpoint, ColorControlFeature feature); + bool HasFeature(chip::EndpointId endpoint, Feature feature); chip::Protocols::InteractionModel::Status stopAllColorTransitions(chip::EndpointId endpoint); bool stopMoveStepCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, uint8_t optionsMask, uint8_t optionsOverride); diff --git a/src/app/clusters/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h index ef8afc5dd92627..5f189861164088 100644 --- a/src/app/clusters/content-launch-server/content-launch-delegate.h +++ b/src/app/clusters/content-launch-server/content-launch-delegate.h @@ -50,7 +50,7 @@ class Delegate virtual uint32_t HandleGetSupportedStreamingProtocols() = 0; - bool HasFeature(chip::EndpointId endpoint, ContentLauncherFeature feature); + bool HasFeature(chip::EndpointId endpoint, Feature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; virtual ~Delegate() = default; diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 25d6987cd1ed02..f5a700ff8a972d 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -99,7 +99,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool Delegate::HasFeature(chip::EndpointId endpoint, ContentLauncherFeature feature) +bool Delegate::HasFeature(chip::EndpointId endpoint, Feature feature) { uint32_t featureMap = GetFeatureMap(endpoint); return (featureMap & chip::to_underlying(feature)); @@ -207,8 +207,7 @@ bool emberAfContentLauncherClusterLaunchContentCallback(CommandHandler * command Delegate * delegate = GetDelegate(endpoint); - VerifyOrExit(isDelegateNull(delegate, endpoint) != true && - delegate->HasFeature(endpoint, ContentLauncherFeature::kContentSearch), + VerifyOrExit(isDelegateNull(delegate, endpoint) != true && delegate->HasFeature(endpoint, Feature::kContentSearch), err = CHIP_ERROR_INCORRECT_STATE); delegate->HandleLaunchContent(responder, decodableParameterList, autoplay, data.HasValue() ? data.Value() : CharSpan()); @@ -241,7 +240,7 @@ bool emberAfContentLauncherClusterLaunchURLCallback(CommandHandler * commandObj, app::CommandResponseHelper responder(commandObj, commandPath); Delegate * delegate = GetDelegate(endpoint); - VerifyOrExit(isDelegateNull(delegate, endpoint) != true && delegate->HasFeature(endpoint, ContentLauncherFeature::kURLPlayback), + VerifyOrExit(isDelegateNull(delegate, endpoint) != true && delegate->HasFeature(endpoint, Feature::kURLPlayback), err = CHIP_ERROR_INCORRECT_STATE); { delegate->HandleLaunchUrl(responder, contentUrl, displayString.HasValue() ? displayString.Value() : CharSpan(), diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index c363ada6d4c30f..757063b5f173af 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -1313,9 +1313,9 @@ void DoorLockServer::clearYearDayScheduleCommandHandler(chip::app::CommandHandle commandObj->AddStatus(commandPath, Status::Success); } -chip::BitFlags DoorLockServer::GetFeatures(chip::EndpointId endpointId) +chip::BitFlags DoorLockServer::GetFeatures(chip::EndpointId endpointId) { - chip::BitFlags featureMap; + chip::BitFlags featureMap; if (!GetAttribute(endpointId, Attributes::FeatureMap::Id, Attributes::FeatureMap::Get, *featureMap.RawStorage())) { ChipLogError(Zcl, "Unable to get the door lock feature map: attribute read error"); diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index 2fca20ddfdc628..5728a4a891c559 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -43,7 +43,6 @@ using chip::app::Clusters::DoorLock::DataOperationTypeEnum; using chip::app::Clusters::DoorLock::DaysMaskMap; using chip::app::Clusters::DoorLock::DlLockState; using chip::app::Clusters::DoorLock::DlStatus; -using chip::app::Clusters::DoorLock::DoorLockFeature; using chip::app::Clusters::DoorLock::DoorStateEnum; using chip::app::Clusters::DoorLock::LockDataTypeEnum; using chip::app::Clusters::DoorLock::LockOperationTypeEnum; @@ -83,6 +82,8 @@ class DoorLockServer public: static DoorLockServer & Instance(); + using Feature = chip::app::Clusters::DoorLock::Feature; + void InitServer(chip::EndpointId endpointId); /** @@ -142,50 +143,46 @@ class DoorLockServer bool SendLockAlarmEvent(chip::EndpointId endpointId, AlarmCodeEnum alarmCode); - chip::BitFlags GetFeatures(chip::EndpointId endpointId); + chip::BitFlags GetFeatures(chip::EndpointId endpointId); - inline bool SupportsPIN(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(DoorLockFeature::kPinCredential); } + inline bool SupportsPIN(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(Feature::kPinCredential); } - inline bool SupportsRFID(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(DoorLockFeature::kRfidCredential); } + inline bool SupportsRFID(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(Feature::kRfidCredential); } - inline bool SupportsFingers(chip::EndpointId endpointId) - { - return GetFeatures(endpointId).Has(DoorLockFeature::kFingerCredentials); - } + inline bool SupportsFingers(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(Feature::kFingerCredentials); } - inline bool SupportsFace(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(DoorLockFeature::kFaceCredentials); } + inline bool SupportsFace(chip::EndpointId endpointId) { return GetFeatures(endpointId).Has(Feature::kFaceCredentials); } inline bool SupportsWeekDaySchedules(chip::EndpointId endpointId) { - return GetFeatures(endpointId).Has(DoorLockFeature::kWeekDayAccessSchedules); + return GetFeatures(endpointId).Has(Feature::kWeekDayAccessSchedules); } inline bool SupportsYearDaySchedules(chip::EndpointId endpointId) { - return GetFeatures(endpointId).Has(DoorLockFeature::kYearDayAccessSchedules); + return GetFeatures(endpointId).Has(Feature::kYearDayAccessSchedules); } inline bool SupportsHolidaySchedules(chip::EndpointId endpointId) { - return GetFeatures(endpointId).Has(DoorLockFeature::kHolidaySchedules); + return GetFeatures(endpointId).Has(Feature::kHolidaySchedules); } inline bool SupportsAnyCredential(chip::EndpointId endpointId) { return GetFeatures(endpointId) - .HasAny(DoorLockFeature::kPinCredential, DoorLockFeature::kRfidCredential, DoorLockFeature::kFingerCredentials, - DoorLockFeature::kFaceCredentials); + .HasAny(Feature::kPinCredential, Feature::kRfidCredential, Feature::kFingerCredentials, Feature::kFaceCredentials); } inline bool SupportsCredentialsOTA(chip::EndpointId endpointId) { - return GetFeatures(endpointId).Has(DoorLockFeature::kCredentialsOverTheAirAccess); + return GetFeatures(endpointId).Has(Feature::kCredentialsOverTheAirAccess); } inline bool SupportsUSR(chip::EndpointId endpointId) { // appclusters, 5.2.2: USR feature has conformance [PIN | RID | FGP | FACE] - return GetFeatures(endpointId).Has(DoorLockFeature::kUser) && SupportsAnyCredential(endpointId); + return GetFeatures(endpointId).Has(Feature::kUser) && SupportsAnyCredential(endpointId); } bool OnFabricRemoved(chip::EndpointId endpointId, chip::FabricIndex fabricIndex); diff --git a/src/app/clusters/fan-control-server/fan-control-server.cpp b/src/app/clusters/fan-control-server/fan-control-server.cpp index 9d3a36e1f6a9f2..25b593bbf9ce2f 100644 --- a/src/app/clusters/fan-control-server/fan-control-server.cpp +++ b/src/app/clusters/fan-control-server/fan-control-server.cpp @@ -140,7 +140,7 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt uint32_t ourFeatureMap; if (FeatureMap::Get(attributePath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS) { - if (ourFeatureMap & to_underlying(FanControlFeature::kMultiSpeed)) + if (ourFeatureMap & to_underlying(Feature::kMultiSpeed)) multiSpeedSupported = true; } } diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 359176876220a3..6f890fdd747777 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -15,12 +15,12 @@ * limitations under the License. */ -#include #include #include #include #include #include +#include #include #include #include diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 9a5604dd3b6838..feb0f55733cb55 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -17,11 +17,11 @@ #include "groups-server.h" -#include #include #include #include #include +#include #include #include #include @@ -129,7 +129,7 @@ void emberAfGroupsClusterServerInitCallback(EndpointId endpointId) ChipLogDetail(Zcl, "ERR: writing NameSupport %x", status); } - status = Attributes::FeatureMap::Set(endpointId, static_cast(GroupsFeature::kGroupNames)); + status = Attributes::FeatureMap::Set(endpointId, static_cast(Feature::kGroupNames)); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogDetail(Zcl, "ERR: writing group feature map %x", status); diff --git a/src/app/clusters/keypad-input-server/keypad-input-delegate.h b/src/app/clusters/keypad-input-server/keypad-input-delegate.h index 65e217bb1a84c9..608b45f0b896e4 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-delegate.h +++ b/src/app/clusters/keypad-input-server/keypad-input-delegate.h @@ -36,7 +36,7 @@ class Delegate public: virtual void HandleSendKey(CommandResponseHelper & helper, const CecKeyCode & keyCode) = 0; - bool HasFeature(chip::EndpointId endpoint, KeypadInputFeature feature); + bool HasFeature(chip::EndpointId endpoint, Feature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 25e8dad47c674e..9790e2f5a6b6ab 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -102,7 +102,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool Delegate::HasFeature(chip::EndpointId endpoint, KeypadInputFeature feature) +bool Delegate::HasFeature(EndpointId endpoint, Feature feature) { uint32_t featureMap = GetFeatureMap(endpoint); return (featureMap & chip::to_underlying(feature)); diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 77242ea554f39d..5a732074dd0851 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -1223,7 +1223,7 @@ void emberAfLevelControlClusterServerInitCallback(EndpointId endpoint) Attributes::MinLevel::Get(endpoint, &state->minLevel); Attributes::MaxLevel::Get(endpoint, &state->maxLevel); - if (LevelControlHasFeature(endpoint, LevelControlFeature::kLighting)) + if (LevelControlHasFeature(endpoint, Feature::kLighting)) { if (state->minLevel < LEVEL_CONTROL_LIGHTING_MIN_LEVEL) { @@ -1322,7 +1322,7 @@ static bool areStartUpLevelControlServerAttributesNonVolatile(EndpointId endpoin void emberAfPluginLevelControlClusterServerPostInitCallback(EndpointId endpoint) {} -bool LevelControlHasFeature(EndpointId endpoint, LevelControlFeature feature) +bool LevelControlHasFeature(EndpointId endpoint, Feature feature) { bool success; uint32_t featureMap; diff --git a/src/app/clusters/level-control/level-control.h b/src/app/clusters/level-control/level-control.h index e4d2c6593ada22..402c30de3048d5 100644 --- a/src/app/clusters/level-control/level-control.h +++ b/src/app/clusters/level-control/level-control.h @@ -44,7 +44,7 @@ void emberAfPluginLevelControlClusterServerPostInitCallback(chip::EndpointId end * has the given feature. The implementation is allowed to assume there is in * fact an instance of Level Control on the given endpoint. */ -bool LevelControlHasFeature(chip::EndpointId endpoint, chip::app::Clusters::LevelControl::LevelControlFeature feature); +bool LevelControlHasFeature(chip::EndpointId endpoint, chip::app::Clusters::LevelControl::Feature feature); namespace LevelControlServer { diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 53d368b62fb29f..7c19ec264f12a7 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -84,7 +84,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -bool HasFeature(chip::EndpointId endpoint, MediaInputFeature feature) +bool HasFeature(chip::EndpointId endpoint, Feature feature) { bool hasFeature = false; uint32_t featureMap = 0; @@ -258,7 +258,7 @@ bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - if (!HasFeature(endpoint, MediaInputFeature::kNameUpdates)) + if (!HasFeature(endpoint, Feature::kNameUpdates)) { ChipLogError(Zcl, "MediaInput no name updates feature"); err = CHIP_ERROR_INCORRECT_STATE; diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index f4aac43abedb25..794662e7b7c1e8 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -15,7 +15,6 @@ * limitations under the License. */ -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index c8c9a4c117c7cf..3a18a094a69360 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -94,41 +94,37 @@ void Instance::InvokeCommand(HandlerContext & ctxt) switch (ctxt.mRequestPath.mCommandId) { case Commands::ScanNetworks::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface) || - mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface) || mFeatureFlags.Has(Feature::kThreadNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleScanNetworks(ctx, req); }); return; case Commands::AddOrUpdateWiFiNetwork::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleAddOrUpdateWiFiNetwork(ctx, req); }); return; case Commands::AddOrUpdateThreadNetwork::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kThreadNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleAddOrUpdateThreadNetwork(ctx, req); }); return; case Commands::RemoveNetwork::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface) || - mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface) || mFeatureFlags.Has(Feature::kThreadNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleRemoveNetwork(ctx, req); }); return; case Commands::ConnectNetwork::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface) || - mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface) || mFeatureFlags.Has(Feature::kThreadNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleConnectNetwork(ctx, req); }); return; case Commands::ReorderNetwork::Id: - VerifyOrReturn(mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface) || - mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)); + VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface) || mFeatureFlags.Has(Feature::kThreadNetworkInterface)); HandleCommand( ctxt, [this](HandlerContext & ctx, const auto & req) { HandleReorderNetwork(ctx, req); }); return; @@ -248,7 +244,7 @@ void Instance::OnNetworkingStatusChange(NetworkCommissioning::Status aCommission void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetworks::DecodableType & req) { MATTER_TRACE_EVENT_SCOPE("HandleScanNetwork", "NetworkCommissioning"); - if (mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface)) + if (mFeatureFlags.Has(Feature::kWiFiNetworkInterface)) { ByteSpan ssid; if (req.ssid.HasValue()) @@ -275,7 +271,7 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw ctx.mCommandHandler.FlushAcksRightAwayOnSlowCommand(); mpDriver.Get()->ScanNetworks(ssid, this); } - else if (mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)) + else if (mFeatureFlags.Has(Feature::kThreadNetworkInterface)) { mCurrentOperationBreadcrumb = req.breadcrumb; mAsyncCommandHandle = CommandHandler::Handle(&ctx.mCommandHandler); @@ -725,7 +721,7 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust ScanNetworks::Id, AddOrUpdateThreadNetwork::Id, RemoveNetwork::Id, ConnectNetwork::Id, ReorderNetwork::Id, }; - if (mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)) + if (mFeatureFlags.Has(Feature::kThreadNetworkInterface)) { for (const auto & cmd : acceptedCommandsListThread) { @@ -738,7 +734,7 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust return CHIP_NO_ERROR; } - if (mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface)) + if (mFeatureFlags.Has(Feature::kWiFiNetworkInterface)) { for (const auto & cmd : acceptedCommandsListWiFi) { @@ -761,8 +757,7 @@ CHIP_ERROR Instance::EnumerateGeneratedCommands(const ConcreteClusterPath & clus constexpr CommandId generatedCommandsListWireless[] = { ScanNetworksResponse::Id, NetworkConfigResponse::Id, ConnectNetworkResponse::Id }; - if (mFeatureFlags.HasAny(NetworkCommissioningFeature::kWiFiNetworkInterface, - NetworkCommissioningFeature::kThreadNetworkInterface)) + if (mFeatureFlags.HasAny(Feature::kWiFiNetworkInterface, Feature::kThreadNetworkInterface)) { for (const auto & cmd : generatedCommandsListWireless) { diff --git a/src/app/clusters/network-commissioning/network-commissioning.h b/src/app/clusters/network-commissioning/network-commissioning.h index 5ec03e2b8a1309..a103c41511e9c4 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.h +++ b/src/app/clusters/network-commissioning/network-commissioning.h @@ -78,7 +78,7 @@ class Instance : public CommandHandlerInterface, void OnCommissioningComplete(); void OnFailSafeTimerExpired(); - const BitFlags mFeatureFlags; + const BitFlags mFeatureFlags; DeviceLayer::NetworkCommissioning::Internal::WirelessDriver * const mpWirelessDriver; DeviceLayer::NetworkCommissioning::Internal::BaseDriver * const mpBaseDriver; @@ -120,24 +120,24 @@ class Instance : public CommandHandlerInterface, public: Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::WiFiDriver * apDelegate) : CommandHandlerInterface(Optional(aEndpointId), Id), - AttributeAccessInterface(Optional(aEndpointId), Id), - mFeatureFlags(NetworkCommissioningFeature::kWiFiNetworkInterface), mpWirelessDriver(apDelegate), mpBaseDriver(apDelegate) + AttributeAccessInterface(Optional(aEndpointId), Id), mFeatureFlags(Feature::kWiFiNetworkInterface), + mpWirelessDriver(apDelegate), mpBaseDriver(apDelegate) { mpDriver.Set(apDelegate); } Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::ThreadDriver * apDelegate) : CommandHandlerInterface(Optional(aEndpointId), Id), - AttributeAccessInterface(Optional(aEndpointId), Id), - mFeatureFlags(NetworkCommissioningFeature::kThreadNetworkInterface), mpWirelessDriver(apDelegate), mpBaseDriver(apDelegate) + AttributeAccessInterface(Optional(aEndpointId), Id), mFeatureFlags(Feature::kThreadNetworkInterface), + mpWirelessDriver(apDelegate), mpBaseDriver(apDelegate) { mpDriver.Set(apDelegate); } Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::EthernetDriver * apDelegate) : CommandHandlerInterface(Optional(aEndpointId), Id), - AttributeAccessInterface(Optional(aEndpointId), Id), - mFeatureFlags(NetworkCommissioningFeature::kEthernetNetworkInterface), mpWirelessDriver(nullptr), mpBaseDriver(apDelegate) + AttributeAccessInterface(Optional(aEndpointId), Id), mFeatureFlags(Feature::kEthernetNetworkInterface), + mpWirelessDriver(nullptr), mpBaseDriver(apDelegate) {} virtual ~Instance() = default; 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 c79b9d592cdca8..b201c022326a0d 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -107,7 +107,7 @@ OnOffServer & OnOffServer::Instance() return instance; } -bool OnOffServer::HasFeature(chip::EndpointId endpoint, OnOffFeature feature) +bool OnOffServer::HasFeature(chip::EndpointId endpoint, Feature feature) { bool success; uint32_t featureMap; @@ -138,7 +138,7 @@ static bool LevelControlWithOnOffFeaturePresent(EndpointId endpoint) return false; } - return LevelControlHasFeature(endpoint, LevelControl::LevelControlFeature::kOnOff); + return LevelControlHasFeature(endpoint, LevelControl::Feature::kOnOff); } #endif // EMBER_AF_PLUGIN_LEVEL_CONTROL 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 46f4eb4154675f..4b9da3d89cdfdc 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -24,8 +24,6 @@ #include #include -using chip::app::Clusters::OnOff::OnOffFeature; - /********************************************************** * Defines and Macros *********************************************************/ @@ -43,6 +41,8 @@ static constexpr uint8_t MIN_TIME_VALUE = 1; class OnOffServer { public: + using Feature = chip::app::Clusters::OnOff::Feature; + /********************************************************** * Functions Definitions *********************************************************/ @@ -63,11 +63,8 @@ class OnOffServer EmberAfStatus setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange); EmberAfStatus getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp); - bool HasFeature(chip::EndpointId endpoint, OnOffFeature feature); - inline bool SupportsLightingApplications(chip::EndpointId endpointId) - { - return HasFeature(endpointId, OnOffFeature::kLighting); - } + bool HasFeature(chip::EndpointId endpoint, Feature feature); + inline bool SupportsLightingApplications(chip::EndpointId endpointId) { return HasFeature(endpointId, Feature::kLighting); } void cancelEndpointTimerCallback(chip::EndpointId endpoint); diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index 59d62bc3a80f01..cb369f6b2f23fd 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -228,7 +228,7 @@ static void setEffectiveModes(EndpointId endpoint) } } -bool HasFeature(EndpointId endpoint, PumpConfigurationAndControlFeature feature) +bool HasFeature(EndpointId endpoint, Feature feature) { bool hasFeature; uint32_t featureMap; @@ -267,37 +267,37 @@ chip::Protocols::InteractionModel::Status MatterPumpConfigurationAndControlClust switch (controlMode) { case ControlModeEnum::kConstantFlow: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantFlow)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantFlow)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case ControlModeEnum::kConstantPressure: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantPressure)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantPressure)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case ControlModeEnum::kConstantSpeed: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantSpeed)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantSpeed)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case ControlModeEnum::kConstantTemperature: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantTemperature)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantTemperature)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case ControlModeEnum::kProportionalPressure: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kCompensatedPressure)) + if (!HasFeature(attributePath.mEndpointId, Feature::kCompensatedPressure)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case ControlModeEnum::kAutomatic: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kAutomatic)) + if (!HasFeature(attributePath.mEndpointId, Feature::kAutomatic)) { status = Protocols::InteractionModel::Status::ConstraintError; } @@ -318,19 +318,19 @@ chip::Protocols::InteractionModel::Status MatterPumpConfigurationAndControlClust switch (operationMode) { case OperationModeEnum::kMinimum: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantSpeed)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantSpeed)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case OperationModeEnum::kMaximum: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kConstantSpeed)) + if (!HasFeature(attributePath.mEndpointId, Feature::kConstantSpeed)) { status = Protocols::InteractionModel::Status::ConstraintError; } break; case OperationModeEnum::kLocal: - if (!HasFeature(attributePath.mEndpointId, PumpConfigurationAndControlFeature::kLocalOperation)) + if (!HasFeature(attributePath.mEndpointId, Feature::kLocalOperation)) { status = Protocols::InteractionModel::Status::ConstraintError; } diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 1436025f6377b0..3ddbe55b157f16 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -88,11 +88,11 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & case ThreadMetrics::Id: return ReadThreadMetrics(aEncoder); case Clusters::Globals::Attributes::FeatureMap::Id: { - BitFlags features; + BitFlags features; if (DeviceLayer::GetDiagnosticDataProvider().SupportsWatermarks()) { - features.Set(SoftwareDiagnosticsFeature::kWaterMarks); + features.Set(Feature::kWaterMarks); } return aEncoder.Encode(features); diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index 7e9661f6fecd46..d01f2fac668746 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -113,7 +113,7 @@ namespace app { namespace Clusters { namespace WindowCovering { -bool HasFeature(chip::EndpointId endpoint, WindowCoveringFeature feature) +bool HasFeature(chip::EndpointId endpoint, Feature feature) { bool hasFeature = false; uint32_t featureMap = 0; @@ -129,12 +129,12 @@ bool HasFeature(chip::EndpointId endpoint, WindowCoveringFeature feature) bool HasFeaturePaLift(chip::EndpointId endpoint) { - return (HasFeature(endpoint, WindowCoveringFeature::kLift) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)); + return (HasFeature(endpoint, Feature::kLift) && HasFeature(endpoint, Feature::kPositionAwareLift)); } bool HasFeaturePaTilt(chip::EndpointId endpoint) { - return (HasFeature(endpoint, WindowCoveringFeature::kTilt) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)); + return (HasFeature(endpoint, Feature::kTilt) && HasFeature(endpoint, Feature::kPositionAwareTilt)); } void TypeSet(chip::EndpointId endpoint, Type type) @@ -635,11 +635,11 @@ bool emberAfWindowCoveringClusterUpOrOpenCallback(app::CommandHandler * commandO return true; } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)) + if (HasFeature(endpoint, Feature::kPositionAwareLift)) { Attributes::TargetPositionLiftPercent100ths::Set(endpoint, WC_PERCENT100THS_MIN_OPEN); } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)) + if (HasFeature(endpoint, Feature::kPositionAwareTilt)) { Attributes::TargetPositionTiltPercent100ths::Set(endpoint, WC_PERCENT100THS_MIN_OPEN); } @@ -647,12 +647,12 @@ bool emberAfWindowCoveringClusterUpOrOpenCallback(app::CommandHandler * commandO Delegate * delegate = GetDelegate(endpoint); if (delegate) { - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)) + if (HasFeature(endpoint, Feature::kPositionAwareLift)) { LogErrorOnFailure(delegate->HandleMovement(WindowCoveringType::Lift)); } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)) + if (HasFeature(endpoint, Feature::kPositionAwareTilt)) { LogErrorOnFailure(delegate->HandleMovement(WindowCoveringType::Tilt)); } @@ -685,11 +685,11 @@ bool emberAfWindowCoveringClusterDownOrCloseCallback(app::CommandHandler * comma return true; } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)) + if (HasFeature(endpoint, Feature::kPositionAwareLift)) { Attributes::TargetPositionLiftPercent100ths::Set(endpoint, WC_PERCENT100THS_MAX_CLOSED); } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)) + if (HasFeature(endpoint, Feature::kPositionAwareTilt)) { Attributes::TargetPositionTiltPercent100ths::Set(endpoint, WC_PERCENT100THS_MAX_CLOSED); } @@ -698,12 +698,12 @@ bool emberAfWindowCoveringClusterDownOrCloseCallback(app::CommandHandler * comma Delegate * delegate = GetDelegate(endpoint); if (delegate) { - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)) + if (HasFeature(endpoint, Feature::kPositionAwareLift)) { LogErrorOnFailure(delegate->HandleMovement(WindowCoveringType::Lift)); } - if (HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)) + if (HasFeature(endpoint, Feature::kPositionAwareTilt)) { LogErrorOnFailure(delegate->HandleMovement(WindowCoveringType::Tilt)); } @@ -794,7 +794,7 @@ bool emberAfWindowCoveringClusterGoToLiftValueCallback(app::CommandHandler * com return true; } - if (HasFeature(endpoint, WindowCoveringFeature::kAbsolutePosition) && HasFeaturePaLift(endpoint)) + if (HasFeature(endpoint, Feature::kAbsolutePosition) && HasFeaturePaLift(endpoint)) { Attributes::TargetPositionLiftPercent100ths::Set(endpoint, LiftToPercent100ths(endpoint, liftValue)); Delegate * delegate = GetDelegate(endpoint); @@ -886,7 +886,7 @@ bool emberAfWindowCoveringClusterGoToTiltValueCallback(app::CommandHandler * com return true; } - if (HasFeature(endpoint, WindowCoveringFeature::kAbsolutePosition) && HasFeaturePaTilt(endpoint)) + if (HasFeature(endpoint, Feature::kAbsolutePosition) && HasFeaturePaTilt(endpoint)) { Attributes::TargetPositionTiltPercent100ths::Set(endpoint, TiltToPercent100ths(endpoint, tiltValue)); Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/window-covering-server/window-covering-server.h b/src/app/clusters/window-covering-server/window-covering-server.h index 7d1514acd64884..b1d21d8bb750bf 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.h +++ b/src/app/clusters/window-covering-server/window-covering-server.h @@ -69,7 +69,7 @@ struct AbsoluteLimits uint16_t closed; }; -bool HasFeature(chip::EndpointId endpoint, WindowCoveringFeature feature); +bool HasFeature(chip::EndpointId endpoint, Feature feature); bool HasFeaturePaLift(chip::EndpointId endpoint); bool HasFeaturePaTilt(chip::EndpointId endpoint); diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index e58894c7644a7f..de1817b98bce43 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -31,11 +31,6 @@ } ], "templates": [ - { - "path": "../../zap-templates/templates/app/att-storage.zapt", - "name": "ZCL att-storage header", - "output": "att-storage.h" - }, { "path": "../../zap-templates/templates/app/attribute-size.zapt", "name": "ZCL attribute-size header", diff --git a/src/app/tests/suites/TV_ChannelCluster.yaml b/src/app/tests/suites/TV_ChannelCluster.yaml index 93a01cdc207629..56c09bc81be192 100644 --- a/src/app/tests/suites/TV_ChannelCluster.yaml +++ b/src/app/tests/suites/TV_ChannelCluster.yaml @@ -112,8 +112,607 @@ tests: value: 0 - label: "Skip Channel Command" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 2 + + - label: "Verify that Skip Channel Command set correct current channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + - label: "Skip Channel Command" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 123 + + - label: "Verify that Skip Channel Command set correct current channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################# + # Test Skip Channel Up 1..8 # + ############################# + + - label: "Test 1.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 1.2 - Skip Up By 1" command: "SkipChannel" arguments: values: - name: "Count" value: 1 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 2 # + + - label: "Test 2.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 2.2 - Skip Up By 2" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 2 + + - label: + "Test 2.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Up 3 # + + - label: "Test 3.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 3.2 - Skip Up By 3" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 3 + + - label: + "Test 3.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 4 # + + - label: "Test 4.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 4.2 - Skip Up By 4" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 4 + + - label: + "Test 4.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 5 # + + - label: "Test 5.2 - Skip Up By 5" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 5 + + - label: + "Test 5.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 6 # + + - label: "Test 6.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 6.2 - Skip Up By 6" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 6 + + - label: + "Test 6.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Up 7 # + + - label: "Test 7.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 7.2 - Skip Up By 7" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 7 + + - label: + "Test 7.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 8 # + + - label: "Test 8.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 8.2 - Skip Up By 8" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 8 + + - label: + "Test 8.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################### + # Test Skip Channel Down 1..8 # + ############################### + + - label: "Test 1.2 - Skip Down By 1" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -1 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 2 # + + - label: "Test 2.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 2.2 - Skip Down By 2" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -2 + + - label: + "Test 2.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Down 3 # + + - label: "Test 3.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 3.2 - Skip Down By 3" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -3 + + - label: + "Test 3.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 4 # + + - label: "Test 4.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 4.2 - Skip Down By 4" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -4 + + - label: + "Test 4.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 5 # + + - label: "Test 5.2 - Skip Down By 5" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -5 + + - label: + "Test 5.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 6 # + + - label: "Test 6.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 6.2 - Skip Down By 6" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -6 + + - label: + "Test 6.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Down 7 # + + - label: "Test 7.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 7.2 - Skip Down By 7" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -7 + + - label: + "Test 7.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 8 # + + - label: "Test 8.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 8.2 - Skip Down By 8" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -8 + + - label: + "Test 8.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################### + # Test Skip Channel Up 32,767 # + ############################### + + - label: "Test 1.2 - Skip Up By 32,767" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 32767 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ################################# + # Test Skip Channel Down 32,768 # + ################################# + + - label: "Test 1.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 1.2 - Skip Down By 32,768" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -32768 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } diff --git a/src/app/tests/suites/examples/TestGenExample.zapt b/src/app/tests/suites/examples/TestGenExample.zapt index 89709513b96298..953dfce94f43ee 100644 --- a/src/app/tests/suites/examples/TestGenExample.zapt +++ b/src/app/tests/suites/examples/TestGenExample.zapt @@ -1,4 +1,4 @@ -{{#chip_tests "ciTests.json"}} +{{#chip_tests "ciTests.json" includeAllClusters=true}} {{#chip_tests_config}} "Argument Name {{name}}" "Argument Type {{type}}" diff --git a/src/app/tests/suites/templates/simulated-cluster-objects.zapt b/src/app/tests/suites/templates/simulated-cluster-objects.zapt index 94c4ee9ff7ab88..9c4dadca6385cd 100644 --- a/src/app/tests/suites/templates/simulated-cluster-objects.zapt +++ b/src/app/tests/suites/templates/simulated-cluster-objects.zapt @@ -7,7 +7,7 @@ namespace chip { -{{#chip_tests_only_clusters}} +{{#chip_tests_only_clusters includeAllClusters=true}} {{#chip_tests_only_cluster_commands}} struct {{name}}Command diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 110a74c39edceb..d8617e1837dfd1 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -26,7 +26,7 @@ #include #if !defined(EMBER_SCRIPTED_TEST) -#include +#include #endif #if !defined(ATTRIBUTE_STORAGE_CONFIGURATION) && defined(EMBER_TEST) diff --git a/src/app/util/config.h b/src/app/util/config.h index 072e6d89a0223f..23064eec714e7d 100644 --- a/src/app/util/config.h +++ b/src/app/util/config.h @@ -17,6 +17,10 @@ #pragma once +#include + +#if !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES + // include generated configuration information from AppBuilder. // ZA_GENERATED_HEADER is defined in the project file #ifdef ZA_GENERATED_HEADER @@ -31,6 +35,8 @@ #include #endif +#endif // !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES + // User options for plugin Binding Table Library // TODO: Make this a CHIP_CONFIG value. #ifndef EMBER_BINDING_TABLE_SIZE diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 8cd6b4d52f87ba..d18e284bd6f134 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include -#include #include #include diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 3c206ffcbd2d03..edda7d6993f7eb 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -28,12 +28,12 @@ * might be fixed with a mock endpoint-config.h */ -#include #include #include #include #include #include +#include #include #include diff --git a/src/app/util/privilege-storage.cpp b/src/app/util/privilege-storage.cpp index 17315ae8fe3622..f2493bcbb2e5b1 100644 --- a/src/app/util/privilege-storage.cpp +++ b/src/app/util/privilege-storage.cpp @@ -15,9 +15,13 @@ * limitations under the License. */ +#include + #include "privilege-storage.h" +#if !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES #include +#endif // !CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES #include diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt index d28b45a8f2032d..f08c912d2ada25 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt @@ -1,6 +1,4 @@ {{> header}} - -{{#if_enabled_clusters side='client'}} #pragma once #include @@ -21,4 +19,3 @@ typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttr {{/zcl_attributes_server}} {{/all_user_clusters}} -{{/if_enabled_clusters}} \ No newline at end of file diff --git a/src/app/zap-templates/templates/app/CHIPClusters.zapt b/src/app/zap-templates/templates/app/CHIPClusters.zapt index 2bf93e2c728fe2..05fab685053834 100644 --- a/src/app/zap-templates/templates/app/CHIPClusters.zapt +++ b/src/app/zap-templates/templates/app/CHIPClusters.zapt @@ -1,7 +1,4 @@ {{> header}} - -{{#if_enabled_clusters side='client'}} -// Prevent multiple inclusion #pragma once #include @@ -25,4 +22,3 @@ public: {{/all_user_clusters}} } // namespace Controller } // namespace chip -{{/if_enabled_clusters}} diff --git a/src/app/zap-templates/templates/app/att-storage.zapt b/src/app/zap-templates/templates/app/att-storage.zapt deleted file mode 100644 index a40ab76e0846be..00000000000000 --- a/src/app/zap-templates/templates/app/att-storage.zapt +++ /dev/null @@ -1,20 +0,0 @@ -{{> header}} - -// Prevent multiple inclusion -#pragma once - -// Cluster masks modify how clusters are used by the framework -// -// Does this cluster have init function? -#define CLUSTER_MASK_INIT_FUNCTION (0x01) -// Does this cluster have attribute changed function? -#define CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION (0x02) -// Bits 0x04 and 0x08 are free. -// Does this cluster have shutdown function? -#define CLUSTER_MASK_SHUTDOWN_FUNCTION (0x10) -// Does this cluster have pre-attribute changed function? -#define CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION (0x20) -// Cluster is a server -#define CLUSTER_MASK_SERVER (0x40) -// Cluster is a client -#define CLUSTER_MASK_CLIENT (0x80) diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 62571d78e1c66a..56d251c3610b23 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -74,6 +74,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index 41f08d8a1123c5..901de42f9525f0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -76,7 +76,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml index f36befbcdce637..b3ba1b927e02f6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml @@ -57,7 +57,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml index 1179eb9ec5d44d..fa0ca6233561b3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml +++ b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml @@ -69,7 +69,7 @@ limitations under the License. BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER true true - + VendorName VendorID diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 47ac01d7eb5cc1..ab70f9c93b5e1a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -41,7 +41,7 @@ limitations under the License. This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. - + @@ -81,7 +81,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml index af32bca3ebea24..99040f85a16982 100644 --- a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml index c568bf9d79e652..738c885b7a7ce0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml @@ -130,7 +130,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml index 99712be31d3a29..554426b035ac19 100644 --- a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml @@ -754,7 +754,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml index b6ef9124da5970..54c590efa83c7f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml @@ -29,7 +29,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml index 53d7b4c107c483..ce9ef44851b6e9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml index 1e9b215d6e5c15..b5f5288c164d73 100644 --- a/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml index e4be4a7b8745b4..f0fcc662285de9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml index 56bf296516f376..68ea66b62e8e5f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml @@ -140,7 +140,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml index f021ee151a0bf1..85bfb6100d6f99 100644 --- a/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml index f69ea234fe7d64..d390e793cff781 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml @@ -73,7 +73,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index 952e9d71e48f86..4a6be6d3345b42 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -114,7 +114,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index b4ff95c8bf6587..9cdf36f0149f5f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml index 299a9b3f57960c..7ea62f31ddac2d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml @@ -169,7 +169,7 @@ limitations under the License.
- + diff --git a/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml index 1389de212bdd2d..305e82aaca0c52 100644 --- a/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml @@ -95,7 +95,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml index 5a256ae97abd75..89d1c42a8c7bf3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml @@ -79,7 +79,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml index b353bb628e0141..7a783e45d6df3d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml @@ -36,7 +36,7 @@ limitations under the License. Scale - + diff --git a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml index 3083e7e828fc99..ee29a6b66d5463 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml @@ -149,7 +149,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml new file mode 100644 index 00000000000000..3a3215addba19f --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml @@ -0,0 +1,49 @@ + + + + + + + + + + Refrigerator Alarm + Appliances + Attributes and commands for configuring the Refrigerator alarm. + 0x0057 + REFRIGERATOR_ALARM + true + true + Mask + Latch + State + + + Reset alarm + + + + + + Notify + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index ee0e60b4fc41d6..d8efbe52c7ae35 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -230,7 +230,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml index 7401708aae91c4..d38ed4774409b4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml @@ -34,7 +34,7 @@ limitations under the License. - + ExpressedState @@ -145,7 +145,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml index 84ff1c9ad321da..0f1570465195f2 100644 --- a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml @@ -44,7 +44,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml index d8ef3ec5c09bf9..2199b908577049 100644 --- a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml @@ -66,7 +66,7 @@ Interactions with the switch device are exposed as attributes (for the latching - + diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml index 684c8e25c43edb..bc0a44e2de551c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml @@ -20,7 +20,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml index 39ae4188a84df6..bf5e90a5ca8859 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml index 40c9d1c3f53d97..dc97fab3cea554 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml @@ -167,7 +167,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml index d93f1f47dadc0e..29ed6a0d1f2048 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + @@ -104,7 +104,8 @@ limitations under the License. true true Accurate time is required for a number of reasons, including scheduling, display and validating security materials. - + + UTCTime Granularity TimeSource diff --git a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml index 3c4cde3bf3e159..9c9f1ba1dfffd3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml @@ -37,7 +37,7 @@ limitations under the License. TemperatureUnit - + diff --git a/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml index f1e81dd925b897..c66640ff224a1c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml @@ -46,7 +46,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml index 59907b9817f434..1af4eeb21aa438 100644 --- a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml +++ b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml @@ -211,7 +211,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 397e35d5e7341f..bf09285691e2e9 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -71,6 +71,7 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", + "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", "scene.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c91a3bd561731d..3d56644adf6da2 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -69,6 +69,7 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", + "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", "scene.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index a96d532425c1a7..eb9c236e7c369e 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -74,6 +74,7 @@ "pump-configuration-and-control-client" ], "PWM_CLUSTER": [], + "REFRIGERATOR_ALARM": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], "SCENES_CLUSTER": [], "SMOKE_CO_ALARM_CLUSTER": [], @@ -177,6 +178,7 @@ "pump-configuration-and-control-server" ], "PWM_CLUSTER": [], + "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], "SCENES_CLUSTER": ["scenes"], "SMOKE_CO_ALARM_CLUSTER": [], diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 8fd93b36d28559..f9cc5a282d8737 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1980,24 +1980,22 @@ void DeviceCommissioner::OnDone(app::ReadClient *) TLV::TLVReader reader; if (this->mAttributeCache->Get(path, reader) == CHIP_NO_ERROR) { - BitFlags features; + BitFlags features; if (app::DataModel::Decode(reader, features) == CHIP_NO_ERROR) { - if (features.Has(app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kWiFiNetworkInterface)) + if (features.Has(app::Clusters::NetworkCommissioning::Feature::kWiFiNetworkInterface)) { ChipLogProgress(Controller, "----- NetworkCommissioning Features: has WiFi. endpointid = %u", path.mEndpointId); info.network.wifi.endpoint = path.mEndpointId; } - else if (features.Has( - app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kThreadNetworkInterface)) + else if (features.Has(app::Clusters::NetworkCommissioning::Feature::kThreadNetworkInterface)) { ChipLogProgress(Controller, "----- NetworkCommissioning Features: has Thread. endpointid = %u", path.mEndpointId); info.network.thread.endpoint = path.mEndpointId; } - else if (features.Has( - app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kEthernetNetworkInterface)) + else if (features.Has(app::Clusters::NetworkCommissioning::Feature::kEthernetNetworkInterface)) { ChipLogProgress(Controller, "----- NetworkCommissioning Features: has Ethernet. endpointid = %u", path.mEndpointId); diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 549fd967716025..1a89e51fb87a2b 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -172,6 +172,8 @@ if (current_os == "android" || build_java_matter_controller) { "jni/PulseWidthModulationClient-ReadImpl.cpp", "jni/PumpConfigurationAndControlClient-InvokeSubscribeImpl.cpp", "jni/PumpConfigurationAndControlClient-ReadImpl.cpp", + "jni/RefrigeratorAlarmClient-InvokeSubscribeImpl.cpp", + "jni/RefrigeratorAlarmClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", "jni/ScenesClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index f1f4eb2bdf4cca..8c5cc231d0eca2 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -61,7 +61,7 @@ client cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap GroupsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kGroupNames = 0x1; } @@ -132,12 +132,12 @@ client cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ client cluster Scenes = 5 { - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; + bitmap Feature : BITMAP32 { + kSceneNames = 0x1; } - bitmap ScenesFeature : BITMAP32 { - kSceneNames = 0x1; + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; } struct AttributeValuePair { @@ -326,12 +326,12 @@ client cluster OnOff = 6 { kTogglePreviousOnOff = 2; } - bitmap OnOffControl : BITMAP8 { - kAcceptOnlyWhenOn = 0x1; + bitmap Feature : BITMAP32 { + kLighting = 0x1; } - bitmap OnOffFeature : BITMAP32 { - kLighting = 0x1; + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; } readonly attribute boolean onOff = 0; @@ -395,7 +395,7 @@ client cluster LevelControl = 8 { kDown = 1; } - bitmap LevelControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; @@ -1126,7 +1126,7 @@ client cluster UnitLocalization = 45 { kKelvin = 2; } - bitmap UnitLocalizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTemperatureUnit = 0x1; } @@ -1330,7 +1330,7 @@ client cluster PowerSource = 47 { kUnderVoltage = 2; } - bitmap PowerSourceFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1499,7 +1499,7 @@ client cluster NetworkCommissioning = 49 { k60g = 4; } - bitmap NetworkCommissioningFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; @@ -1771,7 +1771,7 @@ client cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ client cluster SoftwareDiagnostics = 52 { - bitmap SoftwareDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kWaterMarks = 0x1; } @@ -1828,7 +1828,7 @@ client cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap ThreadNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -2000,7 +2000,7 @@ client cluster WiFiNetworkDiagnostics = 54 { kAx = 5; } - bitmap WiFiNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2057,7 +2057,7 @@ client cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap EthernetNetworkDiagnosticsFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2122,7 +2122,7 @@ client cluster TimeSynchronization = 56 { kNone = 2; } - bitmap TimeSynchronizationFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kTimeZone = 0x1; kNTPClient = 0x2; kNTPServer = 0x4; @@ -2313,7 +2313,7 @@ client cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ client cluster Switch = 59 { - bitmap SwitchFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2686,7 +2686,7 @@ client cluster BooleanState = 69 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ client cluster IcdManagement = 70 { - bitmap ICDManagementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kCheckInProtocolSupport = 0x1; } @@ -2736,7 +2736,7 @@ client cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - bitmap ModeSelectFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kDeponoff = 0x1; } @@ -2781,7 +2781,7 @@ client cluster TemperatureControl = 86 { struct TemperatureLevelStruct { char_string<64> label = 0; - int8u tempLevel = 1; + int8u temperatureLevel = 1; } readonly attribute optional int16s temperatureSetpoint = 0; @@ -2806,6 +2806,38 @@ client cluster TemperatureControl = 86 { command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; } +/** Attributes and commands for configuring the Refrigerator alarm. */ +client cluster RefrigeratorAlarm = 87 { + bitmap AlarmMap : BITMAP32 { + kDoorOpen = 0x1; + } + + info event Notify = 0 { + AlarmMap active = 0; + AlarmMap inactive = 1; + AlarmMap state = 2; + AlarmMap mask = 3; + } + + attribute AlarmMap mask = 0; + readonly attribute AlarmMap latch = 1; + readonly attribute AlarmMap state = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmMap alarms = 0; + optional AlarmMap mask = 1; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; +} + /** Attributes for reporting air quality classification */ client cluster AirQuality = 91 { enum AirQualityEnum : ENUM8 { @@ -2881,7 +2913,7 @@ client cluster SmokeCoAlarm = 92 { kLow = 2; } - bitmap SmokeCOAlarmFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kSmokeAlarm = 0x1; kCoAlarm = 0x2; } @@ -3659,7 +3691,7 @@ client cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DoorLockFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kPinCredential = 0x1; kRfidCredential = 0x2; kFingerCredentials = 0x4; @@ -4012,6 +4044,14 @@ client cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } + bitmap Feature : BITMAP32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + bitmap Mode : BITMAP8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; @@ -4040,14 +4080,6 @@ client cluster WindowCovering = 258 { kProtection = 0x800; } - bitmap WindowCoveringFeature : BITMAP32 { - kLift = 0x1; - kTilt = 0x2; - kPositionAwareLift = 0x4; - kAbsolutePosition = 0x8; - kPositionAwareTilt = 0x10; - } - readonly attribute Type type = 0; readonly attribute optional int16u physicalClosedLimitLift = 1; readonly attribute optional int16u physicalClosedLimitTilt = 2; @@ -4156,7 +4188,7 @@ client cluster PumpConfigurationAndControl = 512 { kLocal = 3; } - bitmap PumpConfigurationAndControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -4306,12 +4338,7 @@ client cluster Thermostat = 513 { kAway = 0x80; } - bitmap ModeForSequence : BITMAP8 { - kHeatSetpointPresent = 0x1; - kCoolSetpointPresent = 0x2; - } - - bitmap ThermostatFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4320,6 +4347,11 @@ client cluster Thermostat = 513 { kAutoMode = 0x20; } + bitmap ModeForSequence : BITMAP8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + struct ThermostatScheduleTransition { int16u transitionTime = 0; nullable int16s heatSetpoint = 1; @@ -4437,7 +4469,7 @@ client cluster FanControl = 514 { kSmart = 6; } - bitmap FanControlFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -4548,14 +4580,6 @@ client cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorControlFeature : BITMAP32 { - kHueAndSaturation = 0x1; - kEnhancedHue = 0x2; - kColorLoop = 0x4; - kXy = 0x8; - kColorTemperature = 0x10; - } - bitmap ColorLoopUpdateFlags : BITMAP8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; @@ -4563,6 +4587,14 @@ client cluster ColorControl = 768 { kUpdateStartHue = 0x8; } + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXy = 0x8; + kColorTemperature = 0x10; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; @@ -4870,7 +4902,7 @@ client cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ client cluster PressureMeasurement = 1027 { - bitmap PressureMeasurementFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kExtended = 0x1; } @@ -4981,7 +5013,7 @@ client cluster Channel = 1284 { kMso = 0; } - bitmap ChannelFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -5026,7 +5058,7 @@ client cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ @@ -5091,7 +5123,7 @@ client cluster MediaPlayback = 1286 { kBuffering = 3; } - bitmap MediaPlaybackFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -5173,7 +5205,7 @@ client cluster MediaInput = 1287 { kOther = 11; } - bitmap MediaInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -5322,7 +5354,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - bitmap KeypadInputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -5377,7 +5409,7 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap ContentLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kContentSearch = 0x1; kURLPlayback = 0x2; } @@ -5466,7 +5498,7 @@ client cluster AudioOutput = 1291 { kOther = 5; } - bitmap AudioOutputFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kNameUpdates = 0x1; } @@ -5508,7 +5540,7 @@ client cluster ApplicationLauncher = 1292 { kSystemBusy = 2; } - bitmap ApplicationLauncherFeature : BITMAP32 { + bitmap Feature : BITMAP32 { kApplicationPlatform = 0x1; } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index d52d30e81ac43c..ae71d90be8fb73 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -10276,6 +10276,212 @@ } ] }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Reset", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Latch", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Air Quality", "code": 91, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 306e57c0abbcdf..4699afda59400e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7958,6 +7958,133 @@ private static Map readTemperatureControlInteractionInf return result; } + private static Map readRefrigeratorAlarmInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readRefrigeratorAlarmMaskCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmMaskAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readMaskAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRefrigeratorAlarmMaskCommandParams); + result.put("readMaskAttribute", readRefrigeratorAlarmMaskAttributeInteractionInfo); + Map readRefrigeratorAlarmLatchCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmLatchAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readLatchAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRefrigeratorAlarmLatchCommandParams); + result.put("readLatchAttribute", readRefrigeratorAlarmLatchAttributeInteractionInfo); + Map readRefrigeratorAlarmStateCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readStateAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRefrigeratorAlarmStateCommandParams); + result.put("readStateAttribute", readRefrigeratorAlarmStateAttributeInteractionInfo); + Map readRefrigeratorAlarmGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.RefrigeratorAlarmCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedRefrigeratorAlarmClusterGeneratedCommandListAttributeCallback(), + readRefrigeratorAlarmGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readRefrigeratorAlarmGeneratedCommandListAttributeInteractionInfo); + Map readRefrigeratorAlarmAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.RefrigeratorAlarmCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedRefrigeratorAlarmClusterAcceptedCommandListAttributeCallback(), + readRefrigeratorAlarmAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readRefrigeratorAlarmAcceptedCommandListAttributeInteractionInfo); + Map readRefrigeratorAlarmEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readEventListAttribute( + (ChipClusters.RefrigeratorAlarmCluster.EventListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedRefrigeratorAlarmClusterEventListAttributeCallback(), + readRefrigeratorAlarmEventListCommandParams); + result.put("readEventListAttribute", readRefrigeratorAlarmEventListAttributeInteractionInfo); + Map readRefrigeratorAlarmAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.RefrigeratorAlarmCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedRefrigeratorAlarmClusterAttributeListAttributeCallback(), + readRefrigeratorAlarmAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readRefrigeratorAlarmAttributeListAttributeInteractionInfo); + Map readRefrigeratorAlarmFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRefrigeratorAlarmFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readRefrigeratorAlarmFeatureMapAttributeInteractionInfo); + Map readRefrigeratorAlarmClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readRefrigeratorAlarmClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRefrigeratorAlarmClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readRefrigeratorAlarmClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readAirQualityInteractionInfo() { Map result = new LinkedHashMap<>(); Map readAirQualityAirQualityCommandParams = @@ -19704,6 +19831,7 @@ public Map> getReadAttributeMap() { put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); put("temperatureControl", readTemperatureControlInteractionInfo()); + put("refrigeratorAlarm", readRefrigeratorAlarmInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 5dec09e00c8159..649598fc021af8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -639,6 +639,24 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo); Map writeTemperatureControlInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("temperatureControl", writeTemperatureControlInteractionInfo); + Map writeRefrigeratorAlarmInteractionInfo = new LinkedHashMap<>(); + Map writeRefrigeratorAlarmMaskCommandParams = + new LinkedHashMap(); + CommandParameterInfo refrigeratorAlarmmaskCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeRefrigeratorAlarmMaskCommandParams.put("value", refrigeratorAlarmmaskCommandParameterInfo); + InteractionInfo writeRefrigeratorAlarmMaskAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .writeMaskAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeRefrigeratorAlarmMaskCommandParams); + writeRefrigeratorAlarmInteractionInfo.put( + "writeMaskAttribute", writeRefrigeratorAlarmMaskAttributeInteractionInfo); + writeAttributeMap.put("refrigeratorAlarm", writeRefrigeratorAlarmInteractionInfo); Map writeAirQualityInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo); Map writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index 92621720aba6b4..59cd477d802c89 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -1,6 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} - package chip.devicecontroller; import javax.annotation.Nullable; @@ -247,4 +245,4 @@ public class ChipClusters { {{/not_last}} {{/zcl_clusters}} } -{{/if_enabled_clusters}} + diff --git a/src/controller/java/templates/ChipIdLookup-java.zapt b/src/controller/java/templates/ChipIdLookup-java.zapt index cd2475af515b1a..55cd007cf195f7 100644 --- a/src/controller/java/templates/ChipIdLookup-java.zapt +++ b/src/controller/java/templates/ChipIdLookup-java.zapt @@ -1,6 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} - package chip.devicecontroller; public final class ChipIdLookup { @@ -53,4 +51,4 @@ public final class ChipIdLookup { return ""; } } -{{/if_enabled_clusters}} \ No newline at end of file + diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index cb4c9893c55413..53666f7b68424c 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -1,6 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} - package chip.devicecontroller; import javax.annotation.Nullable; @@ -373,4 +371,3 @@ public class ClusterInfoMapping { } -{{/if_enabled_clusters}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/encode_value.zapt b/src/controller/java/templates/partials/encode_value.zapt index 8540e487d9ca58..3f6d573662ba9f 100644 --- a/src/controller/java/templates/partials/encode_value.zapt +++ b/src/controller/java/templates/partials/encode_value.zapt @@ -51,11 +51,11 @@ {{#if_chip_enum type}} {{target}} = static_cast>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}})); {{else}} - {{#if_is_bitmap type}} - {{target}} = static_cast>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}})); + {{#if_is_strongly_typed_bitmap type}} + {{target}}.SetRaw(static_cast::IntegerType>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}}))); {{else}} {{target}} = static_cast>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}})); - {{/if_is_bitmap}} + {{/if_is_strongly_typed_bitmap}} {{/if_chip_enum}} {{/if_is_struct}} {{/if}} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index ca6bffdeeb7eeb..83f0c0b049b319 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12271,12 +12271,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0; jobject newElement_0_label; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_tempLevel; - std::string newElement_0_tempLevelClassName = "java/lang/Integer"; - std::string newElement_0_tempLevelCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_tempLevelClassName.c_str(), - newElement_0_tempLevelCtorSignature.c_str(), - entry_0.tempLevel, newElement_0_tempLevel); + jobject newElement_0_temperatureLevel; + std::string newElement_0_temperatureLevelClassName = "java/lang/Integer"; + std::string newElement_0_temperatureLevelCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_temperatureLevelClassName.c_str(), newElement_0_temperatureLevelCtorSignature.c_str(), + entry_0.temperatureLevel, newElement_0_temperatureLevel); jclass temperatureLevelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -12296,11 +12296,192 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } newElement_0 = env->NewObject(temperatureLevelStructStructClass_1, temperatureLevelStructStructCtor_1, - newElement_0_label, newElement_0_tempLevel); + newElement_0_label, newElement_0_temperatureLevel); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::RefrigeratorAlarm::Id: { + using namespace app::Clusters::RefrigeratorAlarm; + switch (aPath.mAttributeId) + { + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Raw(), value); + return value; + } + case Attributes::Latch::Id: { + using TypeInfo = Attributes::Latch::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Raw(), value); + return value; + } + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Raw(), value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index b55e2d66de81f9..3b922d4f5a09d4 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -324,8 +324,8 @@ JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -2342,6 +2342,58 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) onFailure.release(); } +JNI_METHOD(void, RefrigeratorAlarmCluster, writeMaskAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::RefrigeratorAlarm::Attributes::Mask::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().LongToPrimitive(value))); + + std::unique_ptr onSuccess( + Platform::New(callback), 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( + Platform::New(callback), 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; + RefrigeratorAlarmCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, SmokeCoAlarmCluster, writeSensitivityLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { @@ -3026,8 +3078,8 @@ JNI_METHOD(void, DoorLockCluster, writeLocalProgrammingFeaturesAttribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -3338,8 +3390,8 @@ JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -8095,8 +8147,8 @@ JNI_METHOD(void, UnitTestingCluster, writeBitmap8Attribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -8147,8 +8199,8 @@ JNI_METHOD(void, UnitTestingCluster, writeBitmap16Attribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -8199,7 +8251,8 @@ JNI_METHOD(void, UnitTestingCluster, writeBitmap32Attribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = static_cast>(chip::JniReferences::GetInstance().LongToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().LongToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -8250,7 +8303,8 @@ JNI_METHOD(void, UnitTestingCluster, writeBitmap64Attribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = static_cast>(chip::JniReferences::GetInstance().LongToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().LongToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -10077,8 +10131,8 @@ JNI_METHOD(void, UnitTestingCluster, writeListNullablesAndOptionalsStructAttribu jobject element_0_nullableStructItem_1_fItem_3; chip::JniReferences::GetInstance().GetObjectField(element_0_nullableStructItem_1, "f", "Ljava/lang/Integer;", element_0_nullableStructItem_1_fItem_3); - nonNullValue_2.f = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_nullableStructItem_1_fItem_3)); + nonNullValue_2.f.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_nullableStructItem_1_fItem_3))); jobject element_0_nullableStructItem_1_gItem_3; chip::JniReferences::GetInstance().GetObjectField(element_0_nullableStructItem_1, "g", "Ljava/lang/Float;", element_0_nullableStructItem_1_gItem_3); @@ -10129,8 +10183,8 @@ JNI_METHOD(void, UnitTestingCluster, writeListNullablesAndOptionalsStructAttribu jobject optionalValue_2_fItem_3; chip::JniReferences::GetInstance().GetObjectField(optionalValue_2, "f", "Ljava/lang/Integer;", optionalValue_2_fItem_3); - definedValue_2.f = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2_fItem_3)); + definedValue_2.f.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2_fItem_3))); jobject optionalValue_2_gItem_3; chip::JniReferences::GetInstance().GetObjectField(optionalValue_2, "g", "Ljava/lang/Float;", optionalValue_2_gItem_3); @@ -10189,8 +10243,8 @@ JNI_METHOD(void, UnitTestingCluster, writeListNullablesAndOptionalsStructAttribu jobject optionalValue_2_fItem_4; chip::JniReferences::GetInstance().GetObjectField(optionalValue_2, "f", "Ljava/lang/Integer;", optionalValue_2_fItem_4); - nonNullValue_3.f = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2_fItem_4)); + nonNullValue_3.f.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2_fItem_4))); jobject optionalValue_2_gItem_4; chip::JniReferences::GetInstance().GetObjectField(optionalValue_2, "g", "Ljava/lang/Float;", optionalValue_2_gItem_4); @@ -10830,9 +10884,9 @@ JNI_METHOD(void, UnitTestingCluster, writeListFabricScopedAttribute) jobject element_0_fabricSensitiveStructItem_1_fItem_2; chip::JniReferences::GetInstance().GetObjectField(element_0_fabricSensitiveStructItem_1, "f", "Ljava/lang/Integer;", element_0_fabricSensitiveStructItem_1_fItem_2); - listHolder_0->mList[i_0].fabricSensitiveStruct.f = - static_castmList[i_0].fabricSensitiveStruct.f)>>( - chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_fabricSensitiveStructItem_1_fItem_2)); + listHolder_0->mList[i_0].fabricSensitiveStruct.f.SetRaw( + static_castmList[i_0].fabricSensitiveStruct.f)>::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_fabricSensitiveStructItem_1_fItem_2))); jobject element_0_fabricSensitiveStructItem_1_gItem_2; chip::JniReferences::GetInstance().GetObjectField(element_0_fabricSensitiveStructItem_1, "g", "Ljava/lang/Float;", element_0_fabricSensitiveStructItem_1_gItem_2); @@ -11207,8 +11261,8 @@ JNI_METHOD(void, UnitTestingCluster, writeNullableBitmap8Attribute) else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + nonNullValue_0.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); } std::unique_ptr onSuccess( @@ -11267,8 +11321,8 @@ JNI_METHOD(void, UnitTestingCluster, writeNullableBitmap16Attribute) else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + nonNullValue_0.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); } std::unique_ptr onSuccess( @@ -11327,8 +11381,8 @@ JNI_METHOD(void, UnitTestingCluster, writeNullableBitmap32Attribute) else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>( - chip::JniReferences::GetInstance().LongToPrimitive(value)); + nonNullValue_0.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().LongToPrimitive(value))); } std::unique_ptr onSuccess( @@ -11387,8 +11441,8 @@ JNI_METHOD(void, UnitTestingCluster, writeNullableBitmap64Attribute) else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>( - chip::JniReferences::GetInstance().LongToPrimitive(value)); + nonNullValue_0.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().LongToPrimitive(value))); } std::unique_ptr onSuccess( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 965fc7ecc5cabc..698b243a3100d1 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2432,6 +2432,68 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::RefrigeratorAlarm::Id: { + using namespace app::Clusters::RefrigeratorAlarm; + switch (aPath.mEventId) + { + case Events::Notify::Id: { + Events::Notify::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_active; + std::string value_activeClassName = "java/lang/Long"; + std::string value_activeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_activeClassName.c_str(), value_activeCtorSignature.c_str(), cppValue.active.Raw(), value_active); + + jobject value_inactive; + std::string value_inactiveClassName = "java/lang/Long"; + std::string value_inactiveCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_inactiveClassName.c_str(), value_inactiveCtorSignature.c_str(), cppValue.inactive.Raw(), value_inactive); + + jobject value_state; + std::string value_stateClassName = "java/lang/Long"; + std::string value_stateCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_stateClassName.c_str(), value_stateCtorSignature.c_str(), cppValue.state.Raw(), value_state); + + jobject value_mask; + std::string value_maskClassName = "java/lang/Long"; + std::string value_maskCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maskClassName.c_str(), value_maskCtorSignature.c_str(), cppValue.mask.Raw(), value_mask); + + jclass notifyStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RefrigeratorAlarmClusterNotifyEvent", notifyStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$RefrigeratorAlarmClusterNotifyEvent"); + return nullptr; + } + jmethodID notifyStructCtor = env->GetMethodID(notifyStructClass, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + if (notifyStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$RefrigeratorAlarmClusterNotifyEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(notifyStructClass, notifyStructCtor, value_active, value_inactive, value_state, value_mask); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::AirQuality::Id: { using namespace app::Clusters::AirQuality; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 4fb2f30cf7079e..67b729f61bba45 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -20297,12 +20297,12 @@ void CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback::Callback jobject newElement_0; jobject newElement_0_label; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_tempLevel; - std::string newElement_0_tempLevelClassName = "java/lang/Integer"; - std::string newElement_0_tempLevelCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_tempLevelClassName.c_str(), - newElement_0_tempLevelCtorSignature.c_str(), - entry_0.tempLevel, newElement_0_tempLevel); + jobject newElement_0_temperatureLevel; + std::string newElement_0_temperatureLevelClassName = "java/lang/Integer"; + std::string newElement_0_temperatureLevelCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_temperatureLevelClassName.c_str(), + newElement_0_temperatureLevelCtorSignature.c_str(), + entry_0.temperatureLevel, newElement_0_temperatureLevel); jclass temperatureLevelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -20322,7 +20322,7 @@ void CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback::Callback } newElement_0 = env->NewObject(temperatureLevelStructStructClass_1, temperatureLevelStructStructCtor_1, newElement_0_label, - newElement_0_tempLevel); + newElement_0_temperatureLevel); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -20614,6 +20614,290 @@ void CHIPTemperatureControlAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPRefrigeratorAlarmGeneratedCommandListAttributeCallback::CHIPRefrigeratorAlarmGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPRefrigeratorAlarmGeneratedCommandListAttributeCallback::~CHIPRefrigeratorAlarmGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRefrigeratorAlarmGeneratedCommandListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRefrigeratorAlarmAcceptedCommandListAttributeCallback::CHIPRefrigeratorAlarmAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPRefrigeratorAlarmAcceptedCommandListAttributeCallback::~CHIPRefrigeratorAlarmAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRefrigeratorAlarmAcceptedCommandListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRefrigeratorAlarmEventListAttributeCallback::CHIPRefrigeratorAlarmEventListAttributeCallback(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"); + } +} + +CHIPRefrigeratorAlarmEventListAttributeCallback::~CHIPRefrigeratorAlarmEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRefrigeratorAlarmEventListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRefrigeratorAlarmAttributeListAttributeCallback::CHIPRefrigeratorAlarmAttributeListAttributeCallback(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"); + } +} + +CHIPRefrigeratorAlarmAttributeListAttributeCallback::~CHIPRefrigeratorAlarmAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRefrigeratorAlarmAttributeListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPAirQualityGeneratedCommandListAttributeCallback::CHIPAirQualityGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 1f28de5a0bb512..1337fd000a1edc 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - package chip.devicecontroller; import java.util.ArrayList; @@ -14128,6 +14127,224 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class RefrigeratorAlarmCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 87L; + + public RefrigeratorAlarmCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void reset(DefaultClusterCallback callback, Long alarms, Optional mask) { + reset(chipClusterPtr, callback, alarms, mask, null); + } + + public void reset( + DefaultClusterCallback callback, + Long alarms, + Optional mask, + int timedInvokeTimeoutMs) { + reset(chipClusterPtr, callback, alarms, mask, timedInvokeTimeoutMs); + } + + private native void reset( + long chipClusterPtr, + DefaultClusterCallback Callback, + Long alarms, + Optional mask, + @Nullable Integer timedInvokeTimeoutMs); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readMaskAttribute(LongAttributeCallback callback) { + readMaskAttribute(chipClusterPtr, callback); + } + + public void writeMaskAttribute(DefaultClusterCallback callback, Long value) { + writeMaskAttribute(chipClusterPtr, callback, value, null); + } + + public void writeMaskAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeMaskAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeMaskAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaskAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLatchAttribute(LongAttributeCallback callback) { + readLatchAttribute(chipClusterPtr, callback); + } + + public void subscribeLatchAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLatchAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readStateAttribute(LongAttributeCallback callback) { + readStateAttribute(chipClusterPtr, callback); + } + + public void subscribeStateAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readMaskAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void writeMaskAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeMaskAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLatchAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeLatchAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readStateAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeStateAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class AirQualityCluster extends BaseChipCluster { public static final long CLUSTER_ID = 91L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 2e78872d227fd6..6a0bfaa39f51f0 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -963,6 +963,40 @@ public String toString() { } } + public static class RefrigeratorAlarmClusterNotifyEvent { + public Long active; + public Long inactive; + public Long state; + public Long mask; + + public RefrigeratorAlarmClusterNotifyEvent(Long active, Long inactive, Long state, Long mask) { + this.active = active; + this.inactive = inactive; + this.state = state; + this.mask = mask; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RefrigeratorAlarmClusterNotifyEvent {\n"); + output.append("\tactive: "); + output.append(active); + output.append("\n"); + output.append("\tinactive: "); + output.append(inactive); + output.append("\n"); + output.append("\tstate: "); + output.append(state); + output.append("\n"); + output.append("\tmask: "); + output.append(mask); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class SmokeCoAlarmClusterSmokeAlarmEvent { public SmokeCoAlarmClusterSmokeAlarmEvent() {} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 37fd144d52cfac..c550130d9c7f19 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - package chip.devicecontroller; public final class ChipIdLookup { @@ -154,6 +153,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 86L) { return "TemperatureControl"; } + if (clusterId == 87L) { + return "RefrigeratorAlarm"; + } if (clusterId == 91L) { return "AirQuality"; } @@ -2073,6 +2075,36 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 87L) { + if (attributeId == 0L) { + return "Mask"; + } + if (attributeId == 1L) { + return "Latch"; + } + if (attributeId == 2L) { + return "State"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 91L) { if (attributeId == 0L) { return "AirQuality"; @@ -4931,6 +4963,12 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 86L) { return ""; } + if (clusterId == 87L) { + if (eventId == 0L) { + return "Notify"; + } + return ""; + } if (clusterId == 91L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 9b03b8e8d2b064..2e3c03514c24b4 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1520,11 +1520,11 @@ public String toString() { public static class TemperatureControlClusterTemperatureLevelStruct { public String label; - public Integer tempLevel; + public Integer temperatureLevel; - public TemperatureControlClusterTemperatureLevelStruct(String label, Integer tempLevel) { + public TemperatureControlClusterTemperatureLevelStruct(String label, Integer temperatureLevel) { this.label = label; - this.tempLevel = tempLevel; + this.temperatureLevel = temperatureLevel; } @Override @@ -1534,8 +1534,8 @@ public String toString() { output.append("\tlabel: "); output.append(label); output.append("\n"); - output.append("\ttempLevel: "); - output.append(tempLevel); + output.append("\ttemperatureLevel: "); + output.append(temperatureLevel); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 6b5e710a42e614..474738799cb898 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - package chip.devicecontroller; import chip.clusterinfo.ClusterCommandCallback; @@ -7489,6 +7488,102 @@ public void onError(Exception ex) { } } + public static class DelegatedRefrigeratorAlarmClusterGeneratedCommandListAttributeCallback + implements ChipClusters.RefrigeratorAlarmCluster.GeneratedCommandListAttributeCallback, + 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 DelegatedRefrigeratorAlarmClusterAcceptedCommandListAttributeCallback + implements ChipClusters.RefrigeratorAlarmCluster.AcceptedCommandListAttributeCallback, + 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 DelegatedRefrigeratorAlarmClusterEventListAttributeCallback + implements ChipClusters.RefrigeratorAlarmCluster.EventListAttributeCallback, + 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 DelegatedRefrigeratorAlarmClusterAttributeListAttributeCallback + implements ChipClusters.RefrigeratorAlarmCluster.AttributeListAttributeCallback, + 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 DelegatedAirQualityClusterGeneratedCommandListAttributeCallback implements ChipClusters.AirQualityCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -15674,6 +15769,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.TemperatureControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("temperatureControl", temperatureControlClusterInfo); + ClusterInfo refrigeratorAlarmClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RefrigeratorAlarmCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInfo); ClusterInfo airQualityClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.AirQualityCluster(ptr, endpointId), @@ -15965,6 +16065,7 @@ public void combineCommand( destination.get("icdManagement").combineCommands(source.get("icdManagement")); destination.get("modeSelect").combineCommands(source.get("modeSelect")); destination.get("temperatureControl").combineCommands(source.get("temperatureControl")); + destination.get("refrigeratorAlarm").combineCommands(source.get("refrigeratorAlarm")); destination.get("airQuality").combineCommands(source.get("airQuality")); destination.get("smokeCoAlarm").combineCommands(source.get("smokeCoAlarm")); destination.get("hepaFilterMonitoring").combineCommands(source.get("hepaFilterMonitoring")); @@ -18127,6 +18228,31 @@ public Map> getCommandMap() { Map temperatureControlClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("temperatureControl", temperatureControlClusterInteractionInfoMap); + Map refrigeratorAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); + Map refrigeratorAlarmresetCommandParams = + new LinkedHashMap(); + CommandParameterInfo refrigeratorAlarmresetalarmsCommandParameterInfo = + new CommandParameterInfo("alarms", Long.class, Long.class); + refrigeratorAlarmresetCommandParams.put( + "alarms", refrigeratorAlarmresetalarmsCommandParameterInfo); + + CommandParameterInfo refrigeratorAlarmresetmaskCommandParameterInfo = + new CommandParameterInfo("mask", Optional.class, Long.class); + refrigeratorAlarmresetCommandParams.put("mask", refrigeratorAlarmresetmaskCommandParameterInfo); + + InteractionInfo refrigeratorAlarmresetInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .reset( + (DefaultClusterCallback) callback, + (Long) commandArguments.get("alarms"), + (Optional) commandArguments.get("mask")); + }, + () -> new DelegatedDefaultClusterCallback(), + refrigeratorAlarmresetCommandParams); + refrigeratorAlarmClusterInteractionInfoMap.put("reset", refrigeratorAlarmresetInteractionInfo); + commandMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInteractionInfoMap); Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("airQuality", airQualityClusterInteractionInfoMap); Map smokeCoAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index b81327408a5a33..953042902a6514 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -207,8 +207,7 @@ class ChipClusters: "sceneID": "int", "transitionTime": "int", "sceneName": "str", - "clusterID": "int", - "attributeValueList": "", + "extensionFieldSets": "ExtensionFieldSet", }, }, 0x00000001: { @@ -258,6 +257,36 @@ class ChipClusters: "groupID": "int", }, }, + 0x00000040: { + "commandId": 0x00000040, + "commandName": "EnhancedAddScene", + "args": { + "groupID": "int", + "sceneID": "int", + "transitionTime": "int", + "sceneName": "str", + "extensionFieldSets": "ExtensionFieldSet", + }, + }, + 0x00000041: { + "commandId": 0x00000041, + "commandName": "EnhancedViewScene", + "args": { + "groupID": "int", + "sceneID": "int", + }, + }, + 0x00000042: { + "commandId": 0x00000042, + "commandName": "CopyScene", + "args": { + "mode": "int", + "groupIdentifierFrom": "int", + "sceneIdentifierFrom": "int", + "groupIdentifierTo": "int", + "sceneIdentifierTo": "int", + }, + }, }, "attributes": { 0x00000000: { @@ -591,6 +620,13 @@ class ChipClusters: "optionsOverride": "int", }, }, + 0x00000008: { + "commandId": 0x00000008, + "commandName": "MoveToClosestFrequency", + "args": { + "frequency": "int", + }, + }, }, "attributes": { 0x00000000: { @@ -826,6 +862,50 @@ class ChipClusters: }, }, } + _PULSE_WIDTH_MODULATION_CLUSTER_INFO = { + "clusterName": "PulseWidthModulation", + "clusterId": 0x0000001C, + "commands": { + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _DESCRIPTOR_CLUSTER_INFO = { "clusterName": "Descriptor", "clusterId": 0x0000001D, @@ -1188,6 +1268,12 @@ class ChipClusters: "clusterName": "BasicInformation", "clusterId": 0x00000028, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "MfgSpecificPing", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -3097,6 +3183,165 @@ class ChipClusters: }, }, } + _TIME_SYNCHRONIZATION_CLUSTER_INFO = { + "clusterName": "TimeSynchronization", + "clusterId": 0x00000038, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "SetUTCTime", + "args": { + "UTCTime": "int", + "granularity": "int", + "timeSource": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "SetTrustedTimeSource", + "args": { + "trustedTimeSource": "FabricScopedTrustedTimeSourceStruct", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "SetTimeZone", + "args": { + "timeZone": "TimeZoneStruct", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "SetDSTOffset", + "args": { + "DSTOffset": "DSTOffsetStruct", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "SetDefaultNTP", + "args": { + "defaultNTP": "str", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "UTCTime", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "Granularity", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "TimeSource", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "TrustedTimeSource", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "DefaultNTP", + "attributeId": 0x00000004, + "type": "str", + "reportable": True, + }, + 0x00000005: { + "attributeName": "TimeZone", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x00000006: { + "attributeName": "DSTOffset", + "attributeId": 0x00000006, + "type": "", + "reportable": True, + }, + 0x00000007: { + "attributeName": "LocalTime", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "TimeZoneDatabase", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x00000009: { + "attributeName": "NTPServerAvailable", + "attributeId": 0x00000009, + "type": "bool", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "TimeZoneListMaxSize", + "attributeId": 0x0000000A, + "type": "int", + "reportable": True, + }, + 0x0000000B: { + "attributeName": "DSTOffsetListMaxSize", + "attributeId": 0x0000000B, + "type": "int", + "reportable": True, + }, + 0x0000000C: { + "attributeName": "SupportsDNSResolve", + "attributeId": 0x0000000C, + "type": "bool", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_INFO = { "clusterName": "BridgedDeviceBasicInformation", "clusterId": 0x00000039, @@ -3536,14 +3781,7 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "KeySetWrite", "args": { - "groupKeySetID": "int", - "groupKeySecurityPolicy": "int", - "epochKey0": "bytes", - "epochStartTime0": "int", - "epochKey1": "bytes", - "epochStartTime1": "int", - "epochKey2": "bytes", - "epochStartTime2": "int", + "groupKeySet": "GroupKeySetStruct", }, }, 0x00000001: { @@ -3707,43 +3945,368 @@ class ChipClusters: "type": "int", "reportable": True, }, - 0x0000FFFA: { - "attributeName": "EventList", - "attributeId": 0x0000FFFA, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _PROXY_CONFIGURATION_CLUSTER_INFO = { + "clusterName": "ProxyConfiguration", + "clusterId": 0x00000042, + "commands": { + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _PROXY_DISCOVERY_CLUSTER_INFO = { + "clusterName": "ProxyDiscovery", + "clusterId": 0x00000043, + "commands": { + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _PROXY_VALID_CLUSTER_INFO = { + "clusterName": "ProxyValid", + "clusterId": 0x00000044, + "commands": { + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _BOOLEAN_STATE_CLUSTER_INFO = { + "clusterName": "BooleanState", + "clusterId": 0x00000045, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "StateValue", + "attributeId": 0x00000000, + "type": "bool", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _ICD_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "IcdManagement", + "clusterId": 0x00000046, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "RegisterClient", + "args": { + "checkInNodeID": "int", + "monitoredSubject": "int", + "key": "bytes", + "verificationKey": "bytes", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "UnregisterClient", + "args": { + "checkInNodeID": "int", + "key": "bytes", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "StayActiveRequest", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "IdleModeInterval", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "ActiveModeInterval", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "ActiveModeThreshold", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "RegisteredClients", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "ICDCounter", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "ClientsSupportedPerFabric", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _MODE_SELECT_CLUSTER_INFO = { + "clusterName": "ModeSelect", + "clusterId": 0x00000050, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ChangeToMode", + "args": { + "newMode": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "Description", + "attributeId": 0x00000000, + "type": "str", + "reportable": True, + }, + 0x00000001: { + "attributeName": "StandardNamespace", + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", + 0x00000002: { + "attributeName": "SupportedModes", + "attributeId": 0x00000002, + "type": "", "reportable": True, }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, + 0x00000003: { + "attributeName": "CurrentMode", + "attributeId": 0x00000003, "type": "int", "reportable": True, }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, + 0x00000004: { + "attributeName": "StartUpMode", + "attributeId": 0x00000004, "type": "int", "reportable": True, + "writable": True, }, - }, - } - _BOOLEAN_STATE_CLUSTER_INFO = { - "clusterName": "BooleanState", - "clusterId": 0x00000045, - "commands": { - }, - "attributes": { - 0x00000000: { - "attributeName": "StateValue", - "attributeId": 0x00000000, - "type": "bool", + 0x00000005: { + "attributeName": "OnMode", + "attributeId": 0x00000005, + "type": "int", "reportable": True, + "writable": True, }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", @@ -3783,70 +4346,54 @@ class ChipClusters: }, }, } - _ICD_MANAGEMENT_CLUSTER_INFO = { - "clusterName": "IcdManagement", - "clusterId": 0x00000046, + _TEMPERATURE_CONTROL_CLUSTER_INFO = { + "clusterName": "TemperatureControl", + "clusterId": 0x00000056, "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "RegisterClient", - "args": { - "checkInNodeID": "int", - "monitoredSubject": "int", - "key": "bytes", - "verificationKey": "bytes", - }, - }, - 0x00000002: { - "commandId": 0x00000002, - "commandName": "UnregisterClient", - "args": { - "checkInNodeID": "int", - "key": "bytes", - }, - }, - 0x00000003: { - "commandId": 0x00000003, - "commandName": "StayActiveRequest", + "commandName": "SetTemperature", "args": { + "targetTemperature": "int", + "targetTemperatureLevel": "int", }, }, }, "attributes": { 0x00000000: { - "attributeName": "IdleModeInterval", + "attributeName": "TemperatureSetpoint", "attributeId": 0x00000000, "type": "int", "reportable": True, }, 0x00000001: { - "attributeName": "ActiveModeInterval", + "attributeName": "MinTemperature", "attributeId": 0x00000001, "type": "int", "reportable": True, }, 0x00000002: { - "attributeName": "ActiveModeThreshold", + "attributeName": "MaxTemperature", "attributeId": 0x00000002, "type": "int", "reportable": True, }, 0x00000003: { - "attributeName": "RegisteredClients", + "attributeName": "Step", "attributeId": 0x00000003, - "type": "", + "type": "int", "reportable": True, }, 0x00000004: { - "attributeName": "ICDCounter", + "attributeName": "CurrentTemperatureLevelIndex", "attributeId": 0x00000004, "type": "int", "reportable": True, }, 0x00000005: { - "attributeName": "ClientsSupportedPerFabric", + "attributeName": "SupportedTemperatureLevels", "attributeId": 0x00000005, - "type": "int", + "type": "", "reportable": True, }, 0x0000FFF8: { @@ -3887,56 +4434,38 @@ class ChipClusters: }, }, } - _MODE_SELECT_CLUSTER_INFO = { - "clusterName": "ModeSelect", - "clusterId": 0x00000050, + _REFRIGERATOR_ALARM_CLUSTER_INFO = { + "clusterName": "RefrigeratorAlarm", + "clusterId": 0x00000057, "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "ChangeToMode", + "commandName": "Reset", "args": { - "newMode": "int", + "alarms": "int", + "mask": "int", }, }, }, "attributes": { 0x00000000: { - "attributeName": "Description", + "attributeName": "Mask", "attributeId": 0x00000000, - "type": "str", + "type": "int", "reportable": True, + "writable": True, }, 0x00000001: { - "attributeName": "StandardNamespace", + "attributeName": "Latch", "attributeId": 0x00000001, "type": "int", "reportable": True, }, 0x00000002: { - "attributeName": "SupportedModes", + "attributeName": "State", "attributeId": 0x00000002, - "type": "", - "reportable": True, - }, - 0x00000003: { - "attributeName": "CurrentMode", - "attributeId": 0x00000003, - "type": "int", - "reportable": True, - }, - 0x00000004: { - "attributeName": "StartUpMode", - "attributeId": 0x00000004, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000005: { - "attributeName": "OnMode", - "attributeId": 0x00000005, "type": "int", "reportable": True, - "writable": True, }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", @@ -4153,6 +4682,12 @@ class ChipClusters: "clusterName": "HepaFilterMonitoring", "clusterId": 0x00000071, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4221,6 +4756,12 @@ class ChipClusters: "clusterName": "ActivatedCarbonFilterMonitoring", "clusterId": 0x00000072, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4289,6 +4830,12 @@ class ChipClusters: "clusterName": "CeramicFilterMonitoring", "clusterId": 0x00000073, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4357,6 +4904,12 @@ class ChipClusters: "clusterName": "ElectrostaticFilterMonitoring", "clusterId": 0x00000074, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4425,6 +4978,12 @@ class ChipClusters: "clusterName": "UvFilterMonitoring", "clusterId": 0x00000075, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4493,6 +5052,12 @@ class ChipClusters: "clusterName": "IonizingFilterMonitoring", "clusterId": 0x00000076, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4561,6 +5126,12 @@ class ChipClusters: "clusterName": "ZeoliteFilterMonitoring", "clusterId": 0x00000077, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4629,6 +5200,12 @@ class ChipClusters: "clusterName": "OzoneFilterMonitoring", "clusterId": 0x00000078, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4697,6 +5274,12 @@ class ChipClusters: "clusterName": "WaterTankMonitoring", "clusterId": 0x00000079, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4765,6 +5348,12 @@ class ChipClusters: "clusterName": "FuelTankMonitoring", "clusterId": 0x0000007A, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4833,6 +5422,12 @@ class ChipClusters: "clusterName": "InkCartridgeMonitoring", "clusterId": 0x0000007B, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -4901,6 +5496,12 @@ class ChipClusters: "clusterName": "TonerCartridgeMonitoring", "clusterId": 0x0000007C, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ResetCondition", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -5102,8 +5703,7 @@ class ChipClusters: "commandName": "SetCredential", "args": { "operationType": "int", - "credentialType": "int", - "credentialIndex": "int", + "credential": "CredentialStruct", "credentialData": "bytes", "userIndex": "int", "userStatus": "int", @@ -5114,16 +5714,21 @@ class ChipClusters: "commandId": 0x00000024, "commandName": "GetCredentialStatus", "args": { - "credentialType": "int", - "credentialIndex": "int", + "credential": "CredentialStruct", }, }, 0x00000026: { "commandId": 0x00000026, "commandName": "ClearCredential", "args": { - "credentialType": "int", - "credentialIndex": "int", + "credential": "CredentialStruct", + }, + }, + 0x00000027: { + "commandId": 0x00000027, + "commandName": "UnboltDoor", + "args": { + "PINCode": "bytes", }, }, }, @@ -5951,9 +6556,7 @@ class ChipClusters: "numberOfTransitionsForSequence": "int", "dayOfWeekForSequence": "int", "modeForSequence": "int", - "transitionTime": "int", - "heatSetpoint": "int", - "coolSetpoint": "int", + "transitions": "ThermostatScheduleTransition", }, }, 0x00000002: { @@ -8270,7 +8873,7 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "LaunchContent", "args": { - "parameterList": "", + "search": "ContentSearchStruct", "autoPlay": "bool", "data": "str", }, @@ -8281,12 +8884,7 @@ class ChipClusters: "args": { "contentURL": "str", "displayString": "str", - "providerName": "str", - "background": "", - "logo": "", - "progressBar": "", - "splash": "", - "waterMark": "", + "brandingInformation": "BrandingInformationStruct", }, }, }, @@ -8421,8 +9019,7 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "LaunchApp", "args": { - "catalogVendorID": "int", - "applicationID": "str", + "application": "ApplicationStruct", "data": "bytes", }, }, @@ -8430,16 +9027,14 @@ class ChipClusters: "commandId": 0x00000001, "commandName": "StopApp", "args": { - "catalogVendorID": "int", - "applicationID": "str", + "application": "ApplicationStruct", }, }, 0x00000002: { "commandId": 0x00000002, "commandName": "HideApp", "args": { - "catalogVendorID": "int", - "applicationID": "str", + "application": "ApplicationStruct", }, }, }, @@ -8656,6 +9251,21 @@ class ChipClusters: "clusterName": "ElectricalMeasurement", "clusterId": 0x00000B04, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "GetProfileInfoCommand", + "args": { + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "GetMeasurementProfileCommand", + "args": { + "attributeId": "int", + "startTime": "int", + "numberOfIntervals": "int", + }, + }, }, "attributes": { 0x00000000: { @@ -9508,41 +10118,44 @@ class ChipClusters: "arg2": "int", }, }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "TestSimpleArgumentRequest", + "args": { + "arg1": "bool", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "TestStructArrayArgumentRequest", + "args": { + "arg1": "NestedStructList", + "arg2": "SimpleStruct", + "arg3": "int", + "arg4": "bool", + "arg5": "int", + "arg6": "bool", + }, + }, 0x00000007: { "commandId": 0x00000007, "commandName": "TestStructArgumentRequest", "args": { - "a": "int", - "b": "bool", - "c": "int", - "d": "bytes", - "e": "str", - "f": "int", - "g": "", - "h": "", + "arg1": "SimpleStruct", }, }, 0x00000008: { "commandId": 0x00000008, "commandName": "TestNestedStructArgumentRequest", "args": { - "a": "int", - "b": "bool", - "c": "", + "arg1": "NestedStruct", }, }, 0x00000009: { "commandId": 0x00000009, "commandName": "TestListStructArgumentRequest", "args": { - "a": "int", - "b": "bool", - "c": "int", - "d": "bytes", - "e": "str", - "f": "int", - "g": "", - "h": "", + "arg1": "SimpleStruct", }, }, 0x0000000A: { @@ -9556,26 +10169,14 @@ class ChipClusters: "commandId": 0x0000000B, "commandName": "TestNestedStructListArgumentRequest", "args": { - "a": "int", - "b": "bool", - "c": "", - "d": "", - "e": "int", - "f": "bytes", - "g": "int", + "arg1": "NestedStructList", }, }, 0x0000000C: { "commandId": 0x0000000C, "commandName": "TestListNestedStructListArgumentRequest", "args": { - "a": "int", - "b": "bool", - "c": "", - "d": "", - "e": "int", - "f": "bytes", - "g": "int", + "arg1": "NestedStructList", }, }, 0x0000000D: { @@ -9600,18 +10201,29 @@ class ChipClusters: "arg1": "int", }, }, + 0x00000010: { + "commandId": 0x00000010, + "commandName": "TestComplexNullableOptionalRequest", + "args": { + "nullableInt": "int", + "optionalInt": "int", + "nullableOptionalInt": "int", + "nullableString": "str", + "optionalString": "str", + "nullableOptionalString": "str", + "nullableStruct": "SimpleStruct", + "optionalStruct": "SimpleStruct", + "nullableOptionalStruct": "SimpleStruct", + "nullableList": "int", + "optionalList": "int", + "nullableOptionalList": "int", + }, + }, 0x00000011: { "commandId": 0x00000011, "commandName": "SimpleStructEchoRequest", "args": { - "a": "int", - "b": "bool", - "c": "int", - "d": "bytes", - "e": "str", - "f": "int", - "g": "", - "h": "", + "arg1": "SimpleStruct", }, }, 0x00000012: { @@ -9636,6 +10248,13 @@ class ChipClusters: "arg3": "bool", }, }, + 0x00000015: { + "commandId": 0x00000015, + "commandName": "TestEmitTestFabricScopedEventRequest", + "args": { + "arg1": "int", + }, + }, }, "attributes": { 0x00000000: { @@ -10250,6 +10869,70 @@ class ChipClusters: }, }, } + _FAULT_INJECTION_CLUSTER_INFO = { + "clusterName": "FaultInjection", + "clusterId": 0xFFF1FC06, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "FailAtFault", + "args": { + "type": "int", + "id": "int", + "numCallsToSkip": "int", + "numCallsToFail": "int", + "takeMutex": "bool", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "FailRandomlyAtFault", + "args": { + "type": "int", + "id": "int", + "percentage": "int", + }, + }, + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _CLUSTER_ID_DICT = { 0x00000003: _IDENTIFY_CLUSTER_INFO, @@ -10259,6 +10942,7 @@ class ChipClusters: 0x00000007: _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, 0x00000008: _LEVEL_CONTROL_CLUSTER_INFO, 0x0000000F: _BINARY_INPUT_BASIC_CLUSTER_INFO, + 0x0000001C: _PULSE_WIDTH_MODULATION_CLUSTER_INFO, 0x0000001D: _DESCRIPTOR_CLUSTER_INFO, 0x0000001E: _BINDING_CLUSTER_INFO, 0x0000001F: _ACCESS_CONTROL_CLUSTER_INFO, @@ -10279,6 +10963,7 @@ class ChipClusters: 0x00000035: _THREAD_NETWORK_DIAGNOSTICS_CLUSTER_INFO, 0x00000036: _WI_FI_NETWORK_DIAGNOSTICS_CLUSTER_INFO, 0x00000037: _ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_INFO, + 0x00000038: _TIME_SYNCHRONIZATION_CLUSTER_INFO, 0x00000039: _BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_INFO, 0x0000003B: _SWITCH_CLUSTER_INFO, 0x0000003C: _ADMINISTRATOR_COMMISSIONING_CLUSTER_INFO, @@ -10286,9 +10971,14 @@ class ChipClusters: 0x0000003F: _GROUP_KEY_MANAGEMENT_CLUSTER_INFO, 0x00000040: _FIXED_LABEL_CLUSTER_INFO, 0x00000041: _USER_LABEL_CLUSTER_INFO, + 0x00000042: _PROXY_CONFIGURATION_CLUSTER_INFO, + 0x00000043: _PROXY_DISCOVERY_CLUSTER_INFO, + 0x00000044: _PROXY_VALID_CLUSTER_INFO, 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, + 0x00000056: _TEMPERATURE_CONTROL_CLUSTER_INFO, + 0x00000057: _REFRIGERATOR_ALARM_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -10332,6 +11022,7 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, + 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, } _CLUSTER_NAME_DICT = { @@ -10342,6 +11033,7 @@ class ChipClusters: "OnOffSwitchConfiguration": _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, "LevelControl": _LEVEL_CONTROL_CLUSTER_INFO, "BinaryInputBasic": _BINARY_INPUT_BASIC_CLUSTER_INFO, + "PulseWidthModulation": _PULSE_WIDTH_MODULATION_CLUSTER_INFO, "Descriptor": _DESCRIPTOR_CLUSTER_INFO, "Binding": _BINDING_CLUSTER_INFO, "AccessControl": _ACCESS_CONTROL_CLUSTER_INFO, @@ -10362,6 +11054,7 @@ class ChipClusters: "ThreadNetworkDiagnostics": _THREAD_NETWORK_DIAGNOSTICS_CLUSTER_INFO, "WiFiNetworkDiagnostics": _WI_FI_NETWORK_DIAGNOSTICS_CLUSTER_INFO, "EthernetNetworkDiagnostics": _ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_INFO, + "TimeSynchronization": _TIME_SYNCHRONIZATION_CLUSTER_INFO, "BridgedDeviceBasicInformation": _BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_INFO, "Switch": _SWITCH_CLUSTER_INFO, "AdministratorCommissioning": _ADMINISTRATOR_COMMISSIONING_CLUSTER_INFO, @@ -10369,9 +11062,14 @@ class ChipClusters: "GroupKeyManagement": _GROUP_KEY_MANAGEMENT_CLUSTER_INFO, "FixedLabel": _FIXED_LABEL_CLUSTER_INFO, "UserLabel": _USER_LABEL_CLUSTER_INFO, + "ProxyConfiguration": _PROXY_CONFIGURATION_CLUSTER_INFO, + "ProxyDiscovery": _PROXY_DISCOVERY_CLUSTER_INFO, + "ProxyValid": _PROXY_VALID_CLUSTER_INFO, "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, + "TemperatureControl": _TEMPERATURE_CONTROL_CLUSTER_INFO, + "RefrigeratorAlarm": _REFRIGERATOR_ALARM_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -10415,6 +11113,7 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, + "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, } def __init__(self, chipstack): diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 0b2a818f8ed959..81f22de95f359d 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -290,7 +290,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class GroupsFeature(IntFlag): + class Feature(IntFlag): kGroupNames = 0x1 class Commands: @@ -615,12 +615,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: + class Feature(IntFlag): + kSceneNames = 0x1 + class ScenesCopyMode(IntFlag): kCopyAllScenes = 0x1 - class ScenesFeature(IntFlag): - kSceneNames = 0x1 - class Structs: @dataclass class AttributeValuePair(ClusterObject): @@ -1303,12 +1303,12 @@ class OnOffStartUpOnOff(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: + class Feature(IntFlag): + kLighting = 0x1 + class OnOffControl(IntFlag): kAcceptOnlyWhenOn = 0x1 - class OnOffFeature(IntFlag): - kLighting = 0x1 - class Commands: @dataclass class Off(ClusterCommand): @@ -1806,7 +1806,7 @@ class StepMode(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class LevelControlFeature(IntFlag): + class Feature(IntFlag): kOnOff = 0x1 kLighting = 0x2 kFrequency = 0x4 @@ -5661,7 +5661,7 @@ class TempUnitEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class UnitLocalizationFeature(IntFlag): + class Feature(IntFlag): kTemperatureUnit = 0x1 class Attributes: @@ -6222,7 +6222,7 @@ class WiredFaultEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class PowerSourceFeature(IntFlag): + class Feature(IntFlag): kWired = 0x1 kBattery = 0x2 kRechargeable = 0x4 @@ -7353,7 +7353,7 @@ class WiFiBand(MatterIntEnum): kUnknownEnumValue = 5, class Bitmaps: - class NetworkCommissioningFeature(IntFlag): + class Feature(IntFlag): kWiFiNetworkInterface = 0x1 kThreadNetworkInterface = 0x2 kEthernetNetworkInterface = 0x4 @@ -8535,7 +8535,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class SoftwareDiagnosticsFeature(IntFlag): + class Feature(IntFlag): kWaterMarks = 0x1 class Structs: @@ -8943,7 +8943,7 @@ class RoutingRole(MatterIntEnum): kUnknownEnumValue = 7, class Bitmaps: - class ThreadNetworkDiagnosticsFeature(IntFlag): + class Feature(IntFlag): kPacketCounts = 0x1 kErrorCounts = 0x2 kMLECounts = 0x4 @@ -10320,7 +10320,7 @@ class WiFiVersionEnum(MatterIntEnum): kUnknownEnumValue = 6, class Bitmaps: - class WiFiNetworkDiagnosticsFeature(IntFlag): + class Feature(IntFlag): kPacketCounts = 0x1 kErrorCounts = 0x2 @@ -10764,7 +10764,7 @@ class PHYRateEnum(MatterIntEnum): kUnknownEnumValue = 10, class Bitmaps: - class EthernetNetworkDiagnosticsFeature(IntFlag): + class Feature(IntFlag): kPacketCounts = 0x1 kErrorCounts = 0x2 @@ -11129,7 +11129,7 @@ class TimeZoneDatabaseEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class TimeSynchronizationFeature(IntFlag): + class Feature(IntFlag): kTimeZone = 0x1 kNTPClient = 0x2 kNTPServer = 0x4 @@ -12256,7 +12256,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class SwitchFeature(IntFlag): + class Feature(IntFlag): kLatchingSwitch = 0x1 kMomentarySwitch = 0x2 kMomentarySwitchRelease = 0x4 @@ -14537,7 +14537,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class ICDManagementFeature(IntFlag): + class Feature(IntFlag): kCheckInProtocolSupport = 0x1 class Structs: @@ -14858,7 +14858,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class ModeSelectFeature(IntFlag): + class Feature(IntFlag): kDeponoff = 0x1 class Structs: @@ -15149,11 +15149,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="tempLevel", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="temperatureLevel", Tag=1, Type=uint), ]) label: 'str' = "" - tempLevel: 'uint' = 0 + temperatureLevel: 'uint' = 0 class Commands: @dataclass @@ -15368,6 +15368,230 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class RefrigeratorAlarm(Cluster): + id: typing.ClassVar[int] = 0x0057 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="mask", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="latch", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + mask: 'uint' = None + latch: 'uint' = None + state: 'uint' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Bitmaps: + class AlarmMap(IntFlag): + kDoorOpen = 0x1 + + class Commands: + @dataclass + class Reset(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0057 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="alarms", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="mask", Tag=1, Type=typing.Optional[uint]), + ]) + + alarms: 'uint' = 0 + mask: 'typing.Optional[uint]' = None + + class Attributes: + @dataclass + class Mask(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class Latch(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class State(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class Notify(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0057 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="active", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="inactive", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="mask", Tag=3, Type=uint), + ]) + + active: 'uint' = 0 + inactive: 'uint' = 0 + state: 'uint' = 0 + mask: 'uint' = 0 + + @dataclass class AirQuality(Cluster): id: typing.ClassVar[int] = 0x005B @@ -15647,7 +15871,7 @@ class SensitivityEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class SmokeCOAlarmFeature(IntFlag): + class Feature(IntFlag): kSmokeAlarm = 0x1 kCoAlarm = 0x2 @@ -19398,7 +19622,7 @@ class DoorLockDayOfWeek(IntFlag): kFriday = 0x20 kSaturday = 0x40 - class DoorLockFeature(IntFlag): + class Feature(IntFlag): kPinCredential = 0x1 kRfidCredential = 0x2 kFingerCredentials = 0x4 @@ -20908,6 +21132,13 @@ class ConfigStatus(IntFlag): kLiftEncoderControlled = 0x20 kTiltEncoderControlled = 0x40 + class Feature(IntFlag): + kLift = 0x1 + kTilt = 0x2 + kPositionAwareLift = 0x4 + kAbsolutePosition = 0x8 + kPositionAwareTilt = 0x10 + class Mode(IntFlag): kMotorDirectionReversed = 0x1 kCalibrationMode = 0x2 @@ -20933,13 +21164,6 @@ class SafetyStatus(IntFlag): kManualOperation = 0x400 kProtection = 0x800 - class WindowCoveringFeature(IntFlag): - kLift = 0x1 - kTilt = 0x2 - kPositionAwareLift = 0x4 - kAbsolutePosition = 0x8 - kPositionAwareTilt = 0x10 - class Commands: @dataclass class UpOrOpen(ClusterCommand): @@ -21920,7 +22144,7 @@ class OperationModeEnum(MatterIntEnum): kUnknownEnumValue = 4, class Bitmaps: - class PumpConfigurationAndControlFeature(IntFlag): + class Feature(IntFlag): kConstantPressure = 0x1 kCompensatedPressure = 0x2 kConstantFlow = 0x4 @@ -22861,11 +23085,7 @@ class DayOfWeek(IntFlag): kSaturday = 0x40 kAway = 0x80 - class ModeForSequence(IntFlag): - kHeatSetpointPresent = 0x1 - kCoolSetpointPresent = 0x2 - - class ThermostatFeature(IntFlag): + class Feature(IntFlag): kHeating = 0x1 kCooling = 0x2 kOccupancy = 0x4 @@ -22873,6 +23093,10 @@ class ThermostatFeature(IntFlag): kSetback = 0x10 kAutoMode = 0x20 + class ModeForSequence(IntFlag): + kHeatSetpointPresent = 0x1 + kCoolSetpointPresent = 0x2 + class Structs: @dataclass class ThermostatScheduleTransition(ClusterObject): @@ -23939,7 +24163,7 @@ class FanModeType(MatterIntEnum): kUnknownEnumValue = 7, class Bitmaps: - class FanControlFeature(IntFlag): + class Feature(IntFlag): kMultiSpeed = 0x1 kAuto = 0x2 kRocking = 0x4 @@ -24621,19 +24845,19 @@ class ColorCapabilities(IntFlag): kXYAttributesSupported = 0x8 kColorTemperatureSupported = 0x10 - class ColorControlFeature(IntFlag): - kHueAndSaturation = 0x1 - kEnhancedHue = 0x2 - kColorLoop = 0x4 - kXy = 0x8 - kColorTemperature = 0x10 - class ColorLoopUpdateFlags(IntFlag): kUpdateAction = 0x1 kUpdateDirection = 0x2 kUpdateTime = 0x4 kUpdateStartHue = 0x8 + class Feature(IntFlag): + kHueAndSaturation = 0x1 + kEnhancedHue = 0x2 + kColorLoop = 0x4 + kXy = 0x8 + kColorTemperature = 0x10 + class Commands: @dataclass class MoveToHue(ClusterCommand): @@ -26842,7 +27066,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: - class PressureMeasurementFeature(IntFlag): + class Feature(IntFlag): kExtended = 0x1 class Attributes: @@ -28019,7 +28243,7 @@ class LineupInfoTypeEnum(MatterIntEnum): kUnknownEnumValue = 1, class Bitmaps: - class ChannelFeature(IntFlag): + class Feature(IntFlag): kChannelList = 0x1 kLineupInfo = 0x2 @@ -28124,10 +28348,10 @@ class SkipChannel(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="count", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="count", Tag=0, Type=int), ]) - count: 'uint' = 0 + count: 'int' = 0 class Attributes: @dataclass @@ -28557,7 +28781,7 @@ class PlaybackStateEnum(MatterIntEnum): kUnknownEnumValue = 4, class Bitmaps: - class MediaPlaybackFeature(IntFlag): + class Feature(IntFlag): kAdvancedSeek = 0x1 kVariableSpeed = 0x2 @@ -29004,7 +29228,7 @@ class InputTypeEnum(MatterIntEnum): kUnknownEnumValue = 12, class Bitmaps: - class MediaInputFeature(IntFlag): + class Feature(IntFlag): kNameUpdates = 0x1 class Structs: @@ -29479,7 +29703,7 @@ class KeypadInputStatusEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class KeypadInputFeature(IntFlag): + class Feature(IntFlag): kNavigationKeyCodes = 0x1 kLocationKeys = 0x2 kNumberKeys = 0x4 @@ -29684,7 +29908,7 @@ class ParameterEnum(MatterIntEnum): kUnknownEnumValue = 14, class Bitmaps: - class ContentLauncherFeature(IntFlag): + class Feature(IntFlag): kContentSearch = 0x1 kURLPlayback = 0x2 @@ -30014,7 +30238,7 @@ class OutputTypeEnum(MatterIntEnum): kUnknownEnumValue = 6, class Bitmaps: - class AudioOutputFeature(IntFlag): + class Feature(IntFlag): kNameUpdates = 0x1 class Structs: @@ -30237,7 +30461,7 @@ class ApplicationLauncherStatusEnum(MatterIntEnum): kUnknownEnumValue = 3, class Bitmaps: - class ApplicationLauncherFeature(IntFlag): + class Feature(IntFlag): kApplicationPlatform = 0x1 class Structs: diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index 9917fecb1ba5b2..c93e39d4f0ba18 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -13,32 +13,26 @@ class ChipClusters: SUCCESS_DELEGATE = ctypes.CFUNCTYPE(None) FAILURE_DELEGATE = ctypes.CFUNCTYPE(None, ctypes.c_uint8) -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} _{{asDelimitedMacro name}}_CLUSTER_INFO = { "clusterName": "{{asUpperCamelCase name}}", "clusterId": {{asHex code 8}}, "commands": { -{{#all_user_cluster_generated_commands}} - {{#if_compare clusterId ../id operator='=='}} - {{#if (is_str_equal commandSource 'client')}} - {{asHex commandCode 8}}: { - "commandId": {{asHex commandCode 8}}, +{{#zcl_commands_source_client}} + {{asHex code 8}}: { + "commandId": {{asHex code 8}}, "commandName": "{{asUpperCamelCase commandName}}", "args": { {{#zcl_command_arguments}} {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type ../../name}} - "{{asLowerCamelCase label}}": "{{#if (isCharString type)}}str{{else}}{{as_underlying_python_zcl_type type ../../../id}}{{/if}}", - {{/zcl_struct_items_by_struct_and_cluster_name}} + "{{asLowerCamelCase label}}": "{{type}}", {{else}} "{{asLowerCamelCase label}}": "{{#if (isCharString type)}}str{{else}}{{as_underlying_python_zcl_type type ../../id}}{{/if}}", {{/if_is_struct}} {{/zcl_command_arguments}} }, }, - {{/if}} - {{/if_compare}} -{{/all_user_cluster_generated_commands}} +{{/zcl_commands_source_client}} }, "attributes": { {{#zcl_attributes_server removeKeys='isOptional'}} @@ -56,18 +50,18 @@ class ChipClusters: {{/zcl_attributes_server}} }, } -{{/all_user_clusters}} +{{/zcl_clusters}} _CLUSTER_ID_DICT = { -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{asHex code 8}}: _{{asDelimitedMacro name}}_CLUSTER_INFO, -{{/all_user_clusters}} +{{/zcl_clusters}} } _CLUSTER_NAME_DICT = { -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} "{{asUpperCamelCase name}}": _{{asDelimitedMacro name}}_CLUSTER_INFO, -{{/all_user_clusters}} +{{/zcl_clusters}} } def __init__(self, chipstack): diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index 15ad26fff01c41..b4dfdf96577012 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -1773,7 +1773,7 @@ CHIP_ERROR ExtractRawDNFromX509Cert(bool extractSubject, const ByteSpan & certif dn.reduce_size(len); exit: - _log_mbedTLS_error(result); + logMbedTLSError(result); mbedtls_x509_crt_free(&mbedCertificate); #else diff --git a/src/darwin/Framework/CHIP/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/MTRIMDispatch.mm index 3884d0236960f0..f6276fcfcc3979 100644 --- a/src/darwin/Framework/CHIP/MTRIMDispatch.mm +++ b/src/darwin/Framework/CHIP/MTRIMDispatch.mm @@ -18,7 +18,6 @@ #import #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index e3c886a089f972..7cb5db8154c026 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -355,9 +355,18 @@ - (NSString * _Nullable)qrCodeString:(NSError * __autoreleasing *)error payload.rendezvousInformation = [MTRSetupPayload convertDiscoveryCapabilities:self.discoveryCapabilities]; payload.discriminator.SetLongValue([self.discriminator unsignedShortValue]); payload.setUpPINCode = [self.setupPasscode unsignedIntValue]; + if (self.serialNumber != nil) { + CHIP_ERROR err = payload.addSerialNumber(self.serialNumber.UTF8String); + if (err != CHIP_NO_ERROR) { + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + } - std::string outDecimalString; - CHIP_ERROR err = chip::QRCodeSetupPayloadGenerator(payload).payloadBase38Representation(outDecimalString); + std::string outQRCodeString; + CHIP_ERROR err = chip::QRCodeSetupPayloadGenerator(payload).payloadBase38RepresentationWithAutoTLVBuffer(outQRCodeString); if (err != CHIP_NO_ERROR) { if (error != nil) { @@ -366,7 +375,7 @@ - (NSString * _Nullable)qrCodeString:(NSError * __autoreleasing *)error return nil; } - return [NSString stringWithUTF8String:outDecimalString.c_str()]; + return [NSString stringWithUTF8String:outQRCodeString.c_str()]; } + (nullable NSNumber *)_boxDiscoveryCapabilities:(MTRDiscoveryCapabilities)discoveryCapabilities diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 54ef9f23474070..33919c12e7a70c 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -4101,24 +4101,48 @@ - ScenesCopyMode OnOff: - OnOffControl - - OnOffFeature + # Feature was originally named OnOffFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature LevelControl: - - LevelControlFeature + # Feature was originally named LevelControlFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature Actions: - CommandBits UnitLocalization: - - UnitLocalizationFeature + # Feature was originally named UnitLocalizationFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature PowerSource: - - PowerSourceFeature + # Feature was originally named PowerSourceFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature NetworkCommissioning: - - NetworkCommissioningFeature + # Feature was originally named NetworkCommissioningFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature - WiFiSecurity SoftwareDiagnostics: - - SoftwareDiagnosticsFeature + # Feature was originally named SoftwareDiagnosticsFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature ThreadNetworkDiagnostics: - - ThreadNetworkDiagnosticsFeature + # Feature was originally named ThreadNetworkDiagnosticsFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature ModeSelect: - - ModeSelectFeature + # Feature was originally named ModeSelectFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature DoorLock: - DlCredentialRuleMask - DlCredentialRulesSupport @@ -4134,13 +4158,13 @@ - DlRemoteProgrammingEventMask - DlSupportedOperatingModes - DoorLockDayOfWeek - - DoorLockFeature + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature WindowCovering: - ConfigStatus - # WindowCoveringFeature was originally just named Feature, but we - # generate the same API for both of those names, so the name can - # just change here. - - WindowCoveringFeature + - Feature - Mode - OperationalStatus - SafetyStatus @@ -4149,31 +4173,58 @@ Thermostat: - DayOfWeek - ModeForSequence - - ThermostatFeature + # Feature was originally named ThermostatFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature FanControl: - - FanControlFeature + # Feature was originally named FanControlFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + - Feature - RockSupportMask - WindSettingMask - WindSupportMask ColorControl: - ColorCapabilities - - ColorControlFeature + # Feature was originally named ColorControlFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature - ColorLoopUpdateFlags PressureMeasurement: - PressureFeature Channel: - - ChannelFeature + # Feature was originally named ChannelFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature MediaInput: - - MediaInputFeature + # Feature was originally named MediaInputFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature KeypadInput: - - KeypadInputFeature + # Feature was originally named KeypadInputFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature ContentLauncher: - - ContentLauncherFeature + # Feature was originally named ContentLauncherFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature - SupportedStreamingProtocol AudioOutput: - - AudioOutputFeature + # Feature was originally named AudioOutputFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + - Feature ApplicationLauncher: - - ApplicationLauncherFeature + # Feature was originally named ApplicationLauncherFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + - Feature TestCluster: - Bitmap16MaskMap - Bitmap32MaskMap @@ -4190,10 +4241,16 @@ OnOff: OnOffControl: - AcceptOnlyWhenOn - OnOffFeature: + # Feature was originally named OnOffFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - Lighting LevelControl: - LevelControlFeature: + # Feature was originally named LevelControlFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - OnOff - Lighting - Frequency @@ -4212,16 +4269,25 @@ - DisableAction - DisableActionWithDuration UnitLocalization: - UnitLocalizationFeature: + # Feature was originally named UnitLocalizationFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - TemperatureUnit PowerSource: - PowerSourceFeature: + # Feature was originally named PowerSourceFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - Wired - Battery - Rechargeable - Replaceable NetworkCommissioning: - NetworkCommissioningFeature: + # Feature was originally named NetworkCommissioningFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - WiFiNetworkInterface - ThreadNetworkInterface - EthernetNetworkInterface @@ -4232,16 +4298,25 @@ - Wpa2Personal - Wpa3Personal SoftwareDiagnostics: - SoftwareDiagnosticsFeature: + # Feature was originally named SoftwareDiagnosticsFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - WaterMarks ThreadNetworkDiagnostics: - ThreadNetworkDiagnosticsFeature: + # Feature was originally named ThreadNetworkDiagnosticsFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - PacketCounts - ErrorCounts - MLECounts - MACCounts ModeSelect: - ModeSelectFeature: + # Feature was originally named ModeSelectFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - DEPONOFF DoorLock: DlCredentialRuleMask: @@ -4341,7 +4416,10 @@ - Thursday - Friday - Saturday - DoorLockFeature: + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - PINCredentials - RFIDCredentials - FingerCredentials @@ -4363,10 +4441,7 @@ - TiltPositionAware - LiftEncoderControlled - TiltEncoderControlled - # WindowCoveringFeature was originally just named Feature, but we - # generate the same API for both of those names, so the name can - # just change here. - WindowCoveringFeature: + Feature: - Lift - Tilt - PositionAwareLift @@ -4418,7 +4493,10 @@ ModeForSequence: - HeatSetpointFieldPresent - CoolSetpointFieldPresent - ThermostatFeature: + # Feature was originally named ThermostatFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - Heating - Cooling - Occupancy @@ -4426,7 +4504,10 @@ - Setback - Automode FanControl: - FanControlFeature: + # Feature was originally named FanControlFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + Feature: - MultiSpeed - Auto - Rocking @@ -4448,7 +4529,10 @@ - ColorLoopSupported - XYAttributesSupported - ColorTemperatureSupported - ColorControlFeature: + # Feature was originally named ColorControlFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - HueAndSaturation - EnhancedHue - ColorLoop @@ -4463,29 +4547,47 @@ PressureFeature: - EXT Channel: - ChannelFeature: + # Feature was originally named ChannelFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - ChannelList - LineupInfo MediaInput: - MediaInputFeature: + # Feature was originally named MediaInputFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - NameUpdates KeypadInput: - KeypadInputFeature: + # Feature was originally named KeypadInputFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - NavigationKeyCodes - LocationKeys - NumberKeys ContentLauncher: - ContentLauncherFeature: + # Feature was originally named ContentLauncherFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - ContentSearch - URLPlayback SupportedStreamingProtocol: - DASH - HLS AudioOutput: - AudioOutputFeature: + # Feature was originally named AudioOutputFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + Feature: - NameUpdates ApplicationLauncher: - ApplicationLauncherFeature: + # Feature was originally named ApplicationLauncherFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + Feature: - ApplicationPlatform TestCluster: Bitmap16MaskMap: @@ -4617,19 +4719,31 @@ - revision bitmaps: Switch: - - SwitchFeature + # Feature was originally named SwitchFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature MediaPlayback: - - MediaPlaybackFeature + # Feature was originally named MediaPlaybackFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + - Feature bitmap values: Switch: - SwitchFeature: + # Feature was originally named SwitchFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - LatchingSwitch - MomentarySwitch - MomentarySwitchRelease - MomentarySwitchLongPress - MomentarySwitchMultiPress MediaPlayback: - MediaPlaybackFeature: + # Feature was originally named MediaPlaybackFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - AdvancedSeek - VariableSpeed ids: @@ -5744,9 +5858,15 @@ PumpConfigurationAndControl: - PumpFeature WiFiNetworkDiagnostics: - - WiFiNetworkDiagnosticsFeature + # Feature was originally named WiFiNetworkDiagnosticsFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + - Feature EthernetNetworkDiagnostics: - - EthernetNetworkDiagnosticsFeature + # Feature was originally named EthernetNetworkDiagnosticsFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + - Feature bitmap values: UnitTesting: Bitmap8MaskMap: @@ -5795,7 +5915,10 @@ - Thursday - Friday - Saturday - DoorLockFeature: + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - PINCredential - RFIDCredential - WeekDayAccessSchedules @@ -5813,7 +5936,10 @@ - Automatic - Local Thermostat: - ThermostatFeature: + # Feature was originally named ThermostatFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - ScheduleConfiguration - AutoMode DayOfWeek: @@ -5822,11 +5948,17 @@ - HeatSetpointPresent - CoolSetpointPresent WiFiNetworkDiagnostics: - WiFiNetworkDiagnosticsFeature: + # Feature was originally named WiFiNetworkDiagnosticsFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + Feature: - PacketCounts - ErrorCounts EthernetNetworkDiagnostics: - EthernetNetworkDiagnosticsFeature: + # Feature was originally named EthernetNetworkDiagnosticsFeature, but + # we generate the same API for both of those names, so the name + # can just change here. + Feature: - PacketCounts - ErrorCounts deprecated: @@ -6140,7 +6272,10 @@ PressureFeature: - EXT DoorLock: - DoorLockFeature: + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - PINCredentials - RFIDCredentials - WeekDaySchedules @@ -6149,7 +6284,10 @@ - Notifications - YearDaySchedules Thermostat: - ThermostatFeature: + # Feature was originally named ThermostatFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - Schedule - Automode DayOfWeek: @@ -6519,7 +6657,10 @@ PressureFeature: Extended: EXT DoorLock: - DoorLockFeature: + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: PINCredential: PINCredentials RFIDCredential: RFIDCredentials WeekDayAccessSchedules: WeekDaySchedules @@ -6528,7 +6669,10 @@ Notification: Notifications YearDayAccessSchedules: YearDaySchedules Thermostat: - ThermostatFeature: + # Feature was originally named ThermostatFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: ScheduleConfiguration: Schedule AutoMode: Automode DayOfWeek: @@ -6862,6 +7006,8 @@ - FuelTankMonitoring - InkCartridgeMonitoring - TonerCartridgeMonitoring + - RefrigeratorAlarm + - TemperatureControl - SmokeCOAlarm attributes: Scenes: @@ -7148,6 +7294,29 @@ - EventList - FeatureMap - ClusterRevision + RefrigeratorAlarm: + - Mask + - Latch + - State + - GeneratedCommandList + - AcceptedCommandList + - AttributeList + - EventList + - FeatureMap + - ClusterRevision + TemperatureControl: + - TemperatureSetpoint + - MinTemperature + - MaxTemperature + - Step + - CurrentTemperatureLevelIndex + - SupportedTemperatureLevels + - GeneratedCommandList + - AcceptedCommandList + - AttributeList + - EventList + - FeatureMap + - ClusterRevision SmokeCOAlarm: - ExpressedState - SmokeState @@ -7192,6 +7361,10 @@ - ResetCondition TonerCartridgeMonitoring: - ResetCondition + RefrigeratorAlarm: + - Reset + TemperatureControl: + - SetTemperature DoorLock: - UnboltDoor SmokeCOAlarm: @@ -7200,11 +7373,21 @@ DoorLock: UnboltDoor: - pinCode + RefrigeratorAlarm: + Reset: + - alarms + - mask + TemperatureControl: + SetTemperature: + - targetTemperature + - targetTemperatureLevel structs: BasicInformation: - ProductAppearanceStruct BridgedDeviceBasicInformation: - ProductAppearanceStruct + TemperatureControl: + - TemperatureLevelStruct struct fields: BasicInformation: ProductAppearanceStruct: @@ -7214,7 +7397,13 @@ ProductAppearanceStruct: - finish - primaryColor + TemperatureControl: + TemperatureLevelStruct: + - label + - temperatureLevel events: + RefrigeratorAlarm: + - Notify SmokeCOAlarm: - SmokeAlarm - COAlarm @@ -7227,6 +7416,13 @@ - InterconnectSmokeAlarm - InterconnectCOAlarm - AllClear + event fields: + RefrigeratorAlarm: + Notify: + - active + - inactive + - state + - mask enums: AirQuality: - AirQualityEnum @@ -7490,13 +7686,13 @@ AirQuality: - Feature Groups: - - GroupsFeature + - Feature PressureMeasurement: - - PressureMeasurementFeature + - Feature PumpConfigurationAndControl: - - PumpConfigurationAndControlFeature + - Feature Scenes: - - ScenesFeature + - Feature HEPAFilterMonitoring: - Feature ActivatedCarbonFilterMonitoring: @@ -7521,8 +7717,12 @@ - Feature TonerCartridgeMonitoring: - Feature + RefrigeratorAlarm: + - AlarmMap + TemperatureControl: + - Feature SmokeCOAlarm: - - SmokeCOAlarmFeature + - Feature bitmap values: AirQuality: Feature: @@ -7531,13 +7731,13 @@ - VeryPoor - ExtremelyPoor Groups: - GroupsFeature: + Feature: - GroupNames PressureMeasurement: - PressureMeasurementFeature: + Feature: - Extended PumpConfigurationAndControl: - PumpConfigurationAndControlFeature: + Feature: - ConstantPressure - CompensatedPressure - ConstantFlow @@ -7546,7 +7746,7 @@ - Automatic - LocalOperation Scenes: - ScenesFeature: + Feature: - SceneNames HEPAFilterMonitoring: Feature: @@ -7597,10 +7797,20 @@ - Condition - Warning DoorLock: - DoorLockFeature: + # Feature was originally named DoorLockFeature, but we generate the + # same API for both of those names, so the name can just change + # here. + Feature: - Unbolt + RefrigeratorAlarm: + AlarmMap: + - DoorOpen + TemperatureControl: + Feature: + - TemperatureNumber + - TemperatureLevel SmokeCOAlarm: - SmokeCOAlarmFeature: + Feature: - SmokeAlarm - COAlarm ids: @@ -7649,11 +7859,11 @@ GNSS: Gnss bitmaps: Groups: - GroupsFeature: GroupClusterFeature + Feature: GroupClusterFeature PressureMeasurement: - PressureMeasurementFeature: PressureFeature + Feature: PressureFeature PumpConfigurationAndControl: - PumpConfigurationAndControlFeature: PumpFeature + Feature: PumpFeature provisional: clusters: # Not ready to be public API yet. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index aa98a43f38aa53..a5027126bde65b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9100,7 +9100,7 @@ static id _Nullable DecodeAttributeValueForTemperatureControlCluster( newElement_0.label = [[NSString alloc] initWithBytes:entry_0.label.data() length:entry_0.label.size() encoding:NSUTF8StringEncoding]; - newElement_0.tempLevel = [NSNumber numberWithUnsignedChar:entry_0.tempLevel]; + newElement_0.temperatureLevel = [NSNumber numberWithUnsignedChar:entry_0.temperatureLevel]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -9246,6 +9246,178 @@ static id _Nullable DecodeAttributeValueForTemperatureControlCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAlarm; + switch (aAttributeId) { + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + return value; + } + case Attributes::Latch::Id: { + using TypeInfo = Attributes::Latch::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + return value; + } + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForAirQualityCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -22486,6 +22658,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::TemperatureControl::Id: { return DecodeAttributeValueForTemperatureControlCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::RefrigeratorAlarm::Id: { + return DecodeAttributeValueForRefrigeratorAlarmCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::AirQuality::Id: { return DecodeAttributeValueForAirQualityCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index d5be57d1067fc0..057bcd7b7efca4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8041,6 +8041,143 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Refrigerator Alarm + * + * Attributes and commands for configuring the Refrigerator alarm. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterRefrigeratorAlarm : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command Reset + * + * Reset alarm + */ +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)writeAttributeMaskWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)writeAttributeMaskWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeMaskWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeMaskWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeLatchWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeLatchWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeLatchWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Air Quality * @@ -21918,14 +22055,14 @@ typedef NS_OPTIONS(uint32_t, MTRGroupsGroupClusterFeature) { = 0x1, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use MTRGroupsFeature"); -typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { - MTRScenesCopyModeCopyAllScenes API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, -} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureSceneNames MTR_NEWLY_AVAILABLE = 0x1, } MTR_NEWLY_AVAILABLE; +typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { + MTRScenesCopyModeCopyAllScenes API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, +} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + typedef NS_ENUM(uint8_t, MTROnOffDelayedAllOffEffectVariant) { MTROnOffDelayedAllOffEffectVariantFadeToOffIn0p8Seconds API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTROnOffDelayedAllOffEffectVariantNoFade API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, @@ -21951,14 +22088,14 @@ typedef NS_ENUM(uint8_t, MTROnOffStartUpOnOff) { MTROnOffStartUpOnOffTogglePreviousOnOff API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_OPTIONS(uint8_t, MTROnOffControl) { - MTROnOffControlAcceptOnlyWhenOn API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, -} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - typedef NS_OPTIONS(uint32_t, MTROnOffFeature) { MTROnOffFeatureLighting API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTROnOffControl) { + MTROnOffControlAcceptOnlyWhenOn API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, +} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + typedef NS_ENUM(uint8_t, MTRLevelControlMoveMode) { MTRLevelControlMoveModeUp API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRLevelControlMoveModeDown API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, @@ -23200,6 +23337,10 @@ typedef NS_OPTIONS(uint32_t, MTRTemperatureControlFeature) { MTRTemperatureControlFeatureTemperatureLevel MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; +typedef NS_OPTIONS(uint32_t, MTRRefrigeratorAlarmAlarmMap) { + MTRRefrigeratorAlarmAlarmMapDoorOpen MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRAirQuality) { MTRAirQualityUnknown MTR_NEWLY_AVAILABLE = 0x00, MTRAirQualityGood MTR_NEWLY_AVAILABLE = 0x01, @@ -24214,6 +24355,14 @@ typedef NS_OPTIONS(uint8_t, MTRWindowCoveringConfigStatus) { MTRWindowCoveringConfigStatusTiltEncoderControlled API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x40, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint32_t, MTRWindowCoveringFeature) { + MTRWindowCoveringFeatureLift API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, + MTRWindowCoveringFeatureTilt API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, + MTRWindowCoveringFeaturePositionAwareLift API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, + MTRWindowCoveringFeatureAbsolutePosition API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, + MTRWindowCoveringFeaturePositionAwareTilt API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, +} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + typedef NS_OPTIONS(uint8_t, MTRWindowCoveringMode) { MTRWindowCoveringModeMotorDirectionReversed API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, MTRWindowCoveringModeCalibrationMode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, @@ -24242,14 +24391,6 @@ typedef NS_OPTIONS(uint16_t, MTRWindowCoveringSafetyStatus) { MTRWindowCoveringSafetyStatusProtection API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x800, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_OPTIONS(uint32_t, MTRWindowCoveringFeature) { - MTRWindowCoveringFeatureLift API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTRWindowCoveringFeatureTilt API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, - MTRWindowCoveringFeaturePositionAwareLift API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, - MTRWindowCoveringFeatureAbsolutePosition API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, - MTRWindowCoveringFeaturePositionAwareTilt API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, -} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - typedef NS_ENUM(uint8_t, MTRPumpConfigurationAndControlControlMode) { MTRPumpConfigurationAndControlControlModeConstantSpeed API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) = 0x00, MTRPumpConfigurationAndControlControlModeConstantPressure API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) @@ -24469,19 +24610,6 @@ typedef NS_OPTIONS(uint8_t, MTRThermostatDayOfWeek) { = 0x80, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_OPTIONS(uint8_t, MTRThermostatModeForSequence) { - MTRThermostatModeForSequenceHeatSetpointPresent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x1, - MTRThermostatModeForSequenceHeatSetpointFieldPresent MTR_DEPRECATED( - "Please use MTRThermostatModeForSequenceHeatSetpointPresent", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), - tvos(16.1, 16.4)) - = 0x1, - MTRThermostatModeForSequenceCoolSetpointPresent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x2, - MTRThermostatModeForSequenceCoolSetpointFieldPresent MTR_DEPRECATED( - "Please use MTRThermostatModeForSequenceCoolSetpointPresent", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), - tvos(16.1, 16.4)) - = 0x2, -} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { MTRThermostatFeatureHeating API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, MTRThermostatFeatureCooling API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, @@ -24497,6 +24625,19 @@ typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { = 0x20, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRThermostatModeForSequence) { + MTRThermostatModeForSequenceHeatSetpointPresent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x1, + MTRThermostatModeForSequenceHeatSetpointFieldPresent MTR_DEPRECATED( + "Please use MTRThermostatModeForSequenceHeatSetpointPresent", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), + tvos(16.1, 16.4)) + = 0x1, + MTRThermostatModeForSequenceCoolSetpointPresent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x2, + MTRThermostatModeForSequenceCoolSetpointFieldPresent MTR_DEPRECATED( + "Please use MTRThermostatModeForSequenceCoolSetpointPresent", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), + tvos(16.1, 16.4)) + = 0x2, +} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + typedef NS_ENUM(uint8_t, MTRFanControlFanModeSequenceType) { MTRFanControlFanModeSequenceTypeOffLowMedHigh API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRFanControlFanModeSequenceTypeOffLowHigh API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, @@ -24597,6 +24738,13 @@ typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilities) { = 0x10, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRColorControlColorLoopUpdateFlags) { + MTRColorControlColorLoopUpdateFlagsUpdateAction API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, + MTRColorControlColorLoopUpdateFlagsUpdateDirection API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, + MTRColorControlColorLoopUpdateFlagsUpdateTime API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, + MTRColorControlColorLoopUpdateFlagsUpdateStartHue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, +} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureHueAndSaturation API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, MTRColorControlFeatureEnhancedHue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, @@ -24605,13 +24753,6 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureColorTemperature API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_OPTIONS(uint8_t, MTRColorControlColorLoopUpdateFlags) { - MTRColorControlColorLoopUpdateFlagsUpdateAction API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTRColorControlColorLoopUpdateFlagsUpdateDirection API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, - MTRColorControlColorLoopUpdateFlagsUpdateTime API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, - MTRColorControlColorLoopUpdateFlagsUpdateStartHue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, -} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - typedef NS_ENUM(uint8_t, MTRIlluminanceMeasurementLightSensorType) { MTRIlluminanceMeasurementLightSensorTypePhotodiode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRIlluminanceMeasurementLightSensorTypeCMOS API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index c72f186934b01b..10844c383222b6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -48400,6 +48400,492 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterRefrigeratorAlarm + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + _endpoint = [endpointID unsignedShortValue]; + } + return self; +} + +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RefrigeratorAlarm::Commands::Reset::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.alarms = static_cast>(params.alarms.unsignedIntValue); + if (params.mask != nil) { + auto & definedValue_0 = request.mask.Emplace(); + definedValue_0 = static_cast>(params.mask.unsignedIntValue); + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributeMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::Mask::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)writeAttributeMaskWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMaskWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMaskWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = RefrigeratorAlarm::Attributes::Mask::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedIntValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMaskWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::Mask::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeMaskWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmMaskAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(RefrigeratorAlarmMaskAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::Mask::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLatchWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::Latch::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeLatchWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::Latch::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeLatchWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmLatchAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(RefrigeratorAlarmLatchAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::Latch::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::State::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::State::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmStateAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(RefrigeratorAlarmStateAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::State::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RefrigeratorAlarmGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RefrigeratorAlarmAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RefrigeratorAlarmEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RefrigeratorAlarmAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RefrigeratorAlarm::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RefrigeratorAlarm::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RefrigeratorAlarm::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + @implementation MTRBaseClusterAirQuality - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -93960,7 +94446,7 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params compl invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.count = params.count.unsignedShortValue; + request.count = params.count.shortValue; return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 647703d98d0e62..5aadb7f0a173af 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -205,6 +205,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterRefrigeratorAlarm () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@property (nonatomic, assign, readonly) chip::EndpointId endpoint; +@end + @interface MTRBaseClusterAirQuality () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 8500788f0d7e32..c2c0430bdcb2a1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -1107,6 +1107,17 @@ typedef void (*TemperatureControlEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureControlAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmMaskAttributeCallback)(void *, chip::BitMask); +typedef void (*RefrigeratorAlarmLatchAttributeCallback)(void *, chip::BitMask); +typedef void (*RefrigeratorAlarmStateAttributeCallback)(void *, chip::BitMask); +typedef void (*RefrigeratorAlarmGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAcceptedCommandListListAttributeCallback)( @@ -8749,6 +8760,228 @@ class MTRTemperatureControlAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRefrigeratorAlarmMaskAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmMaskAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmMaskAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRRefrigeratorAlarmMaskAttributeCallbackSubscriptionBridge : public MTRRefrigeratorAlarmMaskAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmMaskAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmMaskAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmMaskAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmMaskAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmLatchAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmLatchAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmLatchAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRRefrigeratorAlarmLatchAttributeCallbackSubscriptionBridge : public MTRRefrigeratorAlarmLatchAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmLatchAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmLatchAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmLatchAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmLatchAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmStateAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmStateAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmStateAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRRefrigeratorAlarmStateAttributeCallbackSubscriptionBridge : public MTRRefrigeratorAlarmStateAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmStateAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmStateAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmStateAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmStateAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRefrigeratorAlarmEventListListAttributeCallbackSubscriptionBridge + : public MTRRefrigeratorAlarmEventListListAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRefrigeratorAlarmAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge +{ +public: + MTRRefrigeratorAlarmAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRAirQualityGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 6d584e09edbd9d..d750d5a037aa8e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8148,7 +8148,7 @@ newElement_0.label = [[NSString alloc] initWithBytes:entry_0.label.data() length:entry_0.label.size() encoding:NSUTF8StringEncoding]; - newElement_0.tempLevel = [NSNumber numberWithUnsignedChar:entry_0.tempLevel]; + newElement_0.temperatureLevel = [NSNumber numberWithUnsignedChar:entry_0.temperatureLevel]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -8328,6 +8328,227 @@ } } +void MTRRefrigeratorAlarmMaskAttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedInt:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmMaskAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmLatchAttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedInt:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmLatchAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmStateAttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedInt:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmStateAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRefrigeratorAlarmAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRefrigeratorAlarmAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRAirQualityGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e1d33a8d54b1d3..be9c55ebba0266 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -277,6 +277,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeBooleanStateID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, MTRClusterIDTypeModeSelectID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000050, MTRClusterIDTypeTemperatureControlID MTR_NEWLY_AVAILABLE = 0x00000056, + MTRClusterIDTypeRefrigeratorAlarmID MTR_NEWLY_AVAILABLE = 0x00000057, MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, @@ -3748,6 +3749,23 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterTemperatureControlAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster RefrigeratorAlarm attributes + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeMaskID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeLatchID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeStateID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeEventListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster AirQuality attributes MTRAttributeIDTypeClusterAirQualityAttributeAirQualityID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterAirQualityAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE @@ -9131,6 +9149,9 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster TemperatureControl commands MTRCommandIDTypeClusterTemperatureControlCommandSetTemperatureID MTR_NEWLY_AVAILABLE = 0x00000000, + // Cluster RefrigeratorAlarm commands + MTRCommandIDTypeClusterRefrigeratorAlarmCommandResetID MTR_NEWLY_AVAILABLE = 0x00000000, + // Cluster SmokeCOAlarm commands MTRCommandIDTypeClusterSmokeCOAlarmCommandSelfTestRequestID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10288,6 +10309,9 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterBooleanStateEventStateChangeID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, + // Cluster RefrigeratorAlarm events + MTREventIDTypeClusterRefrigeratorAlarmEventNotifyID MTR_NEWLY_AVAILABLE = 0x00000000, + // Cluster SmokeCOAlarm events MTREventIDTypeClusterSmokeCOAlarmEventSmokeAlarmID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterSmokeCOAlarmEventCOAlarmID MTR_NEWLY_AVAILABLE = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index e6bc0cf251ca08..bd0145b4079a35 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2841,6 +2841,50 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Refrigerator Alarm + * Attributes and commands for configuring the Refrigerator alarm. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterRefrigeratorAlarm : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeMaskWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (void)writeAttributeMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_NEWLY_AVAILABLE; +- (void)writeAttributeMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeLatchWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Air Quality * Attributes for reporting air quality classification diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 70c0811649afc8..940b70222f5bdc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13129,6 +13129,186 @@ - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperaturePara @end +@implementation MTRClusterRefrigeratorAlarm + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = [endpointID unsignedShortValue]; + _device = device; + } + return self; +} + +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRefrigeratorAlarmID, + (unsigned int) MTRCommandIDTypeClusterRefrigeratorAlarmCommandResetID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RefrigeratorAlarm::Commands::Reset::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.alarms = static_cast>(params.alarms.unsignedIntValue); + if (params.mask != nil) { + auto & definedValue_0 = request.mask.Emplace(); + definedValue_0 = static_cast>(params.mask.unsignedIntValue); + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributeMaskWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeMaskID) + params:params]; +} + +- (void)writeAttributeMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMaskWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeMaskID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary *)readAttributeLatchWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeLatchID) + params:params]; +} + +- (NSDictionary *)readAttributeStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeStateID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) + attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeClusterRevisionID) + params:params]; +} + +@end + @implementation MTRClusterAirQuality - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -25434,7 +25614,7 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.count = params.count.unsignedShortValue; + request.count = params.count.shortValue; return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index f67f51f2cf702a..e483aa7dc1cbe7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -206,6 +206,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterRefrigeratorAlarm () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + @interface MTRClusterAirQuality () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 342464bf28616a..b0f528787d97c0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4109,6 +4109,38 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_NEWLY_AVAILABLE +@interface MTRRefrigeratorAlarmClusterResetParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull alarms MTR_NEWLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable mask MTR_NEWLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_NEWLY_AVAILABLE @interface MTRSmokeCOAlarmClusterSelfTestRequestParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index bd6f11686b7439..5e9e298fa5b733 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6492,6 +6492,40 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTRRefrigeratorAlarmClusterResetParams +- (instancetype)init +{ + if (self = [super init]) { + + _alarms = @(0); + + _mask = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRefrigeratorAlarmClusterResetParams alloc] init]; + + other.alarms = self.alarms; + other.mask = self.mask; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: alarms:%@; mask:%@; >", NSStringFromClass([self class]), _alarms, _mask]; + return descriptionString; +} + @end @implementation MTRSmokeCOAlarmClusterSelfTestRequestParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index f33a6a16b3300f..3e1a0cb177f531 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1563,6 +1563,50 @@ static id _Nullable DecodeEventPayloadForTemperatureControlCluster(EventId aEven *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForRefrigeratorAlarmCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAlarm; + switch (aEventId) { + case Events::Notify::Id: { + Events::Notify::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRRefrigeratorAlarmClusterNotifyEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.active.Raw()]; + value.active = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.inactive.Raw()]; + value.inactive = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.state.Raw()]; + value.state = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.mask.Raw()]; + value.mask = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForAirQualityCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::AirQuality; @@ -2889,6 +2933,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::TemperatureControl::Id: { return DecodeEventPayloadForTemperatureControlCluster(aPath.mEventId, aReader, aError); } + case Clusters::RefrigeratorAlarm::Id: { + return DecodeEventPayloadForRefrigeratorAlarmCluster(aPath.mEventId, aReader, aError); + } case Clusters::AirQuality::Id: { return DecodeEventPayloadForAirQualityCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 0bf123fda0b9c2..fa0842de1b7f15 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -682,7 +682,15 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_AVAILABLE @interface MTRTemperatureControlClusterTemperatureLevelStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull tempLevel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull temperatureLevel MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRefrigeratorAlarmClusterNotifyEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull active MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull inactive MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull state MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull mask MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2faddf53bcec91..f34a16a25558db 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2674,7 +2674,7 @@ - (instancetype)init _label = @""; - _tempLevel = @(0); + _temperatureLevel = @(0); } return self; } @@ -2684,15 +2684,52 @@ - (id)copyWithZone:(NSZone * _Nullable)zone auto other = [[MTRTemperatureControlClusterTemperatureLevelStruct alloc] init]; other.label = self.label; - other.tempLevel = self.tempLevel; + other.temperatureLevel = self.temperatureLevel; return other; } - (NSString *)description { - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: label:%@; tempLevel:%@; >", NSStringFromClass([self class]), _label, _tempLevel]; + NSString * descriptionString = [NSString + stringWithFormat:@"<%@: label:%@; temperatureLevel:%@; >", NSStringFromClass([self class]), _label, _temperatureLevel]; + return descriptionString; +} + +@end + +@implementation MTRRefrigeratorAlarmClusterNotifyEvent +- (instancetype)init +{ + if (self = [super init]) { + + _active = @(0); + + _inactive = @(0); + + _state = @(0); + + _mask = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRefrigeratorAlarmClusterNotifyEvent alloc] init]; + + other.active = self.active; + other.inactive = self.inactive; + other.state = self.state; + other.mask = self.mask; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: active:%@; inactive:%@; state:%@; mask:%@; >", + NSStringFromClass([self class]), _active, _inactive, _state, _mask]; return descriptionString; } diff --git a/src/darwin/Framework/CHIPTests/MTRSetupPayloadParserTests.m b/src/darwin/Framework/CHIPTests/MTRSetupPayloadParserTests.m index f52aac1c2a297a..8da233967cab33 100644 --- a/src/darwin/Framework/CHIPTests/MTRSetupPayloadParserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRSetupPayloadParserTests.m @@ -250,4 +250,29 @@ - (void)testQRCodePropertyAliases XCTAssertEqualObjects(payload.setUpPINCode, @(2)); } +- (void)testSerialNumberRoundTrip +{ + NSError * error; + MTRSetupPayload * payload = + [MTRSetupPayload setupPayloadWithOnboardingPayload:@"MT:M5L90MP500K64J0A33P0SET70.QT52B.E23-WZE0WISA0DK5N1K8SQ1RYCU1O0" + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(payload); + + XCTAssertEqualObjects(payload.serialNumber, @"123456789"); + + NSString * serialNumber = @"12345"; + payload.serialNumber = serialNumber; + + NSString * qrCode = [payload qrCodeString:&error]; + XCTAssertNil(error); + XCTAssertNotNil(qrCode); + + MTRSetupPayload * newPayload = [MTRSetupPayload setupPayloadWithOnboardingPayload:qrCode error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(newPayload); + + XCTAssertEqualObjects(newPayload.serialNumber, serialNumber); +} + @end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 406bd64a9552f8..30546060ca618a 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -1522,7 +1522,6 @@ "$(CHIP_ROOT)/third_party/editline/repo/include", "$(CHIP_ROOT)/src/include", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", - "$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters", "$(CHIP_ROOT)/third_party/inipp/repo/inipp", "$(CHIP_ROOT)/third_party/editline/include", "$(CHIP_ROOT)/examples/chip-tool", @@ -1571,7 +1570,6 @@ "$(CHIP_ROOT)/third_party/editline/repo/include", "$(CHIP_ROOT)/src/include", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", - "$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters", "$(SRCROOT)/darwin-framework-tool", "$(CHIP_ROOT)/third_party/inipp/repo/inipp", "$(CHIP_ROOT)/third_party/editline/include", @@ -1678,6 +1676,7 @@ "$(inherited)", "MTR_NEWLY_AVAILABLE=", "MTR_NEWLY_DEPRECATED(message)=", + "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", ); HEADER_SEARCH_PATHS = ( "$(CHIP_ROOT)/src", @@ -1692,8 +1691,6 @@ "$(TEMP_DIR)/out/gen/include", "$(CHIP_ROOT)/zzz_generated/", "$(CHIP_ROOT)/zzz_generated/app-common", - "$(CHIP_ROOT)/zzz_generated/controller-clusters", - "$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters", ); INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1831,6 +1828,7 @@ "$(inherited)", "MTR_NEWLY_AVAILABLE=", "MTR_NEWLY_DEPRECATED(message)=", + "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", ); HEADER_SEARCH_PATHS = ( "$(CHIP_ROOT)/src", @@ -1845,8 +1843,6 @@ "$(TEMP_DIR)/out/gen/include", "$(CHIP_ROOT)/zzz_generated/", "$(CHIP_ROOT)/zzz_generated/app-common", - "$(CHIP_ROOT)/zzz_generated/controller-clusters", - "$(CHIP_ROOT)/zzz_generated/darwin/controller-clusters", ); INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 961db5250e7d63..bc368912e2965c 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1423,6 +1423,20 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS 2 #endif +/** + * @def CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES + * + * @brief Controls whether core data model code will try to include app-specific generated headers. + * + * If this is set to true, data model code will be compiled with no client or + * server clusters enabled and all required access control levels set to their + * defaults: (view for all attribute/event reads, operate for all writes and + * invokes). + */ +#ifndef CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES +#define CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES 0 +#endif + /** * @} */ diff --git a/src/lib/support/logging/CHIPLogging.cpp b/src/lib/support/logging/CHIPLogging.cpp index a1eac1324e6b3b..fd8d782efb2d08 100644 --- a/src/lib/support/logging/CHIPLogging.cpp +++ b/src/lib/support/logging/CHIPLogging.cpp @@ -154,13 +154,13 @@ static const char ModuleNames[kLogModule_Max][kMaxModuleNameLen + 1] = { "CSM", // CASESessionManager }; -static char const * GetModuleName(LogModule module) +} // namespace + +const char * GetModuleName(LogModule module) { return ModuleNames[(module < kLogModule_Max) ? module : kLogModule_NotSpecified]; } -} // namespace - void SetLogRedirectCallback(LogRedirectCallback_t callback) { sLogRedirectCallback.store(callback); diff --git a/src/lib/support/logging/CHIPLogging.h b/src/lib/support/logging/CHIPLogging.h index 3d0dd96d2f5f60..ba13ac96f181ce 100644 --- a/src/lib/support/logging/CHIPLogging.h +++ b/src/lib/support/logging/CHIPLogging.h @@ -83,6 +83,9 @@ using ByteSpan = Span; namespace Logging { +// Get the module name associated with a LogModule, or "-" on invalid value. +const char * GetModuleName(LogModule module); + // Log redirection using LogRedirectCallback_t = void (*)(const char * module, uint8_t category, const char * msg, va_list args); DLL_EXPORT void SetLogRedirectCallback(LogRedirectCallback_t callback); diff --git a/src/platform/Ameba/BLEManagerImpl.cpp b/src/platform/Ameba/BLEManagerImpl.cpp index 2cb77beb3e9c7e..b45c314446e095 100644 --- a/src/platform/Ameba/BLEManagerImpl.cpp +++ b/src/platform/Ameba/BLEManagerImpl.cpp @@ -292,7 +292,12 @@ CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(uint16_t conn_id, uint16_t disc_c disconReason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; break; } - HandleConnectionError(conn_id, disconReason); + + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = conn_id; + event.CHIPoBLEConnectionError.Reason = disconReason; + PlatformMgr().PostEventOrDie(&event); // Force a reconfiguration of advertising in case we switched to non-connectable mode when // the BLE connection was established. diff --git a/src/platform/openiotsdk/CHIPPlatformConfig.h b/src/platform/openiotsdk/CHIPPlatformConfig.h index efc4afd358fdf6..0cf7664c30d3a9 100644 --- a/src/platform/openiotsdk/CHIPPlatformConfig.h +++ b/src/platform/openiotsdk/CHIPPlatformConfig.h @@ -30,7 +30,9 @@ // ==================== General Platform Adaptations ==================== -#define CHIP_CONFIG_EXPECTED_LOW_PROCESSING_TIME 10 +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif // ==================== Security Adaptations ==================== diff --git a/src/platform/openiotsdk/KVBlockDeviceStore.cpp b/src/platform/openiotsdk/KVBlockDeviceStore.cpp index 3a235a0d99c61a..ef623b1f9bc2b9 100644 --- a/src/platform/openiotsdk/KVBlockDeviceStore.cpp +++ b/src/platform/openiotsdk/KVBlockDeviceStore.cpp @@ -114,6 +114,20 @@ CHIP_ERROR KVBlockDeviceStore::Init(void) return CHIP_NO_ERROR; } +CHIP_ERROR KVBlockDeviceStore::Shutdown(void) +{ + if (!tdb) + { + return CHIP_NO_ERROR; + } + + tdb->deinit(); + delete tdb; + tdb = nullptr; + + return CHIP_NO_ERROR; +} + CHIP_ERROR KVBlockDeviceStore::ReadConfigValue(Key key, bool & val) { if (Init() != CHIP_NO_ERROR) diff --git a/src/platform/openiotsdk/KVBlockDeviceStore.h b/src/platform/openiotsdk/KVBlockDeviceStore.h index 5935d599ba17a8..e817d9dde17f28 100644 --- a/src/platform/openiotsdk/KVBlockDeviceStore.h +++ b/src/platform/openiotsdk/KVBlockDeviceStore.h @@ -81,6 +81,7 @@ class KVBlockDeviceStore // Initialization static CHIP_ERROR Init(void); + static CHIP_ERROR Shutdown(void); // Config value accessors static CHIP_ERROR ReadConfigValue(Key key, bool & val); diff --git a/src/platform/openiotsdk/KVPsaPsStore.cpp b/src/platform/openiotsdk/KVPsaPsStore.cpp index 523cb37b536c2a..26215bf2e4431a 100644 --- a/src/platform/openiotsdk/KVPsaPsStore.cpp +++ b/src/platform/openiotsdk/KVPsaPsStore.cpp @@ -115,6 +115,15 @@ CHIP_ERROR KVPsaPsStore::Init(void) return CHIP_NO_ERROR; } +CHIP_ERROR KVPsaPsStore::Shutdown(void) +{ + KVSKeyMapUpdate(); + + initialized = false; + + return CHIP_NO_ERROR; +} + CHIP_ERROR KVPsaPsStore::ReadConfigValue(Key key, bool & val) { if (!ConfigValueExists(key)) diff --git a/src/platform/openiotsdk/KVPsaPsStore.h b/src/platform/openiotsdk/KVPsaPsStore.h index b66c9cf669df63..7e68bdbd32491b 100644 --- a/src/platform/openiotsdk/KVPsaPsStore.h +++ b/src/platform/openiotsdk/KVPsaPsStore.h @@ -122,6 +122,7 @@ class KVPsaPsStore static const Key kMaxMatterPsaPaKeyRegion; static CHIP_ERROR Init(void); + static CHIP_ERROR Shutdown(void); // Config value accessors. static CHIP_ERROR ReadConfigValue(Key key, bool & val); diff --git a/src/platform/openiotsdk/KeyValueStoreManagerImpl.cpp b/src/platform/openiotsdk/KeyValueStoreManagerImpl.cpp index fb5268d494139f..8cf11d2e1ffc77 100644 --- a/src/platform/openiotsdk/KeyValueStoreManagerImpl.cpp +++ b/src/platform/openiotsdk/KeyValueStoreManagerImpl.cpp @@ -46,6 +46,11 @@ CHIP_ERROR KeyValueStoreManagerImpl::Init(void) return KVStoreConfig::Init(); } +CHIP_ERROR KeyValueStoreManagerImpl::Shutdown(void) +{ + return KVStoreConfig::Shutdown(); +} + CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, size_t offset) { diff --git a/src/platform/openiotsdk/KeyValueStoreManagerImpl.h b/src/platform/openiotsdk/KeyValueStoreManagerImpl.h index 3b13ef410444f6..f8e423b35e00fe 100644 --- a/src/platform/openiotsdk/KeyValueStoreManagerImpl.h +++ b/src/platform/openiotsdk/KeyValueStoreManagerImpl.h @@ -38,6 +38,7 @@ class KeyValueStoreManagerImpl final : public KeyValueStoreManager public: CHIP_ERROR Init(void); + CHIP_ERROR Shutdown(void); CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size = nullptr, size_t offset = 0); CHIP_ERROR _Delete(const char * key); CHIP_ERROR _Put(const char * key, const void * value, size_t value_size); diff --git a/src/platform/openiotsdk/SystemPlatformConfig.h b/src/platform/openiotsdk/SystemPlatformConfig.h index bd2e9b39c86786..c75aef3e170f5d 100644 --- a/src/platform/openiotsdk/SystemPlatformConfig.h +++ b/src/platform/openiotsdk/SystemPlatformConfig.h @@ -33,6 +33,7 @@ #define CHIP_SYSTEM_CONFIG_MBED_LOCKING 0 #define CHIP_SYSTEM_CONFIG_NO_LOCKING 0 #define CHIP_SYSTEM_CONFIG_CMSIS_RTOS_LOCKING 1 +#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1 #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #ifndef CHIP_SYSTEM_CONFIG_USE_LWIP_MONOTONIC_TIME diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index da6ce3bb4e3002..12e5c7c294ed14 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -72,6 +72,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla void HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId); void HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt); void HandleSoftTimerEvent(void); + int32_t SendBLEAdvertisementCommand(void); #else void HandleConnectEvent(volatile sl_bt_msg_t * evt); void HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt); diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index fb749556e19b2c..3462402a228a58 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -61,6 +61,28 @@ #define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION SL_HARDWARE_VERSION #endif +/** + * Allow for some test/fall-back values to be used + * Production builds shall set to 0 or remove this option + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS +#define CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS 1 +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS +/** + * @brief Fallback value for the basic information cluster's Vendor name attribute + * if the actual vendor name is not provisioned in the device memory. + */ +#define CHIP_DEVICE_CONFIG_TEST_VENDOR_NAME "Silabs" + +/** + * @brief Fallback value for the basic information cluster's product name attribute + * if the actual vendor name is not provisioned in the device memory. + */ +#define CHIP_DEVICE_CONFIG_TEST_PRODUCT_NAME "SL_Sample" +#endif // CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS + #if defined(SL_WIFI) #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 #else diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 3b908b05275d91..5719b816b95676 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -31,7 +31,7 @@ #ifndef SIWX_917 #include "rail.h" #endif - +#include #ifdef __cplusplus extern "C" { #endif @@ -77,6 +77,8 @@ using namespace ::chip::DeviceLayer::Internal; void sl_ble_init() { + uint8_t randomAddrBLE[6] = { 0 }; + uint64_t randomAddr = chip::Crypto::GetRandU64(); // registering the GAP callback functions rsi_ble_gap_register_callbacks(NULL, NULL, rsi_ble_on_disconnect_event, NULL, NULL, NULL, rsi_ble_on_enhance_conn_status_event, @@ -88,10 +90,13 @@ void sl_ble_init() rsi_ble_on_event_indication_confirmation, NULL); // Exchange of GATT info with BLE stack + rsi_ble_add_matter_service(); // initializing the application events map rsi_ble_app_init_events(); + memcpy(randomAddrBLE, &randomAddr, 6); + rsi_ble_set_random_address_with_value(randomAddrBLE); chip::DeviceLayer::Internal::BLEMgrImpl().HandleBootEvent(); } @@ -621,8 +626,8 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) sl_wfx_mac_address_t macaddr; wfx_get_wifi_mac_addr(SL_WFX_STA_INTERFACE, &macaddr); - //! Set local name - status = rsi_ble_start_advertising(); + status = sInstance.SendBLEAdvertisementCommand(); + if (status == RSI_SUCCESS) { ChipLogProgress(DeviceLayer, "rsi_ble_start_advertising Success"); @@ -643,6 +648,24 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) return CHIP_NO_ERROR; // err; } +int32_t BLEManagerImpl::SendBLEAdvertisementCommand(void) +{ + + rsi_ble_req_adv_t ble_adv = { 0 }; + + ble_adv.status = RSI_BLE_START_ADV; + + ble_adv.adv_type = RSI_BLE_ADV_TYPE; + ble_adv.filter_type = RSI_BLE_ADV_FILTER_TYPE; + ble_adv.direct_addr_type = RSI_BLE_ADV_DIR_ADDR_TYPE; + rsi_ascii_dev_address_to_6bytes_rev(ble_adv.direct_addr, (int8_t *) RSI_BLE_ADV_DIR_ADDR); + ble_adv.adv_int_min = RSI_BLE_ADV_INT_MIN; + ble_adv.adv_int_max = RSI_BLE_ADV_INT_MAX; + ble_adv.own_addr_type = LE_RANDOM_ADDRESS; + ble_adv.adv_channel_map = RSI_BLE_ADV_CHANNEL_MAP; + return rsi_ble_start_advertising_with_values(&ble_adv); +} + // TODO:: Implementation need to be done. CHIP_ERROR BLEManagerImpl::StopAdvertising(void) { diff --git a/src/setup_payload/AdditionalDataPayload.h b/src/setup_payload/AdditionalDataPayload.h index 9614d08579016a..ede62352fadd45 100644 --- a/src/setup_payload/AdditionalDataPayload.h +++ b/src/setup_payload/AdditionalDataPayload.h @@ -34,6 +34,7 @@ #pragma once +#include #include namespace chip { diff --git a/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt b/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt index 15bf03373d5b46..740e4e55261ee3 100644 --- a/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt +++ b/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt @@ -42,8 +42,7 @@ include(linker) add_subdirectory(${OPEN_IOT_SDK_EXAMPLE_COMMON}/app ./app_build) -file(STRINGS testnames.txt TEST_NAMES_FROM_FILE) -STRING(REGEX REPLACE "\n" ";" TEST_NAMES_FROM_FILE "${TEST_NAMES_FROM_FILE}") +file(STRINGS test_components.txt TEST_NAMES_FROM_FILE) target_compile_definitions(openiotsdk-startup PRIVATE diff --git a/src/test_driver/openiotsdk/unit-tests/README.md b/src/test_driver/openiotsdk/unit-tests/README.md index 584f31aea71e0d..06cd8fa8b95600 100644 --- a/src/test_driver/openiotsdk/unit-tests/README.md +++ b/src/test_driver/openiotsdk/unit-tests/README.md @@ -1,86 +1,29 @@ # Matter Open IoT Unit Tests Application The Open IoT SDK Unit Tests Application executes all supported unit tests on the -target. +`FVP Fast Model` target. The Matter unit tests are included in a set of libraries and allow to validate most of the components used by Matter examples applications. The main goal of -this application is to run registered tests on Open IoT SDK target and check the +this project is to run registered tests on Open IoT SDK target and check the results. The final result is the number of tests that failed. -## Environment setup +## Build-run-test-debug -The required environment is the same as for the Matter examples. For information -on how to setup it see -[Open IoT SDK examples](../../../../docs/examples/openiotsdk_examples.md#Environment-setup). +For information on how to setup, build, run, test and debug unit tests refer to +[Open IoT SDK unit tests](../../../../docs/guides/openiotsdk_unit_tests.md). -## Building +## Application output -The build process means creating separate executable file for each Matter tested -component. It assumes the use of all supported test libraries and creating -independent applications from them. - -You build using a vscode task or call the script directly from the command line. - -### Building using vscode task - -``` -Command Palette (F1) => Run Task... => Build Open IoT SDK unit-tests => (debug on/off) -``` - -This will call the scripts with the selected parameters. - -### Building using CLI - -You can call the script directly yourself. - -``` -${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh unit-tests -``` - -Use `--help` to get more information about the script options. - -## Running - -Unit-tests applications can be run independently or as an entire set. It runs in -the background and opens a telnet session. The script will open telnet for you -and connect to the port used by the `FVP`. When the telnet process is terminated -it will also terminate the `FVP` instance. - -You can run the application script from a vscode task or call the script -directly. - -Expected output of each executed test: - -``` - [ATM] Open IoT SDK unit-tests start - [ATM] Open IoT SDK unit-tests run... - ... - [ATM] Test status: 0 -``` - -### Running using vscode task - -``` -Command Palette (F1) => Run Task... => Run Open IoT SDK unit-tests => or all (to run all tests) -``` - -### Running using CLI - -You can call the script directly yourself. - -``` -${MATTER_ROOT}/scripts/examples/openiotsdk_example.sh -C run unit-tests (optional to run specific test) -``` - -## Debugging - -Debugging can be started using a VS code launch task: +Expected output of each executed test application: ``` -Run and Debug (Ctrl+Shift+D) => Debug Open IoT SDK unit-tests application => Start Debugging (F5) => => +[ATM] Open IoT SDK unit-tests start +[ATM] Open IoT SDK unit-tests run... +... +[ATM] Test status: 0 +[ATM] Open IoT SDK unit-tests completed ``` -As you can see above, you will need to select the name of the test twice. This -is because the debug task needs to launch the run task and currently VS code has -no way of passing parameters between tasks. +This means the test application launched correctly and executed all registered +test cases. The `Test status` value indicates the number of tests that failed. diff --git a/src/test_driver/openiotsdk/unit-tests/main/include/CHIPProjectConfig.h b/src/test_driver/openiotsdk/unit-tests/main/include/CHIPProjectConfig.h index bb2c4755245f95..458c7c809dbb57 100644 --- a/src/test_driver/openiotsdk/unit-tests/main/include/CHIPProjectConfig.h +++ b/src/test_driver/openiotsdk/unit-tests/main/include/CHIPProjectConfig.h @@ -31,14 +31,5 @@ #define CHIP_CONFIG_ENABLE_ARG_PARSER 1 #define CHIP_CONFIG_NON_POSIX_LONG_OPT 1 -#define CHIP_SYSTEM_CONFIG_NUM_TIMERS 32 -#define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE 1 - +// Enable building for unit testing #define CONFIG_BUILD_FOR_HOST_UNIT_TEST 1 - -#define CONFIG_IM_BUILD_FOR_UNIT_TEST 1 -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 64 -#define CHIP_CONFIG_MAX_FABRICS 16 -#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 500 - -#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1 diff --git a/src/test_driver/openiotsdk/unit-tests/main/main_ns.cpp b/src/test_driver/openiotsdk/unit-tests/main/main_ns.cpp index e9c8bbd208cf48..a819655c162697 100644 --- a/src/test_driver/openiotsdk/unit-tests/main/main_ns.cpp +++ b/src/test_driver/openiotsdk/unit-tests/main/main_ns.cpp @@ -19,37 +19,15 @@ #include #include +#include "openiotsdk_platform.h" +#include #include #include -#include - -#include "cmsis_os2.h" -#include "openiotsdk_platform.h" - constexpr nl_test_output_logger_t NlTestLogger::nl_test_logger; using namespace ::chip; -static void test_thread(void * argument) -{ - int status; - CHIP_ERROR err; - - if (openiotsdk_network_init(true)) - { - ChipLogAutomation("ERROR: Network initialization failed"); - goto exit; - } - - ChipLogAutomation("Open IoT SDK unit-tests run..."); - status = RunRegisteredUnitTests(); - ChipLogAutomation("Test status: %d", status); - ChipLogAutomation("Open IoT SDK unit-tests completed"); -exit: - osThreadTerminate(osThreadGetId()); -} - int main() { if (openiotsdk_platform_init()) diff --git a/src/test_driver/openiotsdk/unit-tests/testnames.txt b/src/test_driver/openiotsdk/unit-tests/test_components.txt similarity index 100% rename from src/test_driver/openiotsdk/unit-tests/testnames.txt rename to src/test_driver/openiotsdk/unit-tests/test_components.txt diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 79e95533170e92..a84a46bd004e6b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -7433,6 +7433,167 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace TemperatureControl +namespace RefrigeratorAlarm { +namespace Attributes { + +namespace Mask { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace Mask + +namespace Latch { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace Latch + +namespace State { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace State + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RefrigeratorAlarm + namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 869e7be078d6e7..b7d0c6fea1c4b9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1422,6 +1422,37 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace TemperatureControl +namespace RefrigeratorAlarm { +namespace Attributes { + +namespace Mask { +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value); // AlarmMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); +} // namespace Mask + +namespace Latch { +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value); // AlarmMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); +} // namespace Latch + +namespace State { +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value); // AlarmMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); +} // namespace State + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RefrigeratorAlarm + namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 692af229ae6141..0b6e6773814610 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -377,6 +377,14 @@ void emberAfModeSelectClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureControlClusterInitCallback(chip::EndpointId endpoint); +/** @brief Refrigerator Alarm Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRefrigeratorAlarmClusterInitCallback(chip::EndpointId endpoint); + /** @brief Air Quality Cluster Init * * Cluster Init @@ -4044,6 +4052,84 @@ void emberAfTemperatureControlClusterServerTickCallback(chip::EndpointId endpoin */ void emberAfTemperatureControlClusterClientTickCallback(chip::EndpointId endpoint); +// +// Refrigerator Alarm Cluster +// + +/** @brief Refrigerator Alarm Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRefrigeratorAlarmClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Refrigerator Alarm Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterRefrigeratorAlarmClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Refrigerator Alarm Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRefrigeratorAlarmClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Refrigerator Alarm Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterRefrigeratorAlarmClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Refrigerator Alarm Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterRefrigeratorAlarmClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Refrigerator Alarm Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterRefrigeratorAlarmClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Refrigerator Alarm Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRefrigeratorAlarmClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Refrigerator Alarm Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRefrigeratorAlarmClusterClientTickCallback(chip::EndpointId endpoint); + // // Air Quality Cluster // @@ -7940,6 +8026,12 @@ bool emberAfModeSelectClusterChangeToModeCallback( bool emberAfTemperatureControlClusterSetTemperatureCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TemperatureControl::Commands::SetTemperature::DecodableType & commandData); +/** + * @brief Refrigerator Alarm Cluster Reset Command callback (from client) + */ +bool emberAfRefrigeratorAlarmClusterResetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::DecodableType & commandData); /** * @brief Smoke CO Alarm Cluster SelfTestRequest Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index baa6af449d6508..d35c549954cdaf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -98,8 +98,8 @@ static IdentifyIdentifyType __attribute__((unused)) kIdentifyIdentifyTypekUnknow namespace Groups { -// Bitmap for GroupsFeature -enum class GroupsFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kGroupNames = 0x1, }; @@ -107,16 +107,16 @@ enum class GroupsFeature : uint32_t namespace Scenes { -// Bitmap for ScenesCopyMode -enum class ScenesCopyMode : uint8_t +// Bitmap for Feature +enum class Feature : uint32_t { - kCopyAllScenes = 0x1, + kSceneNames = 0x1, }; -// Bitmap for ScenesFeature -enum class ScenesFeature : uint32_t +// Bitmap for ScenesCopyMode +enum class ScenesCopyMode : uint8_t { - kSceneNames = 0x1, + kCopyAllScenes = 0x1, }; } // namespace Scenes @@ -171,16 +171,16 @@ enum class OnOffStartUpOnOff : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for OnOffControl -enum class OnOffControl : uint8_t +// Bitmap for Feature +enum class Feature : uint32_t { - kAcceptOnlyWhenOn = 0x1, + kLighting = 0x1, }; -// Bitmap for OnOffFeature -enum class OnOffFeature : uint32_t +// Bitmap for OnOffControl +enum class OnOffControl : uint8_t { - kLighting = 0x1, + kAcceptOnlyWhenOn = 0x1, }; } // namespace OnOff @@ -226,8 +226,8 @@ using StepMode static StepMode __attribute__((unused)) kStepModekUnknownEnumValue = static_cast(2); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Bitmap for LevelControlFeature -enum class LevelControlFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kOnOff = 0x1, kLighting = 0x2, @@ -568,8 +568,8 @@ enum class TempUnitEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for UnitLocalizationFeature -enum class UnitLocalizationFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kTemperatureUnit = 0x1, }; @@ -827,8 +827,8 @@ enum class WiredFaultEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for PowerSourceFeature -enum class PowerSourceFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kWired = 0x1, kBattery = 0x2, @@ -908,8 +908,8 @@ enum class WiFiBand : uint8_t kUnknownEnumValue = 5, }; -// Bitmap for NetworkCommissioningFeature -enum class NetworkCommissioningFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kWiFiNetworkInterface = 0x1, kThreadNetworkInterface = 0x2, @@ -1080,8 +1080,8 @@ static RadioFaultEnum __attribute__((unused)) kRadioFaultEnumkUnknownEnumValue namespace SoftwareDiagnostics { -// Bitmap for SoftwareDiagnosticsFeature -enum class SoftwareDiagnosticsFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kWaterMarks = 0x1, }; @@ -1139,8 +1139,8 @@ using RoutingRole static RoutingRole __attribute__((unused)) kRoutingRolekUnknownEnumValue = static_cast(7); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Bitmap for ThreadNetworkDiagnosticsFeature -enum class ThreadNetworkDiagnosticsFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kPacketCounts = 0x1, kErrorCounts = 0x2, @@ -1209,8 +1209,8 @@ enum class WiFiVersionEnum : uint8_t kUnknownEnumValue = 6, }; -// Bitmap for WiFiNetworkDiagnosticsFeature -enum class WiFiNetworkDiagnosticsFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kPacketCounts = 0x1, kErrorCounts = 0x2, @@ -1246,8 +1246,8 @@ using PHYRateEnum static PHYRateEnum __attribute__((unused)) kPHYRateEnumkUnknownEnumValue = static_cast(10); #endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Bitmap for EthernetNetworkDiagnosticsFeature -enum class EthernetNetworkDiagnosticsFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kPacketCounts = 0x1, kErrorCounts = 0x2, @@ -1322,8 +1322,8 @@ enum class TimeZoneDatabaseEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for TimeSynchronizationFeature -enum class TimeSynchronizationFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kTimeZone = 0x1, kNTPClient = 0x2, @@ -1384,8 +1384,8 @@ enum class ProductFinishEnum : uint8_t namespace Switch { -// Bitmap for SwitchFeature -enum class SwitchFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kLatchingSwitch = 0x1, kMomentarySwitch = 0x2, @@ -1488,8 +1488,8 @@ namespace BooleanState {} // namespace BooleanState namespace IcdManagement { -// Bitmap for ICDManagementFeature -enum class ICDManagementFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCheckInProtocolSupport = 0x1, }; @@ -1497,8 +1497,8 @@ enum class ICDManagementFeature : uint32_t namespace ModeSelect { -// Bitmap for ModeSelectFeature -enum class ModeSelectFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kDeponoff = 0x1, }; @@ -1514,6 +1514,15 @@ enum class Feature : uint32_t }; } // namespace TemperatureControl +namespace RefrigeratorAlarm { + +// Bitmap for AlarmMap +enum class AlarmMap : uint32_t +{ + kDoorOpen = 0x1, +}; +} // namespace RefrigeratorAlarm + namespace AirQuality { // Enum for AirQualityEnum @@ -1632,8 +1641,8 @@ enum class SensitivityEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for SmokeCOAlarmFeature -enum class SmokeCOAlarmFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kSmokeAlarm = 0x1, kCoAlarm = 0x2, @@ -2549,8 +2558,8 @@ enum class DoorLockDayOfWeek : uint8_t kSaturday = 0x40, }; -// Bitmap for DoorLockFeature -enum class DoorLockFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kPinCredential = 0x1, kRfidCredential = 0x2, @@ -2638,6 +2647,16 @@ enum class ConfigStatus : uint8_t kTiltEncoderControlled = 0x40, }; +// Bitmap for Feature +enum class Feature : uint32_t +{ + kLift = 0x1, + kTilt = 0x2, + kPositionAwareLift = 0x4, + kAbsolutePosition = 0x8, + kPositionAwareTilt = 0x10, +}; + // Bitmap for Mode enum class Mode : uint8_t { @@ -2671,16 +2690,6 @@ enum class SafetyStatus : uint16_t kManualOperation = 0x400, kProtection = 0x800, }; - -// Bitmap for WindowCoveringFeature -enum class WindowCoveringFeature : uint32_t -{ - kLift = 0x1, - kTilt = 0x2, - kPositionAwareLift = 0x4, - kAbsolutePosition = 0x8, - kPositionAwareTilt = 0x10, -}; } // namespace WindowCovering namespace BarrierControl {} // namespace BarrierControl @@ -2717,8 +2726,8 @@ enum class OperationModeEnum : uint8_t kUnknownEnumValue = 4, }; -// Bitmap for PumpConfigurationAndControlFeature -enum class PumpConfigurationAndControlFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kConstantPressure = 0x1, kCompensatedPressure = 0x2, @@ -2820,15 +2829,8 @@ enum class DayOfWeek : uint8_t kAway = 0x80, }; -// Bitmap for ModeForSequence -enum class ModeForSequence : uint8_t -{ - kHeatSetpointPresent = 0x1, - kCoolSetpointPresent = 0x2, -}; - -// Bitmap for ThermostatFeature -enum class ThermostatFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kHeating = 0x1, kCooling = 0x2, @@ -2837,6 +2839,13 @@ enum class ThermostatFeature : uint32_t kSetback = 0x10, kAutoMode = 0x20, }; + +// Bitmap for ModeForSequence +enum class ModeForSequence : uint8_t +{ + kHeatSetpointPresent = 0x1, + kCoolSetpointPresent = 0x2, +}; } // namespace Thermostat namespace FanControl { @@ -2874,8 +2883,8 @@ enum class FanModeType : uint8_t kUnknownEnumValue = 7, }; -// Bitmap for FanControlFeature -enum class FanControlFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kMultiSpeed = 0x1, kAuto = 0x2, @@ -3029,16 +3038,6 @@ enum class ColorCapabilities : uint16_t kColorTemperatureSupported = 0x10, }; -// Bitmap for ColorControlFeature -enum class ColorControlFeature : uint32_t -{ - kHueAndSaturation = 0x1, - kEnhancedHue = 0x2, - kColorLoop = 0x4, - kXy = 0x8, - kColorTemperature = 0x10, -}; - // Bitmap for ColorLoopUpdateFlags enum class ColorLoopUpdateFlags : uint8_t { @@ -3047,6 +3046,16 @@ enum class ColorLoopUpdateFlags : uint8_t kUpdateTime = 0x4, kUpdateStartHue = 0x8, }; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kHueAndSaturation = 0x1, + kEnhancedHue = 0x2, + kColorLoop = 0x4, + kXy = 0x8, + kColorTemperature = 0x10, +}; } // namespace ColorControl namespace BallastConfiguration {} // namespace BallastConfiguration @@ -3070,8 +3079,8 @@ namespace TemperatureMeasurement {} // namespace TemperatureMeasurement namespace PressureMeasurement { -// Bitmap for PressureMeasurementFeature -enum class PressureMeasurementFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kExtended = 0x1, }; @@ -3140,8 +3149,8 @@ enum class LineupInfoTypeEnum : uint8_t kUnknownEnumValue = 1, }; -// Bitmap for ChannelFeature -enum class ChannelFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kChannelList = 0x1, kLineupInfo = 0x2, @@ -3196,8 +3205,8 @@ enum class PlaybackStateEnum : uint8_t kUnknownEnumValue = 4, }; -// Bitmap for MediaPlaybackFeature -enum class MediaPlaybackFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kAdvancedSeek = 0x1, kVariableSpeed = 0x2, @@ -3228,8 +3237,8 @@ enum class InputTypeEnum : uint8_t kUnknownEnumValue = 12, }; -// Bitmap for MediaInputFeature -enum class MediaInputFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kNameUpdates = 0x1, }; @@ -3348,8 +3357,8 @@ enum class KeypadInputStatusEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for KeypadInputFeature -enum class KeypadInputFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kNavigationKeyCodes = 0x1, kLocationKeys = 0x2, @@ -3408,8 +3417,8 @@ enum class ParameterEnum : uint8_t kUnknownEnumValue = 14, }; -// Bitmap for ContentLauncherFeature -enum class ContentLauncherFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kContentSearch = 0x1, kURLPlayback = 0x2, @@ -3441,8 +3450,8 @@ enum class OutputTypeEnum : uint8_t kUnknownEnumValue = 6, }; -// Bitmap for AudioOutputFeature -enum class AudioOutputFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kNameUpdates = 0x1, }; @@ -3463,8 +3472,8 @@ enum class ApplicationLauncherStatusEnum : uint8_t kUnknownEnumValue = 3, }; -// Bitmap for ApplicationLauncherFeature -enum class ApplicationLauncherFeature : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kApplicationPlatform = 0x1, }; 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 faea894cbc0cc9..dcb81394d725f3 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 @@ -11432,7 +11432,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kLabel), label)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTempLevel), tempLevel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTemperatureLevel), temperatureLevel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11455,8 +11455,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kLabel): ReturnErrorOnFailure(DataModel::Decode(reader, label)); break; - case to_underlying(Fields::kTempLevel): - ReturnErrorOnFailure(DataModel::Decode(reader, tempLevel)); + case to_underlying(Fields::kTemperatureLevel): + ReturnErrorOnFailure(DataModel::Decode(reader, temperatureLevel)); break; default: break; @@ -11568,6 +11568,145 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace TemperatureControl +namespace RefrigeratorAlarm { + +namespace Commands { +namespace Reset { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kAlarms), alarms)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMask), mask)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kAlarms): + ReturnErrorOnFailure(DataModel::Decode(reader, alarms)); + break; + case to_underlying(Fields::kMask): + ReturnErrorOnFailure(DataModel::Decode(reader, mask)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Reset. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::Mask::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, mask)); + break; + case Attributes::Latch::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, latch)); + break; + case Attributes::State::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, state)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace Notify { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kActive), active)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kInactive), inactive)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kState), state)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMask), mask)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kActive): + ReturnErrorOnFailure(DataModel::Decode(reader, active)); + break; + case to_underlying(Fields::kInactive): + ReturnErrorOnFailure(DataModel::Decode(reader, inactive)); + break; + case to_underlying(Fields::kState): + ReturnErrorOnFailure(DataModel::Decode(reader, state)); + break; + case to_underlying(Fields::kMask): + ReturnErrorOnFailure(DataModel::Decode(reader, mask)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Notify. +} // namespace Events + +} // namespace RefrigeratorAlarm namespace AirQuality { namespace Commands {} // namespace Commands @@ -23992,6 +24131,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::RefrigeratorAlarm::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::SmokeCoAlarm::Id: { switch (aCommand) { 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 f712d1fc4df4e6..30d3eb2f251ada 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 @@ -14219,15 +14219,15 @@ namespace Structs { namespace TemperatureLevelStruct { enum class Fields : uint8_t { - kLabel = 0, - kTempLevel = 1, + kLabel = 0, + kTemperatureLevel = 1, }; struct Type { public: chip::CharSpan label; - uint8_t tempLevel = static_cast(0); + uint8_t temperatureLevel = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14426,6 +14426,199 @@ struct TypeInfo }; } // namespace Attributes } // namespace TemperatureControl +namespace RefrigeratorAlarm { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Reset { +struct Type; +struct DecodableType; +} // namespace Reset + +} // namespace Commands + +namespace Commands { +namespace Reset { +enum class Fields : uint8_t +{ + kAlarms = 0, + kMask = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Reset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask alarms = static_cast>(0); + Optional> mask; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Reset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask alarms = static_cast>(0); + Optional> mask; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Reset +} // namespace Commands + +namespace Attributes { + +namespace Mask { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Mask::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Mask +namespace Latch { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Latch::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Latch +namespace State { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::State::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace State +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::Mask::TypeInfo::DecodableType mask = + static_cast>(0); + Attributes::Latch::TypeInfo::DecodableType latch = + static_cast>(0); + Attributes::State::TypeInfo::DecodableType state = + static_cast>(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace Notify { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kActive = 0, + kInactive = 1, + kState = 2, + kMask = 3, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Notify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + static constexpr bool kIsFabricScoped = false; + + chip::BitMask active = static_cast>(0); + chip::BitMask inactive = static_cast>(0); + chip::BitMask state = static_cast>(0); + chip::BitMask mask = static_cast>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Notify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask active = static_cast>(0); + chip::BitMask inactive = static_cast>(0); + chip::BitMask state = static_cast>(0); + chip::BitMask mask = static_cast>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace Notify +} // namespace Events +} // namespace RefrigeratorAlarm namespace AirQuality { namespace Attributes { @@ -24799,7 +24992,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - uint16_t count = static_cast(0); + int16_t count = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -24814,7 +25007,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - uint16_t count = static_cast(0); + int16_t count = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SkipChannel 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 8435a596e86b68..d4e77a9d48c17a 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 @@ -2513,6 +2513,48 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace TemperatureControl +namespace RefrigeratorAlarm { +namespace Attributes { + +namespace Mask { +static constexpr AttributeId Id = 0x00000000; +} // namespace Mask + +namespace Latch { +static constexpr AttributeId Id = 0x00000001; +} // namespace Latch + +namespace State { +static constexpr AttributeId Id = 0x00000002; +} // namespace State + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RefrigeratorAlarm + namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 7f82d993004682..ba75dc46137530 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -154,6 +154,9 @@ static constexpr ClusterId Id = 0x00000050; namespace TemperatureControl { static constexpr ClusterId Id = 0x00000056; } // namespace TemperatureControl +namespace RefrigeratorAlarm { +static constexpr ClusterId Id = 0x00000057; +} // namespace RefrigeratorAlarm namespace AirQuality { static constexpr ClusterId Id = 0x0000005B; } // namespace AirQuality diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 3b616e048b5931..9470493c02717a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -651,6 +651,16 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace TemperatureControl +namespace RefrigeratorAlarm { +namespace Commands { + +namespace Reset { +static constexpr CommandId Id = 0x00000000; +} // namespace Reset + +} // namespace Commands +} // namespace RefrigeratorAlarm + namespace SmokeCoAlarm { namespace Commands { 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 index 523d92c4326c3f..91ec9c29157909 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -267,6 +267,16 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace BooleanState +namespace RefrigeratorAlarm { +namespace Events { + +namespace Notify { +static constexpr EventId Id = 0x00000000; +} // namespace Notify + +} // namespace Events +} // namespace RefrigeratorAlarm + namespace SmokeCoAlarm { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index f0436094d5c021..6807688ee25204 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -298,6 +298,12 @@ #define CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER #endif +#if defined(ZCL_USING_REFRIGERATOR_ALARM_SERVER) || defined(ZCL_USING_REFRIGERATOR_ALARM_CLIENT) +#define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM { chip::app::Clusters::RefrigeratorAlarm::Id, "Refrigerator Alarm" }, +#else +#define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM +#endif + #if defined(ZCL_USING_AIR_QUALITY_CLUSTER_SERVER) || defined(ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER { chip::app::Clusters::AirQuality::Id, "Air Quality" }, #else @@ -626,6 +632,7 @@ CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER \ + CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 728f0c8f4ab04a..fe957b65e2c022 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -75,6 +75,7 @@ | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | TemperatureControl | 0x0056 | +| RefrigeratorAlarm | 0x0057 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | HepaFilterMonitoring | 0x0071 | @@ -4093,6 +4094,58 @@ class TemperatureControlSetTemperature : public ClusterCommand chip::app::Clusters::TemperatureControl::Commands::SetTemperature::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster RefrigeratorAlarm | 0x0057 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Reset | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Mask | 0x0000 | +| * Latch | 0x0001 | +| * State | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * Notify | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Reset + */ +class RefrigeratorAlarmReset : public ClusterCommand +{ +public: + RefrigeratorAlarmReset(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("reset", credsIssuerConfig) + { + AddArgument("Alarms", 0, UINT32_MAX, &mRequest.alarms); + AddArgument("Mask", 0, UINT32_MAX, &mRequest.mask); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000057, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000057, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster AirQuality | 0x005B | |------------------------------------------------------------------------------| @@ -7141,7 +7194,7 @@ class ChannelSkipChannel : public ClusterCommand public: ChannelSkipChannel(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("skip-channel", credsIssuerConfig) { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + AddArgument("Count", INT16_MIN, INT16_MAX, &mRequest.count); ClusterCommand::AddArguments(); } @@ -13061,6 +13114,72 @@ void registerClusterTemperatureControl(Commands & commands, CredentialIssuerComm commands.Register(clusterName, clusterCommands); } +void registerClusterRefrigeratorAlarm(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::RefrigeratorAlarm; + + const char * clusterName = "RefrigeratorAlarm"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "mask", Attributes::Mask::Id, credsIssuerConfig), // + make_unique(Id, "latch", Attributes::Latch::Id, credsIssuerConfig), // + make_unique(Id, "state", Attributes::State::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "mask", 0, UINT32_MAX, Attributes::Mask::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "latch", 0, UINT32_MAX, Attributes::Latch::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "state", 0, UINT32_MAX, Attributes::State::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "mask", Attributes::Mask::Id, credsIssuerConfig), // + make_unique(Id, "latch", Attributes::Latch::Id, credsIssuerConfig), // + make_unique(Id, "state", Attributes::State::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "notify", Events::Notify::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "notify", Events::Notify::Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterAirQuality(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::AirQuality; @@ -18256,6 +18375,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterIcdManagement(commands, credsIssuerConfig); registerClusterModeSelect(commands, credsIssuerConfig); registerClusterTemperatureControl(commands, credsIssuerConfig); + registerClusterRefrigeratorAlarm(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index b941117592662b..677a212a03428d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -1890,17 +1890,17 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("TemperatureLevelStruct.label", "label", value.isMember("label"))); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("TemperatureLevelStruct.tempLevel", "tempLevel", value.isMember("tempLevel"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TemperatureLevelStruct.temperatureLevel", "temperatureLevel", + value.isMember("temperatureLevel"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); valueCopy.removeMember("label"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "tempLevel"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.tempLevel, value["tempLevel"])); - valueCopy.removeMember("tempLevel"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "temperatureLevel"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.temperatureLevel, value["temperatureLevel"])); + valueCopy.removeMember("temperatureLevel"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -1908,7 +1908,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, void ComplexArgumentParser::Finalize(chip::app::Clusters::TemperatureControl::Structs::TemperatureLevelStruct::Type & request) { ComplexArgumentParser::Finalize(request.label); - ComplexArgumentParser::Finalize(request.tempLevel); + ComplexArgumentParser::Finalize(request.temperatureLevel); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 41851f2a357637..bce6c44debba4d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1723,10 +1723,10 @@ DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("TempLevel", indent + 1, value.tempLevel); + CHIP_ERROR err = LogValue("TemperatureLevel", indent + 1, value.temperatureLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TempLevel'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TemperatureLevel'"); return err; } } @@ -3547,6 +3547,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RefrigeratorAlarm::Events::Notify::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Active", indent + 1, value.active); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Active'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Inactive", indent + 1, value.inactive); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value) { @@ -7711,6 +7751,57 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case RefrigeratorAlarm::Id: { + switch (path.mAttributeId) + { + case RefrigeratorAlarm::Attributes::Mask::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Mask", 1, value); + } + case RefrigeratorAlarm::Attributes::Latch::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Latch", 1, value); + } + case RefrigeratorAlarm::Attributes::State::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("State", 1, value); + } + case RefrigeratorAlarm::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case RefrigeratorAlarm::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case RefrigeratorAlarm::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case RefrigeratorAlarm::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case RefrigeratorAlarm::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case RefrigeratorAlarm::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case AirQuality::Id: { switch (path.mAttributeId) { @@ -12839,6 +12930,17 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case RefrigeratorAlarm::Id: { + switch (header.mPath.mEventId) + { + case RefrigeratorAlarm::Events::Notify::Id: { + chip::app::Clusters::RefrigeratorAlarm::Events::Notify::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Notify", 1, value); + } + } + break; + } case SmokeCoAlarm::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 64346cd6831f9d..753b6f8ed99ea1 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -304,6 +304,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BooleanState::Events::StateChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::RefrigeratorAlarm::Events::Notify::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ab7ca592e76553..89e38aeae44aff 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -36758,7 +36758,7 @@ class Test_TC_CHANNEL_5_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Channel::Commands::SkipChannel::Type value; - value.count = 1U; + value.count = 1; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional @@ -60634,7 +60634,7 @@ class TV_MediaPlaybackClusterSuite : public TestCommand class TV_ChannelClusterSuite : public TestCommand { public: - TV_ChannelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_ChannelCluster", 7, credsIssuerConfig) + TV_ChannelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_ChannelCluster", 60, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60782,74 +60782,997 @@ class TV_ChannelClusterSuite : public TestCommand case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Channel list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute channel lineup"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Change Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannel::Type value; + value.match = chip::Span("PBSgarbage: not in length on purpose", 3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannel::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Change Channel By Number Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 6U; + value.minorNumber = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 123; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Test 1.2 - Skip Up By 1"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Test 2.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Test 2.2 - Skip Up By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Test 3.2 - Skip Up By 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 3; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Test 4.2 - Skip Up By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Test 5.2 - Skip Up By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); } - } + case 23: { + LogStep(23, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); + ); + } + case 25: { + LogStep(25, "Test 6.2 - Skip Up By 6"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); } - case 1: { - LogStep(1, "Read attribute Channel list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + case 26: { + LogStep(26, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 2: { - LogStep(2, "Read attribute channel lineup"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + case 27: { + LogStep(27, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Test 7.2 - Skip Up By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Read attribute current channel"); + case 30: { + LogStep(30, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Test 8.2 - Skip Up By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Change Channel Command"); + case 33: { + LogStep(33, "Test 1.2 - Skip Down By 1"); ListFreer listFreer; - chip::app::Clusters::Channel::Commands::ChangeChannel::Type value; - value.match = chip::Span("PBSgarbage: not in length on purpose", 3); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannel::Id, value, + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional ); } - case 5: { - LogStep(5, "Change Channel By Number Command"); + case 34: { + LogStep(34, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Test 2.1 - Start from Channel 3"); ListFreer listFreer; chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; - value.majorNumber = 6U; - value.minorNumber = 0U; + value.majorNumber = 9U; + value.minorNumber = 2U; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, chip::NullOptional ); } - case 6: { - LogStep(6, "Skip Channel Command"); + case 36: { + LogStep(36, "Test 2.2 - Skip Down By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Test 3.2 - Skip Down By 3"); ListFreer listFreer; chip::app::Clusters::Channel::Commands::SkipChannel::Type value; - value.count = 1U; + value.count = -3; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional ); } + case 40: { + LogStep(40, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Test 4.2 - Skip Down By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Test 5.2 - Skip Down By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 47: { + LogStep(47, "Test 6.2 - Skip Down By 6"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Test 7.2 - Skip Down By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 51: { + LogStep(51, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Test 8.2 - Skip Down By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 55: { + LogStep(55, "Test 1.2 - Skip Up By 32,767"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 32767; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 58: { + LogStep(58, "Test 1.2 - Skip Down By 32,768"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -32768; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b69c3ef1dcbf1b..a7411f0d9f3ec5 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -78,6 +78,7 @@ | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | TemperatureControl | 0x0056 | +| RefrigeratorAlarm | 0x0057 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | HepaFilterMonitoring | 0x0071 | @@ -41363,6 +41364,749 @@ class SubscribeAttributeTemperatureControlClusterRevision : public SubscribeAttr } }; +/*----------------------------------------------------------------------------*\ +| Cluster RefrigeratorAlarm | 0x0057 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Reset | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Mask | 0x0000 | +| * Latch | 0x0001 | +| * State | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * Notify | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Reset + */ +class RefrigeratorAlarmReset : public ClusterCommand { +public: + RefrigeratorAlarmReset() + : ClusterCommand("reset") + { + AddArgument("Alarms", 0, UINT32_MAX, &mRequest.alarms); + AddArgument("Mask", 0, UINT32_MAX, &mRequest.mask); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRefrigeratorAlarmClusterResetParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.alarms = [NSNumber numberWithUnsignedInt:mRequest.alarms.Raw()]; + if (mRequest.mask.HasValue()) { + params.mask = [NSNumber numberWithUnsignedInt:mRequest.mask.Value().Raw()]; + } else { + params.mask = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resetWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Type mRequest; +}; + +/* + * Attribute Mask + */ +class ReadRefrigeratorAlarmMask : public ReadAttribute { +public: + ReadRefrigeratorAlarmMask() + : ReadAttribute("mask") + { + } + + ~ReadRefrigeratorAlarmMask() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm Mask read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteRefrigeratorAlarmMask : public WriteAttribute { +public: + WriteRefrigeratorAlarmMask() + : WriteAttribute("mask") + { + AddArgument("attr-name", "mask"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteRefrigeratorAlarmMask() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) WriteAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeMaskWithValue:value + params:params + completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("RefrigeratorAlarm Mask write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeRefrigeratorAlarmMask : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmMask() + : SubscribeAttribute("mask") + { + } + + ~SubscribeAttributeRefrigeratorAlarmMask() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaskWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute Latch + */ +class ReadRefrigeratorAlarmLatch : public ReadAttribute { +public: + ReadRefrigeratorAlarmLatch() + : ReadAttribute("latch") + { + } + + ~ReadRefrigeratorAlarmLatch() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeLatchWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.Latch response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm Latch read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmLatch : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmLatch() + : SubscribeAttribute("latch") + { + } + + ~SubscribeAttributeRefrigeratorAlarmLatch() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeLatchWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.Latch response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute State + */ +class ReadRefrigeratorAlarmState : public ReadAttribute { +public: + ReadRefrigeratorAlarmState() + : ReadAttribute("state") + { + } + + ~ReadRefrigeratorAlarmState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.State response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm State read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmState : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmState() + : SubscribeAttribute("state") + { + } + + ~SubscribeAttributeRefrigeratorAlarmState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.State response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadRefrigeratorAlarmGeneratedCommandList : public ReadAttribute { +public: + ReadRefrigeratorAlarmGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadRefrigeratorAlarmGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeRefrigeratorAlarmGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadRefrigeratorAlarmAcceptedCommandList : public ReadAttribute { +public: + ReadRefrigeratorAlarmAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadRefrigeratorAlarmAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeRefrigeratorAlarmAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadRefrigeratorAlarmEventList : public ReadAttribute { +public: + ReadRefrigeratorAlarmEventList() + : ReadAttribute("event-list") + { + } + + ~ReadRefrigeratorAlarmEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmEventList : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeRefrigeratorAlarmEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadRefrigeratorAlarmAttributeList : public ReadAttribute { +public: + ReadRefrigeratorAlarmAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadRefrigeratorAlarmAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeRefrigeratorAlarmAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadRefrigeratorAlarmFeatureMap : public ReadAttribute { +public: + ReadRefrigeratorAlarmFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadRefrigeratorAlarmFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeRefrigeratorAlarmFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadRefrigeratorAlarmClusterRevision : public ReadAttribute { +public: + ReadRefrigeratorAlarmClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadRefrigeratorAlarmClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("RefrigeratorAlarm ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRefrigeratorAlarmClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeRefrigeratorAlarmClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeRefrigeratorAlarmClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000057) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster AirQuality | 0x005B | |------------------------------------------------------------------------------| @@ -84346,7 +85090,7 @@ class ChannelSkipChannel : public ClusterCommand { ChannelSkipChannel() : ClusterCommand("skip-channel") { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + AddArgument("Count", INT16_MIN, INT16_MAX, &mRequest.count); ClusterCommand::AddArguments(); } @@ -84359,7 +85103,7 @@ class ChannelSkipChannel : public ClusterCommand { __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.count = [NSNumber numberWithUnsignedShort:mRequest.count]; + params.count = [NSNumber numberWithShort:mRequest.count]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -115908,6 +116652,43 @@ void registerClusterTemperatureControl(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterRefrigeratorAlarm(Commands & commands) +{ + using namespace chip::app::Clusters::RefrigeratorAlarm; + + const char * clusterName = "RefrigeratorAlarm"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + 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(Id), // + make_unique(Id), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterAirQuality(Commands & commands) { using namespace chip::app::Clusters::AirQuality; @@ -118560,6 +119341,7 @@ void registerClusters(Commands & commands) registerClusterBooleanState(commands); registerClusterModeSelect(commands); registerClusterTemperatureControl(commands); + registerClusterRefrigeratorAlarm(commands); registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterHepaFilterMonitoring(commands); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 589e59669133b4..39eb96909bb5de 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -49337,7 +49337,7 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:1U]; + params.count = [NSNumber numberWithShort:1]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Sends a SkipChannel command to the DUT Error: %@", err); @@ -83573,6 +83573,236 @@ class TV_ChannelCluster : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 6 : Skip Channel Command\n"); err = TestSkipChannelCommand_6(); break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that Skip Channel Command set correct current channel\n"); + err = TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Skip Channel Command\n"); + err = TestSkipChannelCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that Skip Channel Command set correct current channel\n"); + err = TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Test 1.1 - Start from Channel 3\n"); + err = TestTest11StartFromChannel3_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Test 1.2 - Skip Up By 1\n"); + err = TestTest12SkipUpBy1_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Test 2.1 - Start from Channel 3\n"); + err = TestTest21StartFromChannel3_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Test 2.2 - Skip Up By 2\n"); + err = TestTest22SkipUpBy2_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Test 2.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Test 3.1 - Start from Channel 3\n"); + err = TestTest31StartFromChannel3_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Test 3.2 - Skip Up By 3\n"); + err = TestTest32SkipUpBy3_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : Test 3.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Test 4.1 - Start from Channel 3\n"); + err = TestTest41StartFromChannel3_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Test 4.2 - Skip Up By 4\n"); + err = TestTest42SkipUpBy4_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : Test 4.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Test 5.2 - Skip Up By 5\n"); + err = TestTest52SkipUpBy5_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Test 5.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Test 6.1 - Start from Channel 3\n"); + err = TestTest61StartFromChannel3_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Test 6.2 - Skip Up By 6\n"); + err = TestTest62SkipUpBy6_25(); + break; + case 26: + ChipLogProgress( + chipTool, " ***** Test Step 26 : Test 6.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Test 7.1 - Start from Channel 3\n"); + err = TestTest71StartFromChannel3_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Test 7.2 - Skip Up By 7\n"); + err = TestTest72SkipUpBy7_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Test 7.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Test 8.1 - Start from Channel 3\n"); + err = TestTest81StartFromChannel3_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Test 8.2 - Skip Up By 8\n"); + err = TestTest82SkipUpBy8_31(); + break; + case 32: + ChipLogProgress( + chipTool, " ***** Test Step 32 : Test 8.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Test 1.2 - Skip Down By 1\n"); + err = TestTest12SkipDownBy1_33(); + break; + case 34: + ChipLogProgress( + chipTool, " ***** Test Step 34 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Test 2.1 - Start from Channel 3\n"); + err = TestTest21StartFromChannel3_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Test 2.2 - Skip Down By 2\n"); + err = TestTest22SkipDownBy2_36(); + break; + case 37: + ChipLogProgress( + chipTool, " ***** Test Step 37 : Test 2.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Test 3.1 - Start from Channel 3\n"); + err = TestTest31StartFromChannel3_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Test 3.2 - Skip Down By 3\n"); + err = TestTest32SkipDownBy3_39(); + break; + case 40: + ChipLogProgress( + chipTool, " ***** Test Step 40 : Test 3.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Test 4.1 - Start from Channel 3\n"); + err = TestTest41StartFromChannel3_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Test 4.2 - Skip Down By 4\n"); + err = TestTest42SkipDownBy4_42(); + break; + case 43: + ChipLogProgress( + chipTool, " ***** Test Step 43 : Test 4.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Test 5.2 - Skip Down By 5\n"); + err = TestTest52SkipDownBy5_44(); + break; + case 45: + ChipLogProgress( + chipTool, " ***** Test Step 45 : Test 5.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Test 6.1 - Start from Channel 3\n"); + err = TestTest61StartFromChannel3_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Test 6.2 - Skip Down By 6\n"); + err = TestTest62SkipDownBy6_47(); + break; + case 48: + ChipLogProgress( + chipTool, " ***** Test Step 48 : Test 6.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Test 7.1 - Start from Channel 3\n"); + err = TestTest71StartFromChannel3_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Test 7.2 - Skip Down By 7\n"); + err = TestTest72SkipDownBy7_50(); + break; + case 51: + ChipLogProgress( + chipTool, " ***** Test Step 51 : Test 7.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Test 8.1 - Start from Channel 3\n"); + err = TestTest81StartFromChannel3_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Test 8.2 - Skip Down By 8\n"); + err = TestTest82SkipDownBy8_53(); + break; + case 54: + ChipLogProgress( + chipTool, " ***** Test Step 54 : Test 8.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Test 1.2 - Skip Up By 32,767\n"); + err = TestTest12SkipUpBy32767_55(); + break; + case 56: + ChipLogProgress( + chipTool, " ***** Test Step 56 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Test 1.1 - Start from Channel 3\n"); + err = TestTest11StartFromChannel3_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Test 1.2 - Skip Down By 32,768\n"); + err = TestTest12SkipDownBy32768_58(); + break; + case 59: + ChipLogProgress( + chipTool, " ***** Test Step 59 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_59(); + break; } if (CHIP_NO_ERROR != err) { @@ -83605,6 +83835,165 @@ class TV_ChannelCluster : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -83618,7 +84007,7 @@ class TV_ChannelCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 60; chip::Optional mNodeId; chip::Optional mCluster; @@ -83810,7 +84199,59 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:1U]; + params.count = [NSNumber numberWithShort:2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Skip Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSkipChannelCommand_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:123]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Skip Channel Command Error: %@", err); @@ -83822,6 +84263,1285 @@ class TV_ChannelCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest11StartFromChannel3_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipUpBy1_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:1]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Up By 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest21StartFromChannel3_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest22SkipUpBy2_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.2 - Skip Up By 2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 2.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest31StartFromChannel3_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest32SkipUpBy3_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:3]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.2 - Skip Up By 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 3.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest41StartFromChannel3_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest42SkipUpBy4_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:4]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.2 - Skip Up By 4 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 4.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest52SkipUpBy5_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:5]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 5.2 - Skip Up By 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 5.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest61StartFromChannel3_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest62SkipUpBy6_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:6]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.2 - Skip Up By 6 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 6.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest71StartFromChannel3_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest72SkipUpBy7_28() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:7]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.2 - Skip Up By 7 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_29() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 7.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest81StartFromChannel3_30() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest82SkipUpBy8_31() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:8]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.2 - Skip Up By 8 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_32() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 8.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipDownBy1_33() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-1]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Down By 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_34() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest21StartFromChannel3_35() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest22SkipDownBy2_36() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.2 - Skip Down By 2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_37() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 2.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest31StartFromChannel3_38() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest32SkipDownBy3_39() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-3]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.2 - Skip Down By 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_40() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 3.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest41StartFromChannel3_41() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest42SkipDownBy4_42() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-4]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.2 - Skip Down By 4 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_43() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 4.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest52SkipDownBy5_44() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-5]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 5.2 - Skip Down By 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_45() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 5.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest61StartFromChannel3_46() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest62SkipDownBy6_47() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-6]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.2 - Skip Down By 6 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_48() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 6.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest71StartFromChannel3_49() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest72SkipDownBy7_50() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-7]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.2 - Skip Down By 7 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_51() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 7.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest81StartFromChannel3_52() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest82SkipDownBy8_53() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-8]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.2 - Skip Down By 8 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_54() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 8.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipUpBy32767_55() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:32767]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Up By 32,767 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_56() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest11StartFromChannel3_57() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipDownBy32768_58() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-32768]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Down By 32,768 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_59() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TV_LowPowerCluster : public TestCommandBridge { diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h index 01c46405758d23..8166cd647a3d19 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -16,7 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - #pragma once #include @@ -427,6 +426,14 @@ typedef void (*ModeSelectEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAcceptedCommandListListAttributeCallback)( diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h index db17098cf93914..9dc22ecc288536 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h @@ -16,8 +16,6 @@ */ // THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion #pragma once #include @@ -375,6 +373,15 @@ class DLL_EXPORT ModeSelectCluster : public ClusterBase ~ModeSelectCluster() {} }; +class DLL_EXPORT RefrigeratorAlarmCluster : public ClusterBase +{ +public: + RefrigeratorAlarmCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, endpoint) + {} + ~RefrigeratorAlarmCluster() {} +}; + class DLL_EXPORT AirQualityCluster : public ClusterBase { public: diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h index 345ab29adbfc03..c71929f8951104 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h @@ -59,7 +59,7 @@ #define GENERATED_FUNCTION_ARRAYS // This is an array of EmberAfCluster structures. -#define GENERATED_CLUSTER_COUNT 80 +#define GENERATED_CLUSTER_COUNT 81 // clang-format off #define GENERATED_CLUSTERS { \ { \ @@ -543,6 +543,19 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ + { \ + /* Endpoint: 1, Cluster: Refrigerator Alarm (client) */ \ + .clusterId = 0x00000057, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr, \ + .generatedCommandList = nullptr, \ + .eventList = nullptr, \ + .eventCount = 0, \ + },\ { \ /* Endpoint: 1, Cluster: Air Quality (client) */ \ .clusterId = 0x0000005B, \ @@ -1111,7 +1124,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 80, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 81, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h index a7f94ba50a2fdf..7a1fca8e0d30f3 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h @@ -58,6 +58,7 @@ #define EMBER_AF_BOOLEAN_STATE_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ICD_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_MODE_SELECT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_REFRIGERATOR_ALARM_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_AIR_QUALITY_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_SMOKE_CO_ALARM_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_HEPA_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -252,6 +253,10 @@ #define ZCL_USING_MODE_SELECT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_MODE_SELECT_CLIENT +// Use this macro to check if the client side of the Refrigerator Alarm cluster is included +#define ZCL_USING_REFRIGERATOR_ALARM_CLIENT +#define EMBER_AF_PLUGIN_REFRIGERATOR_ALARM_CLIENT + // Use this macro to check if the client side of the Air Quality cluster is included #define ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_AIR_QUALITY_CLIENT diff --git a/zzz_generated/lock-app/nxp/zap-generated/af-gen-event.h b/zzz_generated/lock-app/nxp/zap-generated/af-gen-event.h deleted file mode 100644 index 814d4aab6b8bec..00000000000000 --- a/zzz_generated/lock-app/nxp/zap-generated/af-gen-event.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * 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. - */ - -/** - * - * Copyright (c) 2020 Silicon Labs - * - * 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. - */ - -// Enclosing macro to prevent multiple inclusion -#ifndef __AF_GEN_EVENT__ -#define __AF_GEN_EVENT__ - -#endif // __AF_GEN_EVENT__