diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml
index 835dbadd1aeb85..00f6f024a3fbf8 100644
--- a/.github/workflows/examples-nrfconnect.yaml
+++ b/.github/workflows/examples-nrfconnect.yaml
@@ -40,6 +40,8 @@ jobs:
with:
fetch-depth: 0
submodules: true
+ - name: Update nRF Connect SDK revision to the currently recommended.
+ run: python3 scripts/setup/nrfconnect/update_ncs.py --update
# https://github.com/project-chip/connectedhomeip/issues/3100
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v1
diff --git a/.gitmodules b/.gitmodules
index fd9e0b53b12536..0cb36b7aed6680 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -28,8 +28,8 @@
branch = master
[submodule "pigweed"]
path = third_party/pigweed/repo
- url = https://pigweed.googlesource.com/pigweed/pigweed
- branch = master
+ url = https://github.com/google/pigweed.git
+ branch = main
[submodule "openthread"]
path = third_party/openthread/repo
url = https://github.com/openthread/openthread.git
diff --git a/.pullapprove.yml b/.pullapprove.yml
index f38bee57d49cfe..1990f7fbfc3be9 100644
--- a/.pullapprove.yml
+++ b/.pullapprove.yml
@@ -82,7 +82,7 @@ groups:
reviewers:
teams: [reviewers-apple]
reviews:
- request: 2
+ request: 1
shared-reviewers-comcast:
type: optional
conditions:
@@ -90,7 +90,7 @@ groups:
reviewers:
teams: [reviewers-comcast]
reviews:
- request: 2
+ request: 1
shared-reviewers-google:
type: optional
conditions:
@@ -98,7 +98,7 @@ groups:
reviewers:
teams: [reviewers-google]
reviews:
- request: 2
+ request: 1
shared-reviewers-nordic:
type: optional
conditions:
@@ -106,7 +106,7 @@ groups:
reviewers:
teams: [reviewers-nordic]
reviews:
- request: 2
+ request: 1
shared-reviewers-samsung:
type: optional
conditions:
@@ -114,7 +114,7 @@ groups:
reviewers:
teams: [reviewers-samsung]
reviews:
- request: 2
+ request: 1
shared-reviewers-silabs:
type: optional
conditions:
@@ -122,7 +122,7 @@ groups:
reviewers:
teams: [reviewers-silabs]
reviews:
- request: 2
+ request: 1
############################################################
# Base Required Reviewers
@@ -150,7 +150,7 @@ groups:
teams:
- codeowners-android
reviews:
- request: 2
+ request: 1
codeowners-app:
type: optional
@@ -160,7 +160,7 @@ groups:
teams:
- codeowners-app
reviews:
- request: 2
+ request: 1
codeowners-ble:
type: optional
@@ -170,7 +170,7 @@ groups:
teams:
- codeowners-ble
reviews:
- request: 2
+ request: 1
codeowners-controller:
type: optional
@@ -180,7 +180,7 @@ groups:
teams:
- codeowners-controller
reviews:
- request: 2
+ request: 1
codeowners-darwin:
type: optional
@@ -190,7 +190,7 @@ groups:
teams:
- codeowners-darwin
reviews:
- request: 2
+ request: 1
codeowners-crypto:
type: optional
@@ -200,7 +200,7 @@ groups:
teams:
- codeowners-crypto
reviews:
- request: 2
+ request: 1
codeowners-inet:
type: optional
@@ -230,7 +230,7 @@ groups:
teams:
- codeowners-protocols
reviews:
- request: 2
+ request: 1
codeowners-shell:
type: optional
@@ -240,7 +240,7 @@ groups:
teams:
- codeowners-shell
reviews:
- request: 2
+ request: 1
codeowners-support:
type: optional
@@ -250,7 +250,7 @@ groups:
teams:
- codeowners-support
reviews:
- request: 2
+ request: 1
codeowners-platform:
type: optional
@@ -260,7 +260,7 @@ groups:
teams:
- codeowners-platform
reviews:
- request: 2
+ request: 1
codeowners-qrcode:
type: optional
@@ -270,7 +270,7 @@ groups:
teams:
- codeowners-qrcode
reviews:
- request: 2
+ request: 1
codeowners-setup-payload:
type: optional
@@ -280,7 +280,7 @@ groups:
teams:
- codeowners-setup-payload
reviews:
- request: 2
+ request: 1
codeowners-system:
type: optional
@@ -290,7 +290,7 @@ groups:
teams:
- codeowners-system
reviews:
- request: 2
+ request: 1
codeowners-test-driver:
type: optional
@@ -300,7 +300,7 @@ groups:
teams:
- codeowners-test-driver
reviews:
- request: 2
+ request: 1
codeowners-github:
type: optional
@@ -310,7 +310,7 @@ groups:
teams:
- codeowners-github
reviews:
- request: 2
+ request: 1
codeowners-vscode:
type: optional
@@ -330,7 +330,7 @@ groups:
teams:
- codeowners-integrations
reviews:
- request: 2
+ request: 1
codeowners-transport:
type: optional
@@ -340,7 +340,7 @@ groups:
teams:
- codeowners-transport
reviews:
- request: 2
+ request: 1
codeowners-scripts:
type: optional
@@ -350,7 +350,7 @@ groups:
teams:
- codeowners-scripts
reviews:
- request: 2
+ request: 1
codeowners-documentation:
type: optional
@@ -360,7 +360,7 @@ groups:
teams:
- codeowners-documentation
reviews:
- request: 2
+ request: 1
codeowners-gn:
type: optional
@@ -370,4 +370,4 @@ groups:
teams:
- codeowners-gn
reviews:
- request: 2
+ request: 1
diff --git a/config/nrfconnect/.nrfconnect-recommended-revision b/config/nrfconnect/.nrfconnect-recommended-revision
new file mode 100644
index 00000000000000..56e68719154e67
--- /dev/null
+++ b/config/nrfconnect/.nrfconnect-recommended-revision
@@ -0,0 +1 @@
+8e8c60897eac40f61db9f578ce521970fff8e4d2
diff --git a/config/nrfconnect/app/check-nrfconnect-version.cmake b/config/nrfconnect/app/check-nrfconnect-version.cmake
new file mode 100644
index 00000000000000..a4e6a0cf294c4c
--- /dev/null
+++ b/config/nrfconnect/app/check-nrfconnect-version.cmake
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+find_package(Python3 REQUIRED)
+add_custom_target(check-nrfconnect-version ALL
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../..
+ COMMAND ${Python3_EXECUTABLE} scripts/setup/nrfconnect/update_ncs.py --check --quiet || (exit 0)
+ USES_TERMINAL)
diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt
index 84be44e590f69d..3feee96fec1b69 100644
--- a/config/nrfconnect/chip-module/CMakeLists.txt
+++ b/config/nrfconnect/chip-module/CMakeLists.txt
@@ -202,6 +202,10 @@ chip_gn_arg_bool ("chip_inet_config_enable_dns_resolver" CONFIG_CHIP_BUILD_TE
chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL)
chip_gn_arg_bool ("chip_build_pw_rpc_lib" CONFIG_CHIP_PW_RPC)
+if (CONFIG_CHIP_ENABLE_DNSSD_SRP)
+ chip_gn_arg_string("chip_mdns" "platform")
+endif()
+
if (CHIP_PROJECT_CONFIG)
chip_gn_arg_string("chip_project_config_include" ${CHIP_PROJECT_CONFIG})
chip_gn_arg_string("chip_system_project_config_include" ${CHIP_PROJECT_CONFIG})
diff --git a/docs/BUILDING.md b/docs/BUILDING.md
index 3ccc65e6862ca7..20fc97747009ba 100644
--- a/docs/BUILDING.md
+++ b/docs/BUILDING.md
@@ -43,7 +43,7 @@ On Debian-based Linux distributions such as Ubuntu, these dependencies can be
satisfied with the following:
```
-sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev unzip
+sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip
```
#### How to install prerequisites on macOS
@@ -86,6 +86,38 @@ sudo apt-get install pi-bluetooth
You need to reboot your RPi after install `pi-bluetooth`.
+By default, wpa_supplicant is not allowed to update (overwrite) configuration,
+if you want chip app to be able to store the configuration changes permanently,
+we need to make the following changes.
+
+1. Edit the dbus-fi.w1.wpa_supplicant1.service file to use configuration file
+ instead.
+
+```
+sudo nano /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service
+```
+
+Change the wpa_supplicant start parameters to:
+
+```
+ExecStart=/sbin/wpa_supplicant -u -s -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
+```
+
+2. Add the wpa-supplicant configuration file
+
+```
+sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
+```
+
+And add the following content to the file:
+
+```
+ctrl_interface=DIR=/run/wpa_supplicant
+update_config=1
+```
+
+Finally, reboot your RPi.
+
### Build Preparation
Before running any other build command, the `scripts/activate.sh` environment
diff --git a/docs/dots/Rendezvous/RendezvousSessionGeneral.dot b/docs/dots/Rendezvous/RendezvousSessionGeneral.dot
index d3b11452904216..8578363c69a3d0 100644
--- a/docs/dots/Rendezvous/RendezvousSessionGeneral.dot
+++ b/docs/dots/Rendezvous/RendezvousSessionGeneral.dot
@@ -6,7 +6,7 @@ digraph RendezvousSession
subgraph cluster_controller {
label=<Controller>
- ChipDeviceController [shape=record label=<{ChipDeviceController|RendezvousSessionDelegate}>, URL="@ref chip::DeviceController::ChipDeviceController"]
+ DeviceCommissioner [shape=record label=<{DeviceCommissioner|RendezvousSessionDelegate}>, URL="@ref chip::Controller::DeviceCommissioner"]
}
# This section represents device-only elements
@@ -29,9 +29,9 @@ digraph RendezvousSession
# Main relationships
#############################
RendezvousParameters [shape=ellipse, URL="@ref chip::RendezvousParameters"]
- RendezvousParameters -> { ChipDeviceController, RendezvousDeviceDelegate} [arrowhead=none]
+ RendezvousParameters -> { DeviceCommissioner, RendezvousDeviceDelegate} [arrowhead=none]
- {ChipDeviceController, RendezvousDeviceDelegate} -> RendezvousSession
+ {DeviceCommissioner, RendezvousDeviceDelegate} -> RendezvousSession
RendezvousSession -> TransportBle
RendezvousSession -> TransportInet [style=dashed, color=gray]
}
diff --git a/docs/dots/Rendezvous/RendezvousSessionInit.dot b/docs/dots/Rendezvous/RendezvousSessionInit.dot
index 0751ef5ea006d5..79983ce6e1aa1a 100644
--- a/docs/dots/Rendezvous/RendezvousSessionInit.dot
+++ b/docs/dots/Rendezvous/RendezvousSessionInit.dot
@@ -7,7 +7,7 @@ digraph RendezvousSession
label=<Controller>
node [fillcolor="white:gray", gradientangle=90]
- ChipDeviceController [shape=record label=<{ChipDeviceController|RendezvousSessionDelegate}>, URL="@ref chip::DeviceController::ChipDeviceController"]
+ DeviceCommissioner [shape=record label=<{DeviceCommissioner|RendezvousSessionDelegate}>, URL="@ref chip::Controller::DeviceCommissioner"]
}
# This section represents device-only elements
@@ -66,7 +66,7 @@ digraph RendezvousSession
#############################
# Main relationships
#############################
- {ChipDeviceController, RendezvousDeviceDelegate} -> RendezvousSession
+ {DeviceCommissioner, RendezvousDeviceDelegate} -> RendezvousSession
RendezvousSession -> HasDiscriminator
diff --git a/docs/guides/linux_thread_connectivity.md b/docs/guides/linux_thread_connectivity.md
new file mode 100644
index 00000000000000..70befbaaec7058
--- /dev/null
+++ b/docs/guides/linux_thread_connectivity.md
@@ -0,0 +1,131 @@
+# Configuring Thread network on a Linux machine
+
+You can use a Project CHIP controller such as
+[Python CHIP Controller](../../src/controller/python/README.md) to control
+Thread devices enabled for Project CHIP from a Linux host.
+
+For this purpose, you must equip the host with a Thread radio device, create a
+new Thread network, and ensure that packets addressed to devices within the
+network are routed through the radio device.
+
+
+
+- [Overview](#overview)
+- [Requirements](#requirements)
+- [Configuration](#configuration)
+- [Preparing OpenThread Radio Co-Processor device](#preparing-openthread-radio-co-processor)
+- [Configuring OpenThread Border Router](#configuring-openthread-border-router)
+- [Testing](#testing)
+
+
+
+## Overview
+
+The following figure shows the setup created as a result of configuring Thread
+network on a Linux machine.
+
+![linux_thread_connectivity](../images/linux_thread_connectivity.svg)
+
+In this setup, the connectivity between Python CHIP Controller and Thread
+devices is ensured in the following way:
+
+- CHIP messages generated by the Project CHIP controller are routed through a
+ virtual network interface **otbr0** to
+ [OpenThread Border Router container](https://openthread.io/guides/border-router/docker)
+ in Docker.
+- The OpenThread Border Router container uses a device with the
+ [OpenThread Radio Co-Processor](https://openthread.io/platforms/co-processor)
+ firmware to transmit Project CHIP messages to the Thread network.
+- CHIP-enabled Thread devices connected to the same Thread network receive and
+ consume Project CHIP messages.
+
+
+
+## Requirements
+
+You need the following hardware and software for this configuration:
+
+- OpenThread Radio Co-Processor device (for example,
+ [nRF52840 Dongle](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle),
+ [Thunderboard Sense 2](https://www.silabs.com/development-tools/thunderboard/thunderboard-sense-two-kit))
+- Linux machine with Ubuntu v20.04 or later
+
+
+
+## Configuration
+
+The configuration process is composed of the following steps:
+
+- Preparing OpenThread Radio Co-Processor (RCP) device
+- Configuring OpenThread Border Router container in Docker
+
+### Configuring OpenThread Radio Co-Processor
+
+#### On Nordic Hardware
+
+> Read
+> [Configuring OpenThread Radio Co-processor on nRF52840 Dongle](openthread_rcp_nrf_dongle.md)
+> to learn how to configure Nordic Semiconductor's
+> [nRF52840 Dongle](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle)
+> as OpenThread Radio Co-Processor.
+
+#### On Silicon Labs Hardware
+
+> Please refer to this
+> [guide](https://www.silabs.com/documents/public/application-notes/an1256-using-sl-rcp-with-openthread-border-router.pdf)
+> to configure the OpenThread Radio Co-Processor on the Thunderboard sense 2.
+
+You can replace the nRF52840 Dongle or the Thunderboard with a variety of
+development boards from different vendors. If you are using a Raspberry Pi as
+your testing platform, you can execute this step on a more powerful Linux
+machine to shorten the firmware build time.
+
+### Configuring OpenThread Border Router
+
+To configure OpenThread Border Router, complete the following steps:
+
+1. Install Docker daemon:
+
+ $ sudo apt update && sudo apt install docker.io
+
+2. Start the Docker daemon:
+
+ $ sudo systemctl start docker
+
+3. Create an IPv6 network for the OpenThread Border Router container in Docker:
+
+ $ sudo docker network create --ipv6 --subnet fd11:db8:1::/64 -o com.docker.network.bridge.name=otbr0 otbr
+
+4. Start the OpenThread Border Router container using the following command (in
+ the last line, replace _/dev/ttyACM0_ with the device node name of the
+ OpenThread Radio Co-processor):
+
+ $ sudo docker run -it --rm --privileged --network otbr -p 8080:80 -e NAT64=0 -e DNS64=0 \
+ --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" \
+ --volume /dev/ttyACM0:/dev/radio openthread/otbr --radio-url spinel+hdlc+uart:///dev/radio
+
+5. Open the `http://localhost:8080/` address in a web browser. If you are using
+ a Raspberry Pi without a screen, but you have a different device in the same
+ network, you can start a web browser on that device and use the address of
+ the Raspberry Pi instead of `localhost`.
+6. Click **Form** in the menu to the left. The network forming creator window
+ appears.
+7. Make sure that the On-Mesh Prefix is set to `fd11:22::`. This value is used
+ later to configure the IPv6 packet routing.
+8. Click the **Form** button at the bottom of the window to form a new Thread
+ network using the default settings.
+9. To ensure that packets addressed to devices in the Thread network are routed
+ through the OpenThread Border Router container in Docker, run the following
+ command with the On-Mesh Prefix that you set earlier:
+
+ $ sudo ip -6 route add fd11:22::/64 dev otbr0 via fd11:db8:1::2
+
+
+
+## Testing
+
+After Open Thread Border Router has been configured, complete the steps
+described in the
+[Python CHIP Controller README](../../src/controller/python/README.md) to
+commission a Thread device into the network and control it using the Project
+CHIP protocol.
diff --git a/docs/guides/nxp_k32w_android_commissioning.md b/docs/guides/nxp_k32w_android_commissioning.md
index d63a6a428d4be2..6cad0ef4310309 100644
--- a/docs/guides/nxp_k32w_android_commissioning.md
+++ b/docs/guides/nxp_k32w_android_commissioning.md
@@ -3,8 +3,8 @@
This article describes how to use
[CHIPTool](../../src/android/CHIPTool/README.md) for Android smartphones to
commission an NXP K32W061 DK6 running
-[NXP K32W Lock Example Application](../../examples/lock-app/k32w/README.md) onto
-a CHIP-enabled Thread network.
+[NXP K32W Lock/Light Example Application](../../examples/lock-light-app/k32w/README.md)
+onto a CHIP-enabled Thread network.
@@ -12,7 +12,7 @@ a CHIP-enabled Thread network.
- [Requirements](#requirements)
- [Building and programming OpenThread RCP firmware](#building-rcp-firmware)
- [Configuring PC as Thread Border Router](#configuring-pc)
-- [Building and programming NXP K32W Lock Example Application](#building-example)
+- [Building and programming NXP K32W Lock/Light Example Application](#building-example)
- [Building and installing Android CHIPTool](#building-chiptool)
- [Forming a Thread network on the Border Router](#form-thread)
- [Preparing accessory device](#preparing-accessory)
@@ -45,7 +45,7 @@ with a spare Wi-Fi card and an
device.
The following diagram shows the connectivity between network components required
-to allow communication between devices running the CHIPTool and Lock
+to allow communication between devices running the CHIPTool and Lock/Light
applications:
![nxp_hw_connectivity](../../examples/platform/k32w/doc/images/nxp_hw_connectivity.JPG)
@@ -306,11 +306,15 @@ To make your PC work as a Thread Border Router, complete the following tasks:
-## Building and programming NXP K32W Lock Example Application
+## Building and programming NXP K32W Lock/Light Example Application
See
[NXP K32W Lock Example Application README](../../examples/lock-app/k32w/README.md)
-to learn how to build and program the example onto an K32W061 DK6.
+to learn how to build and program the lock example onto an K32W061 DK6.
+
+See
+[NXP K32W Light Example Application README](../../examples/lighting-app/k32w/README.md)
+to learn how to build and program the light example onto an K32W061 DK6.
@@ -442,10 +446,11 @@ following steps:
2. Verify that the text box on the screen is not empty and contains the IPv6
address of the accessory device.
-3. Tap the following buttons to change the lock state:
+3. Tap the following buttons to change the lock/light state:
- - _ON_ and _OFF_ buttons lock and unlock the door, respectively.
- - _TOGGLE_ changes the lock state to the opposite.
+ - _ON_ and _OFF_ buttons lock/turn on and unlock/turn off the door/light
+ bulb, respectively.
+ - _TOGGLE_ changes the lock/light state to the opposite.
-The _LED D3_ on the device turns on or off based on the changes of the lock
-state.
+The _LED D3_ on the device turns on or off based on the changes of the
+lock/light state.
diff --git a/docs/guides/openthread_rcp_nrf_dongle.md b/docs/guides/openthread_rcp_nrf_dongle.md
new file mode 100644
index 00000000000000..03248105e8fda8
--- /dev/null
+++ b/docs/guides/openthread_rcp_nrf_dongle.md
@@ -0,0 +1,64 @@
+# Configuring OpenThread Radio Co-processor on nRF52840 Dongle
+
+OpenThread Radio Co-processor design allows to add Thread network capabilities
+to devices that do not natively support Thread.
+
+You can build and program
+[OpenThread Radio Co-Processor](https://openthread.io/platforms/co-processor)
+(RCP) firmware onto Nordic Semiconductor's
+[nRF52840 Dongle](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle).
+Once programmed, the dongle can be used for
+[configuring Thread network on a Linux machine](linux_thread_connectivity.md).
+
+## Building and programming the RCP firmware onto an nRF52840 Dongle
+
+Run the following commands to build and program the RCP firmware onto an
+nRF52840 Dongle:
+
+1. Clone the OpenThread repository into the current directory:
+
+ $ git clone https://github.com/openthread/openthread.git
+
+2. Enter the _openthread_ directory:
+
+ $ cd openthread
+
+3. Install OpenThread dependencies:
+
+ $ ./script/bootstrap
+
+4. Set up the build environment:
+
+ $ ./bootstrap
+
+5. Build OpenThread for the nRF52840 Dongle:
+
+ $ make -f examples/Makefile-nrf52840 BOOTLOADER=USB USB=1 THREAD_VERSION=1.2
+
+ This creates an RCP image at `output/nrf52840/bin/ot-rcp`.
+
+6. Convert the RCP image to the `.hex` format:
+
+ $ arm-none-eabi-objcopy -O ihex output/nrf52840/bin/ot-rcp output/nrf52840/bin/ot-rcp.hex
+
+7. Install
+ [nRF Util](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Util):
+
+ $ python3 -m pip install -U nrfutil
+
+8. Generate the RCP firmware package:
+
+ $ nrfutil pkg generate --hw-version 52 --sd-req=0x00 \
+ --application output/nrf52840/bin/ot-rcp.hex \
+ --application-version 1 output/nrf52840/bin/ot-rcp.zip
+
+9. Connect the nRF52840 Dongle to the USB port.
+
+10. Press the **Reset** button on the dongle to put it into the DFU mode. Red
+ LED on the dongle starts blinking.
+
+11. To install the RCP firmware package onto the dongle, run the following
+ command, with _/dev/ttyACM0_ replaced with the device node name of your
+ nRF52840 Dongle:
+
+ $ nrfutil dfu usb-serial -pkg output/nrf52840/bin/ot-rcp.zip -p /dev/ttyACM0
diff --git a/docs/images/linux_thread_connectivity.svg b/docs/images/linux_thread_connectivity.svg
new file mode 100644
index 00000000000000..75fc719a81d178
--- /dev/null
+++ b/docs/images/linux_thread_connectivity.svg
@@ -0,0 +1,312 @@
+
+
+
+
\ No newline at end of file
diff --git a/examples/all-clusters-app/all-clusters-common/BUILD.gn b/examples/all-clusters-app/all-clusters-common/BUILD.gn
index 0715d61989b3ec..1575d1c978881f 100644
--- a/examples/all-clusters-app/all-clusters-common/BUILD.gn
+++ b/examples/all-clusters-app/all-clusters-common/BUILD.gn
@@ -39,6 +39,8 @@ source_set("all-clusters-common") {
"${chip_root}/src/app/clusters/level-control/level-control.cpp",
"${chip_root}/src/app/clusters/low-power-server/low-power-server.cpp",
"${chip_root}/src/app/clusters/media-playback-server/media-playback-server.cpp",
+ "${chip_root}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp",
+ "${chip_root}/src/app/clusters/network-commissioning/network-commissioning.cpp",
"${chip_root}/src/app/clusters/on-off-server/on-off.cpp",
"${chip_root}/src/app/clusters/scenes/scenes.cpp",
"${chip_root}/src/app/clusters/temperature-measurement-server/temperature-measurement-server.cpp",
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index 49f08bd885a779..47fc9c80d9d252 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -1,5 +1,5 @@
{
- "writeTime": "Mon Mar 08 2021 19:19:42 GMT+0100 (Central European Standard Time)",
+ "writeTime": "Fri Mar 12 2021 15:15:46 GMT+0800 (China Standard Time)",
"featureLevel": 11,
"creator": "zap",
"keyValuePairs": [
@@ -38,103 +38,30 @@
"deviceTypeProfileId": null,
"clusters": [
{
- "name": "Basic",
- "code": 0,
+ "name": "Identify",
+ "code": 3,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "IDENTIFY_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
- "name": "ResetToFactoryDefaults",
+ "name": "Identify",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
- }
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "server",
- "enabled": 1,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "ZCL version",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
},
{
- "name": "power source",
- "code": 7,
+ "name": "IdentifyQuery",
+ "code": 1,
"mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
}
],
- "commands": []
- },
- {
- "name": "Identify",
- "code": 3,
- "mfgCode": null,
- "define": "IDENTIFY_CLUSTER",
- "side": "client",
- "enabled": 0,
"attributes": [
{
"name": "cluster revision",
@@ -151,24 +78,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "Identify",
- "code": 0,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "IdentifyQuery",
- "code": 1,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -303,38 +212,6 @@
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "name support",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "AddGroupResponse",
@@ -368,6 +245,38 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "name support",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -661,7 +570,6 @@
"define": "ON_OFF_CLUSTER",
"side": "server",
"enabled": 1,
- "commands": [],
"attributes": [
{
"name": "cluster revision",
@@ -693,7 +601,8 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ]
+ ],
+ "commands": []
},
{
"name": "Level Control",
@@ -702,23 +611,6 @@
"define": "LEVEL_CONTROL_CLUSTER",
"side": "client",
"enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "MoveToLevel",
@@ -784,6 +676,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -828,12 +737,13 @@
]
},
{
- "name": "Door Lock",
- "code": 257,
+ "name": "Basic",
+ "code": 40,
"mfgCode": null,
- "define": "DOOR_LOCK_CLUSTER",
+ "define": "BASIC_CLUSTER",
"side": "client",
"enabled": 0,
+ "commands": [],
"attributes": [
{
"name": "cluster revision",
@@ -842,7 +752,7 @@
"side": "client",
"included": 1,
"storageOption": "RAM",
- "singleton": 0,
+ "singleton": 1,
"bounded": 0,
"defaultValue": "3",
"reportable": 0,
@@ -850,45 +760,269 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
+ ]
+ },
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "server",
+ "enabled": 1,
"commands": [
{
- "name": "LockDoor",
+ "name": "StartUp",
"code": 0,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
"outgoing": 1
},
{
- "name": "UnlockDoor",
+ "name": "ShutDown",
"code": 1,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
"outgoing": 1
},
{
- "name": "UnlockWithTimeout",
- "code": 3,
+ "name": "Leave",
+ "code": 2,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
"outgoing": 1
- },
+ }
+ ],
+ "attributes": [
{
- "name": "GetLogRecord",
- "code": 4,
+ "name": "cluster revision",
+ "code": 65533,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "SetPin",
- "code": 5,
+ "name": "InteractionModelVersion",
+ "code": 0,
"mfgCode": null,
- "source": "client",
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorName",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorID",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductName",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductID",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UserLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Door Lock",
+ "code": 257,
+ "mfgCode": null,
+ "define": "DOOR_LOCK_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "LockDoor",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UnlockDoor",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UnlockWithTimeout",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "GetLogRecord",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "SetPin",
+ "code": 5,
+ "mfgCode": null,
+ "source": "client",
"incoming": 1,
"outgoing": 1
},
@@ -1036,6 +1170,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -1045,6 +1196,24 @@
"define": "DOOR_LOCK_CLUSTER",
"side": "server",
"enabled": 0,
+ "commands": [
+ {
+ "name": "LockDoorResponse",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UnlockDoorResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -1481,24 +1650,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "LockDoorResponse",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "UnlockDoorResponse",
- "code": 1,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -1637,27 +1788,10 @@
"define": "COLOR_CONTROL_CLUSTER",
"side": "client",
"enabled": 0,
- "attributes": [
+ "commands": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
- "commands": [
- {
- "name": "MoveToHue",
- "code": 0,
+ "name": "MoveToHue",
+ "code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
@@ -1767,6 +1901,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -2818,105 +2969,6 @@
"deviceTypeCode": 0,
"deviceTypeProfileId": 259,
"clusters": [
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "client",
- "enabled": 0,
- "commands": [
- {
- "name": "ResetToFactoryDefaults",
- "code": 0,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "MfgSpecificPing",
- "code": 0,
- "mfgCode": "4098",
- "source": "client",
- "incoming": 1,
- "outgoing": 0
- }
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "server",
- "enabled": 1,
- "commands": [],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "ZCL version",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "power source",
- "code": 7,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
{
"name": "Identify",
"code": 3,
@@ -3017,6 +3069,23 @@
"define": "GROUPS_CLUSTER",
"side": "client",
"enabled": 0,
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
"commands": [
{
"name": "AddGroup",
@@ -3066,23 +3135,6 @@
"incoming": 1,
"outgoing": 1
}
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
]
},
{
@@ -3166,6 +3218,23 @@
"define": "SCENES_CLUSTER",
"side": "client",
"enabled": 0,
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
"commands": [
{
"name": "AddScene",
@@ -3223,23 +3292,6 @@
"incoming": 1,
"outgoing": 1
}
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
]
},
{
@@ -3582,6 +3634,7 @@
"define": "LEVEL_CONTROL_CLUSTER",
"side": "server",
"enabled": 1,
+ "commands": [],
"attributes": [
{
"name": "cluster revision",
@@ -3599,50 +3652,480 @@
"reportableChange": 0
},
{
- "name": "current level",
- "code": 0,
+ "name": "current level",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "MfgSpecificPing",
+ "code": 0,
+ "mfgCode": "4098",
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "StartUp",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ShutDown",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Leave",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "InteractionModelVersion",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorName",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorID",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductName",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductID",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UserLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "General Commissioning",
+ "code": 48,
+ "mfgCode": null,
+ "define": "GENERAL_COMMISSIONING_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "SetFabric",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ArmFailSafe",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "CommissioningComplete",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "General Commissioning",
+ "code": 48,
+ "mfgCode": null,
+ "define": "GENERAL_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "SetFabricResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ArmFailSafeResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "CommissioningCompleteResponse",
+ "code": 7,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "FabricId",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "o",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Breadcrumb",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Network Commissioning",
+ "code": 49,
+ "mfgCode": null,
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "ScanNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "AddWiFiNetwork",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "UpdateWiFiNetwork",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "AddThreadNetwork",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "UpdateThreadNetwork",
+ "code": 8,
"mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 1,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
- "commands": []
- },
- {
- "name": "General Commissioning",
- "code": 48,
- "mfgCode": null,
- "define": "GENERAL_COMMISSIONING_CLUSTER",
- "side": "client",
- "enabled": 0,
- "commands": [
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
{
- "name": "SetFabric",
- "code": 0,
+ "name": "RemoveNetwork",
+ "code": 10,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
- "name": "ArmFailSafe",
- "code": 2,
+ "name": "EnableNetwork",
+ "code": 12,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
- "name": "CommissioningComplete",
- "code": 6,
+ "name": "DisableNetwork",
+ "code": 14,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "GetLastNetworkCommissioningResult",
+ "code": 16,
"mfgCode": null,
"source": "client",
"incoming": 1,
@@ -3668,15 +4151,15 @@
]
},
{
- "name": "General Commissioning",
- "code": 48,
+ "name": "Network Commissioning",
+ "code": 49,
"mfgCode": null,
- "define": "GENERAL_COMMISSIONING_CLUSTER",
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
{
- "name": "SetFabricResponse",
+ "name": "ScanNetworksResponse",
"code": 1,
"mfgCode": null,
"source": "server",
@@ -3684,18 +4167,58 @@
"outgoing": 1
},
{
- "name": "ArmFailSafeResponse",
+ "name": "AddWiFiNetworkResponse",
"code": 3,
"mfgCode": null,
"source": "server",
- "incoming": 1,
+ "incoming": 0,
"outgoing": 1
},
{
- "name": "CommissioningCompleteResponse",
+ "name": "UpdateWiFiNetworkResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "AddThreadNetworkResponse",
"code": 7,
"mfgCode": null,
"source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateThreadNetworkResponse",
+ "code": 9,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveNetworkResponse",
+ "code": 11,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "EnableNetworkResponse",
+ "code": 13,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "DisableNetworkResponse",
+ "code": 15,
+ "mfgCode": null,
+ "source": "server",
"incoming": 1,
"outgoing": 1
}
@@ -3715,36 +4238,6 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
- },
- {
- "name": "FabricId",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "o",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "Breadcrumb",
- "code": 1,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
}
]
},
@@ -3755,23 +4248,6 @@
"define": "DOOR_LOCK_CLUSTER",
"side": "client",
"enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "LockDoor",
@@ -3957,6 +4433,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -4558,23 +5051,6 @@
"define": "COLOR_CONTROL_CLUSTER",
"side": "client",
"enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "MoveToHue",
@@ -4688,6 +5164,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -5473,6 +5966,7 @@
"define": "TEMP_MEASUREMENT_CLUSTER",
"side": "client",
"enabled": 0,
+ "commands": [],
"attributes": [
{
"name": "cluster revision",
@@ -5489,8 +5983,7 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": []
+ ]
},
{
"name": "Temperature Measurement",
@@ -5620,6 +6113,24 @@
"define": "IAS_ZONE_CLUSTER",
"side": "server",
"enabled": 1,
+ "commands": [
+ {
+ "name": "ZoneStatusChangeNotification",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ZoneEnrollRequest",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -5711,24 +6222,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "ZoneStatusChangeNotification",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "ZoneEnrollRequest",
- "code": 1,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -6225,23 +6718,6 @@
"define": "CONTENT_LAUNCH_CLUSTER",
"side": "server",
"enabled": 1,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "LaunchContentResponse",
@@ -6259,6 +6735,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
}
]
diff --git a/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.cpp b/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.cpp
index f5f88af110c2c7..fc5ea3b1b8a7c6 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.cpp
@@ -272,10 +272,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -289,6 +285,48 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
@@ -696,10 +734,6 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -710,6 +744,48 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
diff --git a/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.h b/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.h
index 14a3742f090e8f..d028079f799d79 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/CHIPClientCallbacks.h
@@ -20,6 +20,7 @@
#pragma once
#include
+#include
// Global Response Callbacks
typedef void (*DefaultSuccessCallback)(void * context);
@@ -33,6 +34,7 @@ typedef void (*Int32uAttributeCallback)(void * context, uint32_t value);
typedef void (*Int32sAttributeCallback)(void * context, int32_t value);
typedef void (*Int64uAttributeCallback)(void * context, uint64_t value);
typedef void (*Int64sAttributeCallback)(void * context, int64_t value);
+typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value);
typedef void (*ReadReportingConfigurationReportedCallback)(void * context, uint16_t minInterval, uint16_t maxInterval);
typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint16_t timeout);
diff --git a/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.h b/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.h
index 2060cb3e7bfdb9..f82aca72db379b 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.h
@@ -83,10 +83,20 @@ NS_ASSUME_NONNULL_BEGIN
@interface CHIPBasic : CHIPCluster
- (void)mfgSpecificPing:(ResponseHandler)completionHandler;
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler;
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler;
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler;
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler;
+- (void)readAttributeProductName:(ResponseHandler)completionHandler;
+- (void)readAttributeProductID:(ResponseHandler)completionHandler;
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler;
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
+- (void)readAttributeLocation:(ResponseHandler)completionHandler;
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
+- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler;
- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
@end
@@ -323,7 +333,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
-- (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
- (void)setHolidaySchedule:(uint8_t)scheduleId
localStartTime:(uint32_t)localStartTime
localEndTime:(uint32_t)localEndTime
@@ -332,12 +342,12 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setPin:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- pin:(char *)pin
+ pin:(NSString *)pin
completionHandler:(ResponseHandler)completionHandler;
- (void)setRfid:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- id:(char *)id
+ id:(NSString *)id
completionHandler:(ResponseHandler)completionHandler;
- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler;
- (void)setWeekdaySchedule:(uint8_t)scheduleId
@@ -353,8 +363,8 @@ NS_ASSUME_NONNULL_BEGIN
localStartTime:(uint32_t)localStartTime
localEndTime:(uint32_t)localEndTime
completionHandler:(ResponseHandler)completionHandler;
-- (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler;
-- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
- (void)readAttributeLockState:(ResponseHandler)completionHandler;
- (void)configureAttributeLockState:(uint16_t)minInterval
@@ -397,8 +407,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface CHIPGroups : CHIPCluster
-- (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler;
-- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler;
+- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler;
+- (void)addGroupIfIdentifying:(uint16_t)groupId
+ groupName:(NSString *)groupName
+ completionHandler:(ResponseHandler)completionHandler;
- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler;
- (void)removeAllGroups:(ResponseHandler)completionHandler;
- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler;
@@ -517,6 +529,52 @@ NS_ASSUME_NONNULL_BEGIN
@end
+/**
+ * Cluster Network Commissioning
+ *
+ */
+@interface CHIPNetworkCommissioning : CHIPCluster
+
+- (void)addThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)addWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)disableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)enableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler;
+- (void)removeNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)scanNetworks:(NSData *)ssid
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
+
+@end
+
/**
* Cluster On/off
*
@@ -545,7 +603,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)addScene:(uint16_t)groupId
sceneId:(uint8_t)sceneId
transitionTime:(uint16_t)transitionTime
- sceneName:(char *)sceneName
+ sceneName:(NSString *)sceneName
clusterId:(uint16_t)clusterId
length:(uint8_t)length
value:(uint8_t)value
diff --git a/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.mm b/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.mm
index 4651649bf3207f..f364b2e8d1c6e0 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.mm
+++ b/examples/all-clusters-app/all-clusters-common/gen/CHIPClustersObjc.mm
@@ -21,7 +21,7 @@
#import "CHIPDevice.h"
#import "CHIPDevice_Internal.h"
-#import "ChipError.h"
+#import "CHIPError.h"
#import "gen/CHIPClientCallbacks.h"
#import "gen/CHIPClustersObjc.h"
@@ -89,26 +89,38 @@ static void CallbackFn(void * context, uint8_t status)
dispatch_queue_t mQueue;
};
-class CHIPUnsupportedAttributeCallbackBridge : public Callback::Callback {
+class CHIPStringAttributeCallbackBridge : public Callback::Callback {
public:
- CHIPUnsupportedAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
- : Callback::Callback(CallbackFn, this)
+ CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mOctetString(octetString)
+ , mKeepAlive(keepAlive)
{
}
- ~CHIPUnsupportedAttributeCallbackBridge() {};
+ ~CHIPStringAttributeCallbackBridge() {};
- static void CallbackFn(void * context)
+ static void CallbackFn(void * context, chip::ByteSpan value)
{
- CHIPUnsupportedAttributeCallbackBridge * callback = reinterpret_cast(context);
+ CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context);
if (callback && callback->mQueue) {
dispatch_async(callback->mQueue, ^{
- NSError * error = [NSError errorWithDomain:CHIPErrorDomain
- code:CHIPErrorCodeUndefinedError
- userInfo:@ { NSLocalizedDescriptionKey : @"Unsupported attribute type" }];
- callback->mHandler(error, nil);
- callback->Cancel();
- delete callback;
+ if (callback->mOctetString) {
+ NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
+ callback->mHandler(nil, @ { @"value" : data });
+ } else {
+ NSString * str = [[NSString alloc] initWithBytes:value.data()
+ length:value.size()
+ encoding:NSUTF8StringEncoding];
+ callback->mHandler(nil, @ { @"value" : str });
+ }
+
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
});
}
};
@@ -116,6 +128,8 @@ static void CallbackFn(void * context)
private:
ResponseHandler mHandler;
dispatch_queue_t mQueue;
+ bool mOctetString;
+ bool mKeepAlive;
};
class CHIPBooleanAttributeCallbackBridge : public Callback::Callback {
@@ -246,6 +260,70 @@ static void CallbackFn(void * context, uint16_t value)
bool mKeepAlive;
};
+class CHIPInt32uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt32uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint32_t value)
+ {
+ CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
+class CHIPInt64uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt64uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint64_t value)
+ {
+ CHIPInt64uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLongLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
class CHIPInt16sAttributeCallbackBridge : public Callback::Callback {
public:
CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
@@ -321,8 +399,8 @@ @implementation CHIPApplicationBasic
- (void)readAttributeVendorName:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -368,8 +446,8 @@ - (void)readAttributeVendorId:(ResponseHandler)completionHandler
- (void)readAttributeApplicationName:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -415,8 +493,8 @@ - (void)readAttributeProductId:(ResponseHandler)completionHandler
- (void)readAttributeApplicationId:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -714,7 +792,149 @@ - (void)mfgSpecificPing:(ResponseHandler)completionHandler
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
+
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeProductName:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeProductID:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
@@ -729,7 +949,9 @@ - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ResetToFactoryDefaults(onSuccess->Cancel(), onFailure->Cancel());
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -737,9 +959,10 @@ - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler
+- (void)readAttributeLocation:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -752,7 +975,7 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeZclVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -760,9 +983,81 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -775,7 +1070,31 @@ - (void)readAttributePowerSource:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributePowerSource(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -1603,8 +1922,8 @@ - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
- (void)readAttributeCompensationText:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -3382,7 +3701,7 @@ - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
= new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -3398,7 +3717,9 @@ - (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandle
return;
}
- CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
+ CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -3435,7 +3756,7 @@ - (void)setHolidaySchedule:(uint8_t)scheduleId
- (void)setPin:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- pin:(char *)pin
+ pin:(NSString *)pin
completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
@@ -3451,7 +3772,9 @@ - (void)setPin:(uint16_t)userId
return;
}
- CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, pin);
+ CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -3461,7 +3784,7 @@ - (void)setPin:(uint16_t)userId
- (void)setRfid:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- id:(char *)id
+ id:(NSString *)id
completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
@@ -3477,7 +3800,9 @@ - (void)setRfid:(uint16_t)userId
return;
}
- CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, id);
+ CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
+ chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -3563,7 +3888,7 @@ - (void)setYeardaySchedule:(uint8_t)scheduleId
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
= new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -3579,14 +3904,16 @@ - (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHand
return;
}
- CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
+ CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
@@ -3601,7 +3928,9 @@ - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionH
return;
}
- CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds, pin);
+ CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -3838,8 +4167,8 @@ - (void)setFabric:(NSData *)fabricId
- (void)readAttributeFabricId:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -3942,7 +4271,7 @@ @implementation CHIPGroups
return &_cppCluster;
}
-- (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
+- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
{
CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
= new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -3958,14 +4287,16 @@ - (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
+ CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId,
+ chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
+- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
@@ -3980,7 +4311,9 @@ - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName comp
return;
}
- CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
+ CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId,
+ chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -5066,6 +5399,285 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
@end
+@interface CHIPNetworkCommissioning ()
+@property (readonly) Controller::NetworkCommissioningCluster cppCluster;
+@end
+
+@implementation CHIPNetworkCommissioning
+
+- (Controller::ClusterBase *)getCluster
+{
+ return &_cppCluster;
+}
+
+- (void)addThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.AddThreadNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) operationalDataset.bytes, operationalDataset.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)addWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.AddWiFiNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length),
+ chip::ByteSpan((const uint8_t *) credentials.bytes, credentials.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)disableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.DisableNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)enableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.EnableNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.GetLastNetworkCommissioningResult(onSuccess->Cancel(), onFailure->Cancel(), timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)removeNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.RemoveNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)scanNetworks:(NSData *)ssid
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ScanNetworks(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateThreadNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) operationalDataset.bytes, operationalDataset.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateWiFiNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length),
+ chip::ByteSpan((const uint8_t *) credentials.bytes, credentials.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+@end
+
@interface CHIPOnOff ()
@property (readonly) Controller::OnOffCluster cppCluster;
@end
@@ -5248,7 +5860,7 @@ @implementation CHIPScenes
- (void)addScene:(uint16_t)groupId
sceneId:(uint8_t)sceneId
transitionTime:(uint16_t)transitionTime
- sceneName:(char *)sceneName
+ sceneName:(NSString *)sceneName
clusterId:(uint16_t)clusterId
length:(uint8_t)length
value:(uint8_t)value
@@ -5268,8 +5880,10 @@ - (void)addScene:(uint16_t)groupId
return;
}
- CHIP_ERROR err = self.cppCluster.AddScene(
- onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime, sceneName, clusterId, length, value);
+ CHIP_ERROR err = self.cppCluster.AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime,
+ chip::ByteSpan((const uint8_t *) [sceneName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [sceneName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]),
+ clusterId, length, value);
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
index 419f6f93e19f53..c3a00f32299dcf 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
@@ -96,11 +96,6 @@ void DispatchServerCommand(app::Command * command, CommandId commandId, Endpoint
{
switch (commandId)
{
- case ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID: {
- // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
- emberAfBasicClusterResetToFactoryDefaultsCallback();
- break;
- }
default: {
// Unrecognized command ID, error status will apply.
// TODO: Encode response for command not found
@@ -2221,6 +2216,335 @@ void DispatchServerCommand(app::Command * command, CommandId commandId, Endpoint
} // namespace MediaPlayback
+namespace NetworkCommissioning {
+
+void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
+{
+ {
+ switch (commandId)
+ {
+ case ZCL_ADD_THREAD_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(operationalDataset);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterAddThreadNetworkCallback(const_cast(operationalDataset), breadcrumb,
+ timeoutMs);
+ break;
+ }
+ case ZCL_ADD_WI_FI_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ const uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.GetDataPtr(credentials);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 3:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(const_cast(ssid),
+ const_cast(credentials), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_DISABLE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(networkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterDisableNetworkCallback(const_cast(networkID), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ENABLE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(networkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterEnableNetworkCallback(const_cast(networkID), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(timeoutMs);
+ break;
+ }
+ case ZCL_REMOVE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * NetworkID;
+ uint64_t Breadcrumb;
+ uint32_t TimeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(NetworkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(Breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(TimeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterRemoveNetworkCallback(const_cast(NetworkID), Breadcrumb, TimeoutMs);
+ break;
+ }
+ case ZCL_SCAN_NETWORKS_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterScanNetworksCallback(const_cast(ssid), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(operationalDataset);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(const_cast(operationalDataset), breadcrumb,
+ timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ const uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.GetDataPtr(credentials);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 3:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(const_cast(ssid),
+ const_cast(credentials), breadcrumb, timeoutMs);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ // TODO: Encode response for command not found
+ ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, commandId, ZCL_NETWORK_COMMISSIONING_CLUSTER_ID);
+ break;
+ }
+ }
+ }
+}
+
+} // namespace NetworkCommissioning
+
namespace OnOff {
void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
@@ -2543,6 +2867,9 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC
case ZCL_MEDIA_PLAYBACK_CLUSTER_ID:
clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
index 3ab0310a83cce7..72a0198e2f97be 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
@@ -26,30 +26,6 @@
#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE)
#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE)
-// Attribute ids for cluster: Basic
-
-// Client attributes
-
-// Server attributes
-#define ZCL_VERSION_ATTRIBUTE_ID (0x0000)
-#define ZCL_APPLICATION_VERSION_ATTRIBUTE_ID (0x0001)
-#define ZCL_STACK_VERSION_ATTRIBUTE_ID (0x0002)
-#define ZCL_HW_VERSION_ATTRIBUTE_ID (0x0003)
-#define ZCL_MANUFACTURER_NAME_ATTRIBUTE_ID (0x0004)
-#define ZCL_MODEL_IDENTIFIER_ATTRIBUTE_ID (0x0005)
-#define ZCL_DATE_CODE_ATTRIBUTE_ID (0x0006)
-#define ZCL_POWER_SOURCE_ATTRIBUTE_ID (0x0007)
-#define ZCL_GENERIC_DEVICE_CLASS_ATTRIBUTE_ID (0x0008)
-#define ZCL_GENERIC_DEVICE_TYPE_ATTRIBUTE_ID (0x0009)
-#define ZCL_PRODUCT_CODE_ATTRIBUTE_ID (0x000A)
-#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000B)
-#define ZCL_LOCATION_DESCRIPTION_ATTRIBUTE_ID (0x0010)
-#define ZCL_PHYSICAL_ENVIRONMENT_ATTRIBUTE_ID (0x0011)
-#define ZCL_DEVICE_ENABLED_ATTRIBUTE_ID (0x0012)
-#define ZCL_ALARM_MASK_ATTRIBUTE_ID (0x0013)
-#define ZCL_DISABLE_LOCAL_CONFIG_ATTRIBUTE_ID (0x0014)
-#define ZCL_SW_BUILD_ID_ATTRIBUTE_ID (0x4000)
-
// Attribute ids for cluster: Power Configuration
// Client attributes
@@ -384,6 +360,29 @@
#define ZCL_KEEPALIVE_BASE_ATTRIBUTE_ID (0x0000)
#define ZCL_KEEPALIVE_JITTER_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Basic
+
+// Client attributes
+
+// Server attributes
+#define ZCL_INTERACTION_MODEL_VERSION_ATTRIBUTE_ID (0x0000)
+#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0001)
+#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0002)
+#define ZCL_PRODUCT_NAME_ATTRIBUTE_ID (0x0003)
+#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0004)
+#define ZCL_USER_LABEL_ATTRIBUTE_ID (0x0005)
+#define ZCL_LOCATION_ATTRIBUTE_ID (0x0006)
+#define ZCL_HARDWARE_VERSION_ATTRIBUTE_ID (0x0007)
+#define ZCL_HARDWARE_VERSION_STRING_ATTRIBUTE_ID (0x0008)
+#define ZCL_SOFTWARE_VERSION_ATTRIBUTE_ID (0x0009)
+#define ZCL_SOFTWARE_VERSION_STRING_ATTRIBUTE_ID (0x000A)
+#define ZCL_MANUFACTURING_DATE_ATTRIBUTE_ID (0x000B)
+#define ZCL_PART_NUMBER_ATTRIBUTE_ID (0x000C)
+#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000D)
+#define ZCL_PRODUCT_LABEL_ATTRIBUTE_ID (0x000E)
+#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x000F)
+#define ZCL_LOCAL_CONFIG_DISABLED_ATTRIBUTE_ID (0x0010)
+
// Attribute ids for cluster: General Commissioning
// Client attributes
@@ -392,6 +391,12 @@
#define ZCL_FABRIC_ID_ATTRIBUTE_ID (0x0000)
#define ZCL_BREADCRUMB_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Network Commissioning
+
+// Client attributes
+
+// Server attributes
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
@@ -1104,10 +1109,10 @@
// Client attributes
// Server attributes
-#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
-#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0001)
+#define ZCL_APPLICATION_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
+#define ZCL_APPLICATION_VENDOR_ID_ATTRIBUTE_ID (0x0001)
#define ZCL_APPLICATION_NAME_ATTRIBUTE_ID (0x0002)
-#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
+#define ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
#define ZCL_APPLICATION_ID_ATTRIBUTE_ID (0x0005)
#define ZCL_CATALOG_VENDOR_ID_ATTRIBUTE_ID (0x0006)
#define ZCL_APPLICATION_STATUS_ATTRIBUTE_ID (0x0007)
@@ -3839,7 +3844,7 @@
#define ZCL_PRICE_TRAILING_DIGIT_ATTRIBUTE_ID (0x0021)
#define ZCL_PRICE_ATTRIBUTE_ID (0x0022)
#define ZCL_GOOD_ID_ATTRIBUTE_ID (0x0030)
-#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
+#define ZCL_PAYMENT_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
#define ZCL_PAYMENT_TIMESTAMP_ATTRIBUTE_ID (0x0032)
#define ZCL_TRANS_ID_ATTRIBUTE_ID (0x0033)
#define ZCL_TRANS_STATUS_ATTRIBUTE_ID (0x0034)
@@ -4085,12 +4090,6 @@
// Server attributes
-// Attribute ids for cluster: Network Commissioning
-
-// Client attributes
-
-// Server attributes
-
// Attribute ids for cluster: Binding
// Client attributes
diff --git a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
index 36af8206486d4b..2cb33409ea2a0f 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
@@ -42,6 +42,7 @@ EmberAfStatus emberAfIdentifyClusterServerCommandParse(EmberAfClusterCommand * c
EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfLowPowerClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfMediaPlaybackClusterServerCommandParse(EmberAfClusterCommand * cmd);
+EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd);
@@ -128,6 +129,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
case ZCL_MEDIA_PLAYBACK_CLUSTER_ID:
result = emberAfMediaPlaybackClusterServerCommandParse(cmd);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ result = emberAfNetworkCommissioningClusterServerCommandParse(cmd);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
result = emberAfOnOffClusterServerCommandParse(cmd);
break;
@@ -196,10 +200,6 @@ EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd)
{
switch (cmd->commandId)
{
- case ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID: {
- wasHandled = emberAfBasicClusterResetToFactoryDefaultsCallback();
- break;
- }
default: {
// Unrecognized command ID, error status will apply.
break;
@@ -1890,6 +1890,265 @@ EmberAfStatus emberAfMediaPlaybackClusterServerCommandParse(EmberAfClusterComman
}
return status(wasHandled, true, cmd->mfgSpecific);
}
+EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd)
+{
+ bool wasHandled = false;
+
+ if (!cmd->mfgSpecific)
+ {
+ switch (cmd->commandId)
+ {
+ case ZCL_ADD_THREAD_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ operationalDataset = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(operationalDataset) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ADD_WI_FI_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ credentials = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(credentials) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_DISABLE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ networkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(networkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(networkID, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ENABLE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ networkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(networkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(networkID, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(timeoutMs);
+ break;
+ }
+ case ZCL_REMOVE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * NetworkID;
+ uint64_t Breadcrumb;
+ uint32_t TimeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ NetworkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(NetworkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ Breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ TimeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(NetworkID, Breadcrumb, TimeoutMs);
+ break;
+ }
+ case ZCL_SCAN_NETWORKS_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback(ssid, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ operationalDataset = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(operationalDataset) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ credentials = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(credentials) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ break;
+ }
+ }
+ }
+ return status(wasHandled, true, cmd->mfgSpecific);
+}
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
index b50c4f2cebc39d..f4108c83fb1273 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
@@ -69,6 +69,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_MEDIA_PLAYBACK_CLUSTER_ID:
emberAfMediaPlaybackClusterInitCallback(endpoint);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ emberAfNetworkCommissioningClusterInitCallback(endpoint);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
emberAfOnOffClusterInitCallback(endpoint);
break;
@@ -154,6 +157,11 @@ void __attribute__((weak)) emberAfMediaPlaybackClusterInitCallback(EndpointId en
// To prevent warning
(void) endpoint;
}
+void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint)
+{
+ // To prevent warning
+ (void) endpoint;
+}
void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h
index 9865389e510885..1167dd1e5db5b8 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/callback.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h
@@ -149,6 +149,14 @@ void emberAfLowPowerClusterInitCallback(chip::EndpointId endpoint);
*/
void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint);
+/** @brief Network Commissioning Cluster Init
+ *
+ * Cluster Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint);
+
/** @brief On/off Cluster Init
*
* Cluster Init
@@ -1156,6 +1164,77 @@ EmberAfStatus emberAfMediaPlaybackClusterServerPreAttributeChangedCallback(chip:
*/
void emberAfMediaPlaybackClusterServerTickCallback(chip::EndpointId endpoint);
+//
+// Network Commissioning Cluster server
+//
+
+/** @brief Network Commissioning Cluster Server Init
+ *
+ * Server Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfNetworkCommissioningClusterServerInitCallback(chip::EndpointId endpoint);
+
+/** @brief Network Commissioning Cluster Server Attribute Changed
+ *
+ * Server Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ */
+void emberAfNetworkCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
+
+/** @brief Network Commissioning Cluster Server Manufacturer Specific Attribute Changed
+ *
+ * Server Manufacturer Specific Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ * @param manufacturerCode Manufacturer Code of the attribute that changed
+ */
+void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ uint16_t manufacturerCode);
+
+/** @brief Network Commissioning Cluster Server Message Sent
+ *
+ * Server Message Sent
+ *
+ * @param type The type of message sent
+ * @param indexOrDestination The destination or address to which the message was sent
+ * @param apsFrame The APS frame for the message
+ * @param msgLen The length of the message
+ * @param message The message that was sent
+ * @param status The status of the sent message
+ */
+void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
+ EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
+ EmberStatus status);
+
+/** @brief Network Commissioning Cluster Server Pre Attribute Changed
+ *
+ * server Pre Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ EmberAfAttributeType attributeType, uint8_t size,
+ uint8_t * value);
+
+/** @brief Network Commissioning Cluster Server Tick
+ *
+ * server Tick
+ *
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint);
+
//
// On/off Cluster server
//
@@ -1386,12 +1465,6 @@ bool emberAfBarrierControlClusterBarrierControlStopCallback();
bool emberAfBasicClusterMfgSpecificPingCallback();
-/**
- * @brief Basic Cluster ResetToFactoryDefaults Command callback
- */
-
-bool emberAfBasicClusterResetToFactoryDefaultsCallback();
-
/**
* @brief Binding Cluster Bind Command callback
* @param nodeId
@@ -2003,6 +2076,91 @@ bool emberAfMediaPlaybackClusterStartOverRequestCallback();
bool emberAfMediaPlaybackClusterStopRequestCallback();
+/**
+ * @brief Network Commissioning Cluster AddThreadNetwork Command callback
+ * @param operationalDataset
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster AddWiFiNetwork Command callback
+ * @param ssid
+ * @param credentials
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster DisableNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterDisableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster EnableNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterEnableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster RemoveNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(uint8_t * NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster ScanNetworks Command callback
+ * @param ssid
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterScanNetworksCallback(uint8_t * ssid, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster UpdateThreadNetwork Command callback
+ * @param operationalDataset
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster UpdateWiFiNetwork Command callback
+ * @param ssid
+ * @param credentials
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
/**
* @brief On/off Cluster Off Command callback
*/
diff --git a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
index c4f2f0a4a2a4f2..79d1e159594a4a 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
@@ -256,15 +256,6 @@
emberAfFillExternalBuffer(mask, clusterId, ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID, "ub", discoveryComplete, \
extendedDiscoverAttributesInfoRecords, extendedDiscoverAttributesInfoRecordsLen);
-/** @brief Command description for ResetToFactoryDefaults
- *
- * Command: ResetToFactoryDefaults
- */
-#define emberAfFillCommandBasicClusterResetToFactoryDefaults() \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID, "", );
-
/** @brief Command description for Identify
*
* Command: Identify
@@ -1795,6 +1786,33 @@
totalNumberOfNonEmptyProxyTableEntries, gpdSrcId, startIndex, gpdIeee, entriesCount, endpoint, \
proxyTableEntries, proxyTableEntriesLen, index);
+/** @brief Command description for StartUp
+ *
+ * Command: StartUp
+ */
+#define emberAfFillCommandBasicClusterStartUp() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_START_UP_COMMAND_ID, "", );
+
+/** @brief Command description for ShutDown
+ *
+ * Command: ShutDown
+ */
+#define emberAfFillCommandBasicClusterShutDown() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SHUT_DOWN_COMMAND_ID, "", );
+
+/** @brief Command description for Leave
+ *
+ * Command: Leave
+ */
+#define emberAfFillCommandBasicClusterLeave() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_LEAVE_COMMAND_ID, "", );
+
/** @brief Command description for SetFabric
*
* Command: SetFabric
@@ -1893,6 +1911,225 @@
\
ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+/** @brief Command description for ScanNetworks
+ *
+ * Command: ScanNetworks
+ * @param ssid OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
+
+/** @brief Command description for ScanNetworksResponse
+ *
+ * Command: ScanNetworksResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ * @param wifiScanResults WiFiInterfaceScanResult []
+ * @param wifiScanResultsLen int
+ * @param threadScanResults ThreadInterfaceScanResult []
+ * @param threadScanResultsLen int
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
+ threadScanResultsLen) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
+ wifiScanResultsLen, threadScanResults, threadScanResultsLen);
+
+/** @brief Command description for AddWiFiNetwork
+ *
+ * Command: AddWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddWiFiNetworkResponse
+ *
+ * Command: AddWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateWiFiNetwork
+ *
+ * Command: UpdateWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateWiFiNetworkResponse
+ *
+ * Command: UpdateWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for AddThreadNetwork
+ *
+ * Command: AddThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddThreadNetworkResponse
+ *
+ * Command: AddThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateThreadNetwork
+ *
+ * Command: UpdateThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateThreadNetworkResponse
+ *
+ * Command: UpdateThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for RemoveNetwork
+ *
+ * Command: RemoveNetwork
+ * @param NetworkID OCTET_STRING
+ * @param Breadcrumb INT64U
+ * @param TimeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
+
+/** @brief Command description for RemoveNetworkResponse
+ *
+ * Command: RemoveNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for EnableNetwork
+ *
+ * Command: EnableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for EnableNetworkResponse
+ *
+ * Command: EnableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for DisableNetwork
+ *
+ * Command: DisableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for DisableNetworkResponse
+ *
+ * Command: DisableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for GetLastNetworkCommissioningResult
+ *
+ * Command: GetLastNetworkCommissioningResult
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
@@ -5765,225 +6002,6 @@
ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \
endpointInformationRecordList, endpointInformationRecordListLen);
-/** @brief Command description for ScanNetworks
- *
- * Command: ScanNetworks
- * @param ssid OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
-
-/** @brief Command description for ScanNetworksResponse
- *
- * Command: ScanNetworksResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- * @param wifiScanResults WiFiInterfaceScanResult []
- * @param wifiScanResultsLen int
- * @param threadScanResults ThreadInterfaceScanResult []
- * @param threadScanResultsLen int
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
- threadScanResultsLen) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
- wifiScanResultsLen, threadScanResults, threadScanResultsLen);
-
-/** @brief Command description for AddWiFiNetwork
- *
- * Command: AddWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddWiFiNetworkResponse
- *
- * Command: AddWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateWiFiNetwork
- *
- * Command: UpdateWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateWiFiNetworkResponse
- *
- * Command: UpdateWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for AddThreadNetwork
- *
- * Command: AddThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddThreadNetworkResponse
- *
- * Command: AddThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateThreadNetwork
- *
- * Command: UpdateThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateThreadNetworkResponse
- *
- * Command: UpdateThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for RemoveNetwork
- *
- * Command: RemoveNetwork
- * @param NetworkID OCTET_STRING
- * @param Breadcrumb INT64U
- * @param TimeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
-
-/** @brief Command description for RemoveNetworkResponse
- *
- * Command: RemoveNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for EnableNetwork
- *
- * Command: EnableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for EnableNetworkResponse
- *
- * Command: EnableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for DisableNetwork
- *
- * Command: DisableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for DisableNetworkResponse
- *
- * Command: DisableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for GetLastNetworkCommissioningResult
- *
- * Command: GetLastNetworkCommissioningResult
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
-
/** @brief Command description for Bind
*
* Command: Bind
diff --git a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
index 2069290df636a7..add8f83d188cf8 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
@@ -20,9 +20,6 @@
// Prevent multiple inclusion
#pragma once
-// Definitions for cluster: Basic
-#define ZCL_BASIC_CLUSTER_ID (0x0000)
-
// Definitions for cluster: Power Configuration
#define ZCL_POWER_CONFIG_CLUSTER_ID (0x0001)
@@ -83,9 +80,15 @@
// Definitions for cluster: Keep-Alive
#define ZCL_KEEPALIVE_CLUSTER_ID (0x0025)
+// Definitions for cluster: Basic
+#define ZCL_BASIC_CLUSTER_ID (0x0028)
+
// Definitions for cluster: General Commissioning
#define ZCL_GENERAL_COMMISSIONING_CLUSTER_ID (0x0030)
+// Definitions for cluster: Network Commissioning
+#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
@@ -341,9 +344,6 @@
// Definitions for cluster: ZLL Commissioning
#define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000)
-// Definitions for cluster: Network Commissioning
-#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0xAAAA)
-
// Definitions for cluster: Binding
#define ZCL_BINDING_CLUSTER_ID (0xF000)
diff --git a/examples/all-clusters-app/all-clusters-common/gen/command-id.h b/examples/all-clusters-app/all-clusters-common/gen/command-id.h
index 655425d5d43d35..864943b5727fcd 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/command-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/command-id.h
@@ -45,10 +45,6 @@
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15)
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16)
-// Commands for cluster: Basic
-#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
-#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
-
// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
#define ZCL_IDENTIFY_QUERY_RESPONSE_COMMAND_ID (0x00)
@@ -226,6 +222,12 @@
#define ZCL_GP_PROXY_TABLE_RESPONSE_COMMAND_ID (0x0B)
#define ZCL_GP_PROXY_TABLE_REQUEST_COMMAND_ID (0x0B)
+// Commands for cluster: Basic
+#define ZCL_START_UP_COMMAND_ID (0x00)
+#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
+#define ZCL_SHUT_DOWN_COMMAND_ID (0x01)
+#define ZCL_LEAVE_COMMAND_ID (0x02)
+
// Commands for cluster: General Commissioning
#define ZCL_SET_FABRIC_COMMAND_ID (0x00)
#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01)
@@ -236,6 +238,25 @@
#define ZCL_COMMISSIONING_COMPLETE_COMMAND_ID (0x06)
#define ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID (0x07)
+// Commands for cluster: Network Commissioning
+#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
+#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
+#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
+#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
+#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
+#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
+#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
+#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
+#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
+#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
+#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
+#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
+#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
+#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
+#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
+#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
@@ -698,25 +719,6 @@
#define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42)
#define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42)
-// Commands for cluster: Network Commissioning
-#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
-#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
-#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
-#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
-#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
-#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
-#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
-#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
-#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
-#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
-#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
-#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
-#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
-#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
-#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
-#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
-#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
-
// Commands for cluster: Binding
#define ZCL_BIND_COMMAND_ID (0x00)
#define ZCL_UNBIND_COMMAND_ID (0x01)
diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
index 3775b356ce564f..1a35ec1c5b8d4d 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
@@ -26,10 +26,32 @@
#if BIGENDIAN_CPU
#define GENERATED_DEFAULTS \
{ \
- /* 0 */ 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "General Commissioning", attribute: "FabricId". side: server, big-endian */ /* 8 */ \
+ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */ /* 32 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */ /* 64 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */ /* 96 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, big-endian */ /* 112 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */ /* 176 */ 0x00, 0x00, \
+ 0x00, 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */ /* 180 */ 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */ /* 244 */ 1, 'o', \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "General Commissioning", attribute: "FabricId". side: server, big-endian */ /* 252 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "General Commissioning", attribute: "Breadcrumb". side: server, big-endian */ /* 16 */ \
+ /* Default for cluster: "General Commissioning", attribute: "Breadcrumb". side: server, big-endian */ /* 260 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -44,28 +66,73 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "Color Control", attribute: "compensation text". side: server, big-endian */ /* 270 */ \
+ /* Default for cluster: "Color Control", attribute: "compensation text". side: server, big-endian */ /* 514 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, big-endian */ /* 278 */ 0x00, 0x00, \
+ /* Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, big-endian */ /* 522 */ 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "Application Basic", attribute: "vendor name". side: server, big-endian */ /* 310 */ \
+ /* Default for cluster: "Application Basic", attribute: "vendor name". side: server, big-endian */ /* 554 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, /* Default for cluster: "Application Basic", attribute: "application name". side: server, big-endian */ \
- /* 342 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* 586 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Application Basic", attribute: "application id". side: server, big-endian */ /* 618 */ \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, /* Default for cluster: "Application Basic", attribute: "application id". side: server, big-endian */ \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */ /* 650 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */ /* 682 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */ /* 714 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, big-endian */ /* 730 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */ /* 794 */ 0x00, 0x00, \
+ 0x00, 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */ /* 798 */ 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */ \
}
#else // !BIGENDIAN_CPU
#define GENERATED_DEFAULTS \
{ \
- /* 0 */ 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "General Commissioning", attribute: "FabricId". side: server, little-endian */ /* 8 */ \
+ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */ /* 32 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */ /* 64 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */ /* 96 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, little-endian */ /* 112 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */ /* 176 */ \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */ /* 180 */ 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */ /* 244 */ 1, 'o', \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "General Commissioning", attribute: "FabricId". side: server, little-endian */ /* 252 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, /* Default for cluster: "General Commissioning", attribute: "Breadcrumb". side: server, little-endian */ \
- /* 16 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* 260 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -80,22 +147,45 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, /* Default for cluster: "Color Control", attribute: "compensation text". side: server, little-endian */ \
- /* 270 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, little-endian */ /* 278 */ 0x00, 0x00, \
+ /* 514 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, little-endian */ /* 522 */ 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- /* Default for cluster: "Application Basic", attribute: "vendor name". side: server, little-endian */ /* 310 */ \
+ /* Default for cluster: "Application Basic", attribute: "vendor name". side: server, little-endian */ /* 554 */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, /* Default for cluster: "Application Basic", attribute: "application name". side: server, little-endian */ \
- /* 342 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* 586 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, /* Default for cluster: "Application Basic", attribute: "application id". side: server, little-endian */ \
+ /* 618 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */ /* 650 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */ /* 682 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */ /* 714 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, little-endian */ /* 730 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */ /* 794 */ \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */ /* 798 */ 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */ \
}
#endif // BIGENDIAN_CPU
-#define GENERATED_DEFAULTS_COUNT (7)
+#define GENERATED_DEFAULTS_COUNT (21)
#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
#define ZAP_LONG_DEFAULTS_INDEX(index) \
@@ -115,13 +205,10 @@
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
-#define GENERATED_ATTRIBUTE_COUNT 108
+#define GENERATED_ATTRIBUTE_COUNT 127
#define GENERATED_ATTRIBUTES \
{ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Basic (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x08 } }, /* Basic (server): ZCL version */ \
- { 0x0007, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0x00 } }, /* Basic (server): power source */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* Identify (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* Identify (server): cluster revision */ \
{ \
0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) 0x0000 } \
}, /* Identify (server): identify time */ \
@@ -138,12 +225,49 @@
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Level Control (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x00 } }, /* Level Control (server): current level */ \
{ \
- 0x0000, ZAP_TYPE(OCTET_STRING), 8, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(0) } \
+ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
+ }, /* Basic (server): cluster revision */ \
+ { \
+ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } \
+ }, /* Basic (server): InteractionModelVersion */ \
+ { \
+ 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(0) } \
+ }, /* Basic (server): VendorName */ \
+ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): VendorID */ \
+ { \
+ 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(32) } \
+ }, /* Basic (server): ProductName */ \
+ { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): ProductID */ \
+ { 0x0005, \
+ ZAP_TYPE(CHAR_STRING), \
+ 32, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64) } }, /* Basic (server): UserLabel */ \
+ { 0x0006, \
+ ZAP_TYPE(CHAR_STRING), \
+ 16, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(96) } }, /* Basic (server): Location */ \
+ { \
+ 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
+ }, /* Basic (server): HardwareVersion */ \
+ { \
+ 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(112) } \
+ }, /* Basic (server): HardwareVersionString */ \
+ { \
+ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(176) } \
+ }, /* Basic (server): SoftwareVersion */ \
+ { \
+ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(180) } \
+ }, /* Basic (server): SoftwareVersionString */ \
+ { \
+ 0x0000, ZAP_TYPE(OCTET_STRING), 8, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(244) } \
}, /* General Commissioning (server): FabricId */ \
{ \
- 0x0001, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(8) } \
+ 0x0001, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(252) } \
}, /* General Commissioning (server): Breadcrumb */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* General Commissioning (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Network Commissioning (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Door Lock (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 2 } }, /* Door Lock (server): lock state */ \
{ 0x0001, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0 } }, /* Door Lock (server): lock type */ \
@@ -161,7 +285,7 @@
{ 0x0004, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x607D } }, /* Color Control (server): current y */ \
{ 0x0005, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0 } }, /* Color Control (server): drift compensation */ \
{ \
- 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(16) } \
+ 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(260) } \
}, /* Color Control (server): compensation text */ \
{ 0x0007, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x00FA } }, /* Color Control (server): color temperature */ \
{ 0x0008, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0x01 } }, /* Color Control (server): color mode */ \
@@ -243,21 +367,21 @@
{ 0x0001, ZAP_TYPE(ENUM16), 2, 0, { (uint8_t *) 0 } }, /* IAS Zone (server): zone type */ \
{ 0x0002, ZAP_TYPE(BITMAP16), 2, 0, { (uint8_t *) 0x0000 } }, /* IAS Zone (server): zone status */ \
{ \
- 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(270) } \
+ 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(514) } \
}, /* IAS Zone (server): IAS CIE address */ \
{ 0x0011, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0xff } }, /* IAS Zone (server): Zone ID */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Low Power (server): cluster revision */ \
{ \
- 0x0000, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(278) } \
+ 0x0000, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(522) } \
}, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0 } }, /* Application Basic (server): vendor id */ \
{ \
- 0x0002, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(310) } \
+ 0x0002, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(554) } \
}, /* Application Basic (server): application name */ \
{ 0x0003, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0 } }, /* Application Basic (server): product id */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Application Basic (server): cluster revision */ \
{ \
- 0x0005, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(342) } \
+ 0x0005, ZAP_TYPE(OCTET_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(586) } \
}, /* Application Basic (server): application id */ \
{ 0x0006, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0 } }, /* Application Basic (server): catalog vendor id */ \
{ 0x0007, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0x01 } }, /* Application Basic (server): application satus */ \
@@ -265,11 +389,44 @@
{ 0x0000, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0 } }, /* Media Playback (server): current state */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Media Playback (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Content Launch (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Basic (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x08 } }, /* Basic (server): ZCL version */ \
- { 0x0007, ZAP_TYPE(ENUM8), 1, 0, { (uint8_t *) 0x00 } }, /* Basic (server): power source */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* On/off (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */ \
+ { \
+ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
+ }, /* Basic (server): cluster revision */ \
+ { \
+ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } \
+ }, /* Basic (server): InteractionModelVersion */ \
+ { \
+ 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(618) } \
+ }, /* Basic (server): VendorName */ \
+ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): VendorID */ \
+ { \
+ 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(650) } \
+ }, /* Basic (server): ProductName */ \
+ { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): ProductID */ \
+ { 0x0005, \
+ ZAP_TYPE(CHAR_STRING), \
+ 32, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(682) } }, /* Basic (server): UserLabel */ \
+ { 0x0006, \
+ ZAP_TYPE(CHAR_STRING), \
+ 16, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(714) } }, /* Basic (server): Location */ \
+ { \
+ 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
+ }, /* Basic (server): HardwareVersion */ \
+ { \
+ 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(730) } \
+ }, /* Basic (server): HardwareVersionString */ \
+ { \
+ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(794) } \
+ }, /* Basic (server): SoftwareVersion */ \
+ { \
+ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(798) } \
+ }, /* Basic (server): SoftwareVersionString */ \
}
// This is an array of EmberAfCluster structures.
@@ -306,90 +463,97 @@
};
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
-#define GENERATED_CLUSTER_COUNT 19
+#define GENERATED_CLUSTER_COUNT 20
#define GENERATED_CLUSTERS \
{ \
- { 0x0000, ZAP_ATTRIBUTE_INDEX(0), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 1, Cluster: Basic (server) */ \
- { 0x0003, \
- ZAP_ATTRIBUTE_INDEX(3), \
- 2, \
- 4, \
- ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \
- chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \
+ { 0x0003, \
+ ZAP_ATTRIBUTE_INDEX(0), \
+ 2, \
+ 4, \
+ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \
+ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \
{ 0x0004, \
- ZAP_ATTRIBUTE_INDEX(5), \
+ ZAP_ATTRIBUTE_INDEX(2), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \
{ 0x0005, \
- ZAP_ATTRIBUTE_INDEX(7), \
+ ZAP_ATTRIBUTE_INDEX(4), \
6, \
8, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(13), \
+ ZAP_ATTRIBUTE_INDEX(10), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/off (server) */ \
{ 0x0008, \
- ZAP_ATTRIBUTE_INDEX(15), \
+ ZAP_ATTRIBUTE_INDEX(12), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \
{ \
- 0x0030, ZAP_ATTRIBUTE_INDEX(17), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0028, ZAP_ATTRIBUTE_INDEX(14), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 1, Cluster: Basic (server) */ \
+ { \
+ 0x0030, ZAP_ATTRIBUTE_INDEX(26), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: General Commissioning (server) */ \
+ { \
+ 0x0031, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \
{ 0x0101, \
- ZAP_ATTRIBUTE_INDEX(20), \
+ ZAP_ATTRIBUTE_INDEX(30), \
4, \
5, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \
chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \
{ \
- 0x0103, ZAP_ATTRIBUTE_INDEX(24), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0103, ZAP_ATTRIBUTE_INDEX(34), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Barrier Control (server) */ \
{ 0x0300, \
- ZAP_ATTRIBUTE_INDEX(29), \
+ ZAP_ATTRIBUTE_INDEX(39), \
51, \
336, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \
{ \
- 0x0402, ZAP_ATTRIBUTE_INDEX(80), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0402, ZAP_ATTRIBUTE_INDEX(90), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
{ 0x0500, \
- ZAP_ATTRIBUTE_INDEX(84), \
+ ZAP_ATTRIBUTE_INDEX(94), \
6, \
16, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \
ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \
chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \
{ \
- 0x0508, ZAP_ATTRIBUTE_INDEX(90), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0508, ZAP_ATTRIBUTE_INDEX(100), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Low Power (server) */ \
{ \
- 0x050D, ZAP_ATTRIBUTE_INDEX(91), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x050D, ZAP_ATTRIBUTE_INDEX(101), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Application Basic (server) */ \
{ \
- 0xF000, ZAP_ATTRIBUTE_INDEX(99), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0xF000, ZAP_ATTRIBUTE_INDEX(109), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Binding (server) */ \
{ \
- 0xF001, ZAP_ATTRIBUTE_INDEX(100), 2, 4, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0xF001, ZAP_ATTRIBUTE_INDEX(110), 2, 4, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Media Playback (server) */ \
{ \
- 0xF002, ZAP_ATTRIBUTE_INDEX(102), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0xF002, ZAP_ATTRIBUTE_INDEX(112), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Content Launch (server) */ \
- { 0x0000, ZAP_ATTRIBUTE_INDEX(103), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 2, Cluster: Basic (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(106), \
+ ZAP_ATTRIBUTE_INDEX(113), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \
+ { \
+ 0x0028, ZAP_ATTRIBUTE_INDEX(115), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 2, Cluster: Basic (server) */ \
}
#define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
@@ -397,17 +561,17 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
- { ZAP_CLUSTER_INDEX(0), 17, 530 }, { ZAP_CLUSTER_INDEX(17), 2, 7 }, \
+ { ZAP_CLUSTER_INDEX(0), 18, 782 }, { ZAP_CLUSTER_INDEX(18), 2, 257 }, \
}
// Largest attribute size is needed for various buffers
#define ATTRIBUTE_LARGEST (254)
// Total size of singleton attributes
-#define ATTRIBUTE_SINGLETONS_SIZE (0)
+#define ATTRIBUTE_SINGLETONS_SIZE (508)
// Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (537)
+#define ATTRIBUTE_MAX_SIZE (1039)
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (2)
@@ -451,17 +615,10 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (111)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (132)
#define GENERATED_COMMANDS \
{ \
- { 0x0000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Basic (server): MfgSpecificPing */ \
- { \
- 0x0000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) \
- }, /* Basic (server): ResetToFactoryDefaults */ \
- { \
- 0x0000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) \
- }, /* Basic (server): ResetToFactoryDefaults */ \
- { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (server): Identify */ \
+ { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (server): Identify */ \
{ 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Identify (server): IdentifyQueryResponse */ \
{ 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (server): IdentifyQuery */ \
{ 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Groups (server): AddGroup */ \
@@ -501,6 +658,13 @@
{ 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): MoveWithOnOff */ \
{ 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): StepWithOnOff */ \
{ 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): StopWithOnOff */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Basic (server): MfgSpecificPing */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): StartUp */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): StartUp */ \
+ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */ \
+ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */ \
+ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */ \
+ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */ \
{ 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* General Commissioning (server): SetFabric */ \
{ 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* General Commissioning (server): SetFabricResponse */ \
{ 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* General Commissioning (server): ArmFailSafe */ \
@@ -508,6 +672,24 @@
{ 0x0030, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* General Commissioning (server): CommissioningComplete */ \
{ 0x0030, 0x07, \
ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* General Commissioning (server): CommissioningCompleteResponse */ \
+ { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): ScanNetworks */ \
+ { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): ScanNetworksResponse */ \
+ { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddWiFiNetwork */ \
+ { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddWiFiNetworkResponse */ \
+ { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetwork */ \
+ { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetworkResponse */ \
+ { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddThreadNetwork */ \
+ { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddThreadNetworkResponse */ \
+ { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetwork */ \
+ { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetworkResponse */ \
+ { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): RemoveNetwork */ \
+ { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): RemoveNetworkResponse */ \
+ { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): EnableNetwork */ \
+ { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): EnableNetworkResponse */ \
+ { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): DisableNetwork */ \
+ { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): DisableNetworkResponse */ \
+ { 0x0031, 0x10, \
+ ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): GetLastNetworkCommissioningResult */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (server): LockDoor */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Door Lock (server): LockDoorResponse */ \
{ 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (server): UnlockDoor */ \
@@ -624,7 +806,7 @@
#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1)
#define GENERATED_COMMAND_MANUFACTURER_CODES \
{ \
- { 0, 4098 }, \
+ { 40, 4098 }, \
}
// This is an array of EmberAfManufacturerCodeEntry structures for clusters.
diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
index 6a1a6e9bd77ed4..09a3a3eaeea112 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
@@ -43,6 +43,7 @@
#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (1)
+#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2)
#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1)
@@ -129,6 +130,11 @@
#define EMBER_AF_PLUGIN_MEDIA_PLAYBACK_SERVER
#define EMBER_AF_PLUGIN_MEDIA_PLAYBACK
+// Use this macro to check if the server side of the Network Commissioning cluster is included
+#define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER
+#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER
+#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING
+
// Use this macro to check if the server side of the On/off cluster is included
#define ZCL_USING_ON_OFF_CLUSTER_SERVER
#define EMBER_AF_PLUGIN_ON_OFF_SERVER
diff --git a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
index 1ea31513afebcd..8c737e93fea79c 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
@@ -24,12 +24,6 @@
// to the "EmberAfClusterName" defined in the ZCL header.
// The names of clusters that are not present, are removed.
-#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 0, "Basic" },
-#else
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
-#endif
-
#if defined(ZCL_USING_POWER_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_POWER_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER { ZCL_POWER_CONFIG_CLUSTER_ID, 1, "Power Configuration" },
#else
@@ -150,12 +144,24 @@
#define CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER
#endif
+#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 40, "Basic" },
+#else
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
+#endif
+
#if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, 48, "General Commissioning" },
#else
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 49, "Network Commissioning" },
+#else
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -734,12 +740,6 @@
#define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER
#endif
-#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 43690, "Network Commissioning" },
-#else
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
-#endif
-
#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" },
#else
@@ -790,7 +790,6 @@
#endif
#define CLUSTER_IDS_TO_NAMES \
- CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DEVICE_TEMP_CLUSTER \
CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER \
@@ -811,7 +810,9 @@
CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \
CHIP_PRINTCLUSTER_GREEN_POWER_CLUSTER \
CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER \
+ CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
@@ -897,7 +898,6 @@
CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \
CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \
CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \
- CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_BINDING_CLUSTER \
CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER \
CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER \
diff --git a/examples/all-clusters-app/esp32/main/component.mk b/examples/all-clusters-app/esp32/main/component.mk
index df7b728547883e..2c99a7611b8008 100644
--- a/examples/all-clusters-app/esp32/main/component.mk
+++ b/examples/all-clusters-app/esp32/main/component.mk
@@ -37,6 +37,7 @@ COMPONENT_SRCDIRS :=
../third_party/connectedhomeip/src/app/clusters/content-launch-server \
../third_party/connectedhomeip/src/app/clusters/low-power-server \
../third_party/connectedhomeip/src/app/clusters/media-playback-server \
+ ../third_party/connectedhomeip/src/app/clusters/network-commissioning \
../third_party/connectedhomeip/src/app/clusters/temperature-measurement-server \
../third_party/connectedhomeip/src/app/clusters/scenes \
../third_party/connectedhomeip/src/app/clusters/basic \
diff --git a/examples/bridge-app/bridge-common/BUILD.gn b/examples/bridge-app/bridge-common/BUILD.gn
index 2e7f42667d8945..90d5518ea01665 100644
--- a/examples/bridge-app/bridge-common/BUILD.gn
+++ b/examples/bridge-app/bridge-common/BUILD.gn
@@ -26,6 +26,8 @@ source_set("bridge-common") {
"${chip_root}/src/app/clusters/basic/basic.cpp",
"${chip_root}/src/app/clusters/bindings/bindings.cpp",
"${chip_root}/src/app/clusters/level-control/level-control.cpp",
+ "${chip_root}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp",
+ "${chip_root}/src/app/clusters/network-commissioning/network-commissioning.cpp",
"${chip_root}/src/app/clusters/on-off-server/on-off.cpp",
"${chip_root}/src/app/reporting/reporting-default-configuration.cpp",
"${chip_root}/src/app/reporting/reporting.cpp",
diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap
index 96ea807e80cb84..c788f1ec966d01 100644
--- a/examples/bridge-app/bridge-common/bridge-app.zap
+++ b/examples/bridge-app/bridge-common/bridge-app.zap
@@ -1,5 +1,5 @@
{
- "writeTime": "Tue Feb 16 2021 18:07:17 GMT+0100 (Central European Standard Time)",
+ "writeTime": "Fri Mar 12 2021 15:17:33 GMT+0800 (China Standard Time)",
"featureLevel": 11,
"creator": "zap",
"keyValuePairs": [
@@ -38,13 +38,30 @@
"deviceTypeProfileId": 260,
"clusters": [
{
- "name": "Basic",
- "code": 0,
+ "name": "Identify",
+ "code": 3,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "IDENTIFY_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Identify",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "IdentifyQuery",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -55,7 +72,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "3",
+ "defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
@@ -64,13 +81,12 @@
]
},
{
- "name": "Basic",
- "code": 0,
+ "name": "Identify",
+ "code": 3,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "IDENTIFY_CLUSTER",
"side": "server",
"enabled": 0,
- "commands": [],
"attributes": [
{
"name": "cluster revision",
@@ -81,14 +97,14 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "3",
+ "defaultValue": "2",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "ZCL version",
+ "name": "identify time",
"code": 0,
"mfgCode": null,
"side": "server",
@@ -96,47 +112,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "power source",
- "code": 7,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Identify",
- "code": 3,
- "mfgCode": null,
- "define": "IDENTIFY_CLUSTER",
- "side": "client",
- "enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
+ "defaultValue": "0x0000",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
@@ -145,80 +121,39 @@
],
"commands": [
{
- "name": "Identify",
+ "name": "IdentifyQueryResponse",
"code": 0,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
- },
- {
- "name": "IdentifyQuery",
- "code": 1,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
}
]
},
{
- "name": "Identify",
- "code": 3,
+ "name": "Groups",
+ "code": 4,
"mfgCode": null,
- "define": "IDENTIFY_CLUSTER",
- "side": "server",
+ "define": "GROUPS_CLUSTER",
+ "side": "client",
"enabled": 0,
- "commands": [
- {
- "name": "IdentifyQueryResponse",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 0,
- "outgoing": 1
- }
- ],
"attributes": [
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "identify time",
- "code": 0,
- "mfgCode": null,
- "side": "server",
+ "side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "3",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
- ]
- },
- {
- "name": "Groups",
- "code": 4,
- "mfgCode": null,
- "define": "GROUPS_CLUSTER",
- "side": "client",
- "enabled": 0,
+ ],
"commands": [
{
"name": "AddGroup",
@@ -268,23 +203,6 @@
"incoming": 1,
"outgoing": 0
}
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
]
},
{
@@ -451,6 +369,56 @@
"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": "cluster revision",
@@ -542,56 +510,6 @@
"maxInterval": 65344,
"reportableChange": 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
- }
]
},
{
@@ -817,18 +735,10 @@
"reportableChange": 0
}
]
- }
- ]
- },
- {
- "name": "Anonymous Endpoint Type",
- "deviceTypeName": "LO-colordimmablelight",
- "deviceTypeCode": 258,
- "deviceTypeProfileId": 260,
- "clusters": [
+ },
{
"name": "Basic",
- "code": 0,
+ "code": 40,
"mfgCode": null,
"define": "BASIC_CLUSTER",
"side": "client",
@@ -854,12 +764,37 @@
},
{
"name": "Basic",
- "code": 0,
+ "code": 40,
"mfgCode": null,
"define": "BASIC_CLUSTER",
"side": "server",
- "enabled": 0,
- "commands": [],
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "StartUp",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ShutDown",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Leave",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -877,7 +812,7 @@
"reportableChange": 0
},
{
- "name": "ZCL version",
+ "name": "InteractionModelVersion",
"code": 0,
"mfgCode": null,
"side": "server",
@@ -885,14 +820,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0x08",
+ "defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "application version",
+ "name": "VendorName",
"code": 1,
"mfgCode": null,
"side": "server",
@@ -900,14 +835,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "stack version",
+ "name": "VendorID",
"code": 2,
"mfgCode": null,
"side": "server",
@@ -915,14 +850,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "hardware version",
+ "name": "ProductName",
"code": 3,
"mfgCode": null,
"side": "server",
@@ -930,14 +865,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "manufacturer name",
+ "name": "ProductID",
"code": 4,
"mfgCode": null,
"side": "server",
@@ -952,7 +887,7 @@
"reportableChange": 0
},
{
- "name": "model identifier",
+ "name": "UserLabel",
"code": 5,
"mfgCode": null,
"side": "server",
@@ -967,7 +902,7 @@
"reportableChange": 0
},
{
- "name": "date code",
+ "name": "Location",
"code": 6,
"mfgCode": null,
"side": "server",
@@ -982,7 +917,7 @@
"reportableChange": 0
},
{
- "name": "power source",
+ "name": "HardwareVersion",
"code": 7,
"mfgCode": null,
"side": "server",
@@ -997,7 +932,7 @@
"reportableChange": 0
},
{
- "name": "generic device class",
+ "name": "HardwareVersionString",
"code": 8,
"mfgCode": null,
"side": "server",
@@ -1005,14 +940,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0xFF",
+ "defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "generic device type",
+ "name": "SoftwareVersion",
"code": 9,
"mfgCode": null,
"side": "server",
@@ -1020,14 +955,14 @@
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
- "defaultValue": "0xFF",
+ "defaultValue": "0x00",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
- "name": "product code",
+ "name": "SoftwareVersionString",
"code": 10,
"mfgCode": null,
"side": "server",
@@ -1040,39 +975,17 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
- },
- {
- "name": "product url",
- "code": 11,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "sw build id",
- "code": 16384,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
}
]
- },
+ }
+ ]
+ },
+ {
+ "name": "Anonymous Endpoint Type",
+ "deviceTypeName": "LO-colordimmablelight",
+ "deviceTypeCode": 258,
+ "deviceTypeProfileId": 260,
+ "clusters": [
{
"name": "Identify",
"code": 3,
@@ -1080,23 +993,6 @@
"define": "IDENTIFY_CLUSTER",
"side": "client",
"enabled": 0,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "Identify",
@@ -1122,6 +1018,23 @@
"incoming": 1,
"outgoing": 0
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -2089,88 +2002,330 @@
]
},
{
- "name": "Color Control",
- "code": 768,
+ "name": "Basic",
+ "code": 40,
"mfgCode": null,
- "define": "COLOR_CONTROL_CLUSTER",
+ "define": "BASIC_CLUSTER",
"side": "client",
"enabled": 0,
+ "commands": [],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "server",
+ "enabled": 1,
"commands": [
{
- "name": "MoveToHue",
+ "name": "StartUp",
"code": 0,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
- "outgoing": 0
+ "outgoing": 1
},
{
- "name": "MoveHue",
+ "name": "ShutDown",
"code": 1,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
- "outgoing": 0
+ "outgoing": 1
},
{
- "name": "StepHue",
+ "name": "Leave",
"code": 2,
"mfgCode": null,
- "source": "client",
+ "source": "server",
"incoming": 1,
- "outgoing": 0
- },
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
{
- "name": "MoveToSaturation",
- "code": 3,
+ "name": "cluster revision",
+ "code": 65533,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "MoveSaturation",
- "code": 4,
+ "name": "InteractionModelVersion",
+ "code": 0,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "StepSaturation",
- "code": 5,
+ "name": "VendorName",
+ "code": 1,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "MoveToHueAndSaturation",
- "code": 6,
+ "name": "VendorID",
+ "code": 2,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "MoveToColor",
- "code": 7,
+ "name": "ProductName",
+ "code": 3,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
},
{
- "name": "MoveColor",
- "code": 8,
+ "name": "ProductID",
+ "code": 4,
"mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
- },
- {
- "name": "StepColor",
- "code": 9,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UserLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "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": 0
+ },
+ {
+ "name": "MoveColor",
+ "code": 8,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "StepColor",
+ "code": 9,
"mfgCode": null,
"source": "client",
"incoming": 1,
@@ -3099,305 +3254,41 @@
"source": "server",
"incoming": 0,
"outgoing": 1
- }
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- }
- ]
- },
- {
- "name": "Anonymous Endpoint Type",
- "deviceTypeName": "LO-colortemperaturelight",
- "deviceTypeCode": 268,
- "deviceTypeProfileId": 260,
- "clusters": [
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "client",
- "enabled": 0,
- "commands": [],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "server",
- "enabled": 0,
- "commands": [],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "ZCL version",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "application version",
- "code": 1,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "stack version",
- "code": 2,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "hardware version",
- "code": 3,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "manufacturer name",
- "code": 4,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "model identifier",
- "code": 5,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "date code",
- "code": 6,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "power source",
- "code": 7,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "generic device class",
- "code": 8,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0xFF",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "generic device type",
- "code": 9,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0xFF",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "product code",
- "code": 10,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "product url",
- "code": 11,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "sw build id",
- "code": 16384,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Identify",
- "code": 3,
- "mfgCode": null,
- "define": "IDENTIFY_CLUSTER",
- "side": "client",
- "enabled": 0,
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
- "side": "client",
+ "side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "2",
+ "defaultValue": "0x0001",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
- ],
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Anonymous Endpoint Type",
+ "deviceTypeName": "LO-colortemperaturelight",
+ "deviceTypeCode": 268,
+ "deviceTypeProfileId": 260,
+ "clusters": [
+ {
+ "name": "Identify",
+ "code": 3,
+ "mfgCode": null,
+ "define": "IDENTIFY_CLUSTER",
+ "side": "client",
+ "enabled": 0,
"commands": [
{
"name": "Identify",
@@ -3423,6 +3314,23 @@
"incoming": 1,
"outgoing": 0
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -3432,16 +3340,6 @@
"define": "IDENTIFY_CLUSTER",
"side": "server",
"enabled": 0,
- "commands": [
- {
- "name": "IdentifyQueryResponse",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 0,
- "outgoing": 1
- }
- ],
"attributes": [
{
"name": "cluster revision",
@@ -3473,6 +3371,16 @@
"maxInterval": 65344,
"reportableChange": 0
}
+ ],
+ "commands": [
+ {
+ "name": "IdentifyQueryResponse",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ }
]
},
{
@@ -3482,6 +3390,23 @@
"define": "GROUPS_CLUSTER",
"side": "client",
"enabled": 0,
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
"commands": [
{
"name": "AddGroup",
@@ -3531,23 +3456,6 @@
"incoming": 1,
"outgoing": 0
}
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
]
},
{
@@ -5296,22 +5204,12 @@
"deviceTypeProfileId": 43981,
"clusters": [
{
- "name": "Basic",
- "code": 0,
+ "name": "Network Commissioning",
+ "code": 49,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [
- {
- "name": "ResetToFactoryDefaults",
- "code": 0,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 0
- }
- ],
"attributes": [
{
"name": "cluster revision",
@@ -5320,65 +5218,174 @@
"side": "client",
"included": 1,
"storageOption": "RAM",
- "singleton": 1,
+ "singleton": 0,
"bounded": 0,
- "defaultValue": "3",
+ "defaultValue": "0x0001",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
+ ],
+ "commands": [
+ {
+ "name": "ScanNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "AddWiFiNetwork",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "UpdateWiFiNetwork",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "AddThreadNetwork",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "UpdateThreadNetwork",
+ "code": 8,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 0
+ },
+ {
+ "name": "RemoveNetwork",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "EnableNetwork",
+ "code": 12,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "DisableNetwork",
+ "code": 14,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "GetLastNetworkCommissioningResult",
+ "code": 16,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
]
},
{
- "name": "Basic",
- "code": 0,
+ "name": "Network Commissioning",
+ "code": 49,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
"side": "server",
"enabled": 1,
- "commands": [],
- "attributes": [
+ "commands": [
{
- "name": "cluster revision",
- "code": 65533,
+ "name": "ScanNetworksResponse",
+ "code": 1,
"mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
},
{
- "name": "ZCL version",
- "code": 0,
+ "name": "AddWiFiNetworkResponse",
+ "code": 3,
"mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 1,
- "bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
},
{
- "name": "power source",
+ "name": "UpdateWiFiNetworkResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "AddThreadNetworkResponse",
"code": 7,
"mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateThreadNetworkResponse",
+ "code": 9,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveNetworkResponse",
+ "code": 11,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "EnableNetworkResponse",
+ "code": 13,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "DisableNetworkResponse",
+ "code": 15,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
- "singleton": 1,
+ "singleton": 0,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "0x0001",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
@@ -5419,4 +5426,4 @@
"networkId": 0
}
]
-}
+}
\ No newline at end of file
diff --git a/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.cpp b/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.cpp
index f5f88af110c2c7..fc5ea3b1b8a7c6 100644
--- a/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.cpp
+++ b/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.cpp
@@ -272,10 +272,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -289,6 +285,48 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
@@ -696,10 +734,6 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -710,6 +744,48 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
diff --git a/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.h b/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.h
index 14a3742f090e8f..d028079f799d79 100644
--- a/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.h
+++ b/examples/bridge-app/bridge-common/gen/CHIPClientCallbacks.h
@@ -20,6 +20,7 @@
#pragma once
#include
+#include
// Global Response Callbacks
typedef void (*DefaultSuccessCallback)(void * context);
@@ -33,6 +34,7 @@ typedef void (*Int32uAttributeCallback)(void * context, uint32_t value);
typedef void (*Int32sAttributeCallback)(void * context, int32_t value);
typedef void (*Int64uAttributeCallback)(void * context, uint64_t value);
typedef void (*Int64sAttributeCallback)(void * context, int64_t value);
+typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value);
typedef void (*ReadReportingConfigurationReportedCallback)(void * context, uint16_t minInterval, uint16_t maxInterval);
typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint16_t timeout);
diff --git a/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.h b/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.h
index 6321b004fc72f7..b066625c88ce44 100644
--- a/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.h
+++ b/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.h
@@ -48,21 +48,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface CHIPBasic : CHIPCluster
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler;
-
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler;
-- (void)readAttributeApplicationVersion:(ResponseHandler)completionHandler;
-- (void)readAttributeStackVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler;
+- (void)readAttributeProductName:(ResponseHandler)completionHandler;
+- (void)readAttributeProductID:(ResponseHandler)completionHandler;
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler;
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
+- (void)readAttributeLocation:(ResponseHandler)completionHandler;
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler;
-- (void)readAttributeManufacturerName:(ResponseHandler)completionHandler;
-- (void)readAttributeModelIdentifier:(ResponseHandler)completionHandler;
-- (void)readAttributeDateCode:(ResponseHandler)completionHandler;
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler;
-- (void)readAttributeGenericDeviceClass:(ResponseHandler)completionHandler;
-- (void)readAttributeGenericDeviceType:(ResponseHandler)completionHandler;
-- (void)readAttributeProductCode:(ResponseHandler)completionHandler;
-- (void)readAttributeProductUrl:(ResponseHandler)completionHandler;
-- (void)readAttributeSwBuildId:(ResponseHandler)completionHandler;
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler;
- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
@end
@@ -115,6 +113,52 @@ NS_ASSUME_NONNULL_BEGIN
@end
+/**
+ * Cluster Network Commissioning
+ *
+ */
+@interface CHIPNetworkCommissioning : CHIPCluster
+
+- (void)addThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)addWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)disableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)enableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler;
+- (void)removeNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)scanNetworks:(NSData *)ssid
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler;
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
+
+@end
+
/**
* Cluster On/off
*
diff --git a/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.mm b/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.mm
index 98ddbecdf8e85a..8b04fffcbe65c8 100644
--- a/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.mm
+++ b/examples/bridge-app/bridge-common/gen/CHIPClustersObjc.mm
@@ -21,7 +21,7 @@
#import "CHIPDevice.h"
#import "CHIPDevice_Internal.h"
-#import "ChipError.h"
+#import "CHIPError.h"
#import "gen/CHIPClientCallbacks.h"
#import "gen/CHIPClustersObjc.h"
@@ -89,26 +89,38 @@ static void CallbackFn(void * context, uint8_t status)
dispatch_queue_t mQueue;
};
-class CHIPUnsupportedAttributeCallbackBridge : public Callback::Callback {
+class CHIPStringAttributeCallbackBridge : public Callback::Callback {
public:
- CHIPUnsupportedAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
- : Callback::Callback(CallbackFn, this)
+ CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mOctetString(octetString)
+ , mKeepAlive(keepAlive)
{
}
- ~CHIPUnsupportedAttributeCallbackBridge() {};
+ ~CHIPStringAttributeCallbackBridge() {};
- static void CallbackFn(void * context)
+ static void CallbackFn(void * context, chip::ByteSpan value)
{
- CHIPUnsupportedAttributeCallbackBridge * callback = reinterpret_cast(context);
+ CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context);
if (callback && callback->mQueue) {
dispatch_async(callback->mQueue, ^{
- NSError * error = [NSError errorWithDomain:CHIPErrorDomain
- code:CHIPErrorCodeUndefinedError
- userInfo:@ { NSLocalizedDescriptionKey : @"Unsupported attribute type" }];
- callback->mHandler(error, nil);
- callback->Cancel();
- delete callback;
+ if (callback->mOctetString) {
+ NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
+ callback->mHandler(nil, @ { @"value" : data });
+ } else {
+ NSString * str = [[NSString alloc] initWithBytes:value.data()
+ length:value.size()
+ encoding:NSUTF8StringEncoding];
+ callback->mHandler(nil, @ { @"value" : str });
+ }
+
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
});
}
};
@@ -116,6 +128,8 @@ static void CallbackFn(void * context)
private:
ResponseHandler mHandler;
dispatch_queue_t mQueue;
+ bool mOctetString;
+ bool mKeepAlive;
};
class CHIPBooleanAttributeCallbackBridge : public Callback::Callback {
@@ -246,6 +260,70 @@ static void CallbackFn(void * context, uint16_t value)
bool mKeepAlive;
};
+class CHIPInt32uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt32uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint32_t value)
+ {
+ CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
+class CHIPInt64uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt64uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint64_t value)
+ {
+ CHIPInt64uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLongLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
class CHIPInt16sAttributeCallbackBridge : public Callback::Callback {
public:
CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
@@ -319,32 +397,9 @@ @implementation CHIPBasic
return &_cppCluster;
}
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
-{
- CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
- if (!onSuccess) {
- completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
- return;
- }
-
- CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
- if (!onFailure) {
- delete onSuccess;
- completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
- return;
- }
-
- CHIP_ERROR err = self.cppCluster.ResetToFactoryDefaults(onSuccess->Cancel(), onFailure->Cancel());
- if (err != CHIP_NO_ERROR) {
- delete onSuccess;
- delete onFailure;
- completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
- }
-}
-
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -357,7 +412,7 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeZclVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -365,9 +420,10 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeApplicationVersion:(ResponseHandler)completionHandler
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -380,7 +436,7 @@ - (void)readAttributeApplicationVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -388,9 +444,9 @@ - (void)readAttributeApplicationVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeStackVersion:(ResponseHandler)completionHandler
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -403,7 +459,7 @@ - (void)readAttributeStackVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeStackVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -411,9 +467,10 @@ - (void)readAttributeStackVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
+- (void)readAttributeProductName:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -426,7 +483,7 @@ - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -434,10 +491,9 @@ - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeManufacturerName:(ResponseHandler)completionHandler
+- (void)readAttributeProductID:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -450,7 +506,7 @@ - (void)readAttributeManufacturerName:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeManufacturerName(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -458,10 +514,10 @@ - (void)readAttributeManufacturerName:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeModelIdentifier:(ResponseHandler)completionHandler
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -474,7 +530,7 @@ - (void)readAttributeModelIdentifier:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeModelIdentifier(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -482,10 +538,9 @@ - (void)readAttributeModelIdentifier:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeDateCode:(ResponseHandler)completionHandler
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -498,7 +553,9 @@ - (void)readAttributeDateCode:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeDateCode(onSuccess->Cancel(), onFailure->Cancel());
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -506,9 +563,10 @@ - (void)readAttributeDateCode:(ResponseHandler)completionHandler
}
}
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler
+- (void)readAttributeLocation:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -521,7 +579,7 @@ - (void)readAttributePowerSource:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributePowerSource(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -529,9 +587,9 @@ - (void)readAttributePowerSource:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeGenericDeviceClass:(ResponseHandler)completionHandler
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -544,7 +602,9 @@ - (void)readAttributeGenericDeviceClass:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeGenericDeviceClass(onSuccess->Cancel(), onFailure->Cancel());
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -552,9 +612,9 @@ - (void)readAttributeGenericDeviceClass:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeGenericDeviceType:(ResponseHandler)completionHandler
+- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -567,7 +627,7 @@ - (void)readAttributeGenericDeviceType:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeGenericDeviceType(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -575,10 +635,10 @@ - (void)readAttributeGenericDeviceType:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeProductCode:(ResponseHandler)completionHandler
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -591,7 +651,7 @@ - (void)readAttributeProductCode:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeProductCode(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -599,10 +659,9 @@ - (void)readAttributeProductCode:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeProductUrl:(ResponseHandler)completionHandler
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -615,7 +674,7 @@ - (void)readAttributeProductUrl:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeProductUrl(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -623,10 +682,10 @@ - (void)readAttributeProductUrl:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeSwBuildId:(ResponseHandler)completionHandler
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -639,7 +698,7 @@ - (void)readAttributeSwBuildId:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeSwBuildId(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -1085,6 +1144,285 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
@end
+@interface CHIPNetworkCommissioning ()
+@property (readonly) Controller::NetworkCommissioningCluster cppCluster;
+@end
+
+@implementation CHIPNetworkCommissioning
+
+- (Controller::ClusterBase *)getCluster
+{
+ return &_cppCluster;
+}
+
+- (void)addThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.AddThreadNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) operationalDataset.bytes, operationalDataset.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)addWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.AddWiFiNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length),
+ chip::ByteSpan((const uint8_t *) credentials.bytes, credentials.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)disableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.DisableNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)enableNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.EnableNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.GetLastNetworkCommissioningResult(onSuccess->Cancel(), onFailure->Cancel(), timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)removeNetwork:(NSData *)networkID
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.RemoveNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) networkID.bytes, networkID.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)scanNetworks:(NSData *)ssid
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ScanNetworks(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateThreadNetwork:(NSData *)operationalDataset
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateThreadNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) operationalDataset.bytes, operationalDataset.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateWiFiNetwork:(NSData *)ssid
+ credentials:(NSData *)credentials
+ breadcrumb:(uint64_t)breadcrumb
+ timeoutMs:(uint32_t)timeoutMs
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge * onSuccess
+ = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateWiFiNetwork(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) ssid.bytes, ssid.length),
+ chip::ByteSpan((const uint8_t *) credentials.bytes, credentials.length), breadcrumb, timeoutMs);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+@end
+
@interface CHIPOnOff ()
@property (readonly) Controller::OnOffCluster cppCluster;
@end
diff --git a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
index b08b0bc9b45077..38e77a95d8b37c 100644
--- a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp
@@ -39,30 +39,6 @@ namespace app {
namespace clusters {
-namespace Basic {
-
-void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
-{
- {
- switch (commandId)
- {
- case ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID: {
- // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
- emberAfBasicClusterResetToFactoryDefaultsCallback();
- break;
- }
- default: {
- // Unrecognized command ID, error status will apply.
- // TODO: Encode response for command not found
- ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, commandId, ZCL_BASIC_CLUSTER_ID);
- break;
- }
- }
- }
-}
-
-} // namespace Basic
-
namespace LevelControl {
void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
@@ -329,6 +305,335 @@ void DispatchServerCommand(app::Command * command, CommandId commandId, Endpoint
} // namespace LevelControl
+namespace NetworkCommissioning {
+
+void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
+{
+ {
+ switch (commandId)
+ {
+ case ZCL_ADD_THREAD_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(operationalDataset);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterAddThreadNetworkCallback(const_cast(operationalDataset), breadcrumb,
+ timeoutMs);
+ break;
+ }
+ case ZCL_ADD_WI_FI_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ const uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.GetDataPtr(credentials);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 3:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(const_cast(ssid),
+ const_cast(credentials), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_DISABLE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(networkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterDisableNetworkCallback(const_cast(networkID), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ENABLE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(networkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterEnableNetworkCallback(const_cast(networkID), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(timeoutMs);
+ break;
+ }
+ case ZCL_REMOVE_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * NetworkID;
+ uint64_t Breadcrumb;
+ uint32_t TimeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(NetworkID);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(Breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(TimeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterRemoveNetworkCallback(const_cast(NetworkID), Breadcrumb, TimeoutMs);
+ break;
+ }
+ case ZCL_SCAN_NETWORKS_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterScanNetworksCallback(const_cast(ssid), breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(operationalDataset);
+ break;
+ case 1:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(const_cast(operationalDataset), breadcrumb,
+ timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID: {
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ const uint8_t * ssid;
+ const uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ while ((TLVError = dataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(dataTlv.GetTag()))
+ {
+ case 0:
+ TLVError = dataTlv.GetDataPtr(ssid);
+ break;
+ case 1:
+ TLVError = dataTlv.GetDataPtr(credentials);
+ break;
+ case 2:
+ TLVError = dataTlv.Get(breadcrumb);
+ break;
+ case 3:
+ TLVError = dataTlv.Get(timeoutMs);
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(dataTlv.GetTag()), TLVError);
+ }
+ }
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(const_cast(ssid),
+ const_cast(credentials), breadcrumb, timeoutMs);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ // TODO: Encode response for command not found
+ ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, commandId, ZCL_NETWORK_COMMISSIONING_CLUSTER_ID);
+ break;
+ }
+ }
+ }
+}
+
+} // namespace NetworkCommissioning
+
namespace OnOff {
void DispatchServerCommand(app::Command * command, CommandId commandId, EndpointId endpointId, TLV::TLVReader & dataTlv)
@@ -373,12 +678,12 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC
Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId);
switch (aClusterId)
{
- case ZCL_BASIC_CLUSTER_ID:
- clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
- break;
case ZCL_LEVEL_CONTROL_CLUSTER_ID:
clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
diff --git a/examples/bridge-app/bridge-common/gen/attribute-id.h b/examples/bridge-app/bridge-common/gen/attribute-id.h
index 8802797f112bd6..72a0198e2f97be 100644
--- a/examples/bridge-app/bridge-common/gen/attribute-id.h
+++ b/examples/bridge-app/bridge-common/gen/attribute-id.h
@@ -26,30 +26,6 @@
#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE)
#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE)
-// Attribute ids for cluster: Basic
-
-// Client attributes
-
-// Server attributes
-#define ZCL_VERSION_ATTRIBUTE_ID (0x0000)
-#define ZCL_APPLICATION_VERSION_ATTRIBUTE_ID (0x0001)
-#define ZCL_STACK_VERSION_ATTRIBUTE_ID (0x0002)
-#define ZCL_HW_VERSION_ATTRIBUTE_ID (0x0003)
-#define ZCL_MANUFACTURER_NAME_ATTRIBUTE_ID (0x0004)
-#define ZCL_MODEL_IDENTIFIER_ATTRIBUTE_ID (0x0005)
-#define ZCL_DATE_CODE_ATTRIBUTE_ID (0x0006)
-#define ZCL_POWER_SOURCE_ATTRIBUTE_ID (0x0007)
-#define ZCL_GENERIC_DEVICE_CLASS_ATTRIBUTE_ID (0x0008)
-#define ZCL_GENERIC_DEVICE_TYPE_ATTRIBUTE_ID (0x0009)
-#define ZCL_PRODUCT_CODE_ATTRIBUTE_ID (0x000A)
-#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000B)
-#define ZCL_LOCATION_DESCRIPTION_ATTRIBUTE_ID (0x0010)
-#define ZCL_PHYSICAL_ENVIRONMENT_ATTRIBUTE_ID (0x0011)
-#define ZCL_DEVICE_ENABLED_ATTRIBUTE_ID (0x0012)
-#define ZCL_ALARM_MASK_ATTRIBUTE_ID (0x0013)
-#define ZCL_DISABLE_LOCAL_CONFIG_ATTRIBUTE_ID (0x0014)
-#define ZCL_SW_BUILD_ID_ATTRIBUTE_ID (0x4000)
-
// Attribute ids for cluster: Power Configuration
// Client attributes
@@ -384,6 +360,29 @@
#define ZCL_KEEPALIVE_BASE_ATTRIBUTE_ID (0x0000)
#define ZCL_KEEPALIVE_JITTER_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Basic
+
+// Client attributes
+
+// Server attributes
+#define ZCL_INTERACTION_MODEL_VERSION_ATTRIBUTE_ID (0x0000)
+#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0001)
+#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0002)
+#define ZCL_PRODUCT_NAME_ATTRIBUTE_ID (0x0003)
+#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0004)
+#define ZCL_USER_LABEL_ATTRIBUTE_ID (0x0005)
+#define ZCL_LOCATION_ATTRIBUTE_ID (0x0006)
+#define ZCL_HARDWARE_VERSION_ATTRIBUTE_ID (0x0007)
+#define ZCL_HARDWARE_VERSION_STRING_ATTRIBUTE_ID (0x0008)
+#define ZCL_SOFTWARE_VERSION_ATTRIBUTE_ID (0x0009)
+#define ZCL_SOFTWARE_VERSION_STRING_ATTRIBUTE_ID (0x000A)
+#define ZCL_MANUFACTURING_DATE_ATTRIBUTE_ID (0x000B)
+#define ZCL_PART_NUMBER_ATTRIBUTE_ID (0x000C)
+#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000D)
+#define ZCL_PRODUCT_LABEL_ATTRIBUTE_ID (0x000E)
+#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x000F)
+#define ZCL_LOCAL_CONFIG_DISABLED_ATTRIBUTE_ID (0x0010)
+
// Attribute ids for cluster: General Commissioning
// Client attributes
@@ -392,6 +391,12 @@
#define ZCL_FABRIC_ID_ATTRIBUTE_ID (0x0000)
#define ZCL_BREADCRUMB_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Network Commissioning
+
+// Client attributes
+
+// Server attributes
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
@@ -1093,15 +1098,21 @@
// Server attributes
#define ZCL_MAX_DURATION_ATTRIBUTE_ID (0x0000)
+// Attribute ids for cluster: Low Power
+
+// Client attributes
+
+// Server attributes
+
// Attribute ids for cluster: Application Basic
// Client attributes
// Server attributes
-#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
-#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0001)
+#define ZCL_APPLICATION_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
+#define ZCL_APPLICATION_VENDOR_ID_ATTRIBUTE_ID (0x0001)
#define ZCL_APPLICATION_NAME_ATTRIBUTE_ID (0x0002)
-#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
+#define ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
#define ZCL_APPLICATION_ID_ATTRIBUTE_ID (0x0005)
#define ZCL_CATALOG_VENDOR_ID_ATTRIBUTE_ID (0x0006)
#define ZCL_APPLICATION_STATUS_ATTRIBUTE_ID (0x0007)
@@ -3833,7 +3844,7 @@
#define ZCL_PRICE_TRAILING_DIGIT_ATTRIBUTE_ID (0x0021)
#define ZCL_PRICE_ATTRIBUTE_ID (0x0022)
#define ZCL_GOOD_ID_ATTRIBUTE_ID (0x0030)
-#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
+#define ZCL_PAYMENT_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
#define ZCL_PAYMENT_TIMESTAMP_ATTRIBUTE_ID (0x0032)
#define ZCL_TRANS_ID_ATTRIBUTE_ID (0x0033)
#define ZCL_TRANS_STATUS_ATTRIBUTE_ID (0x0034)
@@ -4079,12 +4090,6 @@
// Server attributes
-// Attribute ids for cluster: Network Commissioning
-
-// Client attributes
-
-// Server attributes
-
// Attribute ids for cluster: Binding
// Client attributes
diff --git a/examples/bridge-app/bridge-common/gen/call-command-handler.cpp b/examples/bridge-app/bridge-common/gen/call-command-handler.cpp
index d1a86ac8a37a67..4680bec8290107 100644
--- a/examples/bridge-app/bridge-common/gen/call-command-handler.cpp
+++ b/examples/bridge-app/bridge-common/gen/call-command-handler.cpp
@@ -30,6 +30,7 @@ using namespace chip;
EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd);
+EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd);
static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific)
@@ -72,11 +73,15 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
switch (cmd->apsFrame->clusterId)
{
case ZCL_BASIC_CLUSTER_ID:
- result = emberAfBasicClusterServerCommandParse(cmd);
+ // No commands are enabled for cluster Basic
+ result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_LEVEL_CONTROL_CLUSTER_ID:
result = emberAfLevelControlClusterServerCommandParse(cmd);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ result = emberAfNetworkCommissioningClusterServerCommandParse(cmd);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
result = emberAfOnOffClusterServerCommandParse(cmd);
break;
@@ -90,26 +95,6 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
// Cluster specific command parsing
-EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand * cmd)
-{
- bool wasHandled = false;
-
- if (!cmd->mfgSpecific)
- {
- switch (cmd->commandId)
- {
- case ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID: {
- wasHandled = emberAfBasicClusterResetToFactoryDefaultsCallback();
- break;
- }
- default: {
- // Unrecognized command ID, error status will apply.
- break;
- }
- }
- }
- return status(wasHandled, true, cmd->mfgSpecific);
-}
EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
@@ -326,6 +311,265 @@ EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand
}
return status(wasHandled, true, cmd->mfgSpecific);
}
+EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd)
+{
+ bool wasHandled = false;
+
+ if (!cmd->mfgSpecific)
+ {
+ switch (cmd->commandId)
+ {
+ case ZCL_ADD_THREAD_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ operationalDataset = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(operationalDataset) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ADD_WI_FI_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ credentials = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(credentials) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_DISABLE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ networkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(networkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(networkID, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_ENABLE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * networkID;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ networkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(networkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(networkID, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(timeoutMs);
+ break;
+ }
+ case ZCL_REMOVE_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * NetworkID;
+ uint64_t Breadcrumb;
+ uint32_t TimeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ NetworkID = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(NetworkID) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ Breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ TimeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(NetworkID, Breadcrumb, TimeoutMs);
+ break;
+ }
+ case ZCL_SCAN_NETWORKS_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback(ssid, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * operationalDataset;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ operationalDataset = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(operationalDataset) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
+ break;
+ }
+ case ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * ssid;
+ uint8_t * credentials;
+ uint64_t breadcrumb;
+ uint32_t timeoutMs;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ ssid = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(ssid) + 1u);
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ credentials = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + emberAfStringLength(credentials) + 1u);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 4)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ break;
+ }
+ }
+ }
+ return status(wasHandled, true, cmd->mfgSpecific);
+}
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
diff --git a/examples/bridge-app/bridge-common/gen/callback-stub.cpp b/examples/bridge-app/bridge-common/gen/callback-stub.cpp
index eed6cef3a28321..f40262e72697b7 100644
--- a/examples/bridge-app/bridge-common/gen/callback-stub.cpp
+++ b/examples/bridge-app/bridge-common/gen/callback-stub.cpp
@@ -33,6 +33,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_LEVEL_CONTROL_CLUSTER_ID:
emberAfLevelControlClusterInitCallback(endpoint);
break;
+ case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
+ emberAfNetworkCommissioningClusterInitCallback(endpoint);
+ break;
case ZCL_ON_OFF_CLUSTER_ID:
emberAfOnOffClusterInitCallback(endpoint);
break;
@@ -52,6 +55,11 @@ void __attribute__((weak)) emberAfLevelControlClusterInitCallback(EndpointId end
// To prevent warning
(void) endpoint;
}
+void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint)
+{
+ // To prevent warning
+ (void) endpoint;
+}
void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
diff --git a/examples/bridge-app/bridge-common/gen/callback.h b/examples/bridge-app/bridge-common/gen/callback.h
index 6b284ee368dc37..dfac28f4dfce71 100644
--- a/examples/bridge-app/bridge-common/gen/callback.h
+++ b/examples/bridge-app/bridge-common/gen/callback.h
@@ -53,6 +53,14 @@ void emberAfBasicClusterInitCallback(chip::EndpointId endpoint);
*/
void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint);
+/** @brief Network Commissioning Cluster Init
+ *
+ * Cluster Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint);
+
/** @brief On/off Cluster Init
*
* Cluster Init
@@ -201,6 +209,77 @@ EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::
*/
void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint);
+//
+// Network Commissioning Cluster server
+//
+
+/** @brief Network Commissioning Cluster Server Init
+ *
+ * Server Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfNetworkCommissioningClusterServerInitCallback(chip::EndpointId endpoint);
+
+/** @brief Network Commissioning Cluster Server Attribute Changed
+ *
+ * Server Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ */
+void emberAfNetworkCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
+
+/** @brief Network Commissioning Cluster Server Manufacturer Specific Attribute Changed
+ *
+ * Server Manufacturer Specific Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ * @param manufacturerCode Manufacturer Code of the attribute that changed
+ */
+void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ uint16_t manufacturerCode);
+
+/** @brief Network Commissioning Cluster Server Message Sent
+ *
+ * Server Message Sent
+ *
+ * @param type The type of message sent
+ * @param indexOrDestination The destination or address to which the message was sent
+ * @param apsFrame The APS frame for the message
+ * @param msgLen The length of the message
+ * @param message The message that was sent
+ * @param status The status of the sent message
+ */
+void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
+ EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
+ EmberStatus status);
+
+/** @brief Network Commissioning Cluster Server Pre Attribute Changed
+ *
+ * server Pre Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ EmberAfAttributeType attributeType, uint8_t size,
+ uint8_t * value);
+
+/** @brief Network Commissioning Cluster Server Tick
+ *
+ * server Tick
+ *
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint);
+
//
// On/off Cluster server
//
@@ -271,12 +350,6 @@ void emberAfOnOffClusterServerTickCallback(chip::EndpointId endpoint);
// Cluster Commands Callback
-/**
- * @brief Basic Cluster ResetToFactoryDefaults Command callback
- */
-
-bool emberAfBasicClusterResetToFactoryDefaultsCallback();
-
/**
* @brief Level Control Cluster Move Command callback
* @param moveMode
@@ -349,6 +422,91 @@ bool emberAfLevelControlClusterStopCallback(uint8_t optionMask, uint8_t optionOv
bool emberAfLevelControlClusterStopWithOnOffCallback();
+/**
+ * @brief Network Commissioning Cluster AddThreadNetwork Command callback
+ * @param operationalDataset
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster AddWiFiNetwork Command callback
+ * @param ssid
+ * @param credentials
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster DisableNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterDisableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster EnableNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterEnableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster RemoveNetwork Command callback
+ * @param networkID
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(uint8_t * NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster ScanNetworks Command callback
+ * @param ssid
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterScanNetworksCallback(uint8_t * ssid, uint64_t breadcrumb, uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster UpdateThreadNetwork Command callback
+ * @param operationalDataset
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
+/**
+ * @brief Network Commissioning Cluster UpdateWiFiNetwork Command callback
+ * @param ssid
+ * @param credentials
+ * @param breadcrumb
+ * @param timeoutMs
+ */
+
+bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
+ uint32_t timeoutMs);
+
/**
* @brief On/off Cluster Off Command callback
*/
diff --git a/examples/bridge-app/bridge-common/gen/client-command-macro.h b/examples/bridge-app/bridge-common/gen/client-command-macro.h
index 97de7f69cfff1d..79d1e159594a4a 100644
--- a/examples/bridge-app/bridge-common/gen/client-command-macro.h
+++ b/examples/bridge-app/bridge-common/gen/client-command-macro.h
@@ -256,15 +256,6 @@
emberAfFillExternalBuffer(mask, clusterId, ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID, "ub", discoveryComplete, \
extendedDiscoverAttributesInfoRecords, extendedDiscoverAttributesInfoRecordsLen);
-/** @brief Command description for ResetToFactoryDefaults
- *
- * Command: ResetToFactoryDefaults
- */
-#define emberAfFillCommandBasicClusterResetToFactoryDefaults() \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID, "", );
-
/** @brief Command description for Identify
*
* Command: Identify
@@ -1795,6 +1786,33 @@
totalNumberOfNonEmptyProxyTableEntries, gpdSrcId, startIndex, gpdIeee, entriesCount, endpoint, \
proxyTableEntries, proxyTableEntriesLen, index);
+/** @brief Command description for StartUp
+ *
+ * Command: StartUp
+ */
+#define emberAfFillCommandBasicClusterStartUp() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_START_UP_COMMAND_ID, "", );
+
+/** @brief Command description for ShutDown
+ *
+ * Command: ShutDown
+ */
+#define emberAfFillCommandBasicClusterShutDown() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SHUT_DOWN_COMMAND_ID, "", );
+
+/** @brief Command description for Leave
+ *
+ * Command: Leave
+ */
+#define emberAfFillCommandBasicClusterLeave() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_LEAVE_COMMAND_ID, "", );
+
/** @brief Command description for SetFabric
*
* Command: SetFabric
@@ -1893,6 +1911,225 @@
\
ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+/** @brief Command description for ScanNetworks
+ *
+ * Command: ScanNetworks
+ * @param ssid OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
+
+/** @brief Command description for ScanNetworksResponse
+ *
+ * Command: ScanNetworksResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ * @param wifiScanResults WiFiInterfaceScanResult []
+ * @param wifiScanResultsLen int
+ * @param threadScanResults ThreadInterfaceScanResult []
+ * @param threadScanResultsLen int
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
+ threadScanResultsLen) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
+ wifiScanResultsLen, threadScanResults, threadScanResultsLen);
+
+/** @brief Command description for AddWiFiNetwork
+ *
+ * Command: AddWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddWiFiNetworkResponse
+ *
+ * Command: AddWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateWiFiNetwork
+ *
+ * Command: UpdateWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateWiFiNetworkResponse
+ *
+ * Command: UpdateWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for AddThreadNetwork
+ *
+ * Command: AddThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddThreadNetworkResponse
+ *
+ * Command: AddThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateThreadNetwork
+ *
+ * Command: UpdateThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateThreadNetworkResponse
+ *
+ * Command: UpdateThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for RemoveNetwork
+ *
+ * Command: RemoveNetwork
+ * @param NetworkID OCTET_STRING
+ * @param Breadcrumb INT64U
+ * @param TimeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
+
+/** @brief Command description for RemoveNetworkResponse
+ *
+ * Command: RemoveNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for EnableNetwork
+ *
+ * Command: EnableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for EnableNetworkResponse
+ *
+ * Command: EnableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for DisableNetwork
+ *
+ * Command: DisableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for DisableNetworkResponse
+ *
+ * Command: DisableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for GetLastNetworkCommissioningResult
+ *
+ * Command: GetLastNetworkCommissioningResult
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
@@ -2964,6 +3201,15 @@
\
ZCL_SQUAWK_COMMAND_ID, "u", squawkInfo);
+/** @brief Command description for Sleep
+ *
+ * Command: Sleep
+ */
+#define emberAfFillCommandLow \
+ PowerClusterSleep() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SLEEP_COMMAND_ID, "", );
+
/** @brief Command description for MatchProtocolAddress
*
* Command: MatchProtocolAddress
@@ -5756,225 +6002,6 @@
ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \
endpointInformationRecordList, endpointInformationRecordListLen);
-/** @brief Command description for ScanNetworks
- *
- * Command: ScanNetworks
- * @param ssid OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
-
-/** @brief Command description for ScanNetworksResponse
- *
- * Command: ScanNetworksResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- * @param wifiScanResults WiFiInterfaceScanResult []
- * @param wifiScanResultsLen int
- * @param threadScanResults ThreadInterfaceScanResult []
- * @param threadScanResultsLen int
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
- threadScanResultsLen) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
- wifiScanResultsLen, threadScanResults, threadScanResultsLen);
-
-/** @brief Command description for AddWiFiNetwork
- *
- * Command: AddWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddWiFiNetworkResponse
- *
- * Command: AddWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateWiFiNetwork
- *
- * Command: UpdateWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateWiFiNetworkResponse
- *
- * Command: UpdateWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for AddThreadNetwork
- *
- * Command: AddThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddThreadNetworkResponse
- *
- * Command: AddThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateThreadNetwork
- *
- * Command: UpdateThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateThreadNetworkResponse
- *
- * Command: UpdateThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for RemoveNetwork
- *
- * Command: RemoveNetwork
- * @param NetworkID OCTET_STRING
- * @param Breadcrumb INT64U
- * @param TimeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
-
-/** @brief Command description for RemoveNetworkResponse
- *
- * Command: RemoveNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for EnableNetwork
- *
- * Command: EnableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for EnableNetworkResponse
- *
- * Command: EnableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for DisableNetwork
- *
- * Command: DisableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for DisableNetworkResponse
- *
- * Command: DisableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for GetLastNetworkCommissioningResult
- *
- * Command: GetLastNetworkCommissioningResult
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
-
/** @brief Command description for Bind
*
* Command: Bind
diff --git a/examples/bridge-app/bridge-common/gen/cluster-id.h b/examples/bridge-app/bridge-common/gen/cluster-id.h
index 99de14e2586034..add8f83d188cf8 100644
--- a/examples/bridge-app/bridge-common/gen/cluster-id.h
+++ b/examples/bridge-app/bridge-common/gen/cluster-id.h
@@ -20,9 +20,6 @@
// Prevent multiple inclusion
#pragma once
-// Definitions for cluster: Basic
-#define ZCL_BASIC_CLUSTER_ID (0x0000)
-
// Definitions for cluster: Power Configuration
#define ZCL_POWER_CONFIG_CLUSTER_ID (0x0001)
@@ -83,9 +80,15 @@
// Definitions for cluster: Keep-Alive
#define ZCL_KEEPALIVE_CLUSTER_ID (0x0025)
+// Definitions for cluster: Basic
+#define ZCL_BASIC_CLUSTER_ID (0x0028)
+
// Definitions for cluster: General Commissioning
#define ZCL_GENERAL_COMMISSIONING_CLUSTER_ID (0x0030)
+// Definitions for cluster: Network Commissioning
+#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
@@ -239,6 +242,9 @@
// Definitions for cluster: IAS WD
#define ZCL_IAS_WD_CLUSTER_ID (0x0502)
+// Definitions for cluster: Low Power
+#define ZCL_LOW_POWER_CLUSTER_ID (0x0508)
+
// Definitions for cluster: Application Basic
#define ZCL_APPLICATION_BASIC_CLUSTER_ID (0x050D)
@@ -338,9 +344,6 @@
// Definitions for cluster: ZLL Commissioning
#define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000)
-// Definitions for cluster: Network Commissioning
-#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0xAAAA)
-
// Definitions for cluster: Binding
#define ZCL_BINDING_CLUSTER_ID (0xF000)
diff --git a/examples/bridge-app/bridge-common/gen/command-id.h b/examples/bridge-app/bridge-common/gen/command-id.h
index d31a267c6254af..864943b5727fcd 100644
--- a/examples/bridge-app/bridge-common/gen/command-id.h
+++ b/examples/bridge-app/bridge-common/gen/command-id.h
@@ -45,10 +45,6 @@
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15)
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16)
-// Commands for cluster: Basic
-#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
-#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
-
// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
#define ZCL_IDENTIFY_QUERY_RESPONSE_COMMAND_ID (0x00)
@@ -226,6 +222,12 @@
#define ZCL_GP_PROXY_TABLE_RESPONSE_COMMAND_ID (0x0B)
#define ZCL_GP_PROXY_TABLE_REQUEST_COMMAND_ID (0x0B)
+// Commands for cluster: Basic
+#define ZCL_START_UP_COMMAND_ID (0x00)
+#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
+#define ZCL_SHUT_DOWN_COMMAND_ID (0x01)
+#define ZCL_LEAVE_COMMAND_ID (0x02)
+
// Commands for cluster: General Commissioning
#define ZCL_SET_FABRIC_COMMAND_ID (0x00)
#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01)
@@ -236,6 +238,25 @@
#define ZCL_COMMISSIONING_COMPLETE_COMMAND_ID (0x06)
#define ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID (0x07)
+// Commands for cluster: Network Commissioning
+#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
+#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
+#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
+#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
+#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
+#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
+#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
+#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
+#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
+#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
+#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
+#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
+#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
+#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
+#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
+#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
@@ -369,6 +390,9 @@
#define ZCL_START_WARNING_COMMAND_ID (0x00)
#define ZCL_SQUAWK_COMMAND_ID (0x01)
+// Commands for cluster: Low Power
+#define ZCL_SLEEP_COMMAND_ID (0x00)
+
// Commands for cluster: Generic Tunnel
#define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00)
#define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00)
@@ -695,25 +719,6 @@
#define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42)
#define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42)
-// Commands for cluster: Network Commissioning
-#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
-#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
-#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
-#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
-#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
-#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
-#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
-#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
-#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
-#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
-#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
-#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
-#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
-#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
-#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
-#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
-#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
-
// Commands for cluster: Binding
#define ZCL_BIND_COMMAND_ID (0x00)
#define ZCL_UNBIND_COMMAND_ID (0x01)
diff --git a/examples/bridge-app/bridge-common/gen/endpoint_config.h b/examples/bridge-app/bridge-common/gen/endpoint_config.h
index 9a456798226f46..b797a636a44e30 100644
--- a/examples/bridge-app/bridge-common/gen/endpoint_config.h
+++ b/examples/bridge-app/bridge-common/gen/endpoint_config.h
@@ -26,16 +26,106 @@
#if BIGENDIAN_CPU
#define GENERATED_DEFAULTS \
{ \
+ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */ /* 32 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */ /* 64 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */ /* 96 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, big-endian */ /* 112 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */ /* 176 */ 0x00, 0x00, \
+ 0x00, 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */ /* 180 */ 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */ /* 244 */ 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */ /* 276 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */ /* 308 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */ /* 340 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, big-endian */ /* 356 */ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */ /* 420 */ 0x00, 0x00, \
+ 0x00, 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */ /* 424 */ 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */ \
}
#else // !BIGENDIAN_CPU
#define GENERATED_DEFAULTS \
{ \
+ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */ /* 32 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */ /* 64 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */ /* 96 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, little-endian */ /* 112 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */ /* 176 */ \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */ /* 180 */ 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */ /* 244 */ \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */ /* 276 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */ /* 308 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */ /* 340 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "Location". side: server, little-endian */ /* 356 */ 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */ /* 420 */ \
+ 0x00, 0x00, 0x00, 0x00, \
+ /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */ /* 424 */ 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */ \
}
#endif // BIGENDIAN_CPU
-#define GENERATED_DEFAULTS_COUNT (0)
+#define GENERATED_DEFAULTS_COUNT (14)
#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
#define ZAP_LONG_DEFAULTS_INDEX(index) \
@@ -55,18 +145,50 @@
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
-#define GENERATED_ATTRIBUTE_COUNT 29
+#define GENERATED_ATTRIBUTE_COUNT 51
#define GENERATED_ATTRIBUTES \
{ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } }, /* Basic (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x08 } }, /* Basic (server): ZCL version */ \
- { \
- 0x0007, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
- }, /* Basic (server): power source */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 0x0001 } }, /* Network Commissioning (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* On/off (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Level Control (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x00 } }, /* Level Control (server): current level */ \
+ { \
+ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
+ }, /* Basic (server): cluster revision */ \
+ { \
+ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } \
+ }, /* Basic (server): InteractionModelVersion */ \
+ { \
+ 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(0) } \
+ }, /* Basic (server): VendorName */ \
+ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): VendorID */ \
+ { \
+ 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(32) } \
+ }, /* Basic (server): ProductName */ \
+ { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): ProductID */ \
+ { 0x0005, \
+ ZAP_TYPE(CHAR_STRING), \
+ 32, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64) } }, /* Basic (server): UserLabel */ \
+ { 0x0006, \
+ ZAP_TYPE(CHAR_STRING), \
+ 16, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(96) } }, /* Basic (server): Location */ \
+ { \
+ 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
+ }, /* Basic (server): HardwareVersion */ \
+ { \
+ 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(112) } \
+ }, /* Basic (server): HardwareVersionString */ \
+ { \
+ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(176) } \
+ }, /* Basic (server): SoftwareVersion */ \
+ { \
+ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(180) } \
+ }, /* Basic (server): SoftwareVersionString */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* On/off (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */ \
{ \
@@ -85,7 +207,43 @@
}, /* Level Control (server): options */ \
{ \
0x4000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), { (uint8_t *) 0 } \
- }, /* Level Control (server): start up current level */ \
+ }, /* Level Control (server): start up current level */ \
+ { \
+ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
+ }, /* Basic (server): cluster revision */ \
+ { \
+ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } \
+ }, /* Basic (server): InteractionModelVersion */ \
+ { \
+ 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(244) } \
+ }, /* Basic (server): VendorName */ \
+ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): VendorID */ \
+ { \
+ 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(276) } \
+ }, /* Basic (server): ProductName */ \
+ { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): ProductID */ \
+ { 0x0005, \
+ ZAP_TYPE(CHAR_STRING), \
+ 32, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(308) } }, /* Basic (server): UserLabel */ \
+ { 0x0006, \
+ ZAP_TYPE(CHAR_STRING), \
+ 16, \
+ ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
+ { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(340) } }, /* Basic (server): Location */ \
+ { \
+ 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
+ }, /* Basic (server): HardwareVersion */ \
+ { \
+ 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(356) } \
+ }, /* Basic (server): HardwareVersionString */ \
+ { \
+ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(420) } \
+ }, /* Basic (server): SoftwareVersion */ \
+ { \
+ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(424) } \
+ }, /* Basic (server): SoftwareVersionString */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* On/off (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */ \
{ \
@@ -120,42 +278,50 @@
};
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
-#define GENERATED_CLUSTER_COUNT 7
+#define GENERATED_CLUSTER_COUNT 9
#define GENERATED_CLUSTERS \
{ \
- { 0x0000, ZAP_ATTRIBUTE_INDEX(0), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Basic (server) */ \
+ { \
+ 0x0031, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(3), \
+ ZAP_ATTRIBUTE_INDEX(1), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/off (server) */ \
{ 0x0008, \
- ZAP_ATTRIBUTE_INDEX(5), \
+ ZAP_ATTRIBUTE_INDEX(3), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \
+ { \
+ 0x0028, ZAP_ATTRIBUTE_INDEX(5), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 1, Cluster: Basic (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(7), \
+ ZAP_ATTRIBUTE_INDEX(17), \
6, \
9, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \
{ 0x0008, \
- ZAP_ATTRIBUTE_INDEX(13), \
+ ZAP_ATTRIBUTE_INDEX(23), \
5, \
7, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayLevelControlServer }, /* Endpoint: 2, Cluster: Level Control (server) */ \
+ { \
+ 0x0028, ZAP_ATTRIBUTE_INDEX(28), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 2, Cluster: Basic (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(18), \
+ ZAP_ATTRIBUTE_INDEX(40), \
6, \
9, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 3, Cluster: On/off (server) */ \
{ 0x0008, \
- ZAP_ATTRIBUTE_INDEX(24), \
+ ZAP_ATTRIBUTE_INDEX(46), \
5, \
7, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
@@ -167,18 +333,18 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
- { ZAP_CLUSTER_INDEX(0), 1, 4 }, { ZAP_CLUSTER_INDEX(1), 2, 6 }, { ZAP_CLUSTER_INDEX(3), 2, 16 }, \
- { ZAP_CLUSTER_INDEX(5), 2, 16 }, \
+ { ZAP_CLUSTER_INDEX(0), 1, 2 }, { ZAP_CLUSTER_INDEX(1), 3, 260 }, { ZAP_CLUSTER_INDEX(4), 3, 270 }, \
+ { ZAP_CLUSTER_INDEX(7), 2, 16 }, \
}
// Largest attribute size is needed for various buffers
-#define ATTRIBUTE_LARGEST (3)
+#define ATTRIBUTE_LARGEST (64)
// Total size of singleton attributes
-#define ATTRIBUTE_SINGLETONS_SIZE (4)
+#define ATTRIBUTE_SINGLETONS_SIZE (508)
// Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (42)
+#define ATTRIBUTE_MAX_SIZE (548)
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (4)
@@ -222,11 +388,10 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (40)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (62)
#define GENERATED_COMMANDS \
{ \
- { 0x0000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Basic (server): ResetToFactoryDefaults */ \
- { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Off */ \
+ { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Off */ \
{ 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Off */ \
{ 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Off */ \
{ 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): On */ \
@@ -265,6 +430,30 @@
{ 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): StopWithOnOff */ \
{ 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): StopWithOnOff */ \
{ 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (server): StopWithOnOff */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): StartUp */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): StartUp */ \
+ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */ \
+ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */ \
+ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */ \
+ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */ \
+ { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): ScanNetworks */ \
+ { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): ScanNetworksResponse */ \
+ { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddWiFiNetwork */ \
+ { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddWiFiNetworkResponse */ \
+ { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetwork */ \
+ { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetworkResponse */ \
+ { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddThreadNetwork */ \
+ { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddThreadNetworkResponse */ \
+ { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetwork */ \
+ { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetworkResponse */ \
+ { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): RemoveNetwork */ \
+ { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): RemoveNetworkResponse */ \
+ { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): EnableNetwork */ \
+ { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): EnableNetworkResponse */ \
+ { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): DisableNetwork */ \
+ { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): DisableNetworkResponse */ \
+ { 0x0031, 0x10, \
+ ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): GetLastNetworkCommissioningResult */ \
}
// Array of EmberAfManufacturerCodeEntry structures for commands.
diff --git a/examples/bridge-app/bridge-common/gen/gen_config.h b/examples/bridge-app/bridge-common/gen/gen_config.h
index 5aa3207d2e5f3d..d5a44941d9a09b 100644
--- a/examples/bridge-app/bridge-common/gen/gen_config.h
+++ b/examples/bridge-app/bridge-common/gen/gen_config.h
@@ -29,8 +29,9 @@
#define EMBER_APS_UNICAST_MESSAGE_COUNT 10
/**** Cluster endpoint counts ****/
-#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1)
+#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (2)
#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (3)
+#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (3)
/**** Cluster Plugins ****/
@@ -49,6 +50,11 @@
#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0
#define EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE 0
+// Use this macro to check if the server side of the Network Commissioning cluster is included
+#define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER
+#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER
+#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING
+
// Use this macro to check if the server side of the On/off cluster is included
#define ZCL_USING_ON_OFF_CLUSTER_SERVER
#define EMBER_AF_PLUGIN_ON_OFF_SERVER
diff --git a/examples/bridge-app/bridge-common/gen/print-cluster.h b/examples/bridge-app/bridge-common/gen/print-cluster.h
index 86a2a27beec86b..8c737e93fea79c 100644
--- a/examples/bridge-app/bridge-common/gen/print-cluster.h
+++ b/examples/bridge-app/bridge-common/gen/print-cluster.h
@@ -24,12 +24,6 @@
// to the "EmberAfClusterName" defined in the ZCL header.
// The names of clusters that are not present, are removed.
-#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 0, "Basic" },
-#else
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
-#endif
-
#if defined(ZCL_USING_POWER_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_POWER_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER { ZCL_POWER_CONFIG_CLUSTER_ID, 1, "Power Configuration" },
#else
@@ -150,12 +144,24 @@
#define CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER
#endif
+#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 40, "Basic" },
+#else
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
+#endif
+
#if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, 48, "General Commissioning" },
#else
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 49, "Network Commissioning" },
+#else
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -526,6 +532,12 @@
#define CHIP_PRINTCLUSTER_IAS_WD_CLUSTER
#endif
+#if defined(ZCL_USING_LOW_POWER_CLUSTER_SERVER) || defined(ZCL_USING_LOW_POWER_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER { ZCL_LOW_POWER_CLUSTER_ID, 1288, "Low Power" },
+#else
+#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER
+#endif
+
#if defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER { ZCL_APPLICATION_BASIC_CLUSTER_ID, 1293, "Application Basic" },
#else
@@ -728,12 +740,6 @@
#define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER
#endif
-#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 43690, "Network Commissioning" },
-#else
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
-#endif
-
#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" },
#else
@@ -784,7 +790,6 @@
#endif
#define CLUSTER_IDS_TO_NAMES \
- CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DEVICE_TEMP_CLUSTER \
CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER \
@@ -805,7 +810,9 @@
CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \
CHIP_PRINTCLUSTER_GREEN_POWER_CLUSTER \
CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER \
+ CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
@@ -857,6 +864,7 @@
CHIP_PRINTCLUSTER_IAS_ZONE_CLUSTER \
CHIP_PRINTCLUSTER_IAS_ACE_CLUSTER \
CHIP_PRINTCLUSTER_IAS_WD_CLUSTER \
+ CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER \
CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \
CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \
@@ -890,7 +898,6 @@
CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \
CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \
CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \
- CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_BINDING_CLUSTER \
CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER \
CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER \
diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp
index fc5d18a6150bdb..7857436a76cc2c 100644
--- a/examples/bridge-app/linux/main.cpp
+++ b/examples/bridge-app/linux/main.cpp
@@ -168,7 +168,7 @@ int main(int argc, char * argv[])
chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(nullptr); // Use default device name (CHIP-XXXX)
-#ifdef CONFIG_NETWORK_BLE
+#if CONFIG_NETWORK_LAYER_BLE
chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(LinuxDeviceOptions::GetInstance().mBleDevice, false);
#endif
diff --git a/examples/chip-tool/chip-tool.zap b/examples/chip-tool/chip-tool.zap
index 251ee0f5ffb216..55a9cdbb4cf495 100644
--- a/examples/chip-tool/chip-tool.zap
+++ b/examples/chip-tool/chip-tool.zap
@@ -1,5 +1,5 @@
{
- "writeTime": "Mon Mar 08 2021 19:20:08 GMT+0100 (Central European Standard Time)",
+ "writeTime": "Thu Mar 11 2021 18:15:06 GMT+0100 (Central European Standard Time)",
"featureLevel": 11,
"creator": "zap",
"keyValuePairs": [
@@ -38,15 +38,15 @@
"deviceTypeProfileId": 259,
"clusters": [
{
- "name": "Basic",
- "code": 0,
+ "name": "Identify",
+ "code": 3,
"mfgCode": null,
- "define": "BASIC_CLUSTER",
+ "define": "IDENTIFY_CLUSTER",
"side": "client",
"enabled": 1,
"commands": [
{
- "name": "ResetToFactoryDefaults",
+ "name": "Identify",
"code": 0,
"mfgCode": null,
"source": "client",
@@ -54,95 +54,14 @@
"outgoing": 1
},
{
- "name": "MfgSpecificPing",
- "code": 0,
- "mfgCode": "4098",
+ "name": "IdentifyQuery",
+ "code": 1,
+ "mfgCode": null,
"source": "client",
- "incoming": 0,
+ "incoming": 1,
"outgoing": 1
}
],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 1,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Basic",
- "code": 0,
- "mfgCode": null,
- "define": "BASIC_CLUSTER",
- "side": "server",
- "enabled": 0,
- "commands": [],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "ZCL version",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x08",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "power source",
- "code": 7,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x00",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ]
- },
- {
- "name": "Identify",
- "code": 3,
- "mfgCode": null,
- "define": "IDENTIFY_CLUSTER",
- "side": "client",
- "enabled": 1,
"attributes": [
{
"name": "cluster revision",
@@ -159,24 +78,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "Identify",
- "code": 0,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "IdentifyQuery",
- "code": 1,
- "mfgCode": null,
- "source": "client",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -835,6 +736,257 @@
}
]
},
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "client",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "MfgSpecificPing",
+ "code": 0,
+ "mfgCode": "4098",
+ "source": "client",
+ "incoming": 0,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Basic",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_CLUSTER",
+ "side": "server",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "StartUp",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 0
+ },
+ {
+ "name": "ShutDown",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 0
+ },
+ {
+ "name": "Leave",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 0,
+ "outgoing": 0
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "InteractionModelVersion",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorName",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorID",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductName",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductID",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UserLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "0x00",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
{
"name": "General Commissioning",
"code": 48,
@@ -893,6 +1045,32 @@
"define": "GENERAL_COMMISSIONING_CLUSTER",
"side": "server",
"enabled": 0,
+ "commands": [
+ {
+ "name": "SetFabricResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "ArmFailSafeResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "CommissioningCompleteResponse",
+ "code": 7,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -939,32 +1117,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "SetFabricResponse",
- "code": 1,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "ArmFailSafeResponse",
- "code": 3,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- },
- {
- "name": "CommissioningCompleteResponse",
- "code": 7,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -1832,6 +1984,23 @@
"define": "BARRIER_CONTROL_CLUSTER",
"side": "client",
"enabled": 1,
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
"commands": [
{
"name": "BarrierControlGoToPercent",
@@ -1849,23 +2018,6 @@
"incoming": 1,
"outgoing": 1
}
- ],
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
]
},
{
@@ -1961,23 +2113,6 @@
"define": "COLOR_CONTROL_CLUSTER",
"side": "client",
"enabled": 1,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "MoveToHue",
@@ -2091,6 +2226,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
@@ -3535,6 +3687,16 @@
"define": "MEDIA_PLAYBACK_CLUSTER",
"side": "server",
"enabled": 0,
+ "commands": [
+ {
+ "name": "Playback",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "cluster revision",
@@ -3566,16 +3728,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "Playback",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -3585,23 +3737,6 @@
"define": "CONTENT_LAUNCH_CLUSTER",
"side": "client",
"enabled": 1,
- "attributes": [
- {
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "client",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- }
- ],
"commands": [
{
"name": "LaunchContent",
@@ -3619,6 +3754,23 @@
"incoming": 1,
"outgoing": 1
}
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
]
},
{
diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h
index d13563c3074682..4f407a3f30c322 100644
--- a/examples/chip-tool/commands/clusters/Commands.h
+++ b/examples/chip-tool/commands/clusters/Commands.h
@@ -25,7 +25,6 @@
#include "gen/CHIPClientCallbacks.h"
#include
#include
-#include
static void OnDefaultSuccessResponse(void * context)
{
@@ -43,12 +42,6 @@ static void OnDefaultFailureResponse(void * context, uint8_t status)
command->SetCommandExitStatus(false);
}
-typedef void (*UnsupportedAttributeCallback)(void * context);
-static void OnUnsupportedAttributeResponse(void * context)
-{
- ChipLogError(chipTool, "Unsupported attribute Response. This should never happen !");
-}
-
static void OnBooleanAttributeResponse(void * context, bool value)
{
ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);
@@ -73,9 +66,9 @@ static void OnInt16uAttributeResponse(void * context, uint16_t value)
command->SetCommandExitStatus(true);
}
-static void OnInt16sAttributeResponse(void * context, int16_t value)
+static void OnInt32uAttributeResponse(void * context, uint32_t value)
{
- ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+ ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);
ModelCommand * command = reinterpret_cast(context);
command->SetCommandExitStatus(true);
@@ -89,6 +82,27 @@ static void OnInt64uAttributeResponse(void * context, uint64_t value)
command->SetCommandExitStatus(true);
}
+static void OnInt16sAttributeResponse(void * context, int16_t value)
+{
+ ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+
+ ModelCommand * command = reinterpret_cast(context);
+ command->SetCommandExitStatus(true);
+}
+
+static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
+{
+ char * str = (char *) malloc(value.size() * sizeof(char));
+ memmove(str, value.data(), value.size());
+ str[value.size()] = '\0';
+ free(str);
+
+ ChipLogProgress(chipTool, "String attribute Response: %s (%" PRIu16 ")", str, strlen(str));
+
+ ModelCommand * command = reinterpret_cast(context);
+ command->SetCommandExitStatus(true);
+}
+
static void OnContentLaunchClusterLaunchContentResponse(void * context, uint8_t contentLaunchStatus)
{
ChipLogProgress(chipTool, "ContentLaunchClusterLaunchContentResponse");
@@ -414,7 +428,7 @@ static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, u
|---------------------------------------------------------------------+--------|
| ApplicationBasic | 0x050D |
| BarrierControl | 0x0103 |
-| Basic | 0x0000 |
+| Basic | 0x0028 |
| Binding | 0xF000 |
| ColorControl | 0x0300 |
| ContentLaunch | 0xF002 |
@@ -432,7 +446,7 @@ static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, u
constexpr chip::ClusterId kApplicationBasicClusterId = 0x050D;
constexpr chip::ClusterId kBarrierControlClusterId = 0x0103;
-constexpr chip::ClusterId kBasicClusterId = 0x0000;
+constexpr chip::ClusterId kBasicClusterId = 0x0028;
constexpr chip::ClusterId kBindingClusterId = 0xF000;
constexpr chip::ClusterId kColorControlClusterId = 0x0300;
constexpr chip::ClusterId kContentLaunchClusterId = 0xF002;
@@ -509,8 +523,8 @@ class ReadApplicationBasicVendorName : public ModelCommand
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -565,8 +579,8 @@ class ReadApplicationBasicApplicationName : public ModelCommand
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -621,8 +635,8 @@ class ReadApplicationBasicApplicationId : public ModelCommand
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -944,15 +958,23 @@ class ReadBarrierControlClusterRevision : public ModelCommand
};
/*----------------------------------------------------------------------------*\
-| Cluster Basic | 0x0000 |
+| Cluster Basic | 0x0028 |
|------------------------------------------------------------------------------|
| Commands: | |
| * MfgSpecificPing | 0x00 |
-| * ResetToFactoryDefaults | 0x00 |
|------------------------------------------------------------------------------|
| Attributes: | |
-| * ZclVersion | 0x0000 |
-| * PowerSource | 0x0007 |
+| * InteractionModelVersion | 0x0000 |
+| * VendorName | 0x0001 |
+| * VendorID | 0x0002 |
+| * ProductName | 0x0003 |
+| * ProductID | 0x0004 |
+| * UserLabel | 0x0005 |
+| * Location | 0x0006 |
+| * HardwareVersion | 0x0007 |
+| * HardwareVersionString | 0x0008 |
+| * SoftwareVersion | 0x0009 |
+| * SoftwareVersionString | 0x000A |
| * ClusterRevision | 0xFFFD |
\*----------------------------------------------------------------------------*/
@@ -966,7 +988,7 @@ class BasicMfgSpecificPing : public ModelCommand
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
@@ -981,20 +1003,20 @@ class BasicMfgSpecificPing : public ModelCommand
};
/*
- * Command ResetToFactoryDefaults
+ * Discover Attributes
*/
-class BasicResetToFactoryDefaults : public ModelCommand
+class DiscoverBasicAttributes : public ModelCommand
{
public:
- BasicResetToFactoryDefaults() : ModelCommand("reset-to-factory-defaults") { ModelCommand::AddArguments(); }
+ DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ResetToFactoryDefaults(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
@@ -1005,20 +1027,191 @@ class BasicResetToFactoryDefaults : public ModelCommand
};
/*
- * Discover Attributes
+ * Attribute InteractionModelVersion
*/
-class DiscoverBasicAttributes : public ModelCommand
+class ReadBasicInteractionModelVersion : public ModelCommand
{
public:
- DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
+ ReadBasicInteractionModelVersion() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "interaction-model-version");
+ ModelCommand::AddArguments();
+ }
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute VendorName
+ */
+class ReadBasicVendorName : public ModelCommand
+{
+public:
+ ReadBasicVendorName() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "vendor-name");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute VendorID
+ */
+class ReadBasicVendorID : public ModelCommand
+{
+public:
+ ReadBasicVendorID() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "vendor-id");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute ProductName
+ */
+class ReadBasicProductName : public ModelCommand
+{
+public:
+ ReadBasicProductName() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "product-name");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute ProductID
+ */
+class ReadBasicProductID : public ModelCommand
+{
+public:
+ ReadBasicProductID() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "product-id");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute UserLabel
+ */
+class ReadBasicUserLabel : public ModelCommand
+{
+public:
+ ReadBasicUserLabel() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "user-label");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+class WriteBasicUserLabel : public ModelCommand
+{
+public:
+ WriteBasicUserLabel() : ModelCommand("write")
+ {
+ AddArgument("attr-name", "user-label");
+ AddArgument("attr-value", &mValue);
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
}
private:
@@ -1026,60 +1219,173 @@ class DiscoverBasicAttributes : public ModelCommand
new chip::Callback::Callback(OnDefaultSuccessResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
+ char * mValue;
};
/*
- * Attribute ZclVersion
+ * Attribute Location
*/
-class ReadBasicZclVersion : public ModelCommand
+class ReadBasicLocation : public ModelCommand
{
public:
- ReadBasicZclVersion() : ModelCommand("read")
+ ReadBasicLocation() : ModelCommand("read")
{
- AddArgument("attr-name", "zcl-version");
+ AddArgument("attr-name", "location");
ModelCommand::AddArguments();
}
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ReadAttributeZclVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnInt8uAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
+class WriteBasicLocation : public ModelCommand
+{
+public:
+ WriteBasicLocation() : ModelCommand("write")
+ {
+ AddArgument("attr-name", "location");
+ AddArgument("attr-value", &mValue);
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnDefaultSuccessResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+ char * mValue;
+};
+
/*
- * Attribute PowerSource
+ * Attribute HardwareVersion
*/
-class ReadBasicPowerSource : public ModelCommand
+class ReadBasicHardwareVersion : public ModelCommand
{
public:
- ReadBasicPowerSource() : ModelCommand("read")
+ ReadBasicHardwareVersion() : ModelCommand("read")
{
- AddArgument("attr-name", "power-source");
+ AddArgument("attr-name", "hardware-version");
ModelCommand::AddArguments();
}
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ReadAttributePowerSource(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnInt8uAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute HardwareVersionString
+ */
+class ReadBasicHardwareVersionString : public ModelCommand
+{
+public:
+ ReadBasicHardwareVersionString() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "hardware-version-string");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute SoftwareVersion
+ */
+class ReadBasicSoftwareVersion : public ModelCommand
+{
+public:
+ ReadBasicSoftwareVersion() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "software-version");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnInt32uAttributeResponse, this);
+ chip::Callback::Callback * onFailureCallback =
+ new chip::Callback::Callback(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute SoftwareVersionString
+ */
+class ReadBasicSoftwareVersionString : public ModelCommand
+{
+public:
+ ReadBasicSoftwareVersionString() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "software-version-string");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -1098,7 +1404,7 @@ class ReadBasicClusterRevision : public ModelCommand
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
@@ -2218,8 +2524,8 @@ class ReadColorControlCompensationText : public ModelCommand
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -4424,7 +4730,8 @@ class DoorLockLockDoor : public ModelCommand
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPin);
+ return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
@@ -4493,7 +4800,8 @@ class DoorLockSetPin : public ModelCommand
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType, mPin);
+ return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
@@ -4528,7 +4836,8 @@ class DoorLockSetRfid : public ModelCommand
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType, mId);
+ return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
+ chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
}
private:
@@ -4671,7 +4980,8 @@ class DoorLockUnlockDoor : public ModelCommand
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPin);
+ return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
@@ -4701,7 +5011,8 @@ class DoorLockUnlockWithTimeout : public ModelCommand
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds, mPin);
+ return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
@@ -5048,8 +5359,8 @@ class ReadGeneralCommissioningFabricId : public ModelCommand
}
private:
- chip::Callback::Callback * onSuccessCallback =
- new chip::Callback::Callback(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback * onSuccessCallback =
+ new chip::Callback::Callback(OnStringAttributeResponse, this);
chip::Callback::Callback * onFailureCallback =
new chip::Callback::Callback(OnDefaultFailureResponse, this);
};
@@ -5172,7 +5483,8 @@ class GroupsAddGroup : public ModelCommand
chip::Controller::GroupsCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mGroupName);
+ return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
+ chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
}
private:
@@ -5203,7 +5515,8 @@ class GroupsAddGroupIfIdentifying : public ModelCommand
chip::Controller::GroupsCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mGroupName);
+ return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
+ chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
}
private:
@@ -6657,7 +6970,8 @@ class ScenesAddScene : public ModelCommand
chip::Controller::ScenesCluster cluster;
cluster.Associate(device, endpointId);
return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
- mSceneName, mClusterId, mLength, mValue);
+ chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
+ mValue);
}
private:
@@ -7275,8 +7589,22 @@ void registerClusterBasic(Commands & commands)
const char * clusterName = "Basic";
commands_list clusterCommands = {
- make_unique(), make_unique(), make_unique(),
- make_unique(), make_unique(), make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
+ make_unique(),
};
commands.Register(clusterName, clusterCommands);
diff --git a/examples/chip-tool/config/PersistentStorage.cpp b/examples/chip-tool/config/PersistentStorage.cpp
index 1ae0466abeb879..2170fd3b254fcd 100644
--- a/examples/chip-tool/config/PersistentStorage.cpp
+++ b/examples/chip-tool/config/PersistentStorage.cpp
@@ -53,11 +53,11 @@ CHIP_ERROR PersistentStorage::Init()
return err;
}
-void PersistentStorage::SetDelegate(PersistentStorageResultDelegate * delegate) {}
+void PersistentStorage::SetStorageDelegate(PersistentStorageResultDelegate * delegate) {}
-void PersistentStorage::GetKeyValue(const char * key) {}
+void PersistentStorage::AsyncGetKeyValue(const char * key) {}
-CHIP_ERROR PersistentStorage::GetKeyValue(const char * key, char * value, uint16_t & size)
+CHIP_ERROR PersistentStorage::SyncGetKeyValue(const char * key, char * value, uint16_t & size)
{
CHIP_ERROR err = CHIP_NO_ERROR;
std::string iniValue;
@@ -79,7 +79,7 @@ CHIP_ERROR PersistentStorage::GetKeyValue(const char * key, char * value, uint16
return err;
}
-void PersistentStorage::SetKeyValue(const char * key, const char * value)
+void PersistentStorage::AsyncSetKeyValue(const char * key, const char * value)
{
auto section = mConfig.sections[kDefaultSectionName];
section[key] = std::string(value);
@@ -88,7 +88,7 @@ void PersistentStorage::SetKeyValue(const char * key, const char * value)
CommitConfig();
}
-void PersistentStorage::DeleteKeyValue(const char * key)
+void PersistentStorage::AsyncDeleteKeyValue(const char * key)
{
auto section = mConfig.sections[kDefaultSectionName];
section.erase(key);
@@ -126,7 +126,7 @@ uint16_t PersistentStorage::GetListenPort()
char value[6];
uint16_t size = static_cast(sizeof(value));
- err = GetKeyValue(kPortKey, value, size);
+ err = SyncGetKeyValue(kPortKey, value, size);
if (CHIP_NO_ERROR == err)
{
uint16_t tmpValue;
@@ -148,7 +148,7 @@ LogCategory PersistentStorage::GetLoggingLevel()
char value[9];
uint16_t size = static_cast(sizeof(value));
- err = GetKeyValue(kLoggingKey, value, size);
+ err = SyncGetKeyValue(kLoggingKey, value, size);
if (CHIP_NO_ERROR == err)
{
if (strcasecmp(value, "none") == 0)
diff --git a/examples/chip-tool/config/PersistentStorage.h b/examples/chip-tool/config/PersistentStorage.h
index edef1cdf94678c..85fc73fc394885 100644
--- a/examples/chip-tool/config/PersistentStorage.h
+++ b/examples/chip-tool/config/PersistentStorage.h
@@ -28,11 +28,11 @@ class PersistentStorage : public chip::PersistentStorageDelegate
CHIP_ERROR Init();
/////////// PersistentStorageDelegate Interface /////////
- void SetDelegate(chip::PersistentStorageResultDelegate * delegate) override;
- void GetKeyValue(const char * key) override;
- CHIP_ERROR GetKeyValue(const char * key, char * value, uint16_t & size) override;
- void SetKeyValue(const char * key, const char * value) override;
- void DeleteKeyValue(const char * key) override;
+ void SetStorageDelegate(chip::PersistentStorageResultDelegate * delegate) override;
+ void AsyncGetKeyValue(const char * key) override;
+ CHIP_ERROR SyncGetKeyValue(const char * key, char * value, uint16_t & size) override;
+ void AsyncSetKeyValue(const char * key, const char * value) override;
+ void AsyncDeleteKeyValue(const char * key) override;
uint16_t GetListenPort();
chip::Logging::LogCategory GetLoggingLevel();
diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.cpp b/examples/chip-tool/gen/CHIPClientCallbacks.cpp
index 952cbc6ee063c2..71fe6c668cc75d 100644
--- a/examples/chip-tool/gen/CHIPClientCallbacks.cpp
+++ b/examples/chip-tool/gen/CHIPClientCallbacks.cpp
@@ -272,10 +272,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -289,6 +285,48 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
@@ -1489,10 +1527,6 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
case 0x38: // semi / Semi-precision
case 0x39: // single / Single precision
case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
case 0x48: // array / Array
case 0x49: // struct / Structure
case 0x50: // set / Set
@@ -1503,6 +1537,48 @@ bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uin
return true;
}
+ case 0x41: // octstr / Octet string
+ case 0x42: // string / Character string
+ {
+ // Short Strings must contains at least one byte for the length
+ CHECK_MESSAGE_LENGTH(1);
+ uint8_t length = chip::Encoding::Read8(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
+ case 0x43: // octstr16 / Long octet string
+ case 0x44: // string16 / Long character string
+ {
+ // Long Strings must contains at least two bytes for the length
+ CHECK_MESSAGE_LENGTH(2);
+ uint16_t length = chip::Encoding::LittleEndian::Read16(message);
+ ChipLogProgress(Zcl, " length: 0x%02x", length);
+
+ // When the length is set to 0xFFFF, it represents a non-value. In this case the data field is zero length.
+ if (length == 0xFFFF)
+ {
+ length = 0;
+ }
+
+ CHECK_MESSAGE_LENGTH(length);
+ Callback::Callback * cb =
+ Callback::Callback::FromCancelable(onReportCallback);
+ cb->mCall(cb->mContext, chip::ByteSpan(message, length));
+ break;
+ }
+
case 0x08: // data8 / 8-bit data
case 0x18: // map8 / 8-bit bitmap
case 0x20: // uint8 / Unsigned 8-bit integer
diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.h b/examples/chip-tool/gen/CHIPClientCallbacks.h
index ae3e2fc5a99091..00c37b8efd445a 100644
--- a/examples/chip-tool/gen/CHIPClientCallbacks.h
+++ b/examples/chip-tool/gen/CHIPClientCallbacks.h
@@ -20,6 +20,7 @@
#pragma once
#include
+#include
// Global Response Callbacks
typedef void (*DefaultSuccessCallback)(void * context);
@@ -33,6 +34,7 @@ typedef void (*Int32uAttributeCallback)(void * context, uint32_t value);
typedef void (*Int32sAttributeCallback)(void * context, int32_t value);
typedef void (*Int64uAttributeCallback)(void * context, uint64_t value);
typedef void (*Int64sAttributeCallback)(void * context, int64_t value);
+typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value);
typedef void (*ReadReportingConfigurationReportedCallback)(void * context, uint16_t minInterval, uint16_t maxInterval);
typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint16_t timeout);
diff --git a/examples/chip-tool/gen/CHIPClustersObjc.h b/examples/chip-tool/gen/CHIPClustersObjc.h
index d1a3997dbb5eda..847dc97c76ec21 100644
--- a/examples/chip-tool/gen/CHIPClustersObjc.h
+++ b/examples/chip-tool/gen/CHIPClustersObjc.h
@@ -83,10 +83,20 @@ NS_ASSUME_NONNULL_BEGIN
@interface CHIPBasic : CHIPCluster
- (void)mfgSpecificPing:(ResponseHandler)completionHandler;
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler;
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler;
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler;
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler;
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler;
+- (void)readAttributeProductName:(ResponseHandler)completionHandler;
+- (void)readAttributeProductID:(ResponseHandler)completionHandler;
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler;
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
+- (void)readAttributeLocation:(ResponseHandler)completionHandler;
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler;
+- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler;
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler;
- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
@end
@@ -323,7 +333,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler;
-- (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
- (void)setHolidaySchedule:(uint8_t)scheduleId
localStartTime:(uint32_t)localStartTime
localEndTime:(uint32_t)localEndTime
@@ -332,12 +342,12 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setPin:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- pin:(char *)pin
+ pin:(NSString *)pin
completionHandler:(ResponseHandler)completionHandler;
- (void)setRfid:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- id:(char *)id
+ id:(NSString *)id
completionHandler:(ResponseHandler)completionHandler;
- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler;
- (void)setWeekdaySchedule:(uint8_t)scheduleId
@@ -353,8 +363,8 @@ NS_ASSUME_NONNULL_BEGIN
localStartTime:(uint32_t)localStartTime
localEndTime:(uint32_t)localEndTime
completionHandler:(ResponseHandler)completionHandler;
-- (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler;
-- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
+- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler;
- (void)readAttributeLockState:(ResponseHandler)completionHandler;
- (void)configureAttributeLockState:(uint16_t)minInterval
@@ -397,8 +407,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface CHIPGroups : CHIPCluster
-- (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler;
-- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler;
+- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler;
+- (void)addGroupIfIdentifying:(uint16_t)groupId
+ groupName:(NSString *)groupName
+ completionHandler:(ResponseHandler)completionHandler;
- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler;
- (void)removeAllGroups:(ResponseHandler)completionHandler;
- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler;
@@ -529,7 +541,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)addScene:(uint16_t)groupId
sceneId:(uint8_t)sceneId
transitionTime:(uint16_t)transitionTime
- sceneName:(char *)sceneName
+ sceneName:(NSString *)sceneName
clusterId:(uint16_t)clusterId
length:(uint8_t)length
value:(uint8_t)value
diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm
index 28dab3dc3915c8..f256509b2b1e3d 100644
--- a/examples/chip-tool/gen/CHIPClustersObjc.mm
+++ b/examples/chip-tool/gen/CHIPClustersObjc.mm
@@ -21,7 +21,7 @@
#import "CHIPDevice.h"
#import "CHIPDevice_Internal.h"
-#import "ChipError.h"
+#import "CHIPError.h"
#import "gen/CHIPClientCallbacks.h"
#import "gen/CHIPClustersObjc.h"
@@ -89,26 +89,38 @@ static void CallbackFn(void * context, uint8_t status)
dispatch_queue_t mQueue;
};
-class CHIPUnsupportedAttributeCallbackBridge : public Callback::Callback {
+class CHIPStringAttributeCallbackBridge : public Callback::Callback {
public:
- CHIPUnsupportedAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
- : Callback::Callback(CallbackFn, this)
+ CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mOctetString(octetString)
+ , mKeepAlive(keepAlive)
{
}
- ~CHIPUnsupportedAttributeCallbackBridge() {};
+ ~CHIPStringAttributeCallbackBridge() {};
- static void CallbackFn(void * context)
+ static void CallbackFn(void * context, chip::ByteSpan value)
{
- CHIPUnsupportedAttributeCallbackBridge * callback = reinterpret_cast(context);
+ CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context);
if (callback && callback->mQueue) {
dispatch_async(callback->mQueue, ^{
- NSError * error = [NSError errorWithDomain:CHIPErrorDomain
- code:CHIPErrorCodeUndefinedError
- userInfo:@ { NSLocalizedDescriptionKey : @"Unsupported attribute type" }];
- callback->mHandler(error, nil);
- callback->Cancel();
- delete callback;
+ if (callback->mOctetString) {
+ NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
+ callback->mHandler(nil, @ { @"value" : data });
+ } else {
+ NSString * str = [[NSString alloc] initWithBytes:value.data()
+ length:value.size()
+ encoding:NSUTF8StringEncoding];
+ callback->mHandler(nil, @ { @"value" : str });
+ }
+
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
});
}
};
@@ -116,6 +128,8 @@ static void CallbackFn(void * context)
private:
ResponseHandler mHandler;
dispatch_queue_t mQueue;
+ bool mOctetString;
+ bool mKeepAlive;
};
class CHIPBooleanAttributeCallbackBridge : public Callback::Callback {
@@ -246,6 +260,70 @@ static void CallbackFn(void * context, uint16_t value)
bool mKeepAlive;
};
+class CHIPInt32uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt32uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint32_t value)
+ {
+ CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
+class CHIPInt64uAttributeCallbackBridge : public Callback::Callback {
+public:
+ CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
+ : Callback::Callback(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ , mKeepAlive(keepAlive)
+ {
+ }
+
+ ~CHIPInt64uAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint64_t value)
+ {
+ CHIPInt64uAttributeCallbackBridge * callback = reinterpret_cast(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLongLong:value] });
+ if (!callback->mKeepAlive) {
+ callback->Cancel();
+ delete callback;
+ }
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+ bool mKeepAlive;
+};
+
class CHIPInt16sAttributeCallbackBridge : public Callback::Callback {
public:
CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
@@ -1599,8 +1677,8 @@ @implementation CHIPApplicationBasic
- (void)readAttributeVendorName:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -1646,8 +1724,8 @@ - (void)readAttributeVendorId:(ResponseHandler)completionHandler
- (void)readAttributeApplicationName:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -1693,8 +1771,8 @@ - (void)readAttributeProductId:(ResponseHandler)completionHandler
- (void)readAttributeApplicationId:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -1992,7 +2070,149 @@ - (void)mfgSpecificPing:(ResponseHandler)completionHandler
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
+
+- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeVendorName:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeVendorID:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeProductName:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeProductID:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeUserLabel:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
@@ -2007,7 +2227,9 @@ - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ResetToFactoryDefaults(onSuccess->Cancel(), onFailure->Cancel());
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -2015,9 +2237,10 @@ - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
}
}
-- (void)readAttributeZclVersion:(ResponseHandler)completionHandler
+- (void)readAttributeLocation:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -2030,7 +2253,7 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributeZclVersion(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -2038,9 +2261,105 @@ - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
}
}
-- (void)readAttributePowerSource:(ResponseHandler)completionHandler
+- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
{
- CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
+ CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
+ onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
+{
+ CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
+{
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -2053,7 +2372,7 @@ - (void)readAttributePowerSource:(ResponseHandler)completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.ReadAttributePowerSource(onSuccess->Cancel(), onFailure->Cancel());
+ CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -2881,8 +3200,8 @@ - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
- (void)readAttributeCompensationText:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -4674,7 +4993,7 @@ - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
= new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -4690,7 +5009,9 @@ - (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandle
return;
}
- CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
+ CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -4728,7 +5049,7 @@ - (void)setHolidaySchedule:(uint8_t)scheduleId
- (void)setPin:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- pin:(char *)pin
+ pin:(NSString *)pin
completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess
@@ -4745,7 +5066,9 @@ - (void)setPin:(uint16_t)userId
return;
}
- CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, pin);
+ CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -4755,7 +5078,7 @@ - (void)setPin:(uint16_t)userId
- (void)setRfid:(uint16_t)userId
userStatus:(uint8_t)userStatus
userType:(uint8_t)userType
- id:(char *)id
+ id:(NSString *)id
completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess
@@ -4772,7 +5095,9 @@ - (void)setRfid:(uint16_t)userId
return;
}
- CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, id);
+ CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
+ chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -4861,7 +5186,7 @@ - (void)setYeardaySchedule:(uint8_t)scheduleId
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
= new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -4877,14 +5202,16 @@ - (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHand
return;
}
- CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
+ CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler
+- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
{
CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess
= new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -4900,7 +5227,9 @@ - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionH
return;
}
- CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds, pin);
+ CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
+ chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -5137,8 +5466,8 @@ - (void)setFabric:(NSData *)fabricId
- (void)readAttributeFabricId:(ResponseHandler)completionHandler
{
- CHIPUnsupportedAttributeCallbackBridge * onSuccess
- = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ CHIPStringAttributeCallbackBridge * onSuccess
+ = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
if (!onSuccess) {
completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
return;
@@ -5241,7 +5570,7 @@ @implementation CHIPGroups
return &_cppCluster;
}
-- (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
+- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
{
CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
= new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
@@ -5257,14 +5586,16 @@ - (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler
return;
}
- CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
+ CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId,
+ chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
}
}
-- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
+- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
{
CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
if (!onSuccess) {
@@ -5279,7 +5610,9 @@ - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName comp
return;
}
- CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
+ CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId,
+ chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
@@ -6373,7 +6706,7 @@ @implementation CHIPScenes
- (void)addScene:(uint16_t)groupId
sceneId:(uint8_t)sceneId
transitionTime:(uint16_t)transitionTime
- sceneName:(char *)sceneName
+ sceneName:(NSString *)sceneName
clusterId:(uint16_t)clusterId
length:(uint8_t)length
value:(uint8_t)value
@@ -6393,8 +6726,10 @@ - (void)addScene:(uint16_t)groupId
return;
}
- CHIP_ERROR err = self.cppCluster.AddScene(
- onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime, sceneName, clusterId, length, value);
+ CHIP_ERROR err = self.cppCluster.AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime,
+ chip::ByteSpan((const uint8_t *) [sceneName dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [sceneName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]),
+ clusterId, length, value);
if (err != CHIP_NO_ERROR) {
delete onSuccess;
delete onFailure;
diff --git a/examples/chip-tool/gen/attribute-id.h b/examples/chip-tool/gen/attribute-id.h
index 3ab0310a83cce7..72a0198e2f97be 100644
--- a/examples/chip-tool/gen/attribute-id.h
+++ b/examples/chip-tool/gen/attribute-id.h
@@ -26,30 +26,6 @@
#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE)
#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE)
-// Attribute ids for cluster: Basic
-
-// Client attributes
-
-// Server attributes
-#define ZCL_VERSION_ATTRIBUTE_ID (0x0000)
-#define ZCL_APPLICATION_VERSION_ATTRIBUTE_ID (0x0001)
-#define ZCL_STACK_VERSION_ATTRIBUTE_ID (0x0002)
-#define ZCL_HW_VERSION_ATTRIBUTE_ID (0x0003)
-#define ZCL_MANUFACTURER_NAME_ATTRIBUTE_ID (0x0004)
-#define ZCL_MODEL_IDENTIFIER_ATTRIBUTE_ID (0x0005)
-#define ZCL_DATE_CODE_ATTRIBUTE_ID (0x0006)
-#define ZCL_POWER_SOURCE_ATTRIBUTE_ID (0x0007)
-#define ZCL_GENERIC_DEVICE_CLASS_ATTRIBUTE_ID (0x0008)
-#define ZCL_GENERIC_DEVICE_TYPE_ATTRIBUTE_ID (0x0009)
-#define ZCL_PRODUCT_CODE_ATTRIBUTE_ID (0x000A)
-#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000B)
-#define ZCL_LOCATION_DESCRIPTION_ATTRIBUTE_ID (0x0010)
-#define ZCL_PHYSICAL_ENVIRONMENT_ATTRIBUTE_ID (0x0011)
-#define ZCL_DEVICE_ENABLED_ATTRIBUTE_ID (0x0012)
-#define ZCL_ALARM_MASK_ATTRIBUTE_ID (0x0013)
-#define ZCL_DISABLE_LOCAL_CONFIG_ATTRIBUTE_ID (0x0014)
-#define ZCL_SW_BUILD_ID_ATTRIBUTE_ID (0x4000)
-
// Attribute ids for cluster: Power Configuration
// Client attributes
@@ -384,6 +360,29 @@
#define ZCL_KEEPALIVE_BASE_ATTRIBUTE_ID (0x0000)
#define ZCL_KEEPALIVE_JITTER_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Basic
+
+// Client attributes
+
+// Server attributes
+#define ZCL_INTERACTION_MODEL_VERSION_ATTRIBUTE_ID (0x0000)
+#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0001)
+#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0002)
+#define ZCL_PRODUCT_NAME_ATTRIBUTE_ID (0x0003)
+#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0004)
+#define ZCL_USER_LABEL_ATTRIBUTE_ID (0x0005)
+#define ZCL_LOCATION_ATTRIBUTE_ID (0x0006)
+#define ZCL_HARDWARE_VERSION_ATTRIBUTE_ID (0x0007)
+#define ZCL_HARDWARE_VERSION_STRING_ATTRIBUTE_ID (0x0008)
+#define ZCL_SOFTWARE_VERSION_ATTRIBUTE_ID (0x0009)
+#define ZCL_SOFTWARE_VERSION_STRING_ATTRIBUTE_ID (0x000A)
+#define ZCL_MANUFACTURING_DATE_ATTRIBUTE_ID (0x000B)
+#define ZCL_PART_NUMBER_ATTRIBUTE_ID (0x000C)
+#define ZCL_PRODUCT_URL_ATTRIBUTE_ID (0x000D)
+#define ZCL_PRODUCT_LABEL_ATTRIBUTE_ID (0x000E)
+#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x000F)
+#define ZCL_LOCAL_CONFIG_DISABLED_ATTRIBUTE_ID (0x0010)
+
// Attribute ids for cluster: General Commissioning
// Client attributes
@@ -392,6 +391,12 @@
#define ZCL_FABRIC_ID_ATTRIBUTE_ID (0x0000)
#define ZCL_BREADCRUMB_ATTRIBUTE_ID (0x0001)
+// Attribute ids for cluster: Network Commissioning
+
+// Client attributes
+
+// Server attributes
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
@@ -1104,10 +1109,10 @@
// Client attributes
// Server attributes
-#define ZCL_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
-#define ZCL_VENDOR_ID_ATTRIBUTE_ID (0x0001)
+#define ZCL_APPLICATION_VENDOR_NAME_ATTRIBUTE_ID (0x0000)
+#define ZCL_APPLICATION_VENDOR_ID_ATTRIBUTE_ID (0x0001)
#define ZCL_APPLICATION_NAME_ATTRIBUTE_ID (0x0002)
-#define ZCL_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
+#define ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID (0x0003)
#define ZCL_APPLICATION_ID_ATTRIBUTE_ID (0x0005)
#define ZCL_CATALOG_VENDOR_ID_ATTRIBUTE_ID (0x0006)
#define ZCL_APPLICATION_STATUS_ATTRIBUTE_ID (0x0007)
@@ -3839,7 +3844,7 @@
#define ZCL_PRICE_TRAILING_DIGIT_ATTRIBUTE_ID (0x0021)
#define ZCL_PRICE_ATTRIBUTE_ID (0x0022)
#define ZCL_GOOD_ID_ATTRIBUTE_ID (0x0030)
-#define ZCL_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
+#define ZCL_PAYMENT_SERIAL_NUMBER_ATTRIBUTE_ID (0x0031)
#define ZCL_PAYMENT_TIMESTAMP_ATTRIBUTE_ID (0x0032)
#define ZCL_TRANS_ID_ATTRIBUTE_ID (0x0033)
#define ZCL_TRANS_STATUS_ATTRIBUTE_ID (0x0034)
@@ -4085,12 +4090,6 @@
// Server attributes
-// Attribute ids for cluster: Network Commissioning
-
-// Client attributes
-
-// Server attributes
-
// Attribute ids for cluster: Binding
// Client attributes
diff --git a/examples/chip-tool/gen/client-command-macro.h b/examples/chip-tool/gen/client-command-macro.h
index c4f2f0a4a2a4f2..79d1e159594a4a 100644
--- a/examples/chip-tool/gen/client-command-macro.h
+++ b/examples/chip-tool/gen/client-command-macro.h
@@ -256,15 +256,6 @@
emberAfFillExternalBuffer(mask, clusterId, ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID, "ub", discoveryComplete, \
extendedDiscoverAttributesInfoRecords, extendedDiscoverAttributesInfoRecordsLen);
-/** @brief Command description for ResetToFactoryDefaults
- *
- * Command: ResetToFactoryDefaults
- */
-#define emberAfFillCommandBasicClusterResetToFactoryDefaults() \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID, "", );
-
/** @brief Command description for Identify
*
* Command: Identify
@@ -1795,6 +1786,33 @@
totalNumberOfNonEmptyProxyTableEntries, gpdSrcId, startIndex, gpdIeee, entriesCount, endpoint, \
proxyTableEntries, proxyTableEntriesLen, index);
+/** @brief Command description for StartUp
+ *
+ * Command: StartUp
+ */
+#define emberAfFillCommandBasicClusterStartUp() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_START_UP_COMMAND_ID, "", );
+
+/** @brief Command description for ShutDown
+ *
+ * Command: ShutDown
+ */
+#define emberAfFillCommandBasicClusterShutDown() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SHUT_DOWN_COMMAND_ID, "", );
+
+/** @brief Command description for Leave
+ *
+ * Command: Leave
+ */
+#define emberAfFillCommandBasicClusterLeave() \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_LEAVE_COMMAND_ID, "", );
+
/** @brief Command description for SetFabric
*
* Command: SetFabric
@@ -1893,6 +1911,225 @@
\
ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+/** @brief Command description for ScanNetworks
+ *
+ * Command: ScanNetworks
+ * @param ssid OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
+
+/** @brief Command description for ScanNetworksResponse
+ *
+ * Command: ScanNetworksResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ * @param wifiScanResults WiFiInterfaceScanResult []
+ * @param wifiScanResultsLen int
+ * @param threadScanResults ThreadInterfaceScanResult []
+ * @param threadScanResultsLen int
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
+ threadScanResultsLen) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
+ wifiScanResultsLen, threadScanResults, threadScanResultsLen);
+
+/** @brief Command description for AddWiFiNetwork
+ *
+ * Command: AddWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddWiFiNetworkResponse
+ *
+ * Command: AddWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateWiFiNetwork
+ *
+ * Command: UpdateWiFiNetwork
+ * @param ssid OCTET_STRING
+ * @param credentials OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateWiFiNetworkResponse
+ *
+ * Command: UpdateWiFiNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for AddThreadNetwork
+ *
+ * Command: AddThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for AddThreadNetworkResponse
+ *
+ * Command: AddThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for UpdateThreadNetwork
+ *
+ * Command: UpdateThreadNetwork
+ * @param operationalDataset OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
+
+/** @brief Command description for UpdateThreadNetworkResponse
+ *
+ * Command: UpdateThreadNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for RemoveNetwork
+ *
+ * Command: RemoveNetwork
+ * @param NetworkID OCTET_STRING
+ * @param Breadcrumb INT64U
+ * @param TimeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
+
+/** @brief Command description for RemoveNetworkResponse
+ *
+ * Command: RemoveNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for EnableNetwork
+ *
+ * Command: EnableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for EnableNetworkResponse
+ *
+ * Command: EnableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for DisableNetwork
+ *
+ * Command: DisableNetwork
+ * @param networkID OCTET_STRING
+ * @param breadcrumb INT64U
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
+
+/** @brief Command description for DisableNetworkResponse
+ *
+ * Command: DisableNetworkResponse
+ * @param errorCode INT8U
+ * @param debugText CHAR_STRING
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
+
+/** @brief Command description for GetLastNetworkCommissioningResult
+ *
+ * Command: GetLastNetworkCommissioningResult
+ * @param timeoutMs INT32U
+ */
+#define emberAfFillCommandNetwork \
+ CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
@@ -5765,225 +6002,6 @@
ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID, "uuuub", startIndex, total, startIndex, count, \
endpointInformationRecordList, endpointInformationRecordListLen);
-/** @brief Command description for ScanNetworks
- *
- * Command: ScanNetworks
- * @param ssid OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworks(ssid, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_COMMAND_ID, "uuu", ssid, breadcrumb, timeoutMs);
-
-/** @brief Command description for ScanNetworksResponse
- *
- * Command: ScanNetworksResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- * @param wifiScanResults WiFiInterfaceScanResult []
- * @param wifiScanResultsLen int
- * @param threadScanResults ThreadInterfaceScanResult []
- * @param threadScanResultsLen int
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterScanNetworksResponse(errorCode, debugText, wifiScanResults, wifiScanResultsLen, threadScanResults, \
- threadScanResultsLen) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, "uubb", errorCode, debugText, wifiScanResults, \
- wifiScanResultsLen, threadScanResults, threadScanResultsLen);
-
-/** @brief Command description for AddWiFiNetwork
- *
- * Command: AddWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddWiFiNetworkResponse
- *
- * Command: AddWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateWiFiNetwork
- *
- * Command: UpdateWiFiNetwork
- * @param ssid OCTET_STRING
- * @param credentials OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetwork(ssid, credentials, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID, "uuuu", ssid, credentials, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateWiFiNetworkResponse
- *
- * Command: UpdateWiFiNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateWiFiNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for AddThreadNetwork
- *
- * Command: AddThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for AddThreadNetworkResponse
- *
- * Command: AddThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterAddThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for UpdateThreadNetwork
- *
- * Command: UpdateThreadNetwork
- * @param operationalDataset OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetwork(operationalDataset, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID, "uuu", operationalDataset, breadcrumb, timeoutMs);
-
-/** @brief Command description for UpdateThreadNetworkResponse
- *
- * Command: UpdateThreadNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterUpdateThreadNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for RemoveNetwork
- *
- * Command: RemoveNetwork
- * @param NetworkID OCTET_STRING
- * @param Breadcrumb INT64U
- * @param TimeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetwork(NetworkID, Breadcrumb, TimeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_COMMAND_ID, "uuu", NetworkID, Breadcrumb, TimeoutMs);
-
-/** @brief Command description for RemoveNetworkResponse
- *
- * Command: RemoveNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterRemoveNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for EnableNetwork
- *
- * Command: EnableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for EnableNetworkResponse
- *
- * Command: EnableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterEnableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for DisableNetwork
- *
- * Command: DisableNetwork
- * @param networkID OCTET_STRING
- * @param breadcrumb INT64U
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetwork(networkID, breadcrumb, timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_COMMAND_ID, "uuu", networkID, breadcrumb, timeoutMs);
-
-/** @brief Command description for DisableNetworkResponse
- *
- * Command: DisableNetworkResponse
- * @param errorCode INT8U
- * @param debugText CHAR_STRING
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterDisableNetworkResponse(errorCode, debugText) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID, "uu", errorCode, debugText);
-
-/** @brief Command description for GetLastNetworkCommissioningResult
- *
- * Command: GetLastNetworkCommissioningResult
- * @param timeoutMs INT32U
- */
-#define emberAfFillCommandNetwork \
- CommissioningClusterGetLastNetworkCommissioningResult(timeoutMs) \
- emberAfFillExternalBuffer(mask, \
- \
- ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
-
/** @brief Command description for Bind
*
* Command: Bind
diff --git a/examples/chip-tool/gen/cluster-id.h b/examples/chip-tool/gen/cluster-id.h
index 2069290df636a7..add8f83d188cf8 100644
--- a/examples/chip-tool/gen/cluster-id.h
+++ b/examples/chip-tool/gen/cluster-id.h
@@ -20,9 +20,6 @@
// Prevent multiple inclusion
#pragma once
-// Definitions for cluster: Basic
-#define ZCL_BASIC_CLUSTER_ID (0x0000)
-
// Definitions for cluster: Power Configuration
#define ZCL_POWER_CONFIG_CLUSTER_ID (0x0001)
@@ -83,9 +80,15 @@
// Definitions for cluster: Keep-Alive
#define ZCL_KEEPALIVE_CLUSTER_ID (0x0025)
+// Definitions for cluster: Basic
+#define ZCL_BASIC_CLUSTER_ID (0x0028)
+
// Definitions for cluster: General Commissioning
#define ZCL_GENERAL_COMMISSIONING_CLUSTER_ID (0x0030)
+// Definitions for cluster: Network Commissioning
+#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
@@ -341,9 +344,6 @@
// Definitions for cluster: ZLL Commissioning
#define ZCL_ZLL_COMMISSIONING_CLUSTER_ID (0x1000)
-// Definitions for cluster: Network Commissioning
-#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0xAAAA)
-
// Definitions for cluster: Binding
#define ZCL_BINDING_CLUSTER_ID (0xF000)
diff --git a/examples/chip-tool/gen/command-id.h b/examples/chip-tool/gen/command-id.h
index 655425d5d43d35..864943b5727fcd 100644
--- a/examples/chip-tool/gen/command-id.h
+++ b/examples/chip-tool/gen/command-id.h
@@ -45,10 +45,6 @@
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_COMMAND_ID (0x15)
#define ZCL_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE_COMMAND_ID (0x16)
-// Commands for cluster: Basic
-#define ZCL_RESET_TO_FACTORY_DEFAULTS_COMMAND_ID (0x00)
-#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
-
// Commands for cluster: Identify
#define ZCL_IDENTIFY_COMMAND_ID (0x00)
#define ZCL_IDENTIFY_QUERY_RESPONSE_COMMAND_ID (0x00)
@@ -226,6 +222,12 @@
#define ZCL_GP_PROXY_TABLE_RESPONSE_COMMAND_ID (0x0B)
#define ZCL_GP_PROXY_TABLE_REQUEST_COMMAND_ID (0x0B)
+// Commands for cluster: Basic
+#define ZCL_START_UP_COMMAND_ID (0x00)
+#define ZCL_MFG_SPECIFIC_PING_COMMAND_ID (0x00)
+#define ZCL_SHUT_DOWN_COMMAND_ID (0x01)
+#define ZCL_LEAVE_COMMAND_ID (0x02)
+
// Commands for cluster: General Commissioning
#define ZCL_SET_FABRIC_COMMAND_ID (0x00)
#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01)
@@ -236,6 +238,25 @@
#define ZCL_COMMISSIONING_COMPLETE_COMMAND_ID (0x06)
#define ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID (0x07)
+// Commands for cluster: Network Commissioning
+#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
+#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
+#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
+#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
+#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
+#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
+#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
+#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
+#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
+#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
+#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
+#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
+#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
+#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
+#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
+#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
@@ -698,25 +719,6 @@
#define ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID (0x42)
#define ZCL_GET_ENDPOINT_LIST_RESPONSE_COMMAND_ID (0x42)
-// Commands for cluster: Network Commissioning
-#define ZCL_SCAN_NETWORKS_COMMAND_ID (0x00)
-#define ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID (0x01)
-#define ZCL_ADD_WI_FI_NETWORK_COMMAND_ID (0x02)
-#define ZCL_ADD_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x03)
-#define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04)
-#define ZCL_UPDATE_WI_FI_NETWORK_RESPONSE_COMMAND_ID (0x05)
-#define ZCL_ADD_THREAD_NETWORK_COMMAND_ID (0x06)
-#define ZCL_ADD_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x07)
-#define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08)
-#define ZCL_UPDATE_THREAD_NETWORK_RESPONSE_COMMAND_ID (0x09)
-#define ZCL_REMOVE_NETWORK_COMMAND_ID (0x0A)
-#define ZCL_REMOVE_NETWORK_RESPONSE_COMMAND_ID (0x0B)
-#define ZCL_ENABLE_NETWORK_COMMAND_ID (0x0C)
-#define ZCL_ENABLE_NETWORK_RESPONSE_COMMAND_ID (0x0D)
-#define ZCL_DISABLE_NETWORK_COMMAND_ID (0x0E)
-#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
-#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
-
// Commands for cluster: Binding
#define ZCL_BIND_COMMAND_ID (0x00)
#define ZCL_UNBIND_COMMAND_ID (0x01)
diff --git a/examples/chip-tool/gen/endpoint_config.h b/examples/chip-tool/gen/endpoint_config.h
index 2b8eb4cef7440f..482e761307e597 100644
--- a/examples/chip-tool/gen/endpoint_config.h
+++ b/examples/chip-tool/gen/endpoint_config.h
@@ -58,10 +58,7 @@
#define GENERATED_ATTRIBUTE_COUNT 16
#define GENERATED_ATTRIBUTES \
{ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 3 } }, /* Basic (client): cluster revision */ \
- { \
- 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 2 } \
- }, /* Identify (client): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 2 } }, /* Identify (client): cluster revision */ \
{ \
0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 3 } \
}, /* Groups (client): cluster revision */ \
@@ -74,6 +71,9 @@
{ \
0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 3 } \
}, /* Level Control (client): cluster revision */ \
+ { \
+ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT) | ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
+ }, /* Basic (client): cluster revision */ \
{ \
0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), { (uint8_t *) 0x0001 } \
}, /* General Commissioning (client): cluster revision */ \
@@ -116,16 +116,14 @@
#define GENERATED_CLUSTER_COUNT 16
#define GENERATED_CLUSTERS \
{ \
- { 0x0000, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Basic (client) */ \
- { \
- 0x0003, ZAP_ATTRIBUTE_INDEX(1), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
- }, /* Endpoint: 1, Cluster: Identify (client) */ \
- { 0x0004, ZAP_ATTRIBUTE_INDEX(2), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Groups (client) */ \
- { 0x0005, ZAP_ATTRIBUTE_INDEX(3), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Scenes (client) */ \
- { 0x0006, ZAP_ATTRIBUTE_INDEX(4), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: On/off (client) */ \
+ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \
+ { 0x0004, ZAP_ATTRIBUTE_INDEX(1), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Groups (client) */ \
+ { 0x0005, ZAP_ATTRIBUTE_INDEX(2), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Scenes (client) */ \
+ { 0x0006, ZAP_ATTRIBUTE_INDEX(3), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: On/off (client) */ \
{ \
- 0x0008, ZAP_ATTRIBUTE_INDEX(5), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0008, ZAP_ATTRIBUTE_INDEX(4), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Level Control (client) */ \
+ { 0x0028, ZAP_ATTRIBUTE_INDEX(5), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Basic (client) */ \
{ \
0x0030, ZAP_ATTRIBUTE_INDEX(6), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: General Commissioning (client) */ \
@@ -170,7 +168,7 @@
#define ATTRIBUTE_LARGEST (2)
// Total size of singleton attributes
-#define ATTRIBUTE_SINGLETONS_SIZE (0)
+#define ATTRIBUTE_SINGLETONS_SIZE (2)
// Total size of attribute storage
#define ATTRIBUTE_MAX_SIZE (32)
@@ -217,14 +215,10 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (127)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (129)
#define GENERATED_COMMANDS \
{ \
- { 0x0000, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* Basic (client): MfgSpecificPing */ \
- { \
- 0x0000, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) | ZAP_COMMAND_MASK(OUTGOING_CLIENT) \
- }, /* Basic (client): ResetToFactoryDefaults */ \
- { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (client): Identify */ \
+ { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (client): Identify */ \
{ 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Identify (client): IdentifyQueryResponse */ \
{ 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (client): IdentifyQuery */ \
{ 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Groups (client): AddGroup */ \
@@ -261,6 +255,10 @@
{ 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (client): MoveWithOnOff */ \
{ 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (client): StepWithOnOff */ \
{ 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Level Control (client): StopWithOnOff */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* Basic (client): MfgSpecificPing */ \
+ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (client): StartUp */ \
+ { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (client): ShutDown */ \
+ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (client): Leave */ \
{ 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* General Commissioning (client): SetFabric */ \
{ 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* General Commissioning (client): SetFabricResponse */ \
{ 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* General Commissioning (client): ArmFailSafe */ \
@@ -440,7 +438,7 @@
#define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (1)
#define GENERATED_COMMAND_MANUFACTURER_CODES \
{ \
- { 0, 4098 }, \
+ { 37, 4098 }, \
}
// This is an array of EmberAfManufacturerCodeEntry structures for clusters.
@@ -465,16 +463,7 @@
#define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
#define ZAP_REPORT_DIRECTION(x) ZRD(x)
-// Use this macro to check if Reporting plugin is included
-#define EMBER_AF_PLUGIN_REPORTING
-// User options for plugin Reporting
-#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (1)
-#define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS
-
-#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
+#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (0)
#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \
{ \
- { \
- ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0000, 0xFFFD, ZAP_CLUSTER_MASK(CLIENT), 0x0000, { { 0, 65344, 0 } } \
- }, /* Reporting for cluster: "Basic", attribute: "cluster revision". side: client */ \
}
diff --git a/examples/chip-tool/gen/print-cluster.h b/examples/chip-tool/gen/print-cluster.h
index 1ea31513afebcd..8c737e93fea79c 100644
--- a/examples/chip-tool/gen/print-cluster.h
+++ b/examples/chip-tool/gen/print-cluster.h
@@ -24,12 +24,6 @@
// to the "EmberAfClusterName" defined in the ZCL header.
// The names of clusters that are not present, are removed.
-#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 0, "Basic" },
-#else
-#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
-#endif
-
#if defined(ZCL_USING_POWER_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_POWER_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER { ZCL_POWER_CONFIG_CLUSTER_ID, 1, "Power Configuration" },
#else
@@ -150,12 +144,24 @@
#define CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER
#endif
+#if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, 40, "Basic" },
+#else
+#define CHIP_PRINTCLUSTER_BASIC_CLUSTER
+#endif
+
#if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, 48, "General Commissioning" },
#else
#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 49, "Network Commissioning" },
+#else
+#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -734,12 +740,6 @@
#define CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER
#endif
-#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT)
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, 43690, "Network Commissioning" },
-#else
-#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
-#endif
-
#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, 61440, "Binding" },
#else
@@ -790,7 +790,6 @@
#endif
#define CLUSTER_IDS_TO_NAMES \
- CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_POWER_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DEVICE_TEMP_CLUSTER \
CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER \
@@ -811,7 +810,9 @@
CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \
CHIP_PRINTCLUSTER_GREEN_POWER_CLUSTER \
CHIP_PRINTCLUSTER_KEEPALIVE_CLUSTER \
+ CHIP_PRINTCLUSTER_BASIC_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
@@ -897,7 +898,6 @@
CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \
CHIP_PRINTCLUSTER_DIAGNOSTICS_CLUSTER \
CHIP_PRINTCLUSTER_ZLL_COMMISSIONING_CLUSTER \
- CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_BINDING_CLUSTER \
CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER \
CHIP_PRINTCLUSTER_CONTENT_LAUNCH_CLUSTER \
diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt
index d59fb1ee790dc1..2f4623a48fc177 100644
--- a/examples/chip-tool/templates/commands.zapt
+++ b/examples/chip-tool/templates/commands.zapt
@@ -7,7 +7,6 @@
#include "ModelCommand.h"
#include "gen/CHIPClientCallbacks.h"
#include
-#include
#include
static void OnDefaultSuccessResponse(void * context)
@@ -26,12 +25,6 @@ static void OnDefaultFailureResponse(void * context, uint8_t status)
command->SetCommandExitStatus(false);
}
-typedef void (*UnsupportedAttributeCallback)(void * context);
-static void OnUnsupportedAttributeResponse(void * context)
-{
- ChipLogError(chipTool, "Unsupported attribute Response. This should never happen !");
-}
-
static void OnBooleanAttributeResponse(void * context, bool value)
{
ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);
@@ -56,9 +49,9 @@ static void OnInt16uAttributeResponse(void * context, uint16_t value)
command->SetCommandExitStatus(true);
}
-static void OnInt16sAttributeResponse(void * context, int16_t value)
+static void OnInt32uAttributeResponse(void * context, uint32_t value)
{
- ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+ ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);
ModelCommand * command = reinterpret_cast(context);
command->SetCommandExitStatus(true);
@@ -72,6 +65,27 @@ static void OnInt64uAttributeResponse(void * context, uint64_t value)
command->SetCommandExitStatus(true);
}
+static void OnInt16sAttributeResponse(void * context, int16_t value)
+{
+ ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+
+ ModelCommand * command = reinterpret_cast(context);
+ command->SetCommandExitStatus(true);
+}
+
+static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
+{
+ char * str = (char *)malloc(value.size() * sizeof(char));
+ memmove(str, value.data(), value.size());
+ str[value.size()] = '\0';
+ free(str);
+
+ ChipLogProgress(chipTool, "String attribute Response: %s (%" PRIu16 ")", str, strlen(str));
+
+ ModelCommand * command = reinterpret_cast(context);
+ command->SetCommandExitStatus(true);
+}
+
{{#all_user_clusters}}
{{#if (isClient side) }}
{{#if (user_cluster_has_enabled_command name side)}}
@@ -129,7 +143,7 @@ public:
chip::Controller::{{asCamelCased parent.name false}}Cluster cluster;
cluster.Associate(device, endpointId);
- return cluster.{{asCamelCased name false}}(onSuccessCallback->Cancel(), onFailureCallback->Cancel(){{#chip_server_cluster_command_arguments}}, {{#if (isByteString type)}} chip::ByteSpan(chip::Uint8::from_char(m{{asCamelCased label false}}), strlen(m{{asCamelCased label false}})){{else}}m{{asCamelCased label false}}{{/if}}{{/chip_server_cluster_command_arguments}});
+ return cluster.{{asCamelCased name false}}(onSuccessCallback->Cancel(), onFailureCallback->Cancel(){{#chip_server_cluster_command_arguments}}, {{#if (isString type)}} chip::ByteSpan(chip::Uint8::from_char(m{{asCamelCased label false}}), strlen(m{{asCamelCased label false}})){{else}}m{{asCamelCased label false}}{{/if}}{{/chip_server_cluster_command_arguments}});
}
private:
@@ -209,7 +223,11 @@ public:
Write{{asCamelCased parent.name false}}{{asCamelCased name false}}(): ModelCommand("write")
{
AddArgument("attr-name", "{{asDelimitedCommand (asCamelCased name)}}");
+ {{#if (isString type)}}
+ AddArgument("attr-value", &mValue);
+ {{else}}
AddArgument("attr-value", {{asTypeMinValue type}}, {{asTypeMaxValue type}}, &mValue);
+ {{/if}}
ModelCommand::AddArguments();
}
@@ -219,13 +237,17 @@ public:
chip::Controller::{{asCamelCased parent.name false}}Cluster cluster;
cluster.Associate(device, endpointId);
- return cluster.WriteAttribute{{asCamelCased name false}}(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
+ return cluster.WriteAttribute{{asCamelCased name false}}(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), {{#if (isString type)}} chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)){{else}}mValue{{/if}});
}
private:
chip::Callback::Callback * onSuccessCallback = new chip::Callback::Callback(OnDefaultSuccessResponse, this);
chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this);
+ {{#if (isString type)}}
+ char * mValue;
+ {{else}}
{{chipType}} mValue;
+ {{/if}}
};
{{/if}}
diff --git a/examples/chip-tool/templates/helper.js b/examples/chip-tool/templates/helper.js
index 71a2c7ef73ec9b..8028578770d4f9 100644
--- a/examples/chip-tool/templates/helper.js
+++ b/examples/chip-tool/templates/helper.js
@@ -55,81 +55,6 @@ function hasSpecificResponse(commandName)
return templateUtil.templatePromise(this.global, promise);
}
-function asCallbackAttributeType(attributeType)
-{
- switch (parseInt(attributeType)) {
- case 0x00: // nodata / No data
- case 0x0A: // data24 / 24-bit data
- case 0x0C: // data40 / 40-bit data
- case 0x0D: // data48 / 48-bit data
- case 0x0E: // data56 / 56-bit data
- case 0x1A: // map24 / 24-bit bitmap
- case 0x1C: // map40 / 40-bit bitmap
- case 0x1D: // map48 / 48-bit bitmap
- case 0x1E: // map56 / 56-bit bitmap
- case 0x22: // uint24 / Unsigned 24-bit integer
- case 0x24: // uint40 / Unsigned 40-bit integer
- case 0x25: // uint48 / Unsigned 48-bit integer
- case 0x26: // uint56 / Unsigned 56-bit integer
- case 0x2A: // int24 / Signed 24-bit integer
- case 0x2C: // int40 / Signed 40-bit integer
- case 0x2D: // int48 / Signed 48-bit integer
- case 0x2E: // int56 / Signed 56-bit integer
- case 0x38: // semi / Semi-precision
- case 0x39: // single / Single precision
- case 0x3A: // double / Double precision
- case 0x41: // octstr / Octet string
- case 0x42: // string / Character string
- case 0x43: // octstr16 / Long octet string
- case 0x44: // string16 / Long character string
- case 0x48: // array / Array
- case 0x49: // struct / Structure
- case 0x50: // set / Set
- case 0x51: // bag / Bag
- case 0xE0: // ToD / Time of day
- return 'Unsupported';
- case 0x08: // data8 / 8-bit data
- case 0x18: // map8 / 8-bit bitmap
- case 0x20: // uint8 / Unsigned 8-bit integer
- case 0x30: // enum8 / 8-bit enumeration
- return 'Int8u';
- case 0x09: // data16 / 16-bit data
- case 0x19: // map16 / 16-bit bitmap
- case 0x21: // uint16 / Unsigned 16-bit integer
- case 0x31: // enum16 / 16-bit enumeration
- case 0xE8: // clusterId / Cluster ID
- case 0xE9: // attribId / Attribute ID
- case 0xEA: // bacOID / BACnet OID
- case 0xF1: // key128 / 128-bit security key
- case 0xFF: // unk / Unknown
- return 'Int16u';
- case 0x0B: // data32 / 32-bit data
- case 0x1B: // map32 / 32-bit bitmap
- case 0x23: // uint32 / Unsigned 32-bit integer
- case 0xE1: // date / Date
- case 0xE2: // UTC / UTCTime
- return 'Int32u';
- case 0x0F: // data64 / 64-bit data
- case 0x1F: // map64 / 64-bit bitmap
- case 0x27: // uint64 / Unsigned 64-bit integer
- case 0xF0: // EUI64 / IEEE address
- return 'Int64u';
- case 0x10: // bool / Boolean
- return 'Boolean';
- case 0x28: // int8 / Signed 8-bit integer
- return 'Int8s';
- case 0x29: // int16 / Signed 16-bit integer
- return 'Int16s';
- case 0x2B: // int32 / Signed 32-bit integer
- return 'Int32s';
- case 0x2F: // int64 / Signed 64-bit integer
- return 'Int64s';
- default:
- error = 'Unhandled attribute type ' + attributeType;
- throw error;
- }
-}
-
function asDelimitedCommand(name)
{
return name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
@@ -203,9 +128,8 @@ function isStrEndsWith(str, substr)
//
// Module exports
//
-exports.hasSpecificResponse = hasSpecificResponse;
-exports.asCallbackAttributeType = asCallbackAttributeType;
-exports.asDelimitedCommand = asDelimitedCommand;
-exports.asTypeMinValue = asTypeMinValue;
-exports.asTypeMaxValue = asTypeMaxValue;
-exports.isStrEndsWith = isStrEndsWith;
+exports.hasSpecificResponse = hasSpecificResponse;
+exports.asDelimitedCommand = asDelimitedCommand;
+exports.asTypeMinValue = asTypeMinValue;
+exports.asTypeMaxValue = asTypeMaxValue;
+exports.isStrEndsWith = isStrEndsWith;
diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp
index 8c1599ecf58cfb..212a3491823a66 100644
--- a/examples/lighting-app/efr32/src/AppTask.cpp
+++ b/examples/lighting-app/efr32/src/AppTask.cpp
@@ -47,7 +47,7 @@
#define FACTORY_RESET_TRIGGER_TIMEOUT 3000
#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000
-#define APP_TASK_STACK_SIZE (4096)
+#define APP_TASK_STACK_SIZE (2048)
#define APP_TASK_PRIORITY 2
#define APP_EVENT_QUEUE_SIZE 10
#define EXAMPLE_VENDOR_ID 0xcafe
diff --git a/examples/lighting-app/k32w/.gn b/examples/lighting-app/k32w/.gn
new file mode 100644
index 00000000000000..3d48789e30ab3d
--- /dev/null
+++ b/examples/lighting-app/k32w/.gn
@@ -0,0 +1,28 @@
+# Copyright (c) 2020 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build_overrides/build.gni")
+
+# The location of the build configuration file.
+buildconfig = "${build_root}/config/BUILDCONFIG.gn"
+
+# CHIP uses angle bracket includes.
+check_system_includes = true
+
+default_args = {
+ target_cpu = "arm"
+ target_os = "freertos"
+
+ import("//args.gni")
+}
diff --git a/examples/lighting-app/k32w/BUILD.gn b/examples/lighting-app/k32w/BUILD.gn
new file mode 100644
index 00000000000000..53eb8fa4b9804f
--- /dev/null
+++ b/examples/lighting-app/k32w/BUILD.gn
@@ -0,0 +1,95 @@
+# Copyright (c) 2021 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/k32w_sdk.gni")
+import("//build_overrides/openthread.gni")
+
+import("${k32w_sdk_build_root}/k32w_executable.gni")
+import("${k32w_sdk_build_root}/k32w_sdk.gni")
+
+assert(current_os == "freertos")
+
+k32w_platform_dir = "${chip_root}/examples/platform/k32w"
+
+k32w_sdk("sdk") {
+ include_dirs = [
+ "main/include",
+ "main",
+ "${k32w_platform_dir}/app/project_include",
+ "${k32w_platform_dir}/app/support",
+ "${chip_root}/examples/lighting-app/lighting-common",
+ "${chip_root}/src/app/util",
+ "${chip_root}/src/app/server",
+ "${k32w_platform_dir}/util/include",
+ ]
+
+ sources = [
+ "${k32w_platform_dir}/app/project_include/CHIPProjectConfig.h",
+ "${k32w_platform_dir}/app/project_include/FreeRTOSConfig.h",
+ "${k32w_platform_dir}/app/project_include/OpenThreadConfig.h",
+ "main/include/app_config.h",
+ ]
+
+ public_deps =
+ [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform" ]
+
+ defines = []
+ if (is_debug) {
+ defines += [ "BUILD_RELEASE=0" ]
+ } else {
+ defines += [ "BUILD_RELEASE=1" ]
+ }
+}
+
+k32w_executable("light_app") {
+ output_name = "chip-k32w061-light-example"
+
+ sources = [
+ "${k32w_platform_dir}/util/LEDWidget.cpp",
+ "${k32w_platform_dir}/util/include/LEDWidget.h",
+ "main/AppTask.cpp",
+ "main/LightingManager.cpp",
+ "main/ZclCallbacks.cpp",
+ "main/include/AppEvent.h",
+ "main/include/AppTask.h",
+ "main/include/LightingManager.h",
+ "main/main.cpp",
+ ]
+
+ deps = [
+ ":sdk",
+ "${chip_root}/examples/common/QRCode",
+ "${chip_root}/examples/lighting-app/lighting-common",
+ "${chip_root}/src/lib",
+ "${chip_root}/third_party/mbedtls:mbedtls",
+ "${k32w_platform_dir}/app/support:freertos_mbedtls_utils",
+ "${openthread_root}:libopenthread-cli-ftd",
+ "${openthread_root}:libopenthread-ftd",
+ ]
+
+ output_dir = root_out_dir
+
+ ldscript = "${k32w_platform_dir}/app/ldscripts/chip-k32w061-linker.ld"
+
+ ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
+}
+
+group("k32w") {
+ deps = [ ":light_app" ]
+}
+
+group("default") {
+ deps = [ ":k32w" ]
+}
diff --git a/examples/lighting-app/k32w/README.md b/examples/lighting-app/k32w/README.md
new file mode 100644
index 00000000000000..a7ef3fac3deaca
--- /dev/null
+++ b/examples/lighting-app/k32w/README.md
@@ -0,0 +1,186 @@
+# CHIP K32W061 Lighting Example Application
+
+The Project CHIP K32W061 Lighting Example demonstrates how to remotely control a
+light bulb. The light bulb is simulated using one of the LEDs from the expansion
+board. It uses buttons to test turn on/turn off of the light bulb. You can use
+this example as a reference for creating your own application.
+
+The example is based on
+[Project CHIP](https://github.com/project-chip/connectedhomeip) and the NXP K32W
+SDK, and supports remote access and control of a light bulb over a low-power,
+802.15.4 Thread network.
+
+The example behaves as a Project CHIP accessory, that is a device that can be
+paired into an existing Project CHIP network and can be controlled by this
+network.
+
+