diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6bcebf1e7..284bba316 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,6 +37,9 @@ variables: - idf.py build .build_examples: &build_examples + - cd $ESP_MATTER_PATH/examples/zap_light + - idf.py set-target esp32 + - idf.py build - cd $ESP_MATTER_PATH/examples/light - idf.py set-target esp32 - idf.py build diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 000000000..7a7aeb095 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,63 @@ +# 2021-12-07 (esp_matter: New data model) + +This commit creates the dynamic ESP Matter data model and uses that instead of the +static data model in zap-generated. + +The examples create the ESP Matter data model using the new APIs and default configs. +These APIs add the mandatory clusters and the corresponding attributes and commands for the +device type (endpoint) created. +``` +static esp_matter_node_config_t node_config = NODE_CONFIG_DEFAULT(); +static esp_matter_endpoint_color_dimmable_light_config_t light_config = ENDPOINT_CONFIG_COLOR_DIMMABLE_LIGHT_DEFAULT(); + +esp_matter_node_t *node = esp_matter_node_create(&node_config, app_attribute_update_cb, NULL); +esp_matter_endpoint_t *endpoint = esp_matter_endpoint_create_color_dimmable_light(node, &light_config); +``` + +The examples have also been restructured and the matter submodule specific initialisations have +been moved to the esp_matter component and are called from the application with the new API. +``` +typedef void (*esp_matter_event_callback_t)(const ChipDeviceEvent *event, intptr_t arg); + +esp_err_t esp_matter_start(esp_matter_event_callback_t callback); +``` + +There is now just one attribute update callback which calls the other callbacks in the application. +The application receives this callback twice, once before updating the value in the data model (pre_attribute) +and once after updating the value (post_attribute). +``` +esp_err_t app_attribute_update_cb(esp_matter_callback_type_t type, int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val, void *priv_data); +``` + +The app_driver component has been moved to the application itself and it now uses the endpoint_id, +cluster_id, attribute_id for setting/getting the values. The application calls the the attribute_update +for drivers first when it gets the pre_attribute callback. If this returns success, i.e. ESP_OK, only then +the data model value is updated and the application receives the post_attribute callback. +``` +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); +``` + +The rainmaker example creates its data model dynamically based on the ESP Matter data model. New +params can be easily supported in the rainmaker example by adding to the app_rainmaker_get_* APIs. +The application calls the attribute_update for rainmaker and other ecosystems when it gets the post_attribute +callback. +``` +/* Create a device and add the relevant parameters to it */ +app_rainmaker_device_create(); + +esp_err_t app_rainmaker_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); +``` + +Non-mandatory endpoints, clusters, attributes or commands can also be easily added by using the +low level APIs. New device types (endpoints) and supporting clusters can be added from the spec +by looking at the existing APIs for reference. +``` +esp_matter_node_t *esp_matter_node_create_raw(); +esp_matter_endpoint_t *esp_matter_endpoint_create_raw(esp_matter_node_t *node, int endpoint_id); +esp_matter_cluster_t *esp_matter_cluster_create(esp_matter_endpoint_t *endpoint, int cluster_id, uint8_t flags); +esp_matter_attribute_t *esp_matter_attribute_create(esp_matter_cluster_t *cluster, int attribute_id, uint8_t flags, esp_matter_attr_val_t val); +esp_matter_command_t *esp_matter_command_create(esp_matter_cluster_t *cluster, int command_id, uint8_t flags, esp_matter_command_callback_t callback); +``` + +Another zap_light example has been added for backward compatibility, which uses the static data model +and the default zap-generated. diff --git a/components/esp_matter/CMakeLists.txt b/components/esp_matter/CMakeLists.txt index 30858206f..07806eeee 100644 --- a/components/esp_matter/CMakeLists.txt +++ b/components/esp_matter/CMakeLists.txt @@ -1,3 +1,45 @@ -idf_component_register(SRCS esp_matter.c - INCLUDE_DIRS . - PRIV_REQUIRES ) +set(SRC_DIRS_LIST "." + "${ZAP_GENERATED_PATH}" + "${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes" + "${MATTER_SDK_PATH}/src/app" + "${MATTER_SDK_PATH}/src/app/server" + "${MATTER_SDK_PATH}/src/app/util" + "${MATTER_SDK_PATH}/src/app/reporting" + "${MATTER_SDK_PATH}/src/app/clusters/basic" + "${MATTER_SDK_PATH}/src/app/clusters/administrator-commissioning-server" + "${MATTER_SDK_PATH}/src/app/clusters/application-basic-server" + "${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server" + "${MATTER_SDK_PATH}/src/app/clusters/general-diagnostics-server" + "${MATTER_SDK_PATH}/src/app/clusters/fixed-label-server" + "${MATTER_SDK_PATH}/src/app/clusters/user-label-server" + "${MATTER_SDK_PATH}/src/app/clusters/ota-provider" + "${MATTER_SDK_PATH}/src/app/clusters/ota-requestor" + "${MATTER_SDK_PATH}/src/app/clusters/network-commissioning" + "${MATTER_SDK_PATH}/src/app/clusters/diagnostic-logs-server" + "${MATTER_SDK_PATH}/src/app/clusters/software-diagnostics-server" + "${MATTER_SDK_PATH}/src/app/clusters/thread-network-diagnostics-server" + "${MATTER_SDK_PATH}/src/app/clusters/wifi-network-diagnostics-server" + "${MATTER_SDK_PATH}/src/app/clusters/on-off-server" + "${MATTER_SDK_PATH}/src/app/clusters/operational-credentials-server" + "${MATTER_SDK_PATH}/src/app/clusters/descriptor" + "${MATTER_SDK_PATH}/src/app/clusters/level-control" + "${MATTER_SDK_PATH}/src/app/clusters/identify-server" + "${MATTER_SDK_PATH}/src/app/clusters/groups-server" + "${MATTER_SDK_PATH}/src/app/clusters/scenes" + "${MATTER_SDK_PATH}/src/app/clusters/color-control-server") + +set(INCLUDE_DIRS_LIST "." + "${MATTER_SDK_PATH}/zzz_generated/app-common" + "${MATTER_SDK_PATH}/src" + "${ZAP_GENERATED_PATH}/../") + +set(REQUIRES_LIST chip bt) + +idf_component_register( SRC_DIRS ${SRC_DIRS_LIST} + INCLUDE_DIRS ${INCLUDE_DIRS_LIST} + REQUIRES ${REQUIRES_LIST}) + +# This has been added to fix the error and should be removed once fixed: +# esp-matter/connectedhomeip/connectedhomeip/src/app/EventManagement.cpp:467:23: error: 'writer' is +# used uninitialized in this function +idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized" APPEND) diff --git a/components/esp_matter/esp_matter.c b/components/esp_matter/esp_matter.c deleted file mode 100644 index 010890694..000000000 --- a/components/esp_matter/esp_matter.c +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#define NAME_MAX_LEN 20 - -static const char *TAG = "esp_matter"; - -typedef struct esp_matter_attr_cb { - char name[NAME_MAX_LEN]; - esp_matter_attribute_callback_t callback; - void *priv_data; - struct esp_matter_attr_cb *next; -} esp_matter_attr_cb_t; - -typedef struct { - esp_matter_attr_cb_t *callbacks; -} esp_matter_t; - -static esp_matter_t *esp_matter = NULL; - -esp_matter_attr_val_t esp_matter_bool(bool val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_BOOLEAN, - .val.b = val, - }; - return attr_val; -} - -esp_matter_attr_val_t esp_matter_int(int val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_INTEGER, - .val.i = val, - }; - return attr_val; -} - -esp_matter_attr_val_t esp_matter_float(float val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_FLOAT, - .val.f = val, - }; - return attr_val; -} - -esp_matter_attr_val_t esp_matter_str(const char *val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_STRING, - .val.s = (char *)val, - }; - return attr_val; -} - -esp_matter_attr_val_t esp_matter_obj(const char *val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_OBJECT, - .val.s = (char *)val, - }; - return attr_val; -} - -esp_matter_attr_val_t esp_matter_array(const char *val) -{ - esp_matter_attr_val_t attr_val = { - .type = ESP_MATTER_VAL_TYPE_ARRAY, - .val.s = (char *)val, - }; - return attr_val; -} - -esp_err_t esp_matter_attribute_notify(const char *name, const char *endpoint, const char *attribute, - esp_matter_attr_val_t val) -{ - if (!esp_matter) { - ESP_LOGE(TAG, "Init not done"); - return ESP_ERR_INVALID_STATE; - } - if (!name || !endpoint || !attribute) { - ESP_LOGE(TAG, "Name or endpoint or attribute cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - - /* Note: Even if a callback has not been added previously using esp_matter_attribute_callback_add(), it can still - * call this API to notify others. If this behaviour is to be changed, a check for name can be added here. */ - - /* Print */ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - ESP_LOGI(TAG, "********** %s changed %s's %s to %d **********", name, endpoint, attribute, val.val.b); - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - ESP_LOGI(TAG, "********** %s changed %s's %s to %d **********", name, endpoint, attribute, val.val.i); - } else if (val.type == ESP_MATTER_VAL_TYPE_FLOAT) { - ESP_LOGI(TAG, "********** %s changed %s's %s to %f **********", name, endpoint, attribute, val.val.f); - } else if (val.type == ESP_MATTER_VAL_TYPE_STRING || val.type == ESP_MATTER_VAL_TYPE_OBJECT || - val.type == ESP_MATTER_VAL_TYPE_ARRAY) { - ESP_LOGI(TAG, "********** %s changed %s's %s to %s **********", name, endpoint, attribute, val.val.s); - } else { - ESP_LOGI(TAG, "********** %s changed %s's %s to **********", name, endpoint, attribute); - ESP_LOGW(TAG, "Not notifying other callbacks."); - return ESP_ERR_INVALID_ARG; - } - - /* Callback */ - esp_matter_attr_cb_t *current_callback = esp_matter->callbacks; - while (current_callback) { - if (strncmp(current_callback->name, name, NAME_MAX_LEN) != 0) { - if (current_callback->callback) { - current_callback->callback(endpoint, attribute, val, current_callback->priv_data); - } - } - current_callback = current_callback->next; - } - return ESP_OK; -} - -esp_err_t esp_matter_attribute_callback_add(const char *name, esp_matter_attribute_callback_t callback, void *priv_data) -{ - if (!esp_matter) { - ESP_LOGE(TAG, "Init not done"); - return ESP_ERR_INVALID_STATE; - } - if (!name) { - ESP_LOGE(TAG, "Name cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - - /* Allocate and copy */ - esp_matter_attr_cb_t *new_callback = (esp_matter_attr_cb_t *)calloc(1, sizeof(esp_matter_attr_cb_t)); - if (new_callback == NULL) { - ESP_LOGE(TAG, "Failed to allocate memory for esp_matter_attr_cb_t"); - return ESP_ERR_NO_MEM; - } - strncpy(new_callback->name, name, strnlen(name, NAME_MAX_LEN)); - new_callback->callback = callback; - new_callback->priv_data = priv_data; - - /* Add to list */ - if (esp_matter->callbacks == NULL) { - esp_matter->callbacks = new_callback; - return ESP_OK; - } - esp_matter_attr_cb_t *previous_callback = esp_matter->callbacks; - while (previous_callback->next) { - previous_callback = previous_callback->next; - } - previous_callback->next = new_callback; - return ESP_OK; -} - -esp_err_t esp_matter_attribute_callback_remove(const char *name) -{ - if (!esp_matter) { - ESP_LOGE(TAG, "Init not done"); - return ESP_ERR_INVALID_STATE; - } - if (!name) { - ESP_LOGE(TAG, "Name cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - - /* Find callback */ - esp_matter_attr_cb_t *previous_callback = NULL; - esp_matter_attr_cb_t *current_callback = esp_matter->callbacks; - while (current_callback) { - if (strncmp(current_callback->name, name, NAME_MAX_LEN) == 0) { - break; - } - previous_callback = current_callback; - current_callback = current_callback->next; - } - if (current_callback == NULL) { - ESP_LOGE(TAG, "Could not find callback: %s", name); - return ESP_ERR_NOT_FOUND; - } - - /* Remove from list */ - if (previous_callback == NULL) { - esp_matter->callbacks = current_callback->next; - } else { - previous_callback->next = current_callback->next; - } - - /* Free up */ - free(current_callback); - return ESP_OK; -} - -esp_err_t esp_matter_init() -{ - if (esp_matter) { - ESP_LOGI(TAG, "Already initialized"); - return ESP_OK; - } - esp_matter = (esp_matter_t *)calloc(1, sizeof(esp_matter_t)); - if (!esp_matter) { - ESP_LOGE(TAG, "Failed to allocate memory for esp_matter_t"); - return ESP_ERR_NO_MEM; - } - return ESP_OK; -} diff --git a/components/esp_matter/esp_matter.h b/components/esp_matter/esp_matter.h index 5c48be3e0..ab368ee34 100644 --- a/components/esp_matter/esp_matter.h +++ b/components/esp_matter/esp_matter.h @@ -14,175 +14,21 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +/* +This is a common include file which includes all the other esp_matter component files which would be required by the +application. +*/ -#include -#include -#include +#include +#include +#include +#include +#include -#define REMAP_TO_RANGE(value, from, to) value *to / from +#include +#include +#include +#include -/** ESP Matter Attribute Value type */ -typedef enum { - /** Invalid */ - ESP_MATTER_VAL_TYPE_INVALID = 0, - /** Boolean */ - ESP_MATTER_VAL_TYPE_BOOLEAN, - /** Integer. Mapped to a 32 bit signed integer */ - ESP_MATTER_VAL_TYPE_INTEGER, - /** Floating point number */ - ESP_MATTER_VAL_TYPE_FLOAT, - /** NULL terminated string */ - ESP_MATTER_VAL_TYPE_STRING, - /** NULL terminated JSON Object string Eg. {"name":"value"} */ - ESP_MATTER_VAL_TYPE_OBJECT, - /** NULL terminated JSON Array string Eg. [1,2,3] */ - ESP_MATTER_VAL_TYPE_ARRAY, -} esp_matter_val_type_t; - -/* ESP Matter Value */ -typedef union { - /** Boolean */ - bool b; - /** Integer */ - int i; - /** Float */ - float f; - /** NULL terminated string. It should stay allocated throughout the lifetime of the device. */ - char *s; -} esp_matter_val_t; - -/* ESP Matter Attribute Value */ -typedef struct { - /** Type of Value */ - esp_matter_val_type_t type; - /** Actual value. Depends on the type */ - esp_matter_val_t val; -} esp_matter_attr_val_t; - -/** Callback for attribute value changed - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -typedef esp_err_t (*esp_matter_attribute_callback_t)(const char *endpoint, const char *attribute, - esp_matter_attr_val_t val, void *priv_data); - -/** - * Initialise a Boolean value - * - * @param[in] bval Initialising value. - * - * @return Value structure. - */ -esp_matter_attr_val_t esp_matter_bool(bool bval); - -/** - * Initialise an Integer value - * - * @param[in] ival Initialising value. - * - * @return Value structure. - */ -esp_matter_attr_val_t esp_matter_int(int ival); - -/** - * Initialise a Float value - * - * @param[in] fval Initialising value. - * - * @return Value structure. - */ -esp_matter_attr_val_t esp_matter_float(float fval); - -/** - * Initialise a String value - * - * @param[in] sval Initialising value. - * - * @return Value structure. - */ -esp_matter_attr_val_t esp_matter_str(const char *sval); - -/** - * Initialise a json object value - * - * @note the object will not be validated internally. it is the application's - * responsibility to ensure that the object is a valid json object. - * eg. esp_matter_obj("{\"name\":\"value\"}"); - * - * @param[in] val Initialising value - * - * @return Value structure - */ -esp_matter_attr_val_t esp_matter_obj(const char *val); - -/** - * Initialise a json array value - * - * @note the array will not be validated internally. it is the application's - * responsibility to ensure that the array is a valid json array. - * eg. esp_matter_array("[1,2,3]"); - * - * @param[in] val Initialising value - * - * @return Value structure - */ -esp_matter_attr_val_t esp_matter_array(const char *val); - -/** Add callback - * - * Add a new callback. The callback will then be called if the value of any attributes have been changed by some other - * callback. - * - * @param[in] name Callback name - * @param[in] callback Callback for value change - * @param[in] priv_data (Optional) Private data associated with the callback. This will be passed to the callback. - * It should stay allocated throughout the lifetime of the device. - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t esp_matter_attribute_callback_add(const char *name, esp_matter_attribute_callback_t callback, - void *priv_data); - -/** Remove callback - * - * Remove a previously added callback - * - * @param[in] name Callback name - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t esp_matter_attribute_callback_remove(const char *name); - -/** Notify other callbacks - * - * Notify other callbacks about the change in the value of any attribute for the endpoint - * - * @param[in] name Callback name - * @param[in] endpoint Endpoint name - * @param[in] attribute Attribute name - * @param[in] val Attribute value - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t esp_matter_attribute_notify(const char *name, const char *endpoint, const char *attribute, - esp_matter_attr_val_t val); - -/** Initialize ESP Matter - * - * This initializes the handling of different callbacks - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t esp_matter_init(); - -#ifdef __cplusplus -} -#endif +#include +#include diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp new file mode 100644 index 000000000..cefb8f5d7 --- /dev/null +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -0,0 +1,697 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include + +#include +#include + +using chip::AttributeId; +using chip::ClusterId; +using chip::EndpointId; +using chip::Protocols::InteractionModel::Status; + +static const char *TAG = "esp_matter"; + +static esp_matter_attribute_callback_t attribute_callback = NULL; +static void *attribute_callback_priv_data = NULL; + +esp_matter_attr_val_t esp_matter_invalid(void *val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_INVALID, + .val = { + .p = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_bool(bool val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_BOOLEAN, + .val = { + .b = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_int(int val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_INTEGER, + .val = { + .i = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_float(float val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_FLOAT, + .val = { + .f = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_str(const char *val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_STRING, + .val = { + .s = (char *)val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_json_obj(const char *val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_JSON_OBJECT, + .val = { + .s = (char *)val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_json_array(const char *val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_JSON_ARRAY, + .val = { + .s = (char *)val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_int8(int8_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_INT8, + .val = { + .i8 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_uint8(uint8_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_UINT8, + .val = { + .u8 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_uint16(uint16_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_UINT16, + .val = { + .u16 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_uint32(uint32_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_UINT32, + .val = { + .u32 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_uint64(uint64_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_UINT64, + .val = { + .u64 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_enum8(uint8_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_ENUM8, + .val = { + .u8 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_bitmap8(uint8_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_BITMAP8, + .val = { + .u8 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_bitmap16(uint16_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_BITMAP16, + .val = { + .u16 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_bitmap32(uint32_t val) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_BITMAP32, + .val = { + .u32 = val, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_char_str(char *val, uint16_t total_size) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_CHAR_STRING, + .val = { + .a = { + .b = (uint8_t *)val, + .s = total_size, + .n = 0, + }, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_octet_str(uint8_t *val, uint16_t total_size, uint16_t count) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_OCTET_STRING, + .val = { + .a = { + .b = val, + .s = total_size, + .n = count, + }, + }, + }; + return attr_val; +} + +esp_matter_attr_val_t esp_matter_array(uint8_t *val, uint16_t total_size, uint16_t count) +{ + esp_matter_attr_val_t attr_val = { + .type = ESP_MATTER_VAL_TYPE_ARRAY, + .val = { + .a = { + .b = val, + .s = total_size, + .n = count, + }, + }, + }; + return attr_val; +} + +esp_err_t esp_matter_attribute_get_type_and_val_default(esp_matter_attr_val_t *val, + EmberAfAttributeType *attribute_type, uint16_t *attribute_size, + EmberAfDefaultOrMinMaxAttributeValue *default_value) +{ + switch (val->type) { + case ESP_MATTER_VAL_TYPE_BOOLEAN: + *attribute_type = ZCL_BOOLEAN_ATTRIBUTE_TYPE; + *attribute_size = sizeof(bool); + *default_value = (uint16_t)val->val.b; + break; + + case ESP_MATTER_VAL_TYPE_INTEGER: + *attribute_type = ZCL_INT16U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *default_value = (uint16_t)val->val.i; + break; + + case ESP_MATTER_VAL_TYPE_FLOAT: + *attribute_type = ZCL_SINGLE_ATTRIBUTE_TYPE; + *attribute_size = sizeof(float); + *default_value = (uint8_t *)&val->val.f; + break; + + case ESP_MATTER_VAL_TYPE_STRING: + *attribute_type = ZCL_CHAR_STRING_ATTRIBUTE_TYPE; + if (val->val.s) { + *attribute_size = strlen(val->val.s); + } else { + *attribute_size = 0; + } + *default_value = (uint8_t *)val->val.s; + break; + + case ESP_MATTER_VAL_TYPE_ARRAY: + *attribute_type = ZCL_ARRAY_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *default_value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_CHAR_STRING: + *attribute_type = ZCL_CHAR_STRING_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *default_value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_BYTE_STRING: + ESP_LOGE(TAG, "esp_matter_attr_val_type_t not supported: %d", val->type); + break; + + case ESP_MATTER_VAL_TYPE_OCTET_STRING: + *attribute_type = ZCL_OCTET_STRING_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *default_value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_INT8: + *attribute_type = ZCL_INT8S_ATTRIBUTE_TYPE; + *attribute_size = sizeof(int8_t); + *default_value = (uint16_t)val->val.i8; + break; + + case ESP_MATTER_VAL_TYPE_UINT8: + *attribute_type = ZCL_INT8U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *default_value = (uint16_t)val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_UINT16: + *attribute_type = ZCL_INT16U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *default_value = (uint16_t)val->val.u16; + break; + + case ESP_MATTER_VAL_TYPE_UINT32: + *attribute_type = ZCL_INT32U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint32_t); + *default_value = (uint8_t *)&val->val.u32; + break; + + case ESP_MATTER_VAL_TYPE_UINT64: + *attribute_type = ZCL_INT64U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint64_t); + *default_value = (uint8_t *)&val->val.u64; + break; + + case ESP_MATTER_VAL_TYPE_ENUM8: + *attribute_type = ZCL_ENUM8_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *default_value = (uint16_t)val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP8: + *attribute_type = ZCL_BITMAP8_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *default_value = (uint16_t)val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP16: + *attribute_type = ZCL_BITMAP16_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *default_value = (uint16_t)val->val.u16; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP32: + *attribute_type = ZCL_BITMAP32_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint32_t); + *default_value = (uint8_t *)&val->val.u32; + break; + + default: + ESP_LOGE(TAG, "esp_matter_attr_val_type_t not handled: %d", val->type); + break; + } + + return ESP_OK; +} + +static esp_err_t esp_matter_attribute_get_type_and_val(esp_matter_attr_val_t *val, EmberAfAttributeType *attribute_type, + uint16_t *attribute_size, uint8_t **value) +{ + switch (val->type) { + case ESP_MATTER_VAL_TYPE_BOOLEAN: + *attribute_type = ZCL_BOOLEAN_ATTRIBUTE_TYPE; + *attribute_size = sizeof(bool); + *value = (uint8_t *)&val->val.b; + break; + + case ESP_MATTER_VAL_TYPE_INTEGER: + *attribute_type = ZCL_INT16U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *value = (uint8_t *)&val->val.i; + break; + + case ESP_MATTER_VAL_TYPE_FLOAT: + *attribute_type = ZCL_SINGLE_ATTRIBUTE_TYPE; + *attribute_size = sizeof(float); + *value = (uint8_t *)&val->val.f; + break; + + case ESP_MATTER_VAL_TYPE_STRING: + *attribute_type = ZCL_CHAR_STRING_ATTRIBUTE_TYPE; + if (val->val.s) { + *attribute_size = strlen(val->val.s); + } else { + *attribute_size = 0; + } + *value = (uint8_t *)val->val.s; + break; + + case ESP_MATTER_VAL_TYPE_ARRAY: + *attribute_type = ZCL_ARRAY_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_CHAR_STRING: + *attribute_type = ZCL_CHAR_STRING_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_BYTE_STRING: + ESP_LOGE(TAG, "esp_matter_attr_val_type_t not supported: %d", val->type); + break; + + case ESP_MATTER_VAL_TYPE_OCTET_STRING: + *attribute_type = ZCL_OCTET_STRING_ATTRIBUTE_TYPE; + *attribute_size = val->val.a.s; + *value = (uint8_t *)val->val.a.b; + break; + + case ESP_MATTER_VAL_TYPE_INT8: + *attribute_type = ZCL_INT8S_ATTRIBUTE_TYPE; + *attribute_size = sizeof(int8_t); + *value = (uint8_t *)&val->val.i8; + break; + + case ESP_MATTER_VAL_TYPE_UINT8: + *attribute_type = ZCL_INT8U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *value = (uint8_t *)&val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_UINT16: + *attribute_type = ZCL_INT16U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *value = (uint8_t *)&val->val.u16; + break; + + case ESP_MATTER_VAL_TYPE_UINT32: + *attribute_type = ZCL_INT32U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint32_t); + *value = (uint8_t *)&val->val.u32; + break; + + case ESP_MATTER_VAL_TYPE_UINT64: + *attribute_type = ZCL_INT64U_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint64_t); + *value = (uint8_t *)&val->val.u64; + break; + + case ESP_MATTER_VAL_TYPE_ENUM8: + *attribute_type = ZCL_ENUM8_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *value = (uint8_t *)&val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP8: + *attribute_type = ZCL_BITMAP8_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint8_t); + *value = (uint8_t *)&val->val.u8; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP16: + *attribute_type = ZCL_BITMAP16_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint16_t); + *value = (uint8_t *)&val->val.u16; + break; + + case ESP_MATTER_VAL_TYPE_BITMAP32: + *attribute_type = ZCL_BITMAP32_ATTRIBUTE_TYPE; + *attribute_size = sizeof(uint32_t); + *value = (uint8_t *)&val->val.u32; + break; + + default: + ESP_LOGE(TAG, "esp_matter_attr_val_type_t not handled: %d", val->type); + break; + } + + return ESP_OK; +} + +static esp_matter_attr_val_t esp_matter_attribute_get_attr_val(EmberAfAttributeType attribute_type, + uint16_t attribute_size, uint8_t *value) +{ + switch (attribute_type) { + case ZCL_BOOLEAN_ATTRIBUTE_TYPE: + return esp_matter_bool((bool)*value); + break; + + case ZCL_ARRAY_ATTRIBUTE_TYPE: + return esp_matter_array(value, attribute_size, (uint16_t)value[0]); + break; + + case ZCL_CHAR_STRING_ATTRIBUTE_TYPE: + return esp_matter_char_str((char *)&value[1], value[0]); + break; + + case ZCL_OCTET_STRING_ATTRIBUTE_TYPE: + return esp_matter_octet_str(value, attribute_size, (uint16_t)value[0]); + break; + + case ZCL_INT8S_ATTRIBUTE_TYPE: + return esp_matter_int8((int8_t)*value); + break; + + case ZCL_INT8U_ATTRIBUTE_TYPE: + return esp_matter_uint8((uint8_t)*value); + break; + + case ZCL_INT16U_ATTRIBUTE_TYPE: + return esp_matter_uint16((uint16_t)*value); + break; + + case ZCL_INT32U_ATTRIBUTE_TYPE: + return esp_matter_uint32((uint32_t)*value); + break; + + case ZCL_INT64U_ATTRIBUTE_TYPE: + return esp_matter_uint64((uint64_t)*value); + break; + + case ZCL_ENUM8_ATTRIBUTE_TYPE: + return esp_matter_enum8((uint8_t)*value); + break; + + case ZCL_BITMAP8_ATTRIBUTE_TYPE: + return esp_matter_bitmap8((uint8_t)*value); + break; + + case ZCL_BITMAP16_ATTRIBUTE_TYPE: + return esp_matter_bitmap16((uint16_t)*value); + break; + + default: + return esp_matter_invalid(NULL); + break; + } +} + +void esp_matter_attribute_val_print(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id, + cluster_id, attribute_id, val.val.b); + } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id, + cluster_id, attribute_id, val.val.i); + } else if (val.type == ESP_MATTER_VAL_TYPE_FLOAT) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %f **********", endpoint_id, + cluster_id, attribute_id, val.val.f); + } else if (val.type == ESP_MATTER_VAL_TYPE_STRING || val.type == ESP_MATTER_VAL_TYPE_JSON_OBJECT || + val.type == ESP_MATTER_VAL_TYPE_JSON_ARRAY) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %s **********", endpoint_id, + cluster_id, attribute_id, val.val.s); + } else if (val.type == ESP_MATTER_VAL_TYPE_UINT8 || val.type == ESP_MATTER_VAL_TYPE_BITMAP8) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id, + cluster_id, attribute_id, val.val.u8); + } else if (val.type == ESP_MATTER_VAL_TYPE_UINT16) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id, + cluster_id, attribute_id, val.val.u16); + } else if (val.type == ESP_MATTER_VAL_TYPE_UINT32) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id, + cluster_id, attribute_id, val.val.u32); + } else if (val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING) { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %.*s **********", endpoint_id, + cluster_id, attribute_id, val.val.a.s, val.val.a.b); + } else { + ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is **********", + endpoint_id, cluster_id, attribute_id, val.type); + } +} + +esp_err_t esp_matter_attribute_callback_set(esp_matter_attribute_callback_t callback, void *priv_data) +{ + attribute_callback = callback; + attribute_callback_priv_data = priv_data; + return ESP_OK; +} + +esp_err_t esp_matter_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + EmberAfAttributeType attribute_type = 0; + uint16_t attribute_size = 0; + uint8_t *value = NULL; + esp_matter_attribute_get_type_and_val(&val, &attribute_type, &attribute_size, &value); + + /* Update matter */ + EmberAfStatus status = emberAfWriteServerAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_type); + if (status != EMBER_ZCL_STATUS_SUCCESS) { + ESP_LOGE(TAG, "Error updating attribute to matter"); + return ESP_FAIL; + } + return ESP_OK; +} + +Status MatterPreAttributeChangeCallback(const chip::app::ConcreteAttributePath &path, uint8_t mask, uint8_t type, + uint16_t size, uint8_t *value) +{ + int endpoint_id = path.mEndpointId; + int cluster_id = path.mClusterId; + int attribute_id = path.mAttributeId; + esp_matter_attr_val_t val = esp_matter_attribute_get_attr_val(type, size, value); + + /* Print */ + esp_matter_attribute_val_print(endpoint_id, cluster_id, attribute_id, val); + + /* Callback to application */ + if (attribute_callback) { + esp_err_t err = attribute_callback(ESP_MATTER_CALLBACK_TYPE_PRE_ATTRIBUTE, endpoint_id, cluster_id, + attribute_id, val, attribute_callback_priv_data); + if (err != ESP_OK) { + return Status::Failure; + } + } + return Status::Success; +} + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &path, uint8_t mask, uint8_t type, + uint16_t size, uint8_t *value) +{ + int endpoint_id = path.mEndpointId; + int cluster_id = path.mClusterId; + int attribute_id = path.mAttributeId; + esp_matter_attr_val_t val = esp_matter_attribute_get_attr_val(type, size, value); + + /* Callback to application */ + if (attribute_callback) { + attribute_callback(ESP_MATTER_CALLBACK_TYPE_POST_ATTRIBUTE, endpoint_id, cluster_id, attribute_id, val, + attribute_callback_priv_data); + } +} + +EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, ClusterId cluster_id, + EmberAfAttributeMetadata *matter_attribute, + uint16_t manufacturer_code, uint8_t *buffer, + uint16_t max_read_length) +{ + /* Get value */ + int attribute_id = matter_attribute->attributeId; + esp_matter_node_t *node = esp_matter_node_get(); + if (!node) { + return EMBER_ZCL_STATUS_FAILURE; + } + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get(node, endpoint_id); + esp_matter_cluster_t *cluster = esp_matter_cluster_get(endpoint, cluster_id); + esp_matter_attribute_t *attribute = esp_matter_attribute_get(cluster, attribute_id); + esp_matter_attr_val_t val = esp_matter_attribute_get_val(attribute); + + /* Convert */ + EmberAfAttributeType attribute_type = 0; + uint16_t attribute_size = 0; + uint8_t *value = NULL; + esp_matter_attribute_get_type_and_val(&val, &attribute_type, &attribute_size, &value); + + if (attribute_size > max_read_length) { + return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE; + } + + /* Assign value */ + *buffer = *value; + return EMBER_ZCL_STATUS_SUCCESS; +} + +EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, ClusterId cluster_id, + EmberAfAttributeMetadata *matter_attribute, + uint16_t manufacturer_code, uint8_t *buffer) +{ + /* Get value */ + int attribute_id = matter_attribute->attributeId; + esp_matter_node_t *node = esp_matter_node_get(); + if (!node) { + return EMBER_ZCL_STATUS_FAILURE; + } + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get(node, endpoint_id); + esp_matter_cluster_t *cluster = esp_matter_cluster_get(endpoint, cluster_id); + esp_matter_attribute_t *attribute = esp_matter_attribute_get(cluster, attribute_id); + esp_matter_attr_val_t val = esp_matter_attribute_get_val(attribute); + + /* Convert */ + EmberAfAttributeType attribute_type = 0; + uint16_t attribute_size = 0; + uint8_t *value = NULL; + esp_matter_attribute_get_type_and_val(&val, &attribute_type, &attribute_size, &value); + + /* Convert back */ + value = buffer; + val = esp_matter_attribute_get_attr_val(attribute_type, attribute_size, value); + + /* Update value */ + esp_matter_attribute_set_val(attribute, val); + return EMBER_ZCL_STATUS_SUCCESS; +} diff --git a/components/esp_matter/esp_matter_attribute.h b/components/esp_matter/esp_matter_attribute.h new file mode 100644 index 000000000..11d3d900a --- /dev/null +++ b/components/esp_matter/esp_matter_attribute.h @@ -0,0 +1,176 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include + +#define REMAP_TO_RANGE(value, from, to) ((value * to) / from) + +/** ESP Matter Attribute Value type */ +typedef enum { + /** Invalid */ + ESP_MATTER_VAL_TYPE_INVALID = 0, + /** Boolean */ + ESP_MATTER_VAL_TYPE_BOOLEAN, + /** Integer. Mapped to a 32 bit signed integer */ + ESP_MATTER_VAL_TYPE_INTEGER, + /** Floating point number */ + ESP_MATTER_VAL_TYPE_FLOAT, + /** NULL terminated string */ + ESP_MATTER_VAL_TYPE_STRING, + /** Array Eg. [1,2,3] */ + ESP_MATTER_VAL_TYPE_ARRAY, + /** Byte String Eg. "123" */ + ESP_MATTER_VAL_TYPE_CHAR_STRING, + /** Byte String Eg. [0x01, 0x20] */ + ESP_MATTER_VAL_TYPE_BYTE_STRING, + /** Octet String Eg. [0x01, 0x20] */ + ESP_MATTER_VAL_TYPE_OCTET_STRING, + /** 8 bit signed integer */ + ESP_MATTER_VAL_TYPE_INT8, + /** 8 bit unsigned integer */ + ESP_MATTER_VAL_TYPE_UINT8, + /** 16 bit unsigned integer */ + ESP_MATTER_VAL_TYPE_UINT16, + /** 32 bit unsigned integer */ + ESP_MATTER_VAL_TYPE_UINT32, + /** 64 bit unsigned integer */ + ESP_MATTER_VAL_TYPE_UINT64, + /** 8 bit enum */ + ESP_MATTER_VAL_TYPE_ENUM8, + /** 8 bit bitmap */ + ESP_MATTER_VAL_TYPE_BITMAP8, + /** 16 bit bitmap */ + ESP_MATTER_VAL_TYPE_BITMAP16, + /** 32 bit bitmap */ + ESP_MATTER_VAL_TYPE_BITMAP32, + /** NULL terminated JSON Object string Eg. "{\"name\":\"value\"}" */ + ESP_MATTER_VAL_TYPE_JSON_OBJECT, + /** NULL terminated JSON Array string Eg. "[1,2,3]" */ + ESP_MATTER_VAL_TYPE_JSON_ARRAY, +} esp_matter_val_type_t; + +/* ESP Matter Value */ +typedef union { + /** Boolean */ + bool b; + /** Integer */ + int i; + /** Float */ + float f; + /** NULL terminated string. It should stay allocated throughout the lifetime of the device. */ + char *s; + /** 8 bit signed integer */ + int8_t i8; + /** 8 bit unsigned integer */ + uint8_t u8; + /** 16 bit unsigned integer */ + uint16_t u16; + /** 32 bit unsigned integer */ + uint32_t u32; + /** 64 bit unsigned integer */ + uint64_t u64; + /** Array */ + struct { + /** Buffer */ + uint8_t *b; + /** Total size */ + uint16_t s; + /** Total count */ + uint16_t n; + } a; + /** Pointer */ + void *p; +} esp_matter_val_t; + +/* ESP Matter Attribute Value */ +typedef struct { + /** Type of Value */ + esp_matter_val_type_t type; + /** Actual value. Depends on the type */ + esp_matter_val_t val; +} esp_matter_attr_val_t; + +/*** Attribute val APIs ***/ +/** Invalid */ +esp_matter_attr_val_t esp_matter_invalid(void *val); + +/** Boolean */ +esp_matter_attr_val_t esp_matter_bool(bool val); + +/** Integer */ +esp_matter_attr_val_t esp_matter_int(int val); + +/** Float */ +esp_matter_attr_val_t esp_matter_float(float val); + +/** String */ +esp_matter_attr_val_t esp_matter_str(const char *val); + +/** JSON object string */ +esp_matter_attr_val_t esp_matter_json_obj(const char *val); + +/** JSON array string */ +esp_matter_attr_val_t esp_matter_json_array(const char *val); + +/** 8 bit integer */ +esp_matter_attr_val_t esp_matter_int8(int8_t val); + +/** 8 bit unsigned integer */ +esp_matter_attr_val_t esp_matter_uint8(uint8_t val); + +/** 16 bit unsigned integer */ +esp_matter_attr_val_t esp_matter_uint16(uint16_t val); + +/** 32 bit unsigned integer */ +esp_matter_attr_val_t esp_matter_uint32(uint32_t val); + +/** 64 bit unsigned integer */ +esp_matter_attr_val_t esp_matter_uint64(uint64_t val); + +/** 8 bit enum */ +esp_matter_attr_val_t esp_matter_enum8(uint8_t val); + +/** 8 bit bitmap */ +esp_matter_attr_val_t esp_matter_bitmap8(uint8_t val); + +/** 16 bit bitmap */ +esp_matter_attr_val_t esp_matter_bitmap16(uint16_t val); + +/** 32 bit bitmap */ +esp_matter_attr_val_t esp_matter_bitmap32(uint32_t val); + +/** Character string */ +esp_matter_attr_val_t esp_matter_char_str(char *val, uint16_t total_size); + +/** Octet string */ +esp_matter_attr_val_t esp_matter_octet_str(uint8_t *val, uint16_t total_size, uint16_t count); + +/** Array */ +esp_matter_attr_val_t esp_matter_array(uint8_t *val, uint16_t total_size, uint16_t count); + +/** Attribute update + * + * This API updates the attribute value + */ +esp_err_t esp_matter_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); + +/** Attribute value print + * + * This API prints the attribute value according to the type + */ +void esp_matter_attribute_val_print(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp new file mode 100644 index 000000000..615f2ef55 --- /dev/null +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -0,0 +1,554 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include +#include +#include +#include + +esp_matter_cluster_t *esp_matter_cluster_create_descriptor(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_descriptor_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_DESCRIPTOR_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_DEVICE_LIST_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->device_type_list, sizeof(config->device_type_list), 0)); + esp_matter_attribute_create(cluster, ZCL_SERVER_LIST_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->server_list, sizeof(config->server_list), 0)); + esp_matter_attribute_create(cluster, ZCL_CLIENT_LIST_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->client_list, sizeof(config->client_list), 0)); + esp_matter_attribute_create(cluster, ZCL_PARTS_LIST_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->parts_list, sizeof(config->parts_list), 0)); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_access_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_access_control_config_t *config, + uint8_t flags) +{ + /* Not implemented + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_ACCESS_CONTROL_CLUSTER_ID, + CLUSTER_MASK_SERVER); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_ACL_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->acl, sizeof(config->acl), 0)); + esp_matter_attribute_create(cluster, ZCL_EXTENSION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->extension, sizeof(config->extension), 0)); + + return cluster; + */ + return NULL; +} + +esp_matter_cluster_t *esp_matter_cluster_create_basic(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_basic_config_t *config, uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_BASIC_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_INTERACTION_MODEL_VERSION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->interaction_model_version)); + esp_matter_attribute_create(cluster, ZCL_VENDOR_NAME_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->vendor_name, sizeof(config->vendor_name))); + esp_matter_attribute_create(cluster, ZCL_VENDOR_ID_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->vendor_id)); + esp_matter_attribute_create(cluster, ZCL_PRODUCT_NAME_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->product_name, sizeof(config->product_name))); + esp_matter_attribute_create(cluster, ZCL_PRODUCT_ID_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->product_id)); + esp_matter_attribute_create(cluster, ZCL_NODE_LABEL_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->node_label, sizeof(config->node_label))); + esp_matter_attribute_create(cluster, ZCL_LOCATION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->location, sizeof(config->location))); + esp_matter_attribute_create(cluster, ZCL_HARDWARE_VERSION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->hardware_version)); + esp_matter_attribute_create(cluster, ZCL_HARDWARE_VERSION_STRING_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->hardware_version_string, + sizeof(config->hardware_version_string))); + esp_matter_attribute_create(cluster, ZCL_SOFTWARE_VERSION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint32(config->software_version)); + esp_matter_attribute_create(cluster, ZCL_SOFTWARE_VERSION_STRING_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->software_version_string, + sizeof(config->software_version_string))); + esp_matter_attribute_create(cluster, ZCL_SERIAL_NUMBER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_char_str(config->serial_number, sizeof(config->serial_number))); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_ota_provider(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_ota_provider_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_OTA_PROVIDER_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + + esp_matter_command_create(cluster, ZCL_QUERY_IMAGE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_query_image); + esp_matter_command_create(cluster, ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_query_image_response); + esp_matter_command_create(cluster, ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_apply_update_request); + esp_matter_command_create(cluster, ZCL_APPLY_UPDATE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_apply_update_response); + esp_matter_command_create(cluster, ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_notify_update_applied); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_ota_requestor(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_ota_requestor_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_OTA_REQUESTOR_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_DEFAULT_OTA_PROVIDER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_octet_str(config->default_ota_providers, + sizeof(config->default_ota_providers), 0)); + esp_matter_attribute_create(cluster, ZCL_UPDATE_POSSIBLE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bool(config->update_possible)); + /* Not impplemented + esp_matter_attribute_create(cluster, ZCL_UPDATE_STATE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->update_state)); + esp_matter_attribute_create(cluster, ZCL_UPDATE_STATE_PROGRESS_PROVIDERS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->update_state_progress)); + */ + + esp_matter_command_create(cluster, ZCL_ANNOUNCE_OTA_PROVIDER_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_announce_ota_provider); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_general_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_general_commissioning_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_BREADCRUMB_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint64(config->breadcrumb)); + esp_matter_attribute_create(cluster, ZCL_BASICCOMMISSIONINGINFO_LIST_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->basic_commissioning_info, + sizeof(config->basic_commissioning_info), 0)); + esp_matter_attribute_create(cluster, ZCL_REGULATORYCONFIG_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->regulatory_config)); + esp_matter_attribute_create(cluster, ZCL_LOCATIONCAPABILITY_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->location_capability)); + + esp_matter_command_create(cluster, ZCL_ARM_FAIL_SAFE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_arm_fail_safe); + esp_matter_command_create(cluster, ZCL_ARM_FAIL_SAFE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_arm_fail_safe_response); + esp_matter_command_create(cluster, ZCL_SET_REGULATORY_CONFIG_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_set_regulatory_config); + esp_matter_command_create(cluster, ZCL_SET_REGULATORY_CONFIG_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_set_regulatory_config_response); + esp_matter_command_create(cluster, ZCL_COMMISSIONING_COMPLETE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_commissioning_complete); + esp_matter_command_create(cluster, ZCL_COMMISSIONING_COMPLETE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_commissioning_complete_response); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_network_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_network_commissioning_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap32(config->feature_map)); + esp_matter_attribute_create(cluster, ZCL_MAX_NETWORKS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->max_networks)); + esp_matter_attribute_create(cluster, ZCL_NETWORKS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->networks, sizeof(config->networks), 0)); + esp_matter_attribute_create(cluster, ZCL_SCAN_MAX_TIME_SECONDS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->scan_max_time_seconds)); + esp_matter_attribute_create(cluster, ZCL_CONNECT_MAX_TIME_SECONDS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->connect_max_time_seconds)); + esp_matter_attribute_create(cluster, ZCL_INTERFACE_ENABLED_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bool(config->interface_enabled)); + esp_matter_attribute_create(cluster, ZCL_LAST_NETWORKING_STATUS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->last_networking_status)); + esp_matter_attribute_create(cluster, ZCL_LAST_NETWORK_ID_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_octet_str(config->last_network_id, sizeof(config->last_network_id), 0)); + esp_matter_attribute_create(cluster, ZCL_LAST_CONNECT_ERROR_VALUE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint32(config->last_connect_error_value)); + + esp_matter_command_create(cluster, ZCL_SCAN_NETWORKS_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_scan_networks); + esp_matter_command_create(cluster, ZCL_SCAN_NETWORKS_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_scan_networks_response); + esp_matter_command_create(cluster, ZCL_ADD_OR_UPDATE_WI_FI_NETWORK_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_or_update_wifi_network); + esp_matter_command_create(cluster, ZCL_ADD_OR_UPDATE_THREAD_NETWORK_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_or_update_thread_network); + esp_matter_command_create(cluster, ZCL_REMOVE_NETWORK_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_network); + esp_matter_command_create(cluster, ZCL_NETWORK_CONFIG_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_network_config_response); + esp_matter_command_create(cluster, ZCL_CONNECT_NETWORK_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_connect_network); + esp_matter_command_create(cluster, ZCL_CONNECT_NETWORK_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_connect_network_response); + esp_matter_command_create(cluster, ZCL_REORDER_NETWORK_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_reorder_network); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_general_diagnostics(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_general_diagnostics_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_NETWORK_INTERFACES_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->network_interfaces, sizeof(config->network_interfaces), 0)); + esp_matter_attribute_create(cluster, ZCL_REBOOT_COUNT_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->reboot_count)); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_administrator_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_administrator_commissioning_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID, + flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_WINDOW_STATUS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->window_status)); + esp_matter_attribute_create(cluster, ZCL_ADMIN_FABRIC_INDEX_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->admin_fabric_index)); + esp_matter_attribute_create(cluster, ZCL_ADMIN_VENDOR_ID_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->admin_vendor_id)); + + esp_matter_command_create(cluster, ZCL_OPEN_COMMISSIONING_WINDOW_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_open_commissioning_window); + esp_matter_command_create(cluster, ZCL_OPEN_BASIC_COMMISSIONING_WINDOW_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_open_basic_commissioning_window); + esp_matter_command_create(cluster, ZCL_REVOKE_COMMISSIONING_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_revoke_commissioning); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_operational_credentials(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_operational_credentials_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + /* Not implemented + esp_matter_attribute_create(cluster, ZCL_NOCS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->nocs, sizeof(config->nocs), 0)); + */ + esp_matter_attribute_create(cluster, ZCL_FABRICS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->fabrics, sizeof(config->fabrics), 0)); + esp_matter_attribute_create(cluster, ZCL_SUPPORTED_FABRICS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->supported_fabrics)); + esp_matter_attribute_create(cluster, ZCL_COMMISSIONED_FABRICS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->commissioned_fabrics)); + esp_matter_attribute_create(cluster, ZCL_TRUSTED_ROOTS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->trusted_root_certificates, + sizeof(config->trusted_root_certificates), 0)); + esp_matter_attribute_create(cluster, ZCL_CURRENT_FABRIC_INDEX_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->current_fabric_index)); + + esp_matter_command_create(cluster, ZCL_ATTESTATION_REQUEST_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_attestation_request); + esp_matter_command_create(cluster, ZCL_ATTESTATION_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_attestation_response); + esp_matter_command_create(cluster, ZCL_CERTIFICATE_CHAIN_REQUEST_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_certificate_chain_request); + esp_matter_command_create(cluster, ZCL_CERTIFICATE_CHAIN_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_certificate_chain_response); + esp_matter_command_create(cluster, ZCL_OP_CSR_REQUEST_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_csr_request); + esp_matter_command_create(cluster, ZCL_OP_CSR_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_csr_response); + esp_matter_command_create(cluster, ZCL_ADD_NOC_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_add_noc); + esp_matter_command_create(cluster, ZCL_UPDATE_NOC_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_update_noc); + esp_matter_command_create(cluster, ZCL_NOC_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_noc_response); + esp_matter_command_create(cluster, ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_update_fabric_label); + esp_matter_command_create(cluster, ZCL_REMOVE_FABRIC_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_fabric); + esp_matter_command_create(cluster, ZCL_ADD_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_trusted_root_certificate); + esp_matter_command_create(cluster, ZCL_REMOVE_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_trusted_root_certificate); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_group_key_management(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_group_key_management_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_GROUPS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->group_table, sizeof(config->group_table), 0)); + esp_matter_attribute_create(cluster, ZCL_GROUPKEYS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_array(config->group_key_map, sizeof(config->group_key_map), 0)); + /* Not implemented + esp_matter_attribute_create(cluster, ZCL_MAX_GROUPS_PER_FABRIC_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->max_groups_per_fabric)); + esp_matter_attribute_create(cluster, ZCL_MAX_GROUP_KEYS_PER_FABRIC_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->max_group_keys_per_fabric)); + + esp_matter_command_create(cluster, ZCL_KEY_SET_WRITE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_write); + esp_matter_command_create(cluster, ZCL_KEY_SET_READ_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_read); + esp_matter_command_create(cluster, ZCL_KEY_SET_READ_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_read_response); + esp_matter_command_create(cluster, ZCL_KEY_SET_REMOVE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_remove); + esp_matter_command_create(cluster, ZCL_KEY_SET_READ_ALL_INDICES_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_read_all_indices); + esp_matter_command_create(cluster, ZCL_KEY_SET_READ_ALL_INDICES_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_key_set_read_all_indices_response); + */ + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_identify(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_identify_config_t *config, uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_IDENTIFY_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->identify_time)); + esp_matter_attribute_create(cluster, ZCL_IDENTIFY_TYPE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->identify_type)); + + esp_matter_command_create(cluster, ZCL_IDENTIFY_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_identify); + esp_matter_command_create(cluster, ZCL_IDENTIFY_QUERY_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_identify_query); + esp_matter_command_create(cluster, ZCL_IDENTIFY_QUERY_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_identify_query_response); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_groups(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_groups_config_t *config, uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_GROUPS_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_GROUP_NAME_SUPPORT_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap8(config->name_support)); + + esp_matter_command_create(cluster, ZCL_ADD_GROUP_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_group); + esp_matter_command_create(cluster, ZCL_VIEW_GROUP_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_view_group); + esp_matter_command_create(cluster, ZCL_GET_GROUP_MEMBERSHIP_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_get_group_membership); + esp_matter_command_create(cluster, ZCL_REMOVE_GROUP_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_group); + esp_matter_command_create(cluster, ZCL_REMOVE_ALL_GROUPS_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_all_groups); + esp_matter_command_create(cluster, ZCL_ADD_GROUP_IF_IDENTIFYING_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_group_if_identifying); + esp_matter_command_create(cluster, ZCL_ADD_GROUP_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_group_response); + esp_matter_command_create(cluster, ZCL_VIEW_GROUP_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_view_group_response); + esp_matter_command_create(cluster, ZCL_GET_GROUP_MEMBERSHIP_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_get_group_membership_response); + esp_matter_command_create(cluster, ZCL_REMOVE_GROUP_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_group_response); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_scenes(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_scenes_config_t *config, uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_SCENES_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_SCENE_COUNT_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->scene_count)); + esp_matter_attribute_create(cluster, ZCL_CURRENT_SCENE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->current_scene)); + esp_matter_attribute_create(cluster, ZCL_CURRENT_GROUP_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->current_group)); + esp_matter_attribute_create(cluster, ZCL_SCENE_VALID_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bool(config->scene_valid)); + esp_matter_attribute_create(cluster, ZCL_SCENE_NAME_SUPPORT_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap8(config->name_support)); + + esp_matter_command_create(cluster, ZCL_ADD_SCENE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_scene); + esp_matter_command_create(cluster, ZCL_VIEW_SCENE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_view_scene); + esp_matter_command_create(cluster, ZCL_REMOVE_SCENE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_scene); + esp_matter_command_create(cluster, ZCL_REMOVE_ALL_SCENES_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_all_scenes); + esp_matter_command_create(cluster, ZCL_STORE_SCENE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_store_scene); + esp_matter_command_create(cluster, ZCL_RECALL_SCENE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_recall_scene); + esp_matter_command_create(cluster, ZCL_GET_SCENE_MEMBERSHIP_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_get_scene_membership); + esp_matter_command_create(cluster, ZCL_ADD_SCENE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_add_scene_response); + esp_matter_command_create(cluster, ZCL_VIEW_SCENE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_view_scene_response); + esp_matter_command_create(cluster, ZCL_REMOVE_SCENE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_scene_response); + esp_matter_command_create(cluster, ZCL_REMOVE_ALL_SCENES_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_remove_all_scenes_response); + esp_matter_command_create(cluster, ZCL_STORE_SCENE_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_store_scene_response); + esp_matter_command_create(cluster, ZCL_GET_SCENE_MEMBERSHIP_RESPONSE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_get_scene_membership_response); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_on_off(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_on_off_config_t *config, uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_ON_OFF_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_ON_OFF_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, esp_matter_bool(config->on_off)); + + esp_matter_command_create(cluster, ZCL_OFF_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_off); + esp_matter_command_create(cluster, ZCL_ON_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_on); + esp_matter_command_create(cluster, ZCL_TOGGLE_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_toggle); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_level_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_level_control_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->current_level)); + esp_matter_attribute_create(cluster, ZCL_ON_LEVEL_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->on_level)); + esp_matter_attribute_create(cluster, ZCL_OPTIONS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap8(config->options)); + + esp_matter_command_create(cluster, ZCL_MOVE_TO_LEVEL_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_to_level); + esp_matter_command_create(cluster, ZCL_MOVE_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_move); + esp_matter_command_create(cluster, ZCL_STEP_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_step); + esp_matter_command_create(cluster, ZCL_STOP_COMMAND_ID, COMMAND_MASK_NONE, esp_matter_command_callback_stop); + esp_matter_command_create(cluster, ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_to_level_with_on_off); + esp_matter_command_create(cluster, ZCL_MOVE_WITH_ON_OFF_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_with_on_off); + esp_matter_command_create(cluster, ZCL_STEP_WITH_ON_OFF_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_step_with_on_off); + esp_matter_command_create(cluster, ZCL_STOP_WITH_ON_OFF_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_stop_with_on_off); + + return cluster; +} + +esp_matter_cluster_t *esp_matter_cluster_create_color_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_color_control_config_t *config, + uint8_t flags) +{ + esp_matter_cluster_t *cluster = esp_matter_cluster_create(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, flags); + + esp_matter_attribute_create(cluster, ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint16(config->cluster_revision)); + esp_matter_attribute_create(cluster, ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap32(config->feature_map)); + esp_matter_attribute_create(cluster, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->current_hue)); + esp_matter_attribute_create(cluster, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_uint8(config->current_saturation)); + esp_matter_attribute_create(cluster, ZCL_COLOR_CONTROL_COLOR_MODE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->color_mode)); + esp_matter_attribute_create(cluster, ZCL_OPTIONS_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap8(config->options)); + esp_matter_attribute_create(cluster, ZCL_COLOR_CONTROL_ENHANCED_COLOR_MODE_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_enum8(config->enhanced_color_mode)); + esp_matter_attribute_create(cluster, ZCL_COLOR_CONTROL_COLOR_CAPABILITIES_ATTRIBUTE_ID, ATTRIBUTE_MASK_NONE, + esp_matter_bitmap16(config->color_capabilities)); + + esp_matter_command_create(cluster, ZCL_MOVE_TO_HUE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_to_hue); + esp_matter_command_create(cluster, ZCL_MOVE_HUE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_hue); + esp_matter_command_create(cluster, ZCL_STEP_HUE_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_step_hue); + esp_matter_command_create(cluster, ZCL_MOVE_TO_SATURATION_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_to_saturation); + esp_matter_command_create(cluster, ZCL_MOVE_SATURATION_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_saturation); + esp_matter_command_create(cluster, ZCL_STEP_SATURATION_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_step_saturation); + esp_matter_command_create(cluster, ZCL_MOVE_TO_HUE_AND_SATURATION_COMMAND_ID, COMMAND_MASK_NONE, + esp_matter_command_callback_move_to_hue_and_saturation); + + return cluster; +} diff --git a/components/esp_matter/esp_matter_cluster.h b/components/esp_matter/esp_matter_cluster.h new file mode 100644 index 000000000..7b1072d63 --- /dev/null +++ b/components/esp_matter/esp_matter_cluster.h @@ -0,0 +1,362 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include + +#define ATTRIBUTE_MASK_NONE 0 +#define COMMAND_MASK_NONE 0 +#define CLUSTER_MASK_NONE 0 + +#define CLUSTER_CONFIG_DESCRIPTOR_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .device_type_list = {0}, \ + .server_list = {0}, \ + .client_list = {0}, \ + .parts_list = {0}, \ + } + +#define CLUSTER_CONFIG_ACCESS_CONTROL_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .acl = {0}, \ + .extension = {0}, \ + } + +#define CLUSTER_CONFIG_BASIC_DEFAULT() \ + { \ + .cluster_revision = 3, \ + .interaction_model_version = 1, \ + .vendor_name = {0}, \ + .vendor_id = 0, \ + .product_name = {0}, \ + .product_id = 0, \ + .node_label = {0}, \ + .location = {0}, \ + .hardware_version = 0, \ + .hardware_version_string = {0}, \ + .software_version = 0, \ + .software_version_string = {0}, \ + .serial_number = {0}, \ + } + +#define CLUSTER_CONFIG_OTA_PROVIDER_DEFAULT() \ + { \ + .cluster_revision = 1, \ + } + +#define CLUSTER_CONFIG_OTA_REQUESTOR_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .default_ota_providers = {0}, \ + .update_possible = 0, \ + .update_state = 0, \ + .update_state_progress = 0, \ + } + +#define CLUSTER_CONFIG_GENERAL_COMMISSIONING_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .breadcrumb = 0, \ + .basic_commissioning_info = {0}, \ + .regulatory_config = 0, \ + .location_capability = 0, \ + } + +#define CLUSTER_CONFIG_NETWORK_COMMISSIONING_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .feature_map = 1, \ + .max_networks = 1, \ + .networks = {0}, \ + .scan_max_time_seconds = 0, \ + .connect_max_time_seconds = 0, \ + .interface_enabled = 0, \ + .last_networking_status = 0, \ + .last_network_id = {0}, \ + .last_connect_error_value = 0, \ + } + +#define CLUSTER_CONFIG_GENERAL_DIAGNOSTICS_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .network_interfaces = {0}, \ + .reboot_count = 0, \ + } + +#define CLUSTER_CONFIG_ADMINISTRATOR_COMMISSIONING_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .window_status = 0, \ + .admin_fabric_index = 0, \ + .admin_vendor_id = 0, \ + } + +#define CLUSTER_CONFIG_OPERATIONAL_CREDENTIALS_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .nocs = {0}, \ + .fabrics = {0}, \ + .supported_fabrics = 5, \ + .commissioned_fabrics = 0, \ + .trusted_root_certificates = {0}, \ + .current_fabric_index = 0, \ + } + +#define CLUSTER_CONFIG_GROUP_KEY_MANAGEMENT_DEFAULT() \ + { \ + .cluster_revision = 1, \ + .group_key_map = {0}, \ + .group_table = {0}, \ + .max_groups_per_fabric = 0, \ + .max_group_keys_per_fabric = 1, \ + } + +#define CLUSTER_CONFIG_IDENTIFY_DEFAULT() \ + { \ + .cluster_revision = 2, \ + .identify_time = 0, \ + .identify_type = 0, \ + } + +#define CLUSTER_CONFIG_GROUPS_DEFAULT() \ + { \ + .cluster_revision = 3, \ + .name_support = 0, \ + } + +#define CLUSTER_CONFIG_SCENES_DEFAULT() \ + { \ + .cluster_revision = 3, \ + .scene_count = 0, \ + .current_scene = 0, \ + .current_group = 0, \ + .scene_valid = false, \ + .name_support = 0, \ + } + +#define CLUSTER_CONFIG_ON_OFF_DEFAULT() \ + { \ + .cluster_revision = 4, \ + .on_off = false, \ + } + +#define CLUSTER_CONFIG_LEVEL_CONTROL_DEFAULT() \ + { \ + .cluster_revision = 3, \ + .current_level = 0, \ + .on_level = 0, \ + .options = 0, \ + } + +#define CLUSTER_CONFIG_COLOR_CONTROL_DEFAULT() \ + { \ + .cluster_revision = 3, \ + .feature_map = 1, \ + .current_hue = 0, \ + .current_saturation = 0, \ + .color_mode = 1, \ + .options = 0, \ + .enhanced_color_mode = 1, \ + .color_capabilities = 0, \ + } + +typedef struct esp_matter_cluster_descriptor_config { + uint16_t cluster_revision; + uint8_t device_type_list[254]; + uint8_t server_list[254]; + uint8_t client_list[254]; + uint8_t parts_list[254]; +} esp_matter_cluster_descriptor_config_t; + +typedef struct esp_matter_cluster_access_control_config { + uint16_t cluster_revision; + uint8_t acl[254]; + uint8_t extension[254]; +} esp_matter_cluster_access_control_config_t; + +typedef struct esp_matter_cluster_basic_config { + uint16_t cluster_revision; + uint16_t interaction_model_version; + char vendor_name[32]; + uint16_t vendor_id; + char product_name[32]; + uint16_t product_id; + char node_label[32]; + char location[2]; + uint16_t hardware_version; + char hardware_version_string[64]; + uint32_t software_version; + char software_version_string[64]; + char serial_number[32]; +} esp_matter_cluster_basic_config_t; + +typedef struct esp_matter_cluster_ota_provider_config { + uint16_t cluster_revision; +} esp_matter_cluster_ota_provider_config_t; + +typedef struct esp_matter_cluster_ota_requestor_config { + uint16_t cluster_revision; + uint8_t default_ota_providers[17]; + bool update_possible; + uint8_t update_state; + uint8_t update_state_progress; +} esp_matter_cluster_ota_requestor_config_t; + +typedef struct esp_matter_cluster_general_commissioning_config { + uint16_t cluster_revision; + uint64_t breadcrumb; + uint8_t basic_commissioning_info[254]; + uint8_t regulatory_config; + uint8_t location_capability; +} esp_matter_cluster_general_commissioning_config_t; + +typedef struct esp_matter_cluster_network_commissioning_config { + uint16_t cluster_revision; + uint32_t feature_map; + uint8_t max_networks; + uint8_t networks[12]; + uint8_t scan_max_time_seconds; + uint8_t connect_max_time_seconds; + bool interface_enabled; + uint8_t last_networking_status; + uint8_t last_network_id[32]; + uint32_t last_connect_error_value; +} esp_matter_cluster_network_commissioning_config_t; + +typedef struct esp_matter_cluster_general_diagnostics_config { + uint16_t cluster_revision; + uint8_t network_interfaces[254]; + uint16_t reboot_count; +} esp_matter_cluster_general_diagnostics_config_t; + +typedef struct esp_matter_cluster_administrator_commissioning_config { + uint16_t cluster_revision; + uint8_t window_status; + uint16_t admin_fabric_index; + uint16_t admin_vendor_id; +} esp_matter_cluster_administrator_commissioning_config_t; + +typedef struct esp_matter_cluster_operational_credentials_config { + uint16_t cluster_revision; + uint8_t nocs[254]; + uint8_t fabrics[320]; + uint8_t supported_fabrics; + uint8_t commissioned_fabrics; + uint8_t trusted_root_certificates[400]; + uint8_t current_fabric_index; +} esp_matter_cluster_operational_credentials_config_t; + +typedef struct esp_matter_cluster_group_key_management_config { + uint16_t cluster_revision; + uint8_t group_key_map[254]; + uint8_t group_table[254]; + uint16_t max_groups_per_fabric; + uint16_t max_group_keys_per_fabric; +} esp_matter_cluster_group_key_management_config_t; + +typedef struct esp_matter_cluster_identify_config { + uint16_t cluster_revision; + uint16_t identify_time; + uint8_t identify_type; +} esp_matter_cluster_identify_config_t; + +typedef struct esp_matter_cluster_groups_config { + uint16_t cluster_revision; + uint8_t name_support; +} esp_matter_cluster_groups_config_t; + +typedef struct esp_matter_cluster_scenes_config { + uint16_t cluster_revision; + uint8_t scene_count; + uint8_t current_scene; + uint16_t current_group; + bool scene_valid; + uint8_t name_support; +} esp_matter_cluster_scenes_config_t; + +typedef struct esp_matter_cluster_on_off_config { + uint16_t cluster_revision; + bool on_off; +} esp_matter_cluster_on_off_config_t; + +typedef struct esp_matter_cluster_level_control_config { + uint16_t cluster_revision; + uint8_t current_level; + uint8_t on_level; + uint8_t options; +} esp_matter_cluster_level_control_config_t; + +typedef struct esp_matter_cluster_color_control_config { + uint16_t cluster_revision; + uint32_t feature_map; + uint8_t current_hue; + uint8_t current_saturation; + uint8_t color_mode; + uint8_t options; + uint8_t enhanced_color_mode; + uint16_t color_capabilities; +} esp_matter_cluster_color_control_config_t; + +esp_matter_cluster_t *esp_matter_cluster_create_descriptor(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_descriptor_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_access_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_access_control_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_basic(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_basic_config_t *config, uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_ota_provider(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_ota_provider_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_ota_requestor(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_ota_requestor_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_general_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_general_commissioning_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_network_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_network_commissioning_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_general_diagnostics(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_general_diagnostics_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_administrator_commissioning(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_administrator_commissioning_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_operational_credentials(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_operational_credentials_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_group_key_management(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_group_key_management_config_t *config, + uint8_t flags); + +esp_matter_cluster_t *esp_matter_cluster_create_identify(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_identify_config_t *config, uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_groups(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_groups_config_t *config, uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_scenes(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_scenes_config_t *config, uint8_t flags); + +esp_matter_cluster_t *esp_matter_cluster_create_on_off(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_on_off_config_t *config, uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_level_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_level_control_config_t *config, + uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_create_color_control(esp_matter_endpoint_t *endpoint, + esp_matter_cluster_color_control_config_t *config, + uint8_t flags); diff --git a/components/esp_matter/esp_matter_command.cpp b/components/esp_matter/esp_matter_command.cpp new file mode 100644 index 000000000..cd7fdebb5 --- /dev/null +++ b/components/esp_matter/esp_matter_command.cpp @@ -0,0 +1,1546 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include +#include +#include +#include + +using chip::ByteSpan; +using chip::CharSpan; +using chip::app::CommandHandler; +using chip::app::CommandSender; +using chip::app::ConcreteCommandPath; +using chip::app::DataModel::Decode; +using chip::TLV::TagNumFromTag; +using chip::TLV::TLVReader; + +#if (FIXED_ENDPOINT_COUNT == 0) + +static const char *TAG = "esp_matter_command"; + +void DispatchSingleClusterCommandCommon(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *command_obj) +{ + int endpoint_id = command_path.mEndpointId; + int cluster_id = command_path.mClusterId; + int command_id = command_path.mCommandId; + ESP_LOGI(TAG, "Received command 0x%04X for enpoint 0x%04X's cluster 0x%04X", command_id, endpoint_id, cluster_id); + + esp_matter_node_t *node = esp_matter_node_get(); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get(node, endpoint_id); + esp_matter_cluster_t *cluster = esp_matter_cluster_get(endpoint, cluster_id); + esp_matter_command_t *command = esp_matter_command_get(cluster, command_id); + if (!command) { + ESP_LOGE(TAG, "Command 0x%04X not found", command_id); + return; + } + esp_matter_command_callback_t callback = esp_matter_command_get_callback(command); + callback(command_obj, command_path, tlv_data); +} + +namespace chip { +namespace app { + +void DispatchSingleClusterCommand(const ConcreteCommandPath &command_path, TLVReader &tlv_data, + CommandHandler *command_obj) +{ + Compatibility::SetupEmberAfCommandHandler(command_obj, command_path); + + DispatchSingleClusterCommandCommon(command_path, tlv_data, command_obj); + + Compatibility::ResetEmberAfObjects(); +} + +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath &command_path, TLVReader &tlv_data, + CommandSender *command_obj) +{ + Compatibility::SetupEmberAfCommandSender(command_obj, command_path); + TLV::TLVType tlv_type; + tlv_data.EnterContainer(tlv_type); + + DispatchSingleClusterCommandCommon(command_path, tlv_data, command_obj); + + tlv_data.ExitContainer(tlv_type); + Compatibility::ResetEmberAfObjects(); +} + +} /* namespace app */ +} /* namespace chip */ + +void esp_matter_command_callback_key_set_write(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupKeyManagementClusterKeySetWriteCallback((CommandHandler *)command_obj, command_path, command_data); + } + */ +} + +void esp_matter_command_callback_key_set_read(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupKeyManagementClusterKeySetReadCallback((CommandHandler *)command_obj, command_path, command_data); + } + */ +} + +void esp_matter_command_callback_key_set_remove(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupKeyManagementClusterKeySetRemoveCallback((CommandHandler *)command_obj, command_path, command_data); + } + */ +} + +void esp_matter_command_callback_key_set_read_all_indices(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback((CommandHandler *)command_obj, command_path, + command_data); + } + */ +} + +void esp_matter_command_callback_arm_fail_safe(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGeneralCommissioningClusterArmFailSafeCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_set_regulatory_config(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_commissioning_complete(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGeneralCommissioningClusterCommissioningCompleteCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_scan_networks(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterScanNetworksCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_add_or_update_wifi_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterAddOrUpdateWiFiNetworkCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_add_or_update_thread_network(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterAddOrUpdateThreadNetworkCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_remove_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterRemoveNetworkCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_connect_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterConnectNetworkCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_reorder_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfNetworkCommissioningClusterReorderNetworkCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_open_commissioning_window(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback((CommandHandler *)command_obj, + command_path, command_data); + } +} + +void esp_matter_command_callback_open_basic_commissioning_window(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback((CommandHandler *)command_obj, + command_path, command_data); + } +} + +void esp_matter_command_callback_revoke_commissioning(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfAdministratorCommissioningClusterRevokeCommissioningCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_attestation_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterAttestationRequestCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_certificate_chain_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterCertificateChainRequestCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_csr_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterOpCSRRequestCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_add_noc(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterAddNOCCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_update_noc(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterUpdateNOCCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_update_fabric_label(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterUpdateFabricLabelCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_remove_fabric(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterRemoveFabricCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_add_trusted_root_certificate(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback((CommandHandler *)command_obj, + command_path, command_data); + } +} + +void esp_matter_command_callback_remove_trusted_root_certificate(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback((CommandHandler *)command_obj, + command_path, command_data); + } +} + +void esp_matter_command_callback_query_image(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_apply_update_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_notify_update_applied(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_announce_ota_provider(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_identify(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Identify::Commands::Identify::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfIdentifyClusterIdentifyCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_identify_query(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Identify::Commands::IdentifyQuery::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfIdentifyClusterIdentifyQueryCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_add_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::AddGroup::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterAddGroupCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_view_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::ViewGroup::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterViewGroupCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_get_group_membership(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::GetGroupMembership::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterGetGroupMembershipCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_remove_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::RemoveGroup::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterRemoveGroupCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_remove_all_groups(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::RemoveAllGroups::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterRemoveAllGroupsCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_add_group_if_identifying(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGroupsClusterAddGroupIfIdentifyingCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_add_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::AddScene::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterAddSceneCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_view_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::ViewScene::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterViewSceneCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_remove_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::RemoveScene::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterRemoveSceneCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_remove_all_scenes(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterRemoveAllScenesCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_store_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::StoreScene::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterStoreSceneCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_recall_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::RecallScene::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterRecallSceneCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_get_scene_membership(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::Scenes::Commands::GetSceneMembership::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfScenesClusterGetSceneMembershipCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_off(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::OnOff::Commands::Off::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOnOffClusterOffCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_on(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::OnOff::Commands::On::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOnOffClusterOnCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_toggle(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::OnOff::Commands::Toggle::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfOnOffClusterToggleCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_to_level(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevel::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterMoveToLevelCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::Move::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterMoveCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_step(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::Step::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterStepCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_stop(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::Stop::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterStopCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_to_level_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterMoveToLevelWithOnOffCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_move_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterMoveWithOnOffCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_step_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterStepWithOnOffCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_stop_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfLevelControlClusterStopWithOnOffCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_to_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::MoveToHue::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterMoveToHueCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::MoveHue::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterMoveHueCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_step_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::StepHue::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterStepHueCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_to_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterMoveToSaturationCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::MoveSaturation::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterMoveSaturationCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_step_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::StepSaturation::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterStepSaturationCallback((CommandHandler *)command_obj, command_path, command_data); + } +} + +void esp_matter_command_callback_move_to_hue_and_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfColorControlClusterMoveToHueAndSaturationCallback((CommandHandler *)command_obj, command_path, + command_data); + } +} + +void esp_matter_command_callback_key_set_read_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + uint32_t tag_id = 0; + ByteSpan group_key_set_struct; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(group_key_set_struct); + break; + + default: + break; + } + } + + emberAfGroupKeyManagementClusterKeySetReadResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + group_key_set_struct); + */ +} + +void esp_matter_command_callback_key_set_read_all_indices_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + /* Not implemented + uint32_t tag_id = 0; + ByteSpan group_key_set_indices; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(group_key_set_indices); + break; + + default: + break; + } + } + + emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, + group_key_set_indices); + */ +} + +void esp_matter_command_callback_arm_fail_safe_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t error_code; + CharSpan debug_text; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(error_code); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + default: + break; + } + } + + emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, error_code, debug_text); +} + +void esp_matter_command_callback_set_regulatory_config_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t error_code; + CharSpan debug_text; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(error_code); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + default: + break; + } + } + + emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, error_code, + debug_text); +} + +void esp_matter_command_callback_commissioning_complete_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t error_code; + CharSpan debug_text; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(error_code); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + default: + break; + } + } + + emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, error_code, + debug_text); +} + +void esp_matter_command_callback_scan_networks_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t error_code; + CharSpan debug_text; + const uint8_t *wifi_scan_results; + const uint8_t *thread_scan_results; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(error_code); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + case 2: + tlv_data.GetDataPtr(wifi_scan_results); + break; + + case 3: + tlv_data.GetDataPtr(thread_scan_results); + break; + + default: + break; + } + } + + emberAfNetworkCommissioningClusterScanNetworksResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, error_code, + debug_text, (uint8_t *)wifi_scan_results, + (uint8_t *)thread_scan_results); +} + +void esp_matter_command_callback_network_config_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t networking_status; + CharSpan debug_text; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(networking_status); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + default: + break; + } + } + + emberAfNetworkCommissioningClusterNetworkConfigResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, networking_status, + debug_text); +} + +void esp_matter_command_callback_connect_network_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t networking_status; + CharSpan debug_text; + int32_t error_value; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(networking_status); + break; + + case 1: + tlv_data.Get(debug_text); + break; + + case 2: + tlv_data.Get(error_value); + break; + + default: + break; + } + } + + emberAfNetworkCommissioningClusterConnectNetworkResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, networking_status, + debug_text, error_value); +} + +void esp_matter_command_callback_attestation_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + ByteSpan attestation_elements; + ByteSpan attestation_signature; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(attestation_elements); + break; + + case 1: + tlv_data.Get(attestation_signature); + break; + + default: + break; + } + } + + emberAfOperationalCredentialsClusterAttestationResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, attestation_elements, + attestation_signature); +} + +void esp_matter_command_callback_certificate_chain_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + ByteSpan certificate; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(certificate); + break; + + default: + break; + } + } + + emberAfOperationalCredentialsClusterCertificateChainResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, certificate); +} + +void esp_matter_command_callback_csr_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + ByteSpan nocsr_elements; + ByteSpan attestation_signature; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(nocsr_elements); + break; + + case 1: + tlv_data.Get(attestation_signature); + break; + + default: + break; + } + } + + emberAfOperationalCredentialsClusterOpCSRResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + nocsr_elements, attestation_signature); +} + +void esp_matter_command_callback_noc_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status_code; + uint16_t fabric_index; + CharSpan debug_text; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status_code); + break; + + case 1: + tlv_data.Get(fabric_index); + break; + + case 2: + tlv_data.Get(debug_text); + break; + + default: + break; + } + } + + emberAfOperationalCredentialsClusterNOCResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + status_code, fabric_index, debug_text); +} + +void esp_matter_command_callback_query_image_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint32_t delayed_action_time; + CharSpan image_uri; + uint32_t software_vesion; + CharSpan software_vesion_string; + ByteSpan update_token; + bool user_consent_needed; + ByteSpan metadata_for_requestor; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(delayed_action_time); + break; + + case 2: + tlv_data.Get(image_uri); + break; + + case 3: + tlv_data.Get(software_vesion); + break; + + case 4: + tlv_data.Get(software_vesion_string); + break; + + case 5: + tlv_data.Get(update_token); + break; + + case 6: + tlv_data.Get(user_consent_needed); + break; + + case 7: + tlv_data.Get(metadata_for_requestor); + break; + + default: + break; + } + } + + emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, status, + delayed_action_time, image_uri, software_vesion, + software_vesion_string, update_token, + user_consent_needed, metadata_for_requestor); +} + +void esp_matter_command_callback_apply_update_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t action; + uint32_t delayed_action_time; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(action); + break; + + case 1: + tlv_data.Get(delayed_action_time); + break; + + default: + break; + } + } + + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(command_path.mEndpointId, + (CommandSender *)command_obj, action, + delayed_action_time); +} + +void esp_matter_command_callback_identify_query_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint16_t timeout; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(timeout); + break; + + default: + break; + } + } + + emberAfIdentifyClusterIdentifyQueryResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + timeout); +} + +void esp_matter_command_callback_add_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + default: + break; + } + } + + emberAfGroupsClusterAddGroupResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id); +} + +void esp_matter_command_callback_view_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + CharSpan group_name; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + case 2: + tlv_data.Get(group_name); + break; + + default: + break; + } + } + + emberAfGroupsClusterViewGroupResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id, group_name); +} + +void esp_matter_command_callback_get_group_membership_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t capacity; + const uint8_t *group_list; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(capacity); + break; + + case 2: + tlv_data.GetDataPtr(group_list); + break; + + default: + break; + } + } + + emberAfGroupsClusterGetGroupMembershipResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + capacity, (uint8_t *)group_list); +} + +void esp_matter_command_callback_remove_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + default: + break; + } + } + + emberAfGroupsClusterRemoveGroupResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id); +} + +void esp_matter_command_callback_add_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + uint8_t scene_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + case 2: + tlv_data.Get(scene_id); + break; + + default: + break; + } + } + + emberAfScenesClusterAddSceneResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id, scene_id); +} + +void esp_matter_command_callback_view_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + uint8_t scene_id; + uint16_t transition_time; + CharSpan scene_name; + const uint8_t *extension_field_sets; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + case 2: + tlv_data.Get(scene_id); + break; + + case 3: + tlv_data.Get(transition_time); + break; + + case 4: + tlv_data.Get(scene_name); + break; + + case 5: + tlv_data.GetDataPtr(extension_field_sets); + break; + + default: + break; + } + } + + emberAfScenesClusterViewSceneResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id, scene_id, transition_time, scene_name, + (uint8_t *)extension_field_sets); +} + +void esp_matter_command_callback_remove_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + uint8_t scene_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + case 2: + tlv_data.Get(scene_id); + break; + + default: + break; + } + } + + emberAfScenesClusterRemoveSceneResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id, scene_id); +} + +void esp_matter_command_callback_remove_all_scenes_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + default: + break; + } + } + + emberAfScenesClusterRemoveAllScenesResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id); +} + +void esp_matter_command_callback_store_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint16_t group_id; + uint8_t scene_id; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(group_id); + break; + + case 2: + tlv_data.Get(scene_id); + break; + + default: + break; + } + } + + emberAfScenesClusterStoreSceneResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, status, + group_id, scene_id); +} + +void esp_matter_command_callback_get_scene_membership_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data) +{ + uint32_t tag_id = 0; + uint8_t status; + uint8_t capacity; + uint16_t group_id; + uint8_t scene_count; + const uint8_t *scene_list; + + while (tlv_data.Next() == CHIP_NO_ERROR) { + tag_id = TagNumFromTag(tlv_data.GetTag()); + + switch (tag_id) { + case 0: + tlv_data.Get(status); + break; + + case 1: + tlv_data.Get(capacity); + break; + + case 2: + tlv_data.Get(group_id); + break; + + case 3: + tlv_data.Get(scene_count); + break; + + case 4: + tlv_data.GetDataPtr(scene_list); + break; + + default: + break; + } + } + + emberAfScenesClusterGetSceneMembershipResponseCallback(command_path.mEndpointId, (CommandSender *)command_obj, + status, capacity, group_id, scene_count, + (uint8_t *)scene_list); +} + +#endif /* FIXED_ENDPOINT_COUNT */ diff --git a/components/esp_matter/esp_matter_command.h b/components/esp_matter/esp_matter_command.h new file mode 100644 index 000000000..0163603f3 --- /dev/null +++ b/components/esp_matter/esp_matter_command.h @@ -0,0 +1,202 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include + +using chip::app::ConcreteCommandPath; +using chip::TLV::TLVReader; + +typedef void (*esp_matter_command_callback_t)(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); + +void esp_matter_command_callback_key_set_write(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_key_set_read(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_key_set_remove(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_key_set_read_all_indices(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_arm_fail_safe(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_set_regulatory_config(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_commissioning_complete(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_scan_networks(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_or_update_wifi_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_or_update_thread_network(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_connect_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_reorder_network(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_open_commissioning_window(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_open_basic_commissioning_window(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_revoke_commissioning(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_attestation_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_certificate_chain_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_csr_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_noc(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_update_noc(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_update_fabric_label(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_fabric(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_trusted_root_certificate(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_trusted_root_certificate(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_query_image(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_apply_update_request(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_notify_update_applied(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_announce_ota_provider(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_identify(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_identify_query(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_view_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_get_group_membership(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_group(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_all_groups(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_group_if_identifying(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_view_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_all_scenes(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_store_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_recall_scene(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_get_scene_membership(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_off(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data); +void esp_matter_command_callback_on(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data); +void esp_matter_command_callback_toggle(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_to_level(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data); +void esp_matter_command_callback_step(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data); +void esp_matter_command_callback_stop(void *command_obj, const ConcreteCommandPath &command_path, TLVReader &tlv_data); +void esp_matter_command_callback_move_to_level_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_step_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_stop_with_on_off(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_to_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_step_hue(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_to_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_step_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_move_to_hue_and_saturation(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_key_set_read_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_key_set_read_all_indices_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_arm_fail_safe_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_set_regulatory_config_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_commissioning_complete_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_scan_networks_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_network_config_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_connect_network_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_attestation_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_certificate_chain_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_csr_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_noc_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_query_image_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_apply_update_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_identify_query_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_view_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_get_group_membership_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_group_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_add_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_view_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_remove_all_scenes_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_store_scene_response(void *command_obj, const ConcreteCommandPath &command_path, + TLVReader &tlv_data); +void esp_matter_command_callback_get_scene_membership_response(void *command_obj, + const ConcreteCommandPath &command_path, + TLVReader &tlv_data); diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp new file mode 100644 index 000000000..60d299a6e --- /dev/null +++ b/components/esp_matter/esp_matter_core.cpp @@ -0,0 +1,621 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +#include +#include +#include +#include +#include + +using chip::Credentials::SetDeviceAttestationCredentialsProvider; +using chip::Credentials::Examples::GetExampleDACProvider; +using chip::DeviceLayer::ChipDeviceEvent; +using chip::DeviceLayer::ConnectivityManager; +using chip::DeviceLayer::ConnectivityMgr; +using chip::DeviceLayer::PlatformMgr; +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +using chip::DeviceLayer::ThreadStackMgr; +#endif + +static const char *TAG = "esp_matter_device"; + +typedef struct esp_matter_attribute { + int attribute_id; + uint8_t flags; + esp_matter_attr_val_t val; + struct esp_matter_attribute *next; +} _esp_matter_attribute_t; + +typedef struct esp_matter_command { + int command_id; + uint8_t flags; + esp_matter_command_callback_t callback; + struct esp_matter_command *next; +} _esp_matter_command_t; + +typedef struct esp_matter_cluster { + int cluster_id; + uint8_t flags; + // const EmberAfGenericClusterFunction *function_list; + _esp_matter_attribute_t *attribute_list; + _esp_matter_command_t *command_list; + struct esp_matter_cluster *next; +} _esp_matter_cluster_t; + +typedef struct esp_matter_endpoint { + int endpoint_id; + _esp_matter_cluster_t *cluster_list; + struct esp_matter_endpoint *next; +} _esp_matter_endpoint_t; + +typedef struct esp_matter_node { + _esp_matter_endpoint_t *endpoint_list; +} _esp_matter_node_t; + +static _esp_matter_node_t *node = NULL; + +static int esp_matter_cluster_get_count(_esp_matter_cluster_t *current) +{ + int count = 0; + while (current) { + current = current->next; + count++; + } + return count; +} + +static int esp_matter_attribute_get_count(_esp_matter_attribute_t *current) +{ + int count = 0; + while (current) { + current = current->next; + count++; + } + return count; +} + +extern esp_err_t esp_matter_attribute_get_type_and_val_default(esp_matter_attr_val_t *val, + EmberAfAttributeType *attribute_type, + uint16_t *attribute_size, + EmberAfDefaultOrMinMaxAttributeValue *default_value); + +esp_err_t esp_matter_endpoint_enable(esp_matter_endpoint_t *endpoint) +{ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + static int endpoint_index = 0; + + /* Endpoint Type */ + EmberAfEndpointType *endpoint_type = (EmberAfEndpointType *)calloc(1, sizeof(EmberAfEndpointType)); + if (!endpoint_type) { + ESP_LOGE(TAG, "Couldn't allocate endpoint_type"); + return ESP_ERR_NO_MEM; + } + + /* Clusters */ + _esp_matter_cluster_t *cluster = current_endpoint->cluster_list; + int cluster_count = esp_matter_cluster_get_count(cluster); + int cluster_index = 0; + EmberAfCluster *matter_clusters = (EmberAfCluster *)calloc(1, cluster_count * sizeof(EmberAfCluster)); + if (!matter_clusters) { + ESP_LOGE(TAG, "Couldn't allocate matter_clusters"); + return ESP_ERR_NO_MEM; + } + + while (cluster) { + /* Attributes */ + _esp_matter_attribute_t *attribute = cluster->attribute_list; + int attribute_count = esp_matter_attribute_get_count(attribute); + int attribute_index = 0; + EmberAfAttributeMetadata *matter_attributes = (EmberAfAttributeMetadata *)calloc(1, + attribute_count * sizeof(EmberAfAttributeMetadata)); + if (!matter_attributes) { + ESP_LOGE(TAG, "Couldn't allocate matter_attributes"); + return ESP_ERR_NO_MEM; + } + + while (attribute) { + matter_attributes[attribute_index].attributeId = attribute->attribute_id; + matter_attributes[attribute_index].mask = attribute->flags; + esp_matter_attribute_get_type_and_val_default(&attribute->val, + &matter_attributes[attribute_index].attributeType, + &matter_attributes[attribute_index].size, + &matter_attributes[attribute_index].defaultValue); + + matter_clusters[cluster_index].clusterSize += matter_attributes[attribute_index].size; + attribute = attribute->next; + attribute_index++; + } + + matter_clusters[cluster_index].clusterId = cluster->cluster_id; + matter_clusters[cluster_index].attributes = matter_attributes; + matter_clusters[cluster_index].attributeCount = attribute_count; + matter_clusters[cluster_index].mask = cluster->flags; + // matter_clusters[cluster_index].functions = function_list; + + endpoint_type->endpointSize += matter_clusters[cluster_index].clusterSize; + cluster = cluster->next; + cluster_index++; + } + + endpoint_type->cluster = matter_clusters; + endpoint_type->clusterCount = cluster_count; + + /* Add Endpoint */ + EmberAfStatus err = emberAfSetDynamicEndpoint(endpoint_index, current_endpoint->endpoint_id, endpoint_type, 0, 1); + if (err != EMBER_ZCL_STATUS_SUCCESS) { + ESP_LOGE(TAG, "Error adding dynamic endpoint %d: %d", current_endpoint->endpoint_id, err); + } + endpoint_index++; + return ESP_OK; +} + +static esp_err_t esp_matter_endpoint_enable_all() +{ + if (!node) { + return ESP_FAIL; + } + + _esp_matter_endpoint_t *endpoint = node->endpoint_list; + while (endpoint) { + esp_matter_endpoint_enable((esp_matter_endpoint_t *)endpoint); + endpoint = endpoint->next; + } + return ESP_OK; +} + +static void esp_matter_chip_init_task(intptr_t context) +{ + xTaskHandle task_to_notify = reinterpret_cast(context); + chip::Server::GetInstance().Init(); + SetDeviceAttestationCredentialsProvider(GetExampleDACProvider()); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + chip::app::DnssdServer::Instance().StartServer(); +#endif + xTaskNotifyGive(task_to_notify); +} + +esp_err_t esp_matter_chip_init(esp_matter_event_callback_t callback) +{ + if (PlatformMgr().InitChipStack() != CHIP_NO_ERROR) { + ESP_LOGE(TAG, "Failed to initialize CHIP stack"); + return ESP_FAIL; + } + ConnectivityMgr().SetBLEAdvertisingEnabled(true); + // ConnectivityMgr().SetWiFiAPMode(ConnectivityManager::kWiFiAPMode_Enabled); + if (chip::Platform::MemoryInit() != CHIP_NO_ERROR) { + ESP_LOGE(TAG, "Failed to initialize CHIP memory pool"); + return ESP_ERR_NO_MEM; + } + if (PlatformMgr().StartEventLoopTask() != CHIP_NO_ERROR) { + chip::Platform::MemoryShutdown(); + ESP_LOGE(TAG, "Failed to launch Matter main task"); + return ESP_FAIL; + } + PlatformMgr().AddEventHandler(callback, static_cast(NULL)); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + if (ThreadStackMgr().InitThreadStack() != CHIP_NO_ERROR) { + ESP_LOGE(TAG, "Failed to initialize Thread stack"); + return ESP_FAIL; + } + + if (ThreadStackMgr().StartThreadTask() != CHIP_NO_ERROR) { + ESP_LOGE(TAG, "Failed to launch Thread task"); + return ESP_FAIL; + } +#endif + PlatformMgr().ScheduleWork(esp_matter_chip_init_task, reinterpret_cast(xTaskGetCurrentTaskHandle())); + // Wait for the matter stack to be initialized + xTaskNotifyWait(0, 0, NULL, portMAX_DELAY); + return ESP_OK; +} + +esp_err_t esp_matter_start(esp_matter_event_callback_t callback) +{ + esp_err_t err = esp_matter_chip_init(callback); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error initializing matter"); + } + + err = esp_matter_endpoint_enable_all(); + return err; +} + +esp_matter_node_t *esp_matter_node_get() +{ + return (esp_matter_node_t *)node; +} + +esp_matter_endpoint_t *esp_matter_endpoint_get(esp_matter_node_t *node, int endpoint_id) +{ + if (!node) { + ESP_LOGE(TAG, "Node cannot be NULL"); + return NULL; + } + _esp_matter_node_t *current_node = (_esp_matter_node_t *)node; + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)current_node->endpoint_list; + while (current_endpoint) { + if (current_endpoint->endpoint_id == endpoint_id) { + break; + } + current_endpoint = current_endpoint->next; + } + return (esp_matter_endpoint_t *)current_endpoint; +} + +esp_matter_cluster_t *esp_matter_cluster_get(esp_matter_endpoint_t *endpoint, int cluster_id) +{ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return NULL; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)current_endpoint->cluster_list; + while (current_cluster) { + if (current_cluster->cluster_id == cluster_id) { + break; + } + current_cluster = current_cluster->next; + } + return (esp_matter_cluster_t *)current_cluster; +} + +esp_matter_attribute_t *esp_matter_attribute_get(esp_matter_cluster_t *cluster, int attribute_id) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + _esp_matter_attribute_t *current_attribute = (_esp_matter_attribute_t *)current_cluster->attribute_list; + while (current_attribute) { + if (current_attribute->attribute_id == attribute_id) { + break; + } + current_attribute = current_attribute->next; + } + return (esp_matter_attribute_t *)current_attribute; +} + +esp_matter_command_t *esp_matter_command_get(esp_matter_cluster_t *cluster, int command_id) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + _esp_matter_command_t *current_command = (_esp_matter_command_t *)current_cluster->command_list; + while (current_command) { + if (current_command->command_id == command_id) { + break; + } + current_command = current_command->next; + } + return (esp_matter_command_t *)current_command; +} + +esp_matter_endpoint_t *esp_matter_endpoint_get_first(esp_matter_node_t *node) +{ + if (!node) { + ESP_LOGE(TAG, "Node cannot be NULL"); + return NULL; + } + _esp_matter_node_t *current_node = (_esp_matter_node_t *)node; + return (esp_matter_endpoint_t *)current_node->endpoint_list; +} + +esp_matter_cluster_t *esp_matter_cluster_get_first(esp_matter_endpoint_t *endpoint) +{ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return NULL; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + return (esp_matter_cluster_t *)current_endpoint->cluster_list; +} + +esp_matter_attribute_t *esp_matter_attribute_get_first(esp_matter_cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + return (esp_matter_attribute_t *)current_cluster->attribute_list; +} + +esp_matter_command_t *esp_matter_command_get_first(esp_matter_cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + return (esp_matter_command_t *)current_cluster->command_list; +} + +esp_matter_endpoint_t *esp_matter_endpoint_get_next(esp_matter_endpoint_t *endpoint) +{ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return NULL; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + return (esp_matter_endpoint_t *)current_endpoint->next; +} + +esp_matter_cluster_t *esp_matter_cluster_get_next(esp_matter_cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + return (esp_matter_cluster_t *)current_cluster->next; +} + +esp_matter_attribute_t *esp_matter_attribute_get_next(esp_matter_attribute_t *attribute) +{ + if (!attribute) { + ESP_LOGE(TAG, "Attribute cannot be NULL"); + return NULL; + } + _esp_matter_attribute_t *current_attribute = (_esp_matter_attribute_t *)attribute; + return (esp_matter_attribute_t *)current_attribute->next; +} + +esp_matter_command_t *esp_matter_command_get_next(esp_matter_command_t *command) +{ + if (!command) { + ESP_LOGE(TAG, "Command cannot be NULL"); + return NULL; + } + _esp_matter_command_t *current_command = (_esp_matter_command_t *)command; + return (esp_matter_command_t *)current_command->next; +} + +int esp_matter_endpoint_get_id(esp_matter_endpoint_t *endpoint) +{ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return -1; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + return current_endpoint->endpoint_id; +} + +int esp_matter_cluster_get_id(esp_matter_cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return -1; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + return current_cluster->cluster_id; +} + +int esp_matter_attribute_get_id(esp_matter_attribute_t *attribute) +{ + if (!attribute) { + ESP_LOGE(TAG, "Attribute cannot be NULL"); + return -1; + } + _esp_matter_attribute_t *current_attribute = (_esp_matter_attribute_t *)attribute; + return current_attribute->attribute_id; +} + +int esp_matter_command_get_id(esp_matter_command_t *command) +{ + if (!command) { + ESP_LOGE(TAG, "Command cannot be NULL"); + return -1; + } + _esp_matter_command_t *current_command = (_esp_matter_command_t *)command; + return current_command->command_id; +} + +esp_matter_attr_val_t esp_matter_attribute_get_val(esp_matter_attribute_t *attribute) +{ + if (!attribute) { + ESP_LOGE(TAG, "Attribute cannot be NULL"); + return esp_matter_invalid(NULL); + } + _esp_matter_attribute_t *current_attribute = (_esp_matter_attribute_t *)attribute; + return current_attribute->val; +} + +esp_err_t esp_matter_attribute_set_val(esp_matter_attribute_t *attribute, esp_matter_attr_val_t val) +{ + if (!attribute) { + ESP_LOGE(TAG, "Attribute cannot be NULL"); + return ESP_FAIL; + } + _esp_matter_attribute_t *current_attribute = (_esp_matter_attribute_t *)attribute; + current_attribute->val = val; + return ESP_OK; +} + +esp_matter_command_callback_t esp_matter_command_get_callback(esp_matter_command_t *command) +{ + if (!command) { + ESP_LOGE(TAG, "Command cannot be NULL"); + return NULL; + } + _esp_matter_command_t *current_command = (_esp_matter_command_t *)command; + return current_command->callback; +} + +esp_matter_attribute_t *esp_matter_attribute_create(esp_matter_cluster_t *cluster, int attribute_id, uint8_t flags, + esp_matter_attr_val_t val) +{ + /* Find */ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + + /* Allocate */ + _esp_matter_attribute_t *attribute = (_esp_matter_attribute_t *)calloc(1, sizeof(_esp_matter_attribute_t)); + if (!attribute) { + ESP_LOGE(TAG, "Couldn't allocate _esp_matter_attribute_t"); + return NULL; + } + + /* Set */ + attribute->attribute_id = attribute_id; + attribute->flags = flags; + attribute->flags |= ATTRIBUTE_MASK_EXTERNAL_STORAGE; + attribute->val = val; + + /* Add */ + _esp_matter_attribute_t *previous_attribute = NULL; + _esp_matter_attribute_t *current_attribute = current_cluster->attribute_list; + while (current_attribute) { + previous_attribute = current_attribute; + current_attribute = current_attribute->next; + } + if (previous_attribute == NULL) { + current_cluster->attribute_list = attribute; + } else { + previous_attribute->next = attribute; + } + + return (esp_matter_attribute_t *)attribute; +} + +esp_matter_command_t *esp_matter_command_create(esp_matter_cluster_t *cluster, int command_id, uint8_t flags, + esp_matter_command_callback_t callback) +{ + /* Find */ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return NULL; + } + _esp_matter_cluster_t *current_cluster = (_esp_matter_cluster_t *)cluster; + + /* Allocate */ + _esp_matter_command_t *command = (_esp_matter_command_t *)calloc(1, sizeof(_esp_matter_command_t)); + if (!command) { + ESP_LOGE(TAG, "Couldn't allocate _esp_matter_command_t"); + return NULL; + } + + /* Set */ + command->command_id = command_id; + command->flags = flags; + command->callback = callback; + + /* Add */ + _esp_matter_command_t *previous_command = NULL; + _esp_matter_command_t *current_command = current_cluster->command_list; + while (current_command) { + previous_command = current_command; + current_command = current_command->next; + } + if (previous_command == NULL) { + current_cluster->command_list = command; + } else { + previous_command->next = command; + } + + return (esp_matter_command_t *)command; +} + +esp_matter_cluster_t *esp_matter_cluster_create(esp_matter_endpoint_t *endpoint, int cluster_id, uint8_t flags) +{ + /* Find */ + if (!endpoint) { + ESP_LOGE(TAG, "Endpoint cannot be NULL"); + return NULL; + } + _esp_matter_endpoint_t *current_endpoint = (_esp_matter_endpoint_t *)endpoint; + + /* Allocate */ + _esp_matter_cluster_t *cluster = (_esp_matter_cluster_t *)calloc(1, sizeof(_esp_matter_cluster_t)); + if (!cluster) { + ESP_LOGE(TAG, "Couldn't allocate _esp_matter_cluster_t"); + return NULL; + } + + /* Set */ + cluster->cluster_id = cluster_id; + cluster->flags = flags; + + /* Add */ + _esp_matter_cluster_t *previous_cluster = NULL; + _esp_matter_cluster_t *current_cluster = current_endpoint->cluster_list; + while (current_cluster) { + previous_cluster = current_cluster; + current_cluster = current_cluster->next; + } + if (previous_cluster == NULL) { + current_endpoint->cluster_list = cluster; + } else { + previous_cluster->next = cluster; + } + + return (esp_matter_cluster_t *)cluster; +} + +esp_matter_endpoint_t *esp_matter_endpoint_create_raw(esp_matter_node_t *node, int endpoint_id) +{ + /* Find */ + if (!node) { + ESP_LOGE(TAG, "Node cannot be NULL"); + return NULL; + } + _esp_matter_node_t *current_node = (_esp_matter_node_t *)node; + + /* Allocate */ + _esp_matter_endpoint_t *endpoint = (_esp_matter_endpoint_t *)calloc(1, sizeof(_esp_matter_endpoint_t)); + if (!endpoint) { + ESP_LOGE(TAG, "Couldn't allocate _esp_matter_endpoint_t"); + return NULL; + } + + /* Set */ + endpoint->endpoint_id = endpoint_id; + + /* Add */ + _esp_matter_endpoint_t *previous_endpoint = NULL; + _esp_matter_endpoint_t *current_endpoint = current_node->endpoint_list; + while (current_endpoint) { + previous_endpoint = current_endpoint; + current_endpoint = current_endpoint->next; + } + if (previous_endpoint == NULL) { + current_node->endpoint_list = endpoint; + } else { + previous_endpoint->next = endpoint; + } + + return (esp_matter_endpoint_t *)endpoint; +} + +esp_matter_node_t *esp_matter_node_create_raw() +{ + node = (_esp_matter_node_t *)calloc(1, sizeof(_esp_matter_node_t)); + if (!node) { + ESP_LOGE(TAG, "Couldn't allocate _esp_matter_node_t"); + return NULL; + } + return (esp_matter_node_t *)node; +} diff --git a/components/esp_matter/esp_matter_core.h b/components/esp_matter/esp_matter_core.h new file mode 100644 index 000000000..07da45f00 --- /dev/null +++ b/components/esp_matter/esp_matter_core.h @@ -0,0 +1,89 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include + +using chip::DeviceLayer::ChipDeviceEvent; + +typedef size_t esp_matter_handle_t; +typedef esp_matter_handle_t esp_matter_node_t; +typedef esp_matter_handle_t esp_matter_endpoint_t; +typedef esp_matter_handle_t esp_matter_cluster_t; +typedef esp_matter_handle_t esp_matter_attribute_t; +typedef esp_matter_handle_t esp_matter_command_t; + +typedef enum esp_matter_callback_type { + ESP_MATTER_CALLBACK_TYPE_PRE_ATTRIBUTE, + ESP_MATTER_CALLBACK_TYPE_POST_ATTRIBUTE, +} esp_matter_callback_type_t; + +/** Callback for attribute value changed + * + * @return ESP_OK on success. + * @return error in case of failure. + */ +typedef esp_err_t (*esp_matter_attribute_callback_t)(esp_matter_callback_type_t type, int endpoint_id, int cluster_id, + int attribute_id, esp_matter_attr_val_t val, void *priv_data); + +typedef void (*esp_matter_event_callback_t)(const ChipDeviceEvent *event, intptr_t arg); + +/** Initializing APIs */ +esp_err_t esp_matter_attribute_callback_set(esp_matter_attribute_callback_t callback, void *priv_data); +esp_err_t esp_matter_start(esp_matter_event_callback_t callback); + +/** Node APIs */ +esp_matter_node_t *esp_matter_node_create_raw(); +esp_matter_node_t *esp_matter_node_get(); + +/** Endpoint APIs */ +esp_matter_endpoint_t *esp_matter_endpoint_create_raw(esp_matter_node_t *node, int endpoint_id); +esp_matter_endpoint_t *esp_matter_endpoint_get(esp_matter_node_t *node, int endpoint_id); +esp_matter_endpoint_t *esp_matter_endpoint_get_first(esp_matter_node_t *node); +esp_matter_endpoint_t *esp_matter_endpoint_get_next(esp_matter_endpoint_t *endpoint); +int esp_matter_endpoint_get_id(esp_matter_endpoint_t *endpoint); +/* Endpoint enable: It only needs to be called for endpoints created after calling esp_matter_start(). It should be + * called after all the clusters, attributes and commands have been added to the created endpoint. */ +esp_err_t esp_matter_endpoint_enable(esp_matter_endpoint_t *endpoint); + +/** Cluster APIs */ +esp_matter_cluster_t *esp_matter_cluster_create(esp_matter_endpoint_t *endpoint, int cluster_id, uint8_t flags); +esp_matter_cluster_t *esp_matter_cluster_get(esp_matter_endpoint_t *endpoint, int cluster_id); +esp_matter_cluster_t *esp_matter_cluster_get_first(esp_matter_endpoint_t *endpoint); +esp_matter_cluster_t *esp_matter_cluster_get_next(esp_matter_cluster_t *cluster); +int esp_matter_cluster_get_id(esp_matter_cluster_t *cluster); + +/** Attribute APIs */ +esp_matter_attribute_t *esp_matter_attribute_create(esp_matter_cluster_t *cluster, int attribute_id, uint8_t flags, + esp_matter_attr_val_t val); +esp_matter_attribute_t *esp_matter_attribute_get(esp_matter_cluster_t *cluster, int attribute_id); +esp_matter_attribute_t *esp_matter_attribute_get_first(esp_matter_cluster_t *cluster); +esp_matter_attribute_t *esp_matter_attribute_get_next(esp_matter_attribute_t *attribute); +int esp_matter_attribute_get_id(esp_matter_attribute_t *attribute); + +/** Attribute val APIs */ +esp_err_t esp_matter_attribute_set_val(esp_matter_attribute_t *attribute, esp_matter_attr_val_t val); +esp_matter_attr_val_t esp_matter_attribute_get_val(esp_matter_attribute_t *attribute); + +/** Command APIs */ +esp_matter_command_t *esp_matter_command_create(esp_matter_cluster_t *cluster, int command_id, uint8_t flags, + esp_matter_command_callback_t callback); +esp_matter_command_t *esp_matter_command_get(esp_matter_cluster_t *cluster, int command_id); +esp_matter_command_t *esp_matter_command_get_first(esp_matter_cluster_t *cluster); +esp_matter_command_t *esp_matter_command_get_next(esp_matter_command_t *command); +int esp_matter_command_get_id(esp_matter_command_t *command); +esp_matter_command_callback_t esp_matter_command_get_callback(esp_matter_command_t *command); diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp new file mode 100644 index 000000000..6e536ead5 --- /dev/null +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -0,0 +1,66 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +esp_matter_endpoint_t *esp_matter_endpoint_create_root_node(esp_matter_node_t *node, + esp_matter_endpoint_root_node_config_t *config) +{ + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_create_raw(node, ESP_MATTER_ROOT_NODE_ENDPOINT_ID); + + esp_matter_cluster_create_descriptor(endpoint, &(config->descriptor), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_access_control(endpoint, &(config->access_control), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_basic(endpoint, &(config->basic), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_ota_provider(endpoint, &(config->ota_provider), CLUSTER_MASK_CLIENT); + esp_matter_cluster_create_ota_requestor(endpoint, &(config->ota_requestor), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_general_commissioning(endpoint, &(config->general_commissioning), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_network_commissioning(endpoint, &(config->network_commissioning), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_general_diagnostics(endpoint, &(config->general_diagnostics), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_administrator_commissioning(endpoint, &(config->administrator_commissioning), + CLUSTER_MASK_SERVER); + esp_matter_cluster_create_operational_credentials(endpoint, &(config->operational_credentials), + CLUSTER_MASK_SERVER); + esp_matter_cluster_create_group_key_management(endpoint, &(config->group_key_management), CLUSTER_MASK_SERVER); + + return endpoint; +} + +esp_matter_endpoint_t *esp_matter_endpoint_create_color_dimmable_light(esp_matter_node_t *node, + esp_matter_endpoint_color_dimmable_light_config_t *config) +{ + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_create_raw(node, ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID); + + esp_matter_cluster_create_identify(endpoint, &(config->identify), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_groups(endpoint, &(config->groups), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_scenes(endpoint, &(config->scenes), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_on_off(endpoint, &(config->on_off), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_level_control(endpoint, &(config->level_control), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_basic(endpoint, &(config->basic), CLUSTER_MASK_SERVER); + esp_matter_cluster_create_color_control(endpoint, &(config->color_control), CLUSTER_MASK_SERVER); + + return endpoint; +} + +esp_matter_node_t *esp_matter_node_create(esp_matter_node_config_t *config, esp_matter_attribute_callback_t callback, + void *priv_data) +{ + esp_matter_node_t *node = esp_matter_node_create_raw(); + + esp_matter_attribute_callback_set(callback, priv_data); + + esp_matter_endpoint_create_root_node(node, &(config->root_node)); + + return node; +} diff --git a/components/esp_matter/esp_matter_endpoint.h b/components/esp_matter/esp_matter_endpoint.h new file mode 100644 index 000000000..7610580dc --- /dev/null +++ b/components/esp_matter/esp_matter_endpoint.h @@ -0,0 +1,88 @@ +// Copyright 2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include + +#define ESP_MATTER_ROOT_NODE_ENDPOINT_ID 0x0000 +#define ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID 0x0001 + +#define ENDPOINT_CONFIG_ROOT_NODE_DEFAULT() \ + { \ + .descriptor = CLUSTER_CONFIG_DESCRIPTOR_DEFAULT(), \ + .access_control = CLUSTER_CONFIG_ACCESS_CONTROL_DEFAULT(), \ + .basic = CLUSTER_CONFIG_BASIC_DEFAULT(), \ + .ota_provider = CLUSTER_CONFIG_OTA_PROVIDER_DEFAULT(), \ + .ota_requestor = CLUSTER_CONFIG_OTA_REQUESTOR_DEFAULT(), \ + .general_commissioning = CLUSTER_CONFIG_GENERAL_COMMISSIONING_DEFAULT(), \ + .network_commissioning = CLUSTER_CONFIG_NETWORK_COMMISSIONING_DEFAULT(), \ + .general_diagnostics = CLUSTER_CONFIG_GENERAL_DIAGNOSTICS_DEFAULT(), \ + .administrator_commissioning = CLUSTER_CONFIG_ADMINISTRATOR_COMMISSIONING_DEFAULT(), \ + .operational_credentials = CLUSTER_CONFIG_OPERATIONAL_CREDENTIALS_DEFAULT(), \ + .group_key_management = CLUSTER_CONFIG_GROUP_KEY_MANAGEMENT_DEFAULT(), \ + } + +#define ENDPOINT_CONFIG_COLOR_DIMMABLE_LIGHT_DEFAULT() \ + { \ + .identify = CLUSTER_CONFIG_IDENTIFY_DEFAULT(), \ + .groups = CLUSTER_CONFIG_GROUPS_DEFAULT(), \ + .scenes = CLUSTER_CONFIG_SCENES_DEFAULT(), \ + .on_off = CLUSTER_CONFIG_ON_OFF_DEFAULT(), \ + .level_control = CLUSTER_CONFIG_LEVEL_CONTROL_DEFAULT(), \ + .basic = CLUSTER_CONFIG_BASIC_DEFAULT(), \ + .color_control = CLUSTER_CONFIG_COLOR_CONTROL_DEFAULT(), \ + } + +#define NODE_CONFIG_DEFAULT() \ + { \ + .root_node = ENDPOINT_CONFIG_ROOT_NODE_DEFAULT(), \ + } + +typedef struct esp_matter_endpoint_root_node_config { + esp_matter_cluster_descriptor_config_t descriptor; + esp_matter_cluster_access_control_config_t access_control; + esp_matter_cluster_basic_config_t basic; + esp_matter_cluster_ota_provider_config_t ota_provider; + esp_matter_cluster_ota_requestor_config_t ota_requestor; + esp_matter_cluster_general_commissioning_config_t general_commissioning; + esp_matter_cluster_network_commissioning_config_t network_commissioning; + esp_matter_cluster_general_diagnostics_config_t general_diagnostics; + esp_matter_cluster_administrator_commissioning_config_t administrator_commissioning; + esp_matter_cluster_operational_credentials_config_t operational_credentials; + esp_matter_cluster_group_key_management_config_t group_key_management; +} esp_matter_endpoint_root_node_config_t; + +typedef struct esp_matter_endpoint_color_dimmable_light_config { + esp_matter_cluster_identify_config_t identify; + esp_matter_cluster_groups_config_t groups; + esp_matter_cluster_scenes_config_t scenes; + esp_matter_cluster_on_off_config_t on_off; + esp_matter_cluster_level_control_config_t level_control; + esp_matter_cluster_basic_config_t basic; + esp_matter_cluster_color_control_config_t color_control; +} esp_matter_endpoint_color_dimmable_light_config_t; + +typedef struct esp_matter_node_config { + esp_matter_endpoint_root_node_config_t root_node; +} esp_matter_node_config_t; + +esp_matter_endpoint_t *esp_matter_endpoint_create_root_node(esp_matter_node_t *node, + esp_matter_endpoint_root_node_config_t *config); +esp_matter_endpoint_t *esp_matter_endpoint_create_color_dimmable_light(esp_matter_node_t *node, + esp_matter_endpoint_color_dimmable_light_config_t *config); + +esp_matter_node_t *esp_matter_node_create(esp_matter_node_config_t *config, esp_matter_attribute_callback_t callback, + void *priv_data); diff --git a/components/esp_matter/esp_matter_standard.h b/components/esp_matter/esp_matter_standard.h deleted file mode 100644 index 5a4265d96..000000000 --- a/components/esp_matter/esp_matter_standard.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -/********** STANDARD ENDPOINT NAMES **********/ -#define ESP_MATTER_ENDPOINT_LIGHT "Light" - -/********** STANDARD ATTRIBUTE NAMES **********/ -#define ESP_MATTER_ATTR_POWER "Power" -#define ESP_MATTER_ATTR_BRIGHTNESS "Brightness" -#define ESP_MATTER_ATTR_HUE "Hue" -#define ESP_MATTER_ATTR_SATURATION "Saturation" -#define ESP_MATTER_ATTR_TEMPERATURE "Temperature" - -#ifdef __cplusplus -} -#endif diff --git a/components/esp_matter_console/Kconfig b/components/esp_matter_console/Kconfig index 2ddebb4c4..6e2859a25 100644 --- a/components/esp_matter_console/Kconfig +++ b/components/esp_matter_console/Kconfig @@ -10,6 +10,6 @@ menu "ESP Matter Console" int "Max commands supported" default 10 help - Maximum number of commands that can be added for the 'chip esp ' command. + Maximum number of commands that can be added for the 'matter esp ' command. endmenu diff --git a/components/esp_matter_console/esp_matter_console.cpp b/components/esp_matter_console/esp_matter_console.cpp index 9dbc8f69b..d7f044b18 100644 --- a/components/esp_matter_console/esp_matter_console.cpp +++ b/components/esp_matter_console/esp_matter_console.cpp @@ -40,7 +40,7 @@ esp_err_t esp_matter_console_add_command(esp_matter_console_command_t *command) static void esp_matter_console_print_help() { - ESP_LOGI(TAG, "Usage: chip esp "); + ESP_LOGI(TAG, "Usage: matter esp "); ESP_LOGI(TAG, "Sub commands:"); for (int i = 0; i < total_added_commands; i++) { ESP_LOGI(TAG, "\t%s: %s", commands[i].name, commands[i].description); @@ -84,7 +84,7 @@ static CHIP_ERROR esp_matter_console_common_handler(int argc, char **argv) return CHIP_ERROR_INVALID_ARGUMENT; } } - ESP_LOGE(TAG, "Could not find the command: %s. Try the help command for more details: chip esp help", argv[0]); + ESP_LOGE(TAG, "Could not find the command: %s. Try the help command for more details: matter esp help", argv[0]); return CHIP_ERROR_INVALID_ARGUMENT; } @@ -94,7 +94,7 @@ static esp_err_t esp_matter_console_register_common_shell_handler() { .cmd_func = esp_matter_console_common_handler, .cmd_name = "esp", - .cmd_help = "Usage: chip esp ", + .cmd_help = "Usage: matter esp ", }, }; int cmds_num = sizeof(cmds) / sizeof(chip::Shell::shell_command_t); diff --git a/components/esp_matter_console/esp_matter_console.h b/components/esp_matter_console/esp_matter_console.h index 085e562ad..001dbd451 100644 --- a/components/esp_matter_console/esp_matter_console.h +++ b/components/esp_matter_console/esp_matter_console.h @@ -63,8 +63,11 @@ esp_err_t esp_matter_console_add_command(esp_matter_console_command_t *command); /** Add Diagnostics Commands * * Adds the default diagnostics commands. + * + * @return ESP_OK on success. + * @return error in case of failure. */ -void esp_matter_console_diagnostics_register_commands(); +esp_err_t esp_matter_console_diagnostics_register_commands(); #ifdef __cplusplus } diff --git a/components/esp_matter_console/esp_matter_console_diagnostics.cpp b/components/esp_matter_console/esp_matter_console_diagnostics.cpp index 27377b184..60d7637e4 100644 --- a/components/esp_matter_console/esp_matter_console_diagnostics.cpp +++ b/components/esp_matter_console/esp_matter_console_diagnostics.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include #include +#include #include +#include +#include static const char *TAG = "esp_matter_console_diagnostics"; @@ -26,11 +26,9 @@ static esp_err_t mem_dump_console_handler(int argc, char *argv[]) printf("Current Free Memory\t%d\t\t%d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT) - heap_caps_get_free_size(MALLOC_CAP_SPIRAM), heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); - printf("Largest Free Block\t%d\t\t%d\n", - heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + printf("Largest Free Block\t%d\t\t%d\n", heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM)); - printf("Min. Ever Free Size\t%d\t\t%d\n", - heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + printf("Min. Ever Free Size\t%d\t\t%d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM)); return ESP_OK; } @@ -41,11 +39,11 @@ static esp_err_t up_time_console_handler(int argc, char *argv[]) return ESP_OK; } -static esp_err_t esp_matter_console_diagnostics_handler(int argc, char** argv) +static esp_err_t esp_matter_console_diagnostics_handler(int argc, char **argv) { if (argc == 1 && strncmp(argv[0], "mem-dump", sizeof("mem-dump")) == 0) { return mem_dump_console_handler(argc, argv); - } else if (argc == 1 && strncmp(argv[0], "up-time", sizeof("up-time")) == 0){ + } else if (argc == 1 && strncmp(argv[0], "up-time", sizeof("up-time")) == 0) { return up_time_console_handler(argc, argv); } else { ESP_LOGE(TAG, "Incorrect arguments"); @@ -54,12 +52,13 @@ static esp_err_t esp_matter_console_diagnostics_handler(int argc, char** argv) return ESP_OK; } -void esp_matter_console_diagnostics_register_commands() +esp_err_t esp_matter_console_diagnostics_register_commands() { - esp_matter_console_command_t command= { + esp_matter_console_command_t command = { .name = "diagnostics", - .description = "Diagnostic commands. Usage chip esp diagnostics . Diagnostics commands: mem-dump, up-time", + .description = "Diagnostic commands. Usage matter esp diagnostics . Diagnostics commands: " + "mem-dump, up-time", .handler = esp_matter_console_diagnostics_handler, }; - esp_matter_console_add_command(&command); + return esp_matter_console_add_command(&command); } diff --git a/device_hal/device/CMakeLists.txt b/device_hal/device/CMakeLists.txt index 6b16bda54..933921831 100644 --- a/device_hal/device/CMakeLists.txt +++ b/device_hal/device/CMakeLists.txt @@ -1,4 +1,4 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) idf_component_register(SRC_DIRS "${device_name}" INCLUDE_DIRS include - PRIV_REQUIRES ${used_driver}) + REQUIRES ${used_driver}) diff --git a/device_hal/device/esp32s2_devkit_c/device.c b/device_hal/device/esp32s2_devkit_c/device.c new file mode 100644 index 000000000..43fea710d --- /dev/null +++ b/device_hal/device/esp32s2_devkit_c/device.c @@ -0,0 +1,41 @@ +// Copyright 2021 Espressif Systems (Shanghai) CO LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#include + +#include +#include + +static const char *TAG = "device"; + +static esp_err_t device_light_init() +{ + light_driver_config_t config = { + .gpio = -1, + .channel = -1, + }; + return light_driver_init(&config); +} + +static esp_err_t device_button_init() +{ + return button_driver_init(NULL); +} + +esp_err_t device_init() +{ + ESP_LOGI(TAG, "Initializing device"); + device_light_init(); + device_button_init(); + return ESP_OK; +} diff --git a/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake b/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake new file mode 100644 index 000000000..460133ae7 --- /dev/null +++ b/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.5) +if(NOT ("${IDF_TARGET}" STREQUAL "esp32s2" )) + message(FATAL_ERROR "please set esp32s2 as the IDF_TARGET using 'idf.py set-target esp32s2'") +endif() + +SET(device_hal_path $ENV{ESP_MATTER_DEVICE_PATH}/../../) +SET(device_name esp32s2_devkit_c) +SET(light_type hollow) +SET(button_type hollow) +SET(used_driver light_driver button_driver) +SET(extra_components_dirs_append "${device_hal_path}/light_driver" + "${device_hal_path}/button_driver") + + diff --git a/examples/common/app_driver/CMakeLists.txt b/examples/common/app_driver/CMakeLists.txt deleted file mode 100644 index efc30a06b..000000000 --- a/examples/common/app_driver/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) -idf_component_register(SRCS app_driver.c - INCLUDE_DIRS . - PRIV_REQUIRES device ${used_driver} esp_matter esp_matter_console) diff --git a/examples/common/app_driver/app_driver.c b/examples/common/app_driver/app_driver.c deleted file mode 100644 index 09d030bcc..000000000 --- a/examples/common/app_driver/app_driver.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#define APP_DRIVER_NAME "Driver" -static const char *TAG = "app_driver"; - -static esp_err_t app_driver_attribute_set(const char *endpoint, const char *attribute, esp_matter_attr_val_t val); -static esp_matter_attr_val_t app_driver_attribute_get(const char *endpoint, const char *attribute); - -static void app_driver_print_attr_val(const char *endpoint, const char *attribute, esp_matter_attr_val_t val) -{ - switch (val.type) { - case ESP_MATTER_VAL_TYPE_BOOLEAN: - ESP_LOGI(TAG, "%s's %s is %d", endpoint, attribute, val.val.b); - break; - - case ESP_MATTER_VAL_TYPE_INTEGER: - ESP_LOGI(TAG, "%s's %s is %d", endpoint, attribute, val.val.i); - break; - - case ESP_MATTER_VAL_TYPE_FLOAT: - ESP_LOGI(TAG, "%s's %s is %f", endpoint, attribute, val.val.f); - break; - - case ESP_MATTER_VAL_TYPE_STRING: - case ESP_MATTER_VAL_TYPE_OBJECT: - case ESP_MATTER_VAL_TYPE_ARRAY: - ESP_LOGI(TAG, "%s's %s is %s", endpoint, attribute, val.val.s); - break; - - default: - ESP_LOGI(TAG, "%s's %s is ", endpoint, attribute); - break; - } -} - -static esp_err_t app_driver_console_handler(int argc, char **argv) -{ - if (argc == 4 && strncmp(argv[0], "set", sizeof("set")) == 0) { - char *endpoint_name = argv[1]; - char *attribute_name = argv[2]; - int value = atoi(argv[3]); - esp_matter_attr_val_t val = esp_matter_int(value); - - /* Change val if bool */ - if (strncmp(attribute_name, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - val.type = ESP_MATTER_VAL_TYPE_BOOLEAN; - val.val.b = (bool)value; - } - app_driver_attribute_set(endpoint_name, attribute_name, val); - } else if (argc == 3 && strncmp(argv[0], "get", sizeof("get")) == 0) { - char *endpoint_name = argv[1]; - char *attribute_name = argv[2]; - esp_matter_attr_val_t val = app_driver_attribute_get(endpoint_name, attribute_name); - app_driver_print_attr_val(endpoint_name, attribute_name, val); - } else { - ESP_LOGE(TAG, "Incorrect arguments"); - return -1; - } - return 0; -} - -static void app_driver_register_commands() -{ - esp_matter_console_command_t command = { - .name = "driver", - .description = "This can be used to simulate on-device control. Usage: chip esp driver " - " [value]. Example1: chip esp driver set Light Power 1. " - "Example2: chip esp driver get Light Power.", - .handler = app_driver_console_handler, - }; - esp_matter_console_add_command(&command); -} - -static esp_matter_attr_val_t app_driver_attribute_get(const char *endpoint, const char *attribute) -{ - if (strncmp(endpoint, ESP_MATTER_ENDPOINT_LIGHT, sizeof(ESP_MATTER_ENDPOINT_LIGHT)) == 0) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return esp_matter_bool(light_driver_get_power()); - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return esp_matter_int(light_driver_get_brightness()); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return esp_matter_int(light_driver_get_hue()); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return esp_matter_int(light_driver_get_saturation()); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return esp_matter_int(light_driver_get_temperature()); - } else { - ESP_LOGI(TAG, "Attribute update not handled: %s", attribute); - } - } else { - ESP_LOGI(TAG, "Endpoint not handled"); - } - esp_matter_attr_val_t val = { - .type = ESP_MATTER_VAL_TYPE_INVALID, - }; - return val; -} - -static esp_err_t app_driver_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) -{ - esp_err_t err = ESP_OK; - if (strncmp(endpoint, ESP_MATTER_ENDPOINT_LIGHT, sizeof(ESP_MATTER_ENDPOINT_LIGHT)) == 0) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - err = light_driver_set_power(val.val.b); - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - err = light_driver_set_brightness(val.val.i); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - err = light_driver_set_hue(val.val.i); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - err = light_driver_set_saturation(val.val.i); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - err = light_driver_set_temperature(val.val.i); - } else { - ESP_LOGI(TAG, "Attribute update not handled: %s", attribute); - err = ESP_ERR_NOT_FOUND; - } - } else { - ESP_LOGI(TAG, "Endpoint not handled"); - err = ESP_ERR_NOT_FOUND; - } - return err; -} - -static esp_err_t app_driver_attribute_set(const char *endpoint, const char *attribute, esp_matter_attr_val_t val) -{ - app_driver_attribute_update(endpoint, attribute, val, NULL); - esp_matter_attribute_notify(APP_DRIVER_NAME, endpoint, attribute, val); - return ESP_OK; -} - -esp_err_t app_driver_init() -{ - device_init(); - esp_matter_attribute_callback_add(APP_DRIVER_NAME, app_driver_attribute_update, NULL); - app_driver_register_commands(); - return ESP_OK; -} diff --git a/examples/common/app_openthread/app_openthread.c b/examples/common/app_openthread/app_openthread.c index a243097a2..6d22c5b20 100644 --- a/examples/common/app_openthread/app_openthread.c +++ b/examples/common/app_openthread/app_openthread.c @@ -58,7 +58,7 @@ static void ot_task_worker(void *context) vTaskDelete(NULL); } -void app_openthread_launch_task(void) +esp_err_t app_openthread_launch_task(void) { // Used eventfds: // * netif @@ -71,4 +71,5 @@ void app_openthread_launch_task(void) ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_vfs_eventfd_register(&eventfd_config)); xTaskCreate(ot_task_worker, "ot_cli_main", 10240, xTaskGetCurrentTaskHandle(), 5, NULL); + return ESP_OK; } diff --git a/examples/common/app_openthread/app_openthread.h b/examples/common/app_openthread/app_openthread.h index 3f8c7b940..e20ef1bb7 100644 --- a/examples/common/app_openthread/app_openthread.h +++ b/examples/common/app_openthread/app_openthread.h @@ -14,7 +14,7 @@ extern "C" { #endif -void app_openthread_launch_task(void); +esp_err_t app_openthread_launch_task(void); #ifdef __cplusplus } diff --git a/examples/light/CMakeLists.txt b/examples/light/CMakeLists.txt index 6aad80071..d984bd0de 100644 --- a/examples/light/CMakeLists.txt +++ b/examples/light/CMakeLists.txt @@ -13,13 +13,16 @@ if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c3_devkit_m) elseif("${IDF_TARGET}" STREQUAL "esp32h2") set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32h2_devkit_c) + elseif("${IDF_TARGET}" STREQUAL "esp32s2") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32s2_devkit_c) else() - message(FATAL_ERROR "Unsupported IDF_TARGT") + message(FATAL_ERROR "Unsupported IDF_TARGET") endif() endif(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH}) set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip) +set(ZAP_GENERATED_PATH ${ESP_MATTER_PATH}/examples/light/main/zap-generated) # This should be done before using the IDF_TARGET variable. include($ENV{IDF_PATH}/tools/cmake/project.cmake) @@ -27,7 +30,7 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) set(EXTRA_COMPONENT_DIRS "../common" - "${IDF_PATH}/examples/common_components/qrcode" + "${IDF_PATH}/examples/common_components" "${MATTER_SDK_PATH}/config/esp32/components" "${ESP_MATTER_PATH}/components" "${ESP_MATTER_PATH}/device_hal/device" diff --git a/examples/light/README.md b/examples/light/README.md index 6b58d55ab..cd638aafa 100644 --- a/examples/light/README.md +++ b/examples/light/README.md @@ -19,7 +19,7 @@ Supported features: - BLE commands ``` -> chip ble +> matter ble ``` Set and get the BLE advertisement state. @@ -27,13 +27,13 @@ Set and get the BLE advertisement state. - Wi-Fi commands ``` -> chip wifi mode [disable|ap|sta] +> matter wifi mode [disable|ap|sta] ``` Set and get the Wi-Fi mode. ``` -> chip wifi connect +> matter wifi connect ``` Connect to Wi-Fi network. @@ -41,7 +41,7 @@ Connect to Wi-Fi network. - Device configuration ``` -> chip config +> matter config ``` Dump the device static configuration @@ -50,13 +50,13 @@ Dump the device static configuration - Facotry reset ``` -> chip device factoryreset +> matter device factoryreset ``` - On-boarding codes ``` -> chip onboardingcodes +> matter onboardingcodes ``` Dump the on-boarding pairing code payloads. diff --git a/examples/light/main/CMakeLists.txt b/examples/light/main/CMakeLists.txt index a19cf708e..9c4748960 100644 --- a/examples/light/main/CMakeLists.txt +++ b/examples/light/main/CMakeLists.txt @@ -1,42 +1,7 @@ -set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_CURRENT_LIST_DIR}/zap-generated" - "${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes" - "${MATTER_SDK_PATH}/src/app/server" - "${MATTER_SDK_PATH}/src/app/util" - "${MATTER_SDK_PATH}/src/app/reporting" - "${MATTER_SDK_PATH}/src/app/clusters/basic" - "${MATTER_SDK_PATH}/src/app/clusters/administrator-commissioning-server" - "${MATTER_SDK_PATH}/src/app/clusters/application-basic-server" - "${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server" - "${MATTER_SDK_PATH}/src/app/clusters/general-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/fixed-label-server" - "${MATTER_SDK_PATH}/src/app/clusters/user-label-server" - "${MATTER_SDK_PATH}/src/app/clusters/identify-server" - "${MATTER_SDK_PATH}/src/app/clusters/ota-requestor" - "${MATTER_SDK_PATH}/src/app/clusters/network-commissioning" - "${MATTER_SDK_PATH}/src/app/clusters/diagnostic-logs-server" - "${MATTER_SDK_PATH}/src/app/clusters/software-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/thread-network-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/wifi-network-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/on-off-server" - "${MATTER_SDK_PATH}/src/app/clusters/operational-credentials-server" - "${MATTER_SDK_PATH}/src/app/clusters/descriptor" - "${MATTER_SDK_PATH}/src/app/clusters/level-control" - "${MATTER_SDK_PATH}/src/app/clusters/color-control-server") +set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_openthread app_update) -set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${MATTER_SDK_PATH}/src" - "${MATTER_SDK_PATH}/zzz_generated/app-common") - -set(PRIV_REQUIRES_LIST - chip bt esp32_mbedtls esp_matter esp_matter_console app_driver app_qrcode app_openthread route_hook app_update) - -if ("${IDF_TARGET}" STREQUAL "esp32h2") - list(APPEND PRIV_REQUIRES_LIST openthread) -endif() - -idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} - PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "." PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) diff --git a/examples/light/main/app_constants.h b/examples/light/main/app_constants.h deleted file mode 100644 index 95eb57391..000000000 --- a/examples/light/main/app_constants.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEFAULT_POWER true -#define DEFAULT_BRIGHTNESS 100 -#define DEFAULT_HUE 360 -#define DEFAULT_SATURATION 100 - -#ifdef __cplusplus -} -#endif diff --git a/examples/light/main/app_driver.cpp b/examples/light/main/app_driver.cpp new file mode 100644 index 000000000..62e7d8492 --- /dev/null +++ b/examples/light/main/app_driver.cpp @@ -0,0 +1,131 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include + +static const char *TAG = "app_driver"; + +#define STANDARD_BRIGHTNESS 100 +#define STANDARD_HUE 360 +#define STANDARD_SATURATION 100 +#define STANDARD_TEMPERATURE 100 + +#define MATTER_BRIGHTNESS 255 +#define MATTER_HUE 255 +#define MATTER_SATURATION 255 +#define MATTER_TEMPERATURE 255 + +static esp_err_t app_driver_console_handler(int argc, char **argv) +{ + if (argc == 5 && strncmp(argv[0], "set", sizeof("set")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + int value = atoi(argv[4]); + + esp_matter_attr_val_t val = esp_matter_int(value); + + /* Change val if bool */ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID && attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + val.type = ESP_MATTER_VAL_TYPE_BOOLEAN; + val.val.b = (bool)value; + } + esp_matter_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (argc == 4 && strncmp(argv[0], "get", sizeof("get")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + + esp_matter_node_t *node = esp_matter_node_get(); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get(node, endpoint_id); + esp_matter_cluster_t *cluster = esp_matter_cluster_get(endpoint, cluster_id); + esp_matter_attribute_t *attribute = esp_matter_attribute_get(cluster, attribute_id); + esp_matter_attr_val_t val = esp_matter_attribute_get_val(attribute); + esp_matter_attribute_val_print(endpoint_id, cluster_id, attribute_id, val); + } else { + ESP_LOGE(TAG, "Incorrect arguments"); + return ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +static void app_driver_register_commands() +{ + esp_matter_console_command_t command = { + .name = "driver", + .description = "This can be used to simulate on-device control. " + "Usage: matter esp driver [value]. " + "Example1: matter esp driver set 0x1001 0x0006 0x0000 1. " + "Example2: matter esp driver get 0x1001 0x0006 0x0000.", + .handler = app_driver_console_handler, + }; + esp_matter_console_add_command(&command); +} + +/* Do any conversions/remapping for the actual value here */ +static esp_err_t app_driver_light_set_power(esp_matter_attr_val_t val) +{ + return light_driver_set_power(val.val.b); +} + +static esp_err_t app_driver_light_set_brightness(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); + return light_driver_set_brightness(value); +} + +static esp_err_t app_driver_light_set_hue(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_HUE, STANDARD_HUE); + return light_driver_set_hue(value); +} + +static esp_err_t app_driver_light_set_saturation(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_SATURATION, STANDARD_SATURATION); + return light_driver_set_saturation(value); +} + +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + esp_err_t err = ESP_OK; + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + err = app_driver_light_set_power(val); + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + err = app_driver_light_set_brightness(val); + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + err = app_driver_light_set_hue(val); + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + err = app_driver_light_set_saturation(val); + } + } + } + return err; +} + +esp_err_t app_driver_init() +{ + device_init(); + app_driver_register_commands(); + return ESP_OK; +} diff --git a/examples/common/app_driver/app_driver.h b/examples/light/main/app_driver.h similarity index 81% rename from examples/common/app_driver/app_driver.h rename to examples/light/main/app_driver.h index ca77abbf5..e8656e837 100644 --- a/examples/common/app_driver/app_driver.h +++ b/examples/light/main/app_driver.h @@ -13,6 +13,7 @@ extern "C" { #endif #include +#include /** Initialize the board and the drivers * @@ -23,6 +24,8 @@ extern "C" { */ esp_err_t app_driver_init(void); +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); + #ifdef __cplusplus } #endif diff --git a/examples/light/main/app_main.cpp b/examples/light/main/app_main.cpp index c6c551333..06d0937e9 100644 --- a/examples/light/main/app_main.cpp +++ b/examples/light/main/app_main.cpp @@ -6,86 +6,90 @@ CONDITIONS OF ANY KIND, either express or implied. */ -#include "app_constants.h" -#include "app_driver.h" -#include "app_matter.h" -#include "app_ota.h" -#include "app_qrcode.h" -#include "esp_matter.h" -#include "esp_matter_console.h" -#include "esp_matter_standard.h" +#include +#include +#include -#include "esp_err.h" -#include "esp_log.h" -#include "nvs_flash.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "lib/shell/Engine.h" +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif +#include +#include +#include -#define APP_MAIN_NAME "Main" static const char *TAG = "app_main"; -static esp_err_t app_main_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) +static esp_matter_node_config_t node_config = NODE_CONFIG_DEFAULT(); +static esp_matter_endpoint_color_dimmable_light_config_t light_config = ENDPOINT_CONFIG_COLOR_DIMMABLE_LIGHT_DEFAULT(); + +static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg) { - /* Just adding this callback to notify the application */ - switch (val.type) { - case ESP_MATTER_VAL_TYPE_BOOLEAN: - ESP_LOGD(TAG, "%s's %s is %d", endpoint, attribute, val.val.b); - break; - - case ESP_MATTER_VAL_TYPE_INTEGER: - ESP_LOGD(TAG, "%s's %s is %d", endpoint, attribute, val.val.i); - break; - - case ESP_MATTER_VAL_TYPE_FLOAT: - ESP_LOGD(TAG, "%s's %s is %f", endpoint, attribute, val.val.f); - break; - - case ESP_MATTER_VAL_TYPE_STRING: - case ESP_MATTER_VAL_TYPE_OBJECT: - case ESP_MATTER_VAL_TYPE_ARRAY: - ESP_LOGD(TAG, "%s's %s is %s", endpoint, attribute, val.val.s); - break; - - default: - ESP_LOGD(TAG, "%s's %s is ", endpoint, attribute); - break; + if (event->Type == chip::DeviceLayer::DeviceEventType::PublicEventTypes::kInterfaceIpAddressChanged) { +#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD + chip::app::DnssdServer::Instance().StartServer(); + esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); +#endif } - return ESP_OK; + ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +static esp_err_t app_attribute_update_cb(esp_matter_callback_type_t type, int endpoint_id, int cluster_id, + int attribute_id, esp_matter_attr_val_t val, void *priv_data) +{ + esp_err_t err = ESP_OK; + + if (type == ESP_MATTER_CALLBACK_TYPE_PRE_ATTRIBUTE) { + /* Driver update */ + err = app_driver_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (type == ESP_MATTER_CALLBACK_TYPE_POST_ATTRIBUTE) { + /* Other ecosystems update */ + } + + return err; } extern "C" void app_main() { - /* Initialize the ESP NVS layer */ - ESP_ERROR_CHECK(nvs_flash_init()); + esp_err_t err = ESP_OK; - /* Initialize esp_matter */ - esp_matter_init(); - esp_matter_attribute_callback_add(APP_MAIN_NAME, app_main_attribute_update, NULL); + /* Initialize the ESP NVS layer */ + nvs_flash_init(); + + /* Create matter device */ + esp_matter_node_t *node = esp_matter_node_create(&node_config, app_attribute_update_cb, NULL); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_create_color_dimmable_light(node, &light_config); + /** + These node and endpoint handles can be used to create and add other endpoints and other clusters to the endpoints. + */ + if (!node || !endpoint) { + ESP_LOGE(TAG, "Matter device creation failed"); + } /* Initialize driver */ app_driver_init(); - /* Initialize chip */ - ESP_ERROR_CHECK(app_matter_init()); - app_qrcode_print(); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + /* Initialize OpenThread */ + app_openthread_launch_task(); +#endif - /* Set the default attribute values */ - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_POWER, - esp_matter_bool(DEFAULT_POWER)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_BRIGHTNESS, - esp_matter_int(DEFAULT_BRIGHTNESS)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_HUE, - esp_matter_int(DEFAULT_HUE)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_SATURATION, - esp_matter_int(DEFAULT_SATURATION)); + /* Matter start */ + err = esp_matter_start(app_event_cb); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Matter start failed: %d", err); + } + app_qrcode_print(); #if CONFIG_ENABLE_CHIP_SHELL esp_matter_console_diagnostics_register_commands(); -#if CONFIG_ENABLE_OTA_REQUESTOR - esp_matter_console_ota_register_commands(); -#endif esp_matter_console_init(); #endif + +#if CONFIG_ENABLE_OTA_REQUESTOR + matter_ota_requestor_init(); +#endif } diff --git a/examples/light/main/app_matter.cpp b/examples/light/main/app_matter.cpp deleted file mode 100644 index d92a3cffa..000000000 --- a/examples/light/main/app_matter.cpp +++ /dev/null @@ -1,307 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include "app_matter.h" -#include "app_constants.h" -#include "app_ota.h" -#include "esp_matter.h" -#include "esp_matter_standard.h" - -#include "esp_heap_caps.h" -#include "esp_log.h" -#include "esp_route_hook.h" - -#include "app-common/zap-generated/att-storage.h" -#include "app-common/zap-generated/attribute-id.h" -#include "app-common/zap-generated/attribute-type.h" -#include "app-common/zap-generated/cluster-id.h" -#include "app/server/Dnssd.h" -#include "app/server/Server.h" -#include "app/util/af.h" -#include "app/util/basic-types.h" -#include "core/CHIPError.h" -#include "credentials/DeviceAttestationCredsProvider.h" -#include "credentials/examples/DeviceAttestationCredsExample.h" -#include "freertos/FreeRTOS.h" -#include "lib/shell/Engine.h" -#include "lib/support/CHIPMem.h" -#include "platform/CHIPDeviceLayer.h" -#include "platform/PlatformManager.h" - -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -#include "app_openthread.h" -#endif - -using chip::AttributeId; -using chip::ClusterId; -using chip::EndpointId; -using chip::Credentials::SetDeviceAttestationCredentialsProvider; -using chip::Credentials::Examples::GetExampleDACProvider; -using chip::DeviceLayer::ChipDeviceEvent; -using chip::DeviceLayer::ConnectivityMgr; -using chip::DeviceLayer::PlatformMgr; -using chip::DeviceLayer::DeviceEventType::PublicEventTypes; -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -using chip::DeviceLayer::ThreadStackMgr; -#endif - -typedef enum { - REMAP_MATTER_TO_STANDARD, - REMAP_STANDARD_TO_MATTER, -} app_matter_remap_t; - -#define STANDARD_BRIGHTNESS 100 -#define STANDARD_HUE 360 -#define STANDARD_SATURATION 100 -#define STANDARD_TEMPERATURE 100 - -#define MATTER_BRIGHTNESS 255 -#define MATTER_HUE 255 -#define MATTER_SATURATION 255 -#define MATTER_TEMPERATURE 255 - -#define APP_MATTER_NAME "Matter" -static const char *TAG = "app_matter"; - -int app_matter_remap(char *attribute, int value, app_matter_remap_t remap) -{ - if (remap == REMAP_MATTER_TO_STANDARD) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return value; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return REMAP_TO_RANGE(value, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return REMAP_TO_RANGE(value, MATTER_HUE, STANDARD_HUE); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return REMAP_TO_RANGE(value, MATTER_SATURATION, STANDARD_SATURATION); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return REMAP_TO_RANGE(value, MATTER_TEMPERATURE, STANDARD_TEMPERATURE); - } - } else if (remap == REMAP_STANDARD_TO_MATTER) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return value; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_BRIGHTNESS, MATTER_BRIGHTNESS); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_HUE, MATTER_HUE); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_SATURATION, MATTER_SATURATION); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_TEMPERATURE, MATTER_TEMPERATURE); - } - } - return value; -} - -static EndpointId app_matter_get_endpoint_id(const char *endpoint) -{ - if (strncmp(endpoint, ESP_MATTER_ENDPOINT_LIGHT, sizeof(ESP_MATTER_ENDPOINT_LIGHT)) == 0) { - return 1; - } - return 0; -} - -static const char *app_matter_get_endpoint_name(EndpointId endpoint) -{ - if (endpoint == 1) { - return ESP_MATTER_ENDPOINT_LIGHT; - } - return NULL; -} - -static ClusterId app_matter_get_cluster_id(const char *attribute) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return ZCL_ON_OFF_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return ZCL_LEVEL_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } - return 0; -} - -static AttributeId app_matter_get_attribute_id(const char *attribute) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return ZCL_ON_OFF_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return ZCL_CURRENT_LEVEL_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID; - } - return 0; -} - -static const char *app_matter_get_attribute_name(ClusterId cluster, AttributeId attribute) -{ - if (cluster == ZCL_ON_OFF_CLUSTER_ID) { - return ESP_MATTER_ATTR_POWER; - } else if (cluster == ZCL_LEVEL_CONTROL_CLUSTER_ID) { - return ESP_MATTER_ATTR_BRIGHTNESS; - } else if (cluster == ZCL_COLOR_CONTROL_CLUSTER_ID) { - if (attribute == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_HUE; - } else if (attribute == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_SATURATION; - } else if (attribute == ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_TEMPERATURE; - } - } - return NULL; -} - -static EmberAfAttributeType app_matter_get_attribute_type(esp_matter_attr_val_t val) -{ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - return ZCL_BOOLEAN_ATTRIBUTE_TYPE; - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - return ZCL_INT8U_ATTRIBUTE_TYPE; - } - return 0; -} - -static int app_matter_get_attribute_value(esp_matter_attr_val_t val) -{ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - return (int)val.val.b; - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - return val.val.i; - } - return 0; -} - -static esp_matter_attr_val_t app_matter_get_attribute_val(char *attribute, int value) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return esp_matter_bool((bool)value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return esp_matter_int(value); - } - return esp_matter_int(value); -} - -static esp_err_t app_matter_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) -{ - EndpointId endpoint_id = app_matter_get_endpoint_id(endpoint); - ClusterId cluster_id = app_matter_get_cluster_id(attribute); - AttributeId attribute_id = app_matter_get_attribute_id(attribute); - EmberAfAttributeType attribute_type = app_matter_get_attribute_type(val); - int value = app_matter_get_attribute_value(val); - uint8_t value_remap = (uint8_t)app_matter_remap((char *)attribute, value, REMAP_STANDARD_TO_MATTER); - ESP_LOGD(TAG, "Changing %s from standard: %d, to matter: %d\n", attribute, value, value_remap); - - EmberAfStatus status = emberAfWriteAttribute(endpoint_id, cluster_id, attribute_id, CLUSTER_MASK_SERVER, - (uint8_t *)&value_remap, attribute_type); - if (status != EMBER_ZCL_STATUS_SUCCESS) { - ESP_LOGE(TAG, "Error updating attribute to matter"); - return ESP_FAIL; - } - return ESP_OK; -} - -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &path, uint8_t mask, uint8_t type, - uint16_t size, uint8_t *value) - -{ - char *endpoint_name = (char *)app_matter_get_endpoint_name(path.mEndpointId); - char *attribute_name = (char *)app_matter_get_attribute_name(path.mClusterId, path.mAttributeId); - if (endpoint_name == NULL || attribute_name == NULL) { - return; - } - int value_remap = app_matter_remap(attribute_name, (int)*value, REMAP_MATTER_TO_STANDARD); - esp_matter_attr_val_t val = app_matter_get_attribute_val(attribute_name, value_remap); - ESP_LOGD(TAG, "Changing %s from matter: %d, to standard: %d\n", attribute_name, *value, value_remap); - - esp_matter_attribute_notify(APP_MATTER_NAME, endpoint_name, attribute_name, val); -} - -esp_err_t app_matter_attribute_set(const char *endpoint, const char *attribute, esp_matter_attr_val_t val) -{ - app_matter_attribute_update(endpoint, attribute, val, NULL); - esp_matter_attribute_notify(APP_MATTER_NAME, endpoint, attribute, val); - return ESP_OK; -} - -static void on_device_event(const ChipDeviceEvent *event, intptr_t arg) -{ - if (event->Type == PublicEventTypes::kInterfaceIpAddressChanged) { -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD - chip::app::DnssdServer::Instance().StartServer(); - esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); -#endif - } - ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); -} - -static void matter_init_task(intptr_t context) -{ - xTaskHandle task_to_notify = reinterpret_cast(context); - chip::Server::GetInstance().Init(); - SetDeviceAttestationCredentialsProvider(GetExampleDACProvider()); -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - chip::app::DnssdServer::Instance().StartServer(); -#endif - xTaskNotifyGive(task_to_notify); -} - -esp_err_t app_matter_init() -{ - if (PlatformMgr().InitChipStack() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to initialize CHIP stack"); - return ESP_FAIL; - } - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - if (chip::Platform::MemoryInit() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to initialize CHIP memory pool"); - return ESP_ERR_NO_MEM; - } - if (PlatformMgr().StartEventLoopTask() != CHIP_NO_ERROR) { - chip::Platform::MemoryShutdown(); - ESP_LOGE(TAG, "Failed to launch Matter main task"); - return ESP_FAIL; - } - PlatformMgr().AddEventHandler(on_device_event, static_cast(NULL)); -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - /* Initializa OpenThread */ - app_openthread_launch_task(); - - if (ThreadStackMgr().InitThreadStack() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to initialize Thread stack"); - return ESP_FAIL; - } - - if (ThreadStackMgr().StartThreadTask() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to launch Thread task"); - return ESP_FAIL; - } -#endif - PlatformMgr().ScheduleWork(matter_init_task, reinterpret_cast(xTaskGetCurrentTaskHandle())); - // Wait for the matter stack to be initialized - xTaskNotifyWait(0, 0, NULL, portMAX_DELAY); -#if CONFIG_ENABLE_OTA_REQUESTOR - matter_ota_requestor_init(); -#endif - esp_matter_attribute_callback_add(APP_MATTER_NAME, app_matter_attribute_update, NULL); - return ESP_OK; -} diff --git a/examples/light/main/app_matter.h b/examples/light/main/app_matter.h deleted file mode 100644 index 8f822664b..000000000 --- a/examples/light/main/app_matter.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#pragma once - -#include "esp_err.h" - -/** Initialize the matter stack - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t app_matter_init(void); diff --git a/examples/light/main/app_ota.cpp b/examples/light/main/app_ota.cpp index d72d74f22..c0f52c15f 100644 --- a/examples/light/main/app_ota.cpp +++ b/examples/light/main/app_ota.cpp @@ -5,34 +5,36 @@ software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -#include #include #include +#include + #include "OTAImageProcessorImpl.h" #include "OTARequestorDriverImpl.h" -#include "platform/OTARequestorInterface.h" #include "app/clusters/ota-requestor/BDXDownloader.h" #include "app/clusters/ota-requestor/OTARequestor.h" +#include "platform/OTARequestorInterface.h" -using chip::Server; -using chip::OTARequestor; using chip::BDXDownloader; using chip::OTAImageProcessorImpl; +using chip::OTARequestor; using chip::OTARequestorDriverImpl; +using chip::Server; static const char *TAG = "esp_matter_ota"; -OTARequestor gRequestorCore; +OTARequestor gRequestorCore; OTARequestorDriverImpl gRequestorUser; -BDXDownloader gDownloader; -OTAImageProcessorImpl gImageProcessor; +BDXDownloader gDownloader; +OTAImageProcessorImpl gImageProcessor; -static esp_err_t apply_image_handler(int argc, char** argv) { - chip::OTARequestor * requestor = reinterpret_cast(chip::GetRequestorInstance()); +static esp_err_t apply_image_handler(int argc, char **argv) +{ + chip::OTARequestor *requestor = reinterpret_cast(chip::GetRequestorInstance()); requestor->ApplyUpdate(); return ESP_OK; } -static esp_err_t esp_matter_console_ota_handler(int argc, char** argv) +static esp_err_t esp_matter_console_ota_handler(int argc, char **argv) { if (argc == 1 && strncmp(argv[0], "apply", sizeof("apply")) == 0) { return apply_image_handler(argc, argv); @@ -40,7 +42,7 @@ static esp_err_t esp_matter_console_ota_handler(int argc, char** argv) ESP_LOGE(TAG, "Incorrect arguments"); return ESP_FAIL; } - return ESP_OK; + return ESP_OK; } void esp_matter_console_ota_register_commands() @@ -56,10 +58,12 @@ void esp_matter_console_ota_register_commands() void matter_ota_requestor_init(void) { chip::SetRequestorInstance(&gRequestorCore); - Server * server = &(Server::GetInstance()); + Server *server = &(Server::GetInstance()); gRequestorCore.SetServerInstance(server); gRequestorCore.SetOtaRequestorDriver(&gRequestorUser); gImageProcessor.SetOTADownloader(&gDownloader); gDownloader.SetImageProcessorDelegate(&gImageProcessor); gRequestorCore.SetBDXDownloader(&gDownloader); + + esp_matter_console_ota_register_commands(); } diff --git a/examples/light/main/zap-generated/CHIPClientCallbacks.cpp b/examples/light/main/zap-generated/CHIPClientCallbacks.cpp index 19dd77a3a..2e9d8d2ba 100644 --- a/examples/light/main/zap-generated/CHIPClientCallbacks.cpp +++ b/examples/light/main/zap-generated/CHIPClientCallbacks.cpp @@ -131,6 +131,2620 @@ namespace { // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); +void AccessControlClusterAclListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccessControlClusterExtensionListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccessControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccountLoginClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AdministratorCommissioningClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AudioOutputClusterAudioOutputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AudioOutputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BarrierControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BinaryInputBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BindingClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BooleanStateClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterActionListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterEndpointListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedDeviceBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ContentLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterDeviceListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterServerListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterClientListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterPartsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DiagnosticLogsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DoorLockClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ElectricalMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void EthernetNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FixedLabelClusterLabelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FixedLabelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FlowMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralCommissioningClusterBasicCommissioningInfoListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralCommissioningClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterNetworkInterfacesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveHardwareFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveRadioFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveNetworkFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void IdentifyClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void IlluminanceMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void KeypadInputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void LevelControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void LowPowerClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaInputClusterMediaInputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaInputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaPlaybackClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ModeSelectClusterSupportedModesListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ModeSelectClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void NetworkCommissioningClusterNetworksListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OccupancySensingClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OnOffClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceConfigurationClusterSourcesListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PressureMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PumpConfigurationAndControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void RelativeHumidityMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ScenesClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SoftwareDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SwitchClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TargetNavigatorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TemperatureMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListInt8uListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListStructOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListNullablesAndOptionalsStructListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListLongOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThermostatClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThermostatUserInterfaceConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable( + onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterNeighborTableListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterRouteTableListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterSecurityPolicyListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterOperationalDatasetComponentsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable( + onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterActiveNetworkFaultsListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void UserLabelClusterLabelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WakeOnLanClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WiFiNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WindowCoveringClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +bool emberAfAccountLoginClusterGetSetupPINResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::CharSpan setupPIN) +{ + ChipLogProgress(Zcl, "GetSetupPINResponse:"); + ChipLogProgress(Zcl, " setupPIN: %.*s", static_cast(setupPIN.size()), setupPIN.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("AccountLoginClusterGetSetupPINResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, setupPIN); + return true; +} + +bool emberAfApplicationLauncherClusterHideAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) +{ + ChipLogProgress(Zcl, "HideAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterHideAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterLaunchAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfApplicationLauncherClusterStopAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) +{ + ChipLogProgress(Zcl, "StopAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterStopAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfChannelClusterChangeChannelResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch, uint8_t errorType) +{ + ChipLogProgress(Zcl, "ChangeChannelResponse:"); + ChipLogProgress(Zcl, " channelMatch: Not sure how to log struct ChannelInfo"); + ChipLogProgress(Zcl, " errorType: %" PRIu8 "", errorType); + + GET_CLUSTER_RESPONSE_CALLBACKS("ChannelClusterChangeChannelResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, ChannelInfo(), errorType); + return true; +} + +bool emberAfContentLauncherClusterLaunchContentResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t contentLaunchStatus, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchContentResponse:"); + ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchContentResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, contentLaunchStatus, data); + return true; +} + +bool emberAfContentLauncherClusterLaunchURLResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t contentLaunchStatus, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchURLResponse:"); + ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchURLResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, contentLaunchStatus, data); + return true; +} + +bool emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::ByteSpan content, uint32_t timeStamp, uint32_t timeSinceBoot) +{ + ChipLogProgress(Zcl, "RetrieveLogsResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " content: %zu", content.size()); + ChipLogProgress(Zcl, " timeStamp: %" PRIu32 "", timeStamp); + ChipLogProgress(Zcl, " timeSinceBoot: %" PRIu32 "", timeSinceBoot); + + GET_CLUSTER_RESPONSE_CALLBACKS("DiagnosticLogsClusterRetrieveLogsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, content, timeStamp, timeSinceBoot); + return true; +} + +bool emberAfDoorLockClusterGetCredentialStatusResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + bool credentialExists, uint16_t userIndex, + uint16_t nextCredentialIndex) +{ + ChipLogProgress(Zcl, "GetCredentialStatusResponse:"); + ChipLogProgress(Zcl, " credentialExists: %d", credentialExists); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " nextCredentialIndex: %" PRIu16 "", nextCredentialIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterGetCredentialStatusResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, credentialExists, userIndex, nextCredentialIndex); + return true; +} + +bool emberAfDoorLockClusterGetUserResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint16_t userIndex, + chip::CharSpan userName, uint32_t userUniqueId, uint8_t userStatus, + uint8_t userType, uint8_t credentialRule, + /* TYPE WARNING: array array defaults to */ uint8_t * credentials, + chip::FabricIndex creatorFabricIndex, chip::FabricIndex lastModifiedFabricIndex, + uint16_t nextUserIndex) +{ + ChipLogProgress(Zcl, "GetUserResponse:"); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " userName: %.*s", static_cast(userName.size()), userName.data()); + ChipLogProgress(Zcl, " userUniqueId: %" PRIu32 "", userUniqueId); + ChipLogProgress(Zcl, " userStatus: %" PRIu8 "", userStatus); + ChipLogProgress(Zcl, " userType: %" PRIu8 "", userType); + ChipLogProgress(Zcl, " credentialRule: %" PRIu8 "", credentialRule); + ChipLogProgress(Zcl, " credentials: %p", credentials); + ChipLogProgress(Zcl, " creatorFabricIndex: %" PRIu8 "", creatorFabricIndex); + ChipLogProgress(Zcl, " lastModifiedFabricIndex: %" PRIu8 "", lastModifiedFabricIndex); + ChipLogProgress(Zcl, " nextUserIndex: %" PRIu16 "", nextUserIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterGetUserResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, userIndex, userName, userUniqueId, userStatus, userType, credentialRule, credentials, + creatorFabricIndex, lastModifiedFabricIndex, nextUserIndex); + return true; +} + +bool emberAfDoorLockClusterSetCredentialResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t userIndex, uint16_t nextCredentialIndex) +{ + ChipLogProgress(Zcl, "SetCredentialResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " nextCredentialIndex: %" PRIu16 "", nextCredentialIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterSetCredentialResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, userIndex, nextCredentialIndex); + return true; +} + +bool emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "ArmFailSafeResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterArmFailSafeResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "CommissioningCompleteResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterCommissioningCompleteResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "SetRegulatoryConfigResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterSetRegulatoryConfigResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGroupsClusterAddGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "AddGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterAddGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfGroupsClusterGetGroupMembershipResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t capacity, + /* TYPE WARNING: array array defaults to */ uint8_t * groupList) +{ + ChipLogProgress(Zcl, "GetGroupMembershipResponse:"); + ChipLogProgress(Zcl, " capacity: %" PRIu8 "", capacity); + ChipLogProgress(Zcl, " groupList: %p", groupList); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterGetGroupMembershipResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, capacity, groupList); + return true; +} + +bool emberAfGroupsClusterRemoveGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "RemoveGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterRemoveGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfGroupsClusterViewGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, chip::CharSpan groupName) +{ + ChipLogProgress(Zcl, "ViewGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " groupName: %.*s", static_cast(groupName.size()), groupName.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterViewGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, groupName); + return true; +} + +bool emberAfIdentifyClusterIdentifyQueryResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint16_t timeout) +{ + ChipLogProgress(Zcl, "IdentifyQueryResponse:"); + ChipLogProgress(Zcl, " timeout: %" PRIu16 "", timeout); + + GET_CLUSTER_RESPONSE_CALLBACKS("IdentifyClusterIdentifyQueryResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, timeout); + return true; +} + +bool emberAfKeypadInputClusterSendKeyResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status) +{ + ChipLogProgress(Zcl, "SendKeyResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + + GET_CLUSTER_RESPONSE_CALLBACKS("KeypadInputClusterSendKeyResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status); + return true; +} + +bool emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaFastForwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaFastForwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaNextResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaNextResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaNextResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPauseResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPauseResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPauseResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPlayResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPlayResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPlayResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPreviousResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPreviousResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaRewindResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaRewindResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSeekResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSeekResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSkipBackwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipBackwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSkipForwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipForwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaStartOverResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStartOverResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaStopResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaStopResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStopResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfNetworkCommissioningClusterConnectNetworkResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t NetworkingStatus, chip::CharSpan DebugText, + int32_t ErrorValue) +{ + ChipLogProgress(Zcl, "ConnectNetworkResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + ChipLogProgress(Zcl, " ErrorValue: %" PRId32 "", ErrorValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterConnectNetworkResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText, ErrorValue); + return true; +} + +bool emberAfNetworkCommissioningClusterNetworkConfigResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t NetworkingStatus, chip::CharSpan DebugText) +{ + ChipLogProgress(Zcl, "NetworkConfigResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterNetworkConfigResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText); + return true; +} + +bool emberAfNetworkCommissioningClusterScanNetworksResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, uint8_t NetworkingStatus, chip::CharSpan DebugText, + /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults, + /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults) +{ + ChipLogProgress(Zcl, "ScanNetworksResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + ChipLogProgress(Zcl, " WiFiScanResults: %p", WiFiScanResults); + ChipLogProgress(Zcl, " ThreadScanResults: %p", ThreadScanResults); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterScanNetworksResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText, WiFiScanResults, ThreadScanResults); + return true; +} + bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t action, uint32_t delayedActionTime) { @@ -172,3 +2786,324 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(EndpointI userConsentNeeded, metadataForRequestor); return true; } + +bool emberAfOperationalCredentialsClusterAttestationResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan AttestationElements, chip::ByteSpan Signature) +{ + ChipLogProgress(Zcl, "AttestationResponse:"); + ChipLogProgress(Zcl, " AttestationElements: %zu", AttestationElements.size()); + ChipLogProgress(Zcl, " Signature: %zu", Signature.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterAttestationResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, AttestationElements, Signature); + return true; +} + +bool emberAfOperationalCredentialsClusterCertificateChainResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan Certificate) +{ + ChipLogProgress(Zcl, "CertificateChainResponse:"); + ChipLogProgress(Zcl, " Certificate: %zu", Certificate.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterCertificateChainResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, Certificate); + return true; +} + +bool emberAfOperationalCredentialsClusterNOCResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) +{ + ChipLogProgress(Zcl, "NOCResponse:"); + ChipLogProgress(Zcl, " StatusCode: %" PRIu8 "", StatusCode); + ChipLogProgress(Zcl, " FabricIndex: %" PRIu8 "", FabricIndex); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterNOCResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, StatusCode, FabricIndex, DebugText); + return true; +} + +bool emberAfOperationalCredentialsClusterOpCSRResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan NOCSRElements, chip::ByteSpan AttestationSignature) +{ + ChipLogProgress(Zcl, "OpCSRResponse:"); + ChipLogProgress(Zcl, " NOCSRElements: %zu", NOCSRElements.size()); + ChipLogProgress(Zcl, " AttestationSignature: %zu", AttestationSignature.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterOpCSRResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NOCSRElements, AttestationSignature); + return true; +} + +bool emberAfScenesClusterAddSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "AddSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterAddSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterGetSceneMembershipResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint8_t capacity, uint16_t groupId, uint8_t sceneCount, + /* TYPE WARNING: array array defaults to */ uint8_t * sceneList) +{ + ChipLogProgress(Zcl, "GetSceneMembershipResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " capacity: %" PRIu8 "", capacity); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneCount: %" PRIu8 "", sceneCount); + ChipLogProgress(Zcl, " sceneList: %p", sceneList); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterGetSceneMembershipResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, capacity, groupId, sceneCount, sceneList); + return true; +} + +bool emberAfScenesClusterRemoveAllScenesResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "RemoveAllScenesResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterRemoveAllScenesResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfScenesClusterRemoveSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "RemoveSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterRemoveSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterStoreSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "StoreSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterStoreSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterViewSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, + chip::CharSpan sceneName, + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets) +{ + ChipLogProgress(Zcl, "ViewSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + ChipLogProgress(Zcl, " transitionTime: %" PRIu16 "", transitionTime); + ChipLogProgress(Zcl, " sceneName: %.*s", static_cast(sceneName.size()), sceneName.data()); + ChipLogProgress(Zcl, " extensionFieldSets: %p", extensionFieldSets); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterViewSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId, transitionTime, sceneName, extensionFieldSets); + return true; +} + +bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "NavigateTargetResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("TargetNavigatorClusterNavigateTargetResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfTestClusterClusterBooleanResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, bool value) +{ + ChipLogProgress(Zcl, "BooleanResponse:"); + ChipLogProgress(Zcl, " value: %d", value); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterBooleanResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + return true; +} + +bool emberAfTestClusterClusterSimpleStructResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType arg1) +{ + ChipLogProgress(Zcl, "SimpleStructResponse:"); + ChipLogProgress(Zcl, " arg1: Not sure how to log struct SimpleStruct"); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterSimpleStructResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, SimpleStruct()); + return true; +} + +bool emberAfTestClusterClusterTestAddArgumentsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestAddArgumentsResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestAddArgumentsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + +bool emberAfTestClusterClusterTestEnumsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, chip::VendorId arg1, + uint8_t arg2) +{ + ChipLogProgress(Zcl, "TestEnumsResponse:"); + ChipLogProgress(Zcl, " arg1: %" PRIu16 "", arg1); + ChipLogProgress(Zcl, " arg2: %" PRIu8 "", arg2); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestEnumsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, arg1, arg2); + return true; +} + +bool emberAfTestClusterClusterTestListInt8UReverseResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + /* TYPE WARNING: array array defaults to */ uint8_t * arg1) +{ + ChipLogProgress(Zcl, "TestListInt8UReverseResponse:"); + ChipLogProgress(Zcl, " arg1: %p", arg1); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestListInt8UReverseResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, arg1); + return true; +} + +bool emberAfTestClusterClusterTestNullableOptionalResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + bool wasPresent, bool wasNull, uint8_t value, + uint8_t originalValue) +{ + ChipLogProgress(Zcl, "TestNullableOptionalResponse:"); + ChipLogProgress(Zcl, " wasPresent: %d", wasPresent); + ChipLogProgress(Zcl, " wasNull: %d", wasNull); + ChipLogProgress(Zcl, " value: %" PRIu8 "", value); + ChipLogProgress(Zcl, " originalValue: %" PRIu8 "", originalValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestNullableOptionalResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, wasPresent, wasNull, value, originalValue); + return true; +} + +bool emberAfTestClusterClusterTestSpecificResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestSpecificResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestSpecificResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + +bool emberAfThermostatClusterGetRelayStatusLogResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint16_t timeOfDay, uint16_t relayStatus, int16_t localTemperature, + uint8_t humidityInPercentage, int16_t setpoint, + uint16_t unreadEntries) +{ + ChipLogProgress(Zcl, "GetRelayStatusLogResponse:"); + ChipLogProgress(Zcl, " timeOfDay: %" PRIu16 "", timeOfDay); + ChipLogProgress(Zcl, " relayStatus: %" PRIu16 "", relayStatus); + ChipLogProgress(Zcl, " localTemperature: %" PRId16 "", localTemperature); + ChipLogProgress(Zcl, " humidityInPercentage: %" PRIu8 "", humidityInPercentage); + ChipLogProgress(Zcl, " setpoint: %" PRId16 "", setpoint); + ChipLogProgress(Zcl, " unreadEntries: %" PRIu16 "", unreadEntries); + + GET_CLUSTER_RESPONSE_CALLBACKS("ThermostatClusterGetRelayStatusLogResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, timeOfDay, relayStatus, localTemperature, humidityInPercentage, setpoint, unreadEntries); + return true; +} + +bool emberAfThermostatClusterGetWeeklyScheduleResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, + uint8_t modeForSequence, + /* TYPE WARNING: array array defaults to */ uint8_t * payload) +{ + ChipLogProgress(Zcl, "GetWeeklyScheduleResponse:"); + ChipLogProgress(Zcl, " numberOfTransitionsForSequence: %" PRIu8 "", numberOfTransitionsForSequence); + ChipLogProgress(Zcl, " dayOfWeekForSequence: %" PRIu8 "", dayOfWeekForSequence); + ChipLogProgress(Zcl, " modeForSequence: %" PRIu8 "", modeForSequence); + ChipLogProgress(Zcl, " payload: %p", payload); + + GET_CLUSTER_RESPONSE_CALLBACKS("ThermostatClusterGetWeeklyScheduleResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload); + return true; +} diff --git a/examples/light/main/zap-generated/CHIPClientCallbacks.h b/examples/light/main/zap-generated/CHIPClientCallbacks.h index 9e7856a02..c7620fc2e 100644 --- a/examples/light/main/zap-generated/CHIPClientCallbacks.h +++ b/examples/light/main/zap-generated/CHIPClientCallbacks.h @@ -35,10 +35,589 @@ // #6308 should handle IM error code on the application side, either modify this function or remove this. // Cluster Specific Response Callbacks +typedef void (*AccountLoginClusterGetSetupPINResponseCallback)(void * context, chip::CharSpan setupPIN); +typedef void (*ApplicationLauncherClusterHideAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ApplicationLauncherClusterLaunchAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ApplicationLauncherClusterStopAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ChannelClusterChangeChannelResponseCallback)(void * context, ChannelInfo channelMatch, uint8_t errorType); +typedef void (*ContentLauncherClusterLaunchContentResponseCallback)(void * context, uint8_t contentLaunchStatus, + chip::CharSpan data); +typedef void (*ContentLauncherClusterLaunchURLResponseCallback)(void * context, uint8_t contentLaunchStatus, chip::CharSpan data); +typedef void (*DiagnosticLogsClusterRetrieveLogsResponseCallback)(void * context, uint8_t status, chip::ByteSpan content, + uint32_t timeStamp, uint32_t timeSinceBoot); +typedef void (*DoorLockClusterGetCredentialStatusResponseCallback)(void * context, bool credentialExists, uint16_t userIndex, + uint16_t nextCredentialIndex); +typedef void (*DoorLockClusterGetUserResponseCallback)(void * context, uint16_t userIndex, chip::CharSpan userName, + uint32_t userUniqueId, uint8_t userStatus, uint8_t userType, + uint8_t credentialRule, + /* TYPE WARNING: array array defaults to */ uint8_t * credentials, + chip::FabricIndex creatorFabricIndex, + chip::FabricIndex lastModifiedFabricIndex, uint16_t nextUserIndex); +typedef void (*DoorLockClusterSetCredentialResponseCallback)(void * context, uint8_t status, uint16_t userIndex, + uint16_t nextCredentialIndex); +typedef void (*GeneralCommissioningClusterArmFailSafeResponseCallback)(void * context, uint8_t errorCode, chip::CharSpan debugText); +typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallback)(void * context, uint8_t errorCode, + chip::CharSpan debugText); +typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallback)(void * context, uint8_t errorCode, + chip::CharSpan debugText); +typedef void (*GroupsClusterAddGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*GroupsClusterGetGroupMembershipResponseCallback)(void * context, uint8_t capacity, + /* TYPE WARNING: array array defaults to */ uint8_t * groupList); +typedef void (*GroupsClusterRemoveGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*GroupsClusterViewGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId, chip::CharSpan groupName); +typedef void (*IdentifyClusterIdentifyQueryResponseCallback)(void * context, uint16_t timeout); +typedef void (*KeypadInputClusterSendKeyResponseCallback)(void * context, uint8_t status); +typedef void (*MediaPlaybackClusterMediaFastForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaNextResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPauseResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPlayResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPreviousResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaRewindResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSeekResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSkipBackwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSkipForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaStartOverResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaStopResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*NetworkCommissioningClusterConnectNetworkResponseCallback)(void * context, uint8_t NetworkingStatus, + chip::CharSpan DebugText, int32_t ErrorValue); +typedef void (*NetworkCommissioningClusterNetworkConfigResponseCallback)(void * context, uint8_t NetworkingStatus, + chip::CharSpan DebugText); +typedef void (*NetworkCommissioningClusterScanNetworksResponseCallback)( + void * context, uint8_t NetworkingStatus, chip::CharSpan DebugText, + /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults, + /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults); typedef void (*OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback)(void * context, uint8_t action, uint32_t delayedActionTime); typedef void (*OtaSoftwareUpdateProviderClusterQueryImageResponseCallback)( void * context, uint8_t status, uint32_t delayedActionTime, chip::CharSpan imageURI, uint32_t softwareVersion, chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, bool userConsentNeeded, chip::ByteSpan metadataForRequestor); +typedef void (*OperationalCredentialsClusterAttestationResponseCallback)(void * context, chip::ByteSpan AttestationElements, + chip::ByteSpan Signature); +typedef void (*OperationalCredentialsClusterCertificateChainResponseCallback)(void * context, chip::ByteSpan Certificate); +typedef void (*OperationalCredentialsClusterNOCResponseCallback)(void * context, uint8_t StatusCode, uint8_t FabricIndex, + chip::CharSpan DebugText); +typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan NOCSRElements, + chip::ByteSpan AttestationSignature); +typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t status, uint8_t capacity, uint16_t groupId, + uint8_t sceneCount, + /* TYPE WARNING: array array defaults to */ uint8_t * sceneList); +typedef void (*ScenesClusterRemoveAllScenesResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*ScenesClusterRemoveSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterStoreSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterViewSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId, + uint16_t transitionTime, chip::CharSpan sceneName, + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); +typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*TestClusterClusterBooleanResponseCallback)(void * context, bool value); +typedef void (*TestClusterClusterSimpleStructResponseCallback)(void * context, SimpleStruct arg1); +typedef void (*TestClusterClusterTestAddArgumentsResponseCallback)(void * context, uint8_t returnValue); +typedef void (*TestClusterClusterTestEnumsResponseCallback)(void * context, chip::VendorId arg1, uint8_t arg2); +typedef void (*TestClusterClusterTestListInt8UReverseResponseCallback)(void * context, + /* TYPE WARNING: array array defaults to */ uint8_t * arg1); +typedef void (*TestClusterClusterTestNullableOptionalResponseCallback)(void * context, bool wasPresent, bool wasNull, uint8_t value, + uint8_t originalValue); +typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); +typedef void (*ThermostatClusterGetRelayStatusLogResponseCallback)(void * context, uint16_t timeOfDay, uint16_t relayStatus, + int16_t localTemperature, uint8_t humidityInPercentage, + int16_t setpoint, uint16_t unreadEntries); +typedef void (*ThermostatClusterGetWeeklyScheduleResponseCallback)(void * context, uint8_t numberOfTransitionsForSequence, + uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + /* TYPE WARNING: array array defaults to */ uint8_t * payload); // List specific responses +void AccessControlClusterAclListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlAclListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void AccessControlClusterExtensionListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlExtensionListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void AccessControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void AccountLoginClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccountLoginAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void AdministratorCommissioningClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AdministratorCommissioningAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationLauncherApplicationLauncherListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationLauncherAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void AudioOutputClusterAudioOutputListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AudioOutputAudioOutputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void AudioOutputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AudioOutputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BarrierControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BarrierControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BasicAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BinaryInputBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BinaryInputBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BindingClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BooleanStateClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BooleanStateAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BridgedActionsClusterActionListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsActionListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void BridgedActionsClusterEndpointListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsEndpointListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void BridgedActionsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BridgedDeviceBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedDeviceBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ChannelClusterChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelChannelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ChannelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ColorControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAcceptHeaderListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void DescriptorClusterDeviceListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorDeviceListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterServerListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorServerListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterClientListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorClientListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterPartsListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorPartsListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DiagnosticLogsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DiagnosticLogsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void DoorLockClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DoorLockAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ElectricalMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ElectricalMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void EthernetNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*EthernetNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void FixedLabelClusterLabelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FixedLabelLabelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void FixedLabelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FixedLabelAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void FlowMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FlowMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralCommissioningClusterBasicCommissioningInfoListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralCommissioningBasicCommissioningInfoListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & data); +void GeneralCommissioningClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralCommissioningAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterNetworkInterfacesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsNetworkInterfacesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & data); +void GeneralDiagnosticsClusterActiveHardwareFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveHardwareFaultsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterActiveRadioFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveRadioFaultsListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterActiveNetworkFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveNetworkFaultsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupKeysListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GroupsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupsAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void IdentifyClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*IdentifyAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void IlluminanceMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*IlluminanceMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void KeypadInputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*KeypadInputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void LevelControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*LevelControlAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void LowPowerClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*LowPowerAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void MediaInputClusterMediaInputListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaInputMediaInputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void MediaInputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaInputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void MediaPlaybackClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaPlaybackAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ModeSelectClusterSupportedModesListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ModeSelectSupportedModesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ModeSelectClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void NetworkCommissioningClusterNetworksListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*NetworkCommissioningNetworksListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OtaSoftwareUpdateProviderAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OtaSoftwareUpdateRequestorAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OccupancySensingClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OccupancySensingAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OnOffClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OnOffAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OnOffSwitchConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsTrustedRootCertificatesListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceActiveBatteryFaultsListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceConfigurationClusterSourcesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceConfigurationSourcesListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PressureMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PressureMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PumpConfigurationAndControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PumpConfigurationAndControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void RelativeHumidityMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*RelativeHumidityMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ScenesClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ScenesAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SoftwareDiagnosticsThreadMetricsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void SoftwareDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SoftwareDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void SwitchClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SwitchAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TargetNavigatorTargetNavigatorListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & data); +void TargetNavigatorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TargetNavigatorAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TemperatureMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TemperatureMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListInt8uListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListOctetStringListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListStructOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListStructOctetStringListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void TestClusterClusterListNullablesAndOptionalsStructListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListNullablesAndOptionalsStructListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & data); +void TestClusterClusterListLongOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListLongOctetStringListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TestClusterClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ThermostatClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThermostatAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ThermostatUserInterfaceConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThermostatUserInterfaceConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ThreadNetworkDiagnosticsClusterNeighborTableListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterRouteTableListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsRouteTableListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void ThreadNetworkDiagnosticsClusterSecurityPolicyListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterOperationalDatasetComponentsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterActiveNetworkFaultsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ThreadNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void UserLabelClusterLabelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*UserLabelLabelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void WakeOnLanClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WakeOnLanAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void WiFiNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WiFiNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void WindowCoveringClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WindowCoveringAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/examples/light/main/zap-generated/CHIPClusters.cpp b/examples/light/main/zap-generated/CHIPClusters.cpp index 610435b71..2d5931206 100644 --- a/examples/light/main/zap-generated/CHIPClusters.cpp +++ b/examples/light/main/zap-generated/CHIPClusters.cpp @@ -31,157 +31,182 @@ using namespace Encoding::LittleEndian; namespace Controller { // TODO(#4502): onCompletion is not used by IM for now. -// TODO(#4503): length should be passed to commands when byte string is in argument list. +// TODO(#4503): length should be passed to commands when byte string is in +// argument list. // TODO(#4503): Commands should take group id as an argument. // OtaSoftwareUpdateProvider Cluster Commands -CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t newVersion) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t newVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // newVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // newVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t softwareVersion) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t softwareVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::VendorId vendorId, - uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, - uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::VendorId vendorId, + uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, + chip::ByteSpan metadataForProvider) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::QueryImage::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // vendorId: vendorId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - // productId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); - // protocolsSupported: OTADownloadProtocol - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); - // hardwareVersion: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); - // location: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); - // requestorCanConsent: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); - // metadataForProvider: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // vendorId: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); + // productId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + // protocolsSupported: OTADownloadProtocol + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); + // hardwareVersion: int16u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); + // location: charString + SuccessOrExit( + err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); + // requestorCanConsent: boolean + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); + // metadataForProvider: octetString + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } } // namespace Controller diff --git a/examples/light/main/zap-generated/CHIPClusters.h b/examples/light/main/zap-generated/CHIPClusters.h index 908506def..baebb9cf4 100644 --- a/examples/light/main/zap-generated/CHIPClusters.h +++ b/examples/light/main/zap-generated/CHIPClusters.h @@ -30,21 +30,28 @@ namespace chip { namespace Controller { -class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase -{ +class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { public: - OtaSoftwareUpdateProviderCluster() : ClusterBase(app::Clusters::OtaSoftwareUpdateProvider::Id) {} - ~OtaSoftwareUpdateProviderCluster() {} + OtaSoftwareUpdateProviderCluster() + : ClusterBase(app::Clusters::OtaSoftwareUpdateProvider::Id) {} + ~OtaSoftwareUpdateProviderCluster() {} - // Cluster Commands - CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t newVersion); - CHIP_ERROR NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t softwareVersion); - CHIP_ERROR QueryImage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::VendorId vendorId, uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, - uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider); + // Cluster Commands + CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t newVersion); + CHIP_ERROR NotifyUpdateApplied(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t softwareVersion); + CHIP_ERROR QueryImage(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::VendorId vendorId, uint16_t productId, + uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, + bool requestorCanConsent, + chip::ByteSpan metadataForProvider); }; } // namespace Controller diff --git a/examples/light/main/zap-generated/IMClusterCommandHandler.cpp b/examples/light/main/zap-generated/IMClusterCommandHandler.cpp deleted file mode 100644 index f33546975..000000000 --- a/examples/light/main/zap-generated/IMClusterCommandHandler.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Currently we need some work to keep compatible with ember lib. -#include - -namespace chip { -namespace app { - -// Cluster specific command parsing - -namespace Clusters { - -namespace AdministratorCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::OpenBasicCommissioningWindow::Id: { - Commands::OpenBasicCommissioningWindow::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( - apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OpenCommissioningWindow::Id: { - Commands::OpenCommissioningWindow::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback(apCommandObj, aCommandPath, - commandData); - } - break; - } - case Commands::RevokeCommissioning::Id: { - Commands::RevokeCommissioning::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace AdministratorCommissioning - -namespace ColorControl { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ColorLoopSet::Id: { - Commands::ColorLoopSet::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterColorLoopSetCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveHue::Id: { - Commands::EnhancedMoveHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedMoveHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveToHue::Id: { - Commands::EnhancedMoveToHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveToHueAndSaturation::Id: { - Commands::EnhancedMoveToHueAndSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedStepHue::Id: { - Commands::EnhancedStepHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveColor::Id: { - Commands::MoveColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveColorTemperature::Id: { - Commands::MoveColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveHue::Id: { - Commands::MoveHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveSaturation::Id: { - Commands::MoveSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToColor::Id: { - Commands::MoveToColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToColorTemperature::Id: { - Commands::MoveToColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToHue::Id: { - Commands::MoveToHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToHueAndSaturation::Id: { - Commands::MoveToHueAndSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToSaturation::Id: { - Commands::MoveToSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepColor::Id: { - Commands::StepColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepColorTemperature::Id: { - Commands::StepColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepHue::Id: { - Commands::StepHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepSaturation::Id: { - Commands::StepSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StopMoveStep::Id: { - Commands::StopMoveStep::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace ColorControl - -namespace DiagnosticLogs { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::RetrieveLogsRequest::Id: { - Commands::RetrieveLogsRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace DiagnosticLogs - -namespace GeneralCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ArmFailSafe::Id: { - Commands::ArmFailSafe::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::CommissioningComplete::Id: { - Commands::CommissioningComplete::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::SetRegulatoryConfig::Id: { - Commands::SetRegulatoryConfig::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace GeneralCommissioning - -namespace Identify { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Identify::Id: { - Commands::Identify::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterIdentifyCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::IdentifyQuery::Id: { - Commands::IdentifyQuery::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterIdentifyQueryCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::TriggerEffect::Id: { - Commands::TriggerEffect::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterTriggerEffectCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Identify - -namespace LevelControl { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Move::Id: { - Commands::Move::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToLevel::Id: { - Commands::MoveToLevel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToLevelWithOnOff::Id: { - Commands::MoveToLevelWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveWithOnOff::Id: { - Commands::MoveWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Step::Id: { - Commands::Step::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepWithOnOff::Id: { - Commands::StepWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Stop::Id: { - Commands::Stop::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StopWithOnOff::Id: { - Commands::StopWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace LevelControl - -namespace NetworkCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddOrUpdateThreadNetwork::Id: { - Commands::AddOrUpdateThreadNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfNetworkCommissioningClusterAddOrUpdateThreadNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AddOrUpdateWiFiNetwork::Id: { - Commands::AddOrUpdateWiFiNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfNetworkCommissioningClusterAddOrUpdateWiFiNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ConnectNetwork::Id: { - Commands::ConnectNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterConnectNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveNetwork::Id: { - Commands::RemoveNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ReorderNetwork::Id: { - Commands::ReorderNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterReorderNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ScanNetworks::Id: { - Commands::ScanNetworks::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace NetworkCommissioning - -namespace OtaSoftwareUpdateProvider { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ApplyUpdateResponse::Id: { - expectArgumentCount = 2; - uint8_t action; - uint32_t delayedActionTime; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(action); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( - aCommandPath.mEndpointId, apCommandObj, action, delayedActionTime); - } - break; - } - case Commands::QueryImageResponse::Id: { - expectArgumentCount = 8; - uint8_t status; - uint32_t delayedActionTime; - chip::CharSpan imageURI; - uint32_t softwareVersion; - chip::CharSpan softwareVersionString; - chip::ByteSpan updateToken; - bool userConsentNeeded; - chip::ByteSpan metadataForRequestor; - bool argExists[8]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 8) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - case 2: - TLVUnpackError = aDataTlv.Get(imageURI); - break; - case 3: - TLVUnpackError = aDataTlv.Get(softwareVersion); - break; - case 4: - TLVUnpackError = aDataTlv.Get(softwareVersionString); - break; - case 5: - TLVUnpackError = aDataTlv.Get(updateToken); - break; - case 6: - TLVUnpackError = aDataTlv.Get(userConsentNeeded); - break; - case 7: - TLVUnpackError = aDataTlv.Get(metadataForRequestor); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( - aCommandPath.mEndpointId, apCommandObj, status, delayedActionTime, imageURI, softwareVersion, - softwareVersionString, updateToken, userConsentNeeded, metadataForRequestor); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace OtaSoftwareUpdateProvider - -namespace OtaSoftwareUpdateRequestor { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AnnounceOtaProvider::Id: { - Commands::AnnounceOtaProvider::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OtaSoftwareUpdateRequestor - -namespace OnOff { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Off::Id: { - Commands::Off::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OffWithEffect::Id: { - Commands::OffWithEffect::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOffWithEffectCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::On::Id: { - Commands::On::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OnWithRecallGlobalScene::Id: { - Commands::OnWithRecallGlobalScene::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnWithRecallGlobalSceneCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OnWithTimedOff::Id: { - Commands::OnWithTimedOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnWithTimedOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Toggle::Id: { - Commands::Toggle::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OnOff - -namespace OperationalCredentials { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddNOC::Id: { - Commands::AddNOC::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AddTrustedRootCertificate::Id: { - Commands::AddTrustedRootCertificate::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AttestationRequest::Id: { - Commands::AttestationRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::CertificateChainRequest::Id: { - Commands::CertificateChainRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OpCSRRequest::Id: { - Commands::OpCSRRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveFabric::Id: { - Commands::RemoveFabric::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveTrustedRootCertificate::Id: { - Commands::RemoveTrustedRootCertificate::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(apCommandObj, aCommandPath, - commandData); - } - break; - } - case Commands::UpdateFabricLabel::Id: { - Commands::UpdateFabricLabel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::UpdateNOC::Id: { - Commands::UpdateNOC::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OperationalCredentials - -namespace SoftwareDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetWatermarks::Id: { - Commands::ResetWatermarks::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace SoftwareDiagnostics - -namespace ThreadNetworkDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetCounts::Id: { - Commands::ResetCounts::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace ThreadNetworkDiagnostics - -namespace WiFiNetworkDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetCounts::Id: { - Commands::ResetCounts::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace WiFiNetworkDiagnostics - -} // namespace Clusters - -void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) -{ - Compatibility::SetupEmberAfCommandHandler(apCommandObj, aCommandPath); - - switch (aCommandPath.mClusterId) - { - case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OtaSoftwareUpdateRequestor::Id: - Clusters::OtaSoftwareUpdateRequestor::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - default: - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCluster); - break; - } - - Compatibility::ResetEmberAfObjects(); -} - -void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, - CommandSender * apCommandObj) -{ - Compatibility::SetupEmberAfCommandSender(apCommandObj, aCommandPath); - - TLV::TLVType dataTlvType; - SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aCommandPath.mClusterId) - { - case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandPath, aReader); - break; - default: - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); - break; - } - -exit: - aReader.ExitContainer(dataTlvType); - Compatibility::ResetEmberAfObjects(); -} - -} // namespace app -} // namespace chip diff --git a/examples/light/main/zap-generated/PluginApplicationCallbacks.h b/examples/light/main/zap-generated/PluginApplicationCallbacks.h index 219beb967..fc04c756a 100644 --- a/examples/light/main/zap-generated/PluginApplicationCallbacks.h +++ b/examples/light/main/zap-generated/PluginApplicationCallbacks.h @@ -21,23 +21,20 @@ #include -#define MATTER_PLUGINS_INIT \ - MatterAdministratorCommissioningPluginServerInitCallback(); \ - MatterBasicPluginServerInitCallback(); \ - MatterColorControlPluginServerInitCallback(); \ - MatterDescriptorPluginServerInitCallback(); \ - MatterDiagnosticLogsPluginServerInitCallback(); \ - MatterFixedLabelPluginServerInitCallback(); \ - MatterGeneralCommissioningPluginServerInitCallback(); \ - MatterGeneralDiagnosticsPluginServerInitCallback(); \ - MatterIdentifyPluginServerInitCallback(); \ - MatterLevelControlPluginServerInitCallback(); \ - MatterNetworkCommissioningPluginServerInitCallback(); \ - MatterOtaSoftwareUpdateProviderPluginClientInitCallback(); \ - MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ - MatterOnOffPluginServerInitCallback(); \ - MatterOperationalCredentialsPluginServerInitCallback(); \ - MatterSoftwareDiagnosticsPluginServerInitCallback(); \ - MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ - MatterUserLabelPluginServerInitCallback(); \ - MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); +#define MATTER_PLUGINS_INIT \ + MatterAdministratorCommissioningPluginServerInitCallback(); \ + MatterBasicPluginServerInitCallback(); \ + MatterColorControlPluginServerInitCallback(); \ + MatterDescriptorPluginServerInitCallback(); \ + MatterGeneralCommissioningPluginServerInitCallback(); \ + MatterGeneralDiagnosticsPluginServerInitCallback(); \ + MatterGroupKeyManagementPluginServerInitCallback(); \ + MatterGroupsPluginServerInitCallback(); \ + MatterIdentifyPluginServerInitCallback(); \ + MatterLevelControlPluginServerInitCallback(); \ + MatterNetworkCommissioningPluginServerInitCallback(); \ + MatterOtaSoftwareUpdateProviderPluginClientInitCallback(); \ + MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ + MatterOnOffPluginServerInitCallback(); \ + MatterOperationalCredentialsPluginServerInitCallback(); \ + MatterScenesPluginServerInitCallback(); diff --git a/examples/light/main/zap-generated/callback-stub.cpp b/examples/light/main/zap-generated/callback-stub.cpp index 8285b4676..659182e0d 100644 --- a/examples/light/main/zap-generated/callback-stub.cpp +++ b/examples/light/main/zap-generated/callback-stub.cpp @@ -25,257 +25,242 @@ using namespace chip; // Cluster Init Functions -void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) -{ - switch (clusterId) - { - case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: - emberAfAdministratorCommissioningClusterInitCallback(endpoint); - break; - case ZCL_BASIC_CLUSTER_ID: - emberAfBasicClusterInitCallback(endpoint); - break; - case ZCL_COLOR_CONTROL_CLUSTER_ID: - emberAfColorControlClusterInitCallback(endpoint); - break; - case ZCL_DESCRIPTOR_CLUSTER_ID: - emberAfDescriptorClusterInitCallback(endpoint); - break; - case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID: - emberAfDiagnosticLogsClusterInitCallback(endpoint); - break; - case ZCL_FIXED_LABEL_CLUSTER_ID: - emberAfFixedLabelClusterInitCallback(endpoint); - break; - case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: - emberAfGeneralCommissioningClusterInitCallback(endpoint); - break; - case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: - emberAfGeneralDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_IDENTIFY_CLUSTER_ID: - emberAfIdentifyClusterInitCallback(endpoint); - break; - case ZCL_LEVEL_CONTROL_CLUSTER_ID: - emberAfLevelControlClusterInitCallback(endpoint); - break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: - emberAfNetworkCommissioningClusterInitCallback(endpoint); - break; - case ZCL_OTA_PROVIDER_CLUSTER_ID: - emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); - break; - case ZCL_OTA_REQUESTOR_CLUSTER_ID: - emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); - break; - case ZCL_ON_OFF_CLUSTER_ID: - emberAfOnOffClusterInitCallback(endpoint); - break; - case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: - emberAfOperationalCredentialsClusterInitCallback(endpoint); - break; - case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: - emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_USER_LABEL_CLUSTER_ID: - emberAfUserLabelClusterInitCallback(endpoint); - break; - case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); - break; - default: - // Unrecognized cluster ID - break; - } +void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { + switch (clusterId) { + case ZCL_ACCESS_CONTROL_CLUSTER_ID: + emberAfAccessControlClusterInitCallback(endpoint); + break; + case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: + emberAfAdministratorCommissioningClusterInitCallback(endpoint); + break; + case ZCL_BASIC_CLUSTER_ID: + emberAfBasicClusterInitCallback(endpoint); + break; + case ZCL_COLOR_CONTROL_CLUSTER_ID: + emberAfColorControlClusterInitCallback(endpoint); + break; + case ZCL_DESCRIPTOR_CLUSTER_ID: + emberAfDescriptorClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: + emberAfGeneralCommissioningClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + emberAfGeneralDiagnosticsClusterInitCallback(endpoint); + break; + case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: + emberAfGroupKeyManagementClusterInitCallback(endpoint); + break; + case ZCL_GROUPS_CLUSTER_ID: + emberAfGroupsClusterInitCallback(endpoint); + break; + case ZCL_IDENTIFY_CLUSTER_ID: + emberAfIdentifyClusterInitCallback(endpoint); + break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + emberAfLevelControlClusterInitCallback(endpoint); + break; + case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: + emberAfNetworkCommissioningClusterInitCallback(endpoint); + break; + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); + break; + case ZCL_OTA_REQUESTOR_CLUSTER_ID: + emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); + break; + case ZCL_ON_OFF_CLUSTER_ID: + emberAfOnOffClusterInitCallback(endpoint); + break; + case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: + emberAfOperationalCredentialsClusterInitCallback(endpoint); + break; + case ZCL_SCENES_CLUSTER_ID: + emberAfScenesClusterInitCallback(endpoint); + break; + default: + // Unrecognized cluster ID + break; + } } -void __attribute__((weak)) emberAfAdministratorCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfAccessControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfBasicClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfAdministratorCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfBasicClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfDescriptorClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfColorControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfDiagnosticLogsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfDescriptorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfFixedLabelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGroupKeyManagementClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGroupsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfLevelControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfIdentifyClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfLevelControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateRequestorClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOtaSoftwareUpdateRequestorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOnOffClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} -void __attribute__((weak)) emberAfUserLabelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} -void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfScenesClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } // // Non-Cluster Related Callbacks // -void __attribute__((weak)) emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} +void __attribute__((weak)) +emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} -void __attribute__((weak)) emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} +void __attribute__((weak)) +emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} EmberAfAttributeWritePermission __attribute__((weak)) -emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t * value, uint8_t type) -{ - return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default +emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, + ClusterId clusterId, + AttributeId attributeId, uint8_t mask, + uint16_t manufacturerCode, + uint8_t *value, uint8_t type) { + return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default } bool __attribute__((weak)) -emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId) -{ - return true; +emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; } bool __attribute__((weak)) -emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId) -{ - return true; -} - -bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status) -{ - return false; -} - -bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status) -{ - return false; -} - -bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) -{ - return false; -} - -EmberAfStatus __attribute__((weak)) -emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata, - uint16_t manufacturerCode, uint8_t * buffer, uint16_t maxReadLength) -{ - return EMBER_ZCL_STATUS_FAILURE; -} - -EmberAfStatus __attribute__((weak)) -emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata, - uint16_t manufacturerCode, uint8_t * buffer) -{ - return EMBER_ZCL_STATUS_FAILURE; -} - -uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() -{ - return 0; +emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; } bool __attribute__((weak)) -emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo) -{ - return false; +emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, + EmberAfStatus status) { + return false; +} + +bool __attribute__((weak)) +emberAfPreMessageSendCallback(EmberAfMessageStruct *messageStruct, + EmberStatus *status) { + return false; +} + +bool __attribute__((weak)) +emberAfMessageSentCallback(const MessageSendDestination &destination, + EmberApsFrame *apsFrame, uint16_t msgLen, + uint8_t *message, EmberStatus status) { + return false; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer, uint16_t maxReadLength) { + return EMBER_ZCL_STATUS_FAILURE; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer) { + return EMBER_ZCL_STATUS_FAILURE; +} + +uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() { return 0; } + +bool __attribute__((weak)) +emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t *returnNetworkIndex, + EmberAfEndpointInfoStruct *returnEndpointInfo) { + return false; } void __attribute__((weak)) emberAfRegistrationAbortCallback() {} EmberStatus __attribute__((weak)) -emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message) -{ - return EMBER_LIBRARY_NOT_PRESENT; +emberAfInterpanSendMessageCallback(EmberAfInterpanHeader *header, + uint16_t messageLength, uint8_t *message) { + return EMBER_LIBRARY_NOT_PRESENT; } -bool __attribute__((weak)) emberAfStartMoveCallback() -{ - return false; -} +bool __attribute__((weak)) emberAfStartMoveCallback() { return false; } chip::Protocols::InteractionModel::Status __attribute__((weak)) -MatterPreAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, uint16_t size, - uint8_t * value) -{ - return chip::Protocols::InteractionModel::Status::Success; +MatterPreAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) { + return chip::Protocols::InteractionModel::Status::Success; } -void __attribute__((weak)) MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, - uint8_t type, uint16_t size, uint8_t * value) -{} +void __attribute__((weak)) MatterPostAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) {} diff --git a/examples/light/main/zap-generated/endpoint_config.h b/examples/light/main/zap-generated/endpoint_config.h index a5cfcb7c5..cfe8b48f3 100644 --- a/examples/light/main/zap-generated/endpoint_config.h +++ b/examples/light/main/zap-generated/endpoint_config.h @@ -20,930 +20,49 @@ // Prevent multiple inclusion #pragma once -// Default values for the attributes longer than a pointer, -// in a form of a binary blob -// Separate block is generated for big-endian and little-endian cases. -#if BIGENDIAN_CPU -#define GENERATED_DEFAULTS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server), big-endian */ \ - \ - /* 0 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ - \ - /* 4 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 12 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 266 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x06, \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ - \ - /* 270 - Networks, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 282 - LastConnectErrorValue, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 286 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ - \ - /* 290 - UpTime, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 298 - TotalOperationalHours, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ - \ - /* 302 - CurrentHeapFree, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 310 - CurrentHeapUsed, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 318 - CurrentHeapHighWatermark, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 326 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ - \ - /* 330 - NetworkName, */ \ - 0x00, 0x00, \ - \ - /* 332 - ExtendedPanId, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 340 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 348 - PartitionId, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 352 - TxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 356 - TxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 360 - TxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 364 - TxAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 368 - TxAckedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 372 - TxNoAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 376 - TxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 380 - TxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 384 - TxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 388 - TxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 392 - TxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 396 - TxRetryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 400 - TxDirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 404 - TxIndirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 408 - TxErrCcaCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 412 - TxErrAbortCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 416 - TxErrBusyChannelCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 420 - RxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 424 - RxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 428 - RxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 432 - RxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 436 - RxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 440 - RxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 444 - RxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 448 - RxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 452 - RxAddressFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 456 - RxDestAddrFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 460 - RxDuplicatedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 464 - RxErrNoFrameCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 468 - RxErrUnknownNeighborCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 472 - RxErrInvalidSrcAddrCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 476 - RxErrSecCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 480 - RxErrFcsCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 484 - RxErrOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 488 - ActiveTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 496 - PendingTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 504 - delay, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 508 - ChannelMask, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 515 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x0F, \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x03, \ - \ - /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ - \ - /* 563 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - } +#define GENERATED_ATTRIBUTES \ + {} -#else // !BIGENDIAN_CPU -#define GENERATED_DEFAULTS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server), little-endian */ \ - \ - /* 0 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ - \ - /* 4 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 12 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 266 - FeatureMap, */ \ - 0x06, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ - \ - /* 270 - Networks, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 282 - LastConnectErrorValue, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 286 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ - \ - /* 290 - UpTime, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 298 - TotalOperationalHours, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ - \ - /* 302 - CurrentHeapFree, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 310 - CurrentHeapUsed, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 318 - CurrentHeapHighWatermark, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 326 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ - \ - /* 330 - NetworkName, */ \ - 0x00, 0x00, \ - \ - /* 332 - ExtendedPanId, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 340 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 348 - PartitionId, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 352 - TxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 356 - TxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 360 - TxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 364 - TxAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 368 - TxAckedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 372 - TxNoAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 376 - TxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 380 - TxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 384 - TxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 388 - TxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 392 - TxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 396 - TxRetryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 400 - TxDirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 404 - TxIndirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 408 - TxErrCcaCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 412 - TxErrAbortCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 416 - TxErrBusyChannelCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 420 - RxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 424 - RxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 428 - RxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 432 - RxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 436 - RxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 440 - RxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 444 - RxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 448 - RxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 452 - RxAddressFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 456 - RxDestAddrFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 460 - RxDuplicatedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 464 - RxErrNoFrameCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 468 - RxErrUnknownNeighborCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 472 - RxErrInvalidSrcAddrCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 476 - RxErrSecCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 480 - RxErrFcsCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 484 - RxErrOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 488 - ActiveTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 496 - PendingTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 504 - delay, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 508 - ChannelMask, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 515 - FeatureMap, */ \ - 0x0F, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x03, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ - \ - /* 563 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - } +#define GENERATED_CLUSTERS \ + {} -#endif // BIGENDIAN_CPU - -#define GENERATED_DEFAULTS_COUNT (66) - -#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE -#define ZAP_LONG_DEFAULTS_INDEX(index) \ - { \ - &generatedDefaults[index] \ - } -#define ZAP_MIN_MAX_DEFAULTS_INDEX(index) \ - { \ - &minMaxDefaults[index] \ - } -#define ZAP_EMPTY_DEFAULT() \ - { \ - (uint16_t) 0 \ - } -#define ZAP_SIMPLE_DEFAULT(x) \ - { \ - (uint16_t) x \ - } - -// This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 3 -#define GENERATED_MIN_MAX_DEFAULTS \ - { \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFE }, /* identify time */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* options */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { \ - (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF \ - } /* start up color temperature mireds */ \ - } - -#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask -// This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 205 -#define GENERATED_ATTRIBUTES \ - { \ - \ - /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x0002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x0003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* InteractionModelVersion */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductName */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductID */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* NodeLabel */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 3, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* Location */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ - { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(0) }, /* SoftwareVersion */ \ - { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ - { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SerialNumber */ \ - { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ - { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ - { 0x0012, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* UniqueID */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* default ota provider */ \ - { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(12) }, /* BasicCommissioningInfoList */ \ - { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ - { 0x0003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(266) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x0001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(270) }, /* Networks */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ - { 0x0004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ - { 0x0006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* LastConnectErrorValue */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(290) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(298) }, /* TotalOperationalHours */ \ - { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ - { 0x0005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ - { 0x0006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ - { 0x0007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaults */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(302) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(310) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(318) }, /* CurrentHeapHighWatermark */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(326) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(330) }, /* NetworkName */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* PartitionId */ \ - { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ - { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ - { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ - { 0x000D, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LeaderRouterId */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* DetachedRoleCount */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChildRoleCount */ \ - { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RouterRoleCount */ \ - { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* LeaderRoleCount */ \ - { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* AttachAttemptCount */ \ - { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ - { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ - { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(368) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(376) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(384) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(388) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(392) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(396) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(400) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(404) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(408) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(420) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(424) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(428) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(432) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(436) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(440) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(444) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(448) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(452) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(456) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(460) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(464) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(468) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(472) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(476) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(480) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(484) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(488) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(496) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(504) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(508) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(515) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_EMPTY_DEFAULT() }, /* bssid */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ - { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ - { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(519) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(523) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(527) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(531) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(539) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(543) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(551) }, /* OverrunCount */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(559) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ - { 0x0001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x0002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ - { 0x0004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* TrustedRootCertificates */ \ - { 0x0005, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* CurrentFabricIndex */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(0) }, /* identify time */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* identify type */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ - { 0x4000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* GlobalSceneControl */ \ - { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ - { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ - { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* max level */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ - { 0x0005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ - { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ - { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* options */ \ - { 0x0010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ - { 0x0011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_SIMPLE_DEFAULT(0xFE) }, /* on level */ \ - { 0x0012, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* on transition time */ \ - { 0x0013, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* off transition time */ \ - { 0x0014, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* default move rate */ \ - { 0x4000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* start up current level */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x0002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x0003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current hue */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current saturation */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ - { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ - { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ - { 0x0010, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* number of primaries */ \ - { 0x4000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* enhanced current hue */ \ - { 0x4001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* enhanced color mode */ \ - { 0x4002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop active */ \ - { 0x4003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop direction */ \ - { 0x4004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0019) }, /* color loop time */ \ - { 0x4005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x2300) }, /* color loop start enhanced hue */ \ - { 0x4006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color loop stored enhanced hue */ \ - { 0x400A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color capabilities */ \ - { 0x400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color temp physical min */ \ - { 0x400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* color temp physical max */ \ - { 0x400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* couple color temp to level min-mireds */ \ - { 0x4010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* start up color temperature mireds */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - } - -// This is an array of EmberAfCluster structures. -#define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index])) - -// Cluster function static arrays -#define GENERATED_FUNCTION_ARRAYS \ - const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \ - (EmberAfGenericClusterFunction) emberAfBasicClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayIdentifyServer[] = { \ - (EmberAfGenericClusterFunction) emberAfIdentifyClusterServerInitCallback, \ - (EmberAfGenericClusterFunction) MatterIdentifyClusterServerAttributeChangedCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ - (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ - (EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ - (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ - }; - -#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 20 -#define GENERATED_CLUSTERS \ - { \ - { 0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(5), \ - 20, \ - 687, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x0029, ZAP_ATTRIBUTE_INDEX(25), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ - { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(25), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(28), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(34), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(44), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(44), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(53), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(59), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(124), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(139), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(143), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(149), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(151), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(153), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(156), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(163), \ - 15, \ - 23, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(178), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(183), \ - 22, \ - 36, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ - } - -#define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) - -// This is an array of EmberAfEndpointType structures. -#define GENERATED_ENDPOINT_TYPES \ - { \ - { ZAP_CLUSTER_INDEX(0), 15, 1399 }, { ZAP_CLUSTER_INDEX(15), 5, 77 }, \ - } +#define GENERATED_ENDPOINT_TYPES \ + {} // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (401) -// Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (687) - // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1476) +#define ATTRIBUTE_MAX_SIZE (0) // Number of fixed endpoints -#define FIXED_ENDPOINT_COUNT (2) +#define FIXED_ENDPOINT_COUNT (0) +#ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#endif +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) // Array of endpoints that are supported, the data inside // the array is the endpoint number. -#define FIXED_ENDPOINT_ARRAY \ - { \ - 0x0000, 0x0001 \ - } +#define FIXED_ENDPOINT_ARRAY \ + {0} // Array of profile ids -#define FIXED_PROFILE_IDS \ - { \ - 0x0103, 0x0103 \ - } +#define FIXED_PROFILE_IDS \ + {0} // Array of device ids -#define FIXED_DEVICE_IDS \ - { \ - 22, 257 \ - } +#define FIXED_DEVICE_IDS \ + {0} // Array of device versions -#define FIXED_DEVICE_VERSIONS \ - { \ - 1, 1 \ - } +#define FIXED_DEVICE_VERSIONS \ + {0} // Array of endpoint types supported on each endpoint -#define FIXED_ENDPOINT_TYPES \ - { \ - 0, 1 \ - } +#define FIXED_ENDPOINT_TYPES \ + {0} // Array of networks supported on each endpoint -#define FIXED_NETWORKS \ - { \ - 0, 0 \ - } +#define FIXED_NETWORKS \ + {0} diff --git a/examples/light/main/zap-generated/gen_config.h b/examples/light/main/zap-generated/gen_config.h index 3344d49cf..de53fb975 100644 --- a/examples/light/main/zap-generated/gen_config.h +++ b/examples/light/main/zap-generated/gen_config.h @@ -29,29 +29,35 @@ #define EMBER_APS_UNICAST_MESSAGE_COUNT 10 /**** Cluster endpoint counts ****/ +#define EMBER_AF_ACCESS_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define EMBER_AF_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_FIXED_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_USER_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ -// Use this macro to check if the server side of the AdministratorCommissioning cluster is included +// Use this macro to check if the server side of the Access Control cluster is +// included +#define ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL + +// Use this macro to check if the server side of the AdministratorCommissioning +// cluster is included #define ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING @@ -61,7 +67,8 @@ #define EMBER_AF_PLUGIN_BASIC_SERVER #define EMBER_AF_PLUGIN_BASIC -// Use this macro to check if the server side of the Color Control cluster is included +// Use this macro to check if the server side of the Color Control cluster is +// included #define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL @@ -70,37 +77,43 @@ #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV -// Use this macro to check if the server side of the Descriptor cluster is included +// Use this macro to check if the server side of the Descriptor cluster is +// included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_DESCRIPTOR_SERVER #define EMBER_AF_PLUGIN_DESCRIPTOR -// Use this macro to check if the server side of the Diagnostic Logs cluster is included -#define ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS_SERVER -#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS - -// Use this macro to check if the server side of the Fixed Label cluster is included -#define ZCL_USING_FIXED_LABEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_FIXED_LABEL_SERVER -#define EMBER_AF_PLUGIN_FIXED_LABEL - -// Use this macro to check if the server side of the General Commissioning cluster is included +// Use this macro to check if the server side of the General Commissioning +// cluster is included #define ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING -// Use this macro to check if the server side of the General Diagnostics cluster is included +// Use this macro to check if the server side of the General Diagnostics cluster +// is included #define ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS -// Use this macro to check if the server side of the Identify cluster is included +// Use this macro to check if the server side of the Group Key Management +// cluster is included +#define ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT + +// Use this macro to check if the server side of the Groups cluster is included +#define ZCL_USING_GROUPS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUPS_SERVER +#define EMBER_AF_PLUGIN_GROUPS + +// Use this macro to check if the server side of the Identify cluster is +// included #define ZCL_USING_IDENTIFY_CLUSTER_SERVER #define EMBER_AF_PLUGIN_IDENTIFY_SERVER #define EMBER_AF_PLUGIN_IDENTIFY -// Use this macro to check if the server side of the Level Control cluster is included +// Use this macro to check if the server side of the Level Control cluster is +// included #define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER #define EMBER_AF_PLUGIN_LEVEL_CONTROL @@ -109,16 +122,19 @@ #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 +// 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 client side of the OTA Software Update Provider cluster is included +// Use this macro to check if the client side of the OTA Software Update +// Provider cluster is included #define ZCL_USING_OTA_PROVIDER_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_CLIENT -// Use this macro to check if the server side of the OTA Software Update Requestor cluster is included +// Use this macro to check if the server side of the OTA Software Update +// Requestor cluster is included #define ZCL_USING_OTA_REQUESTOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR_SERVER #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR @@ -128,27 +144,15 @@ #define EMBER_AF_PLUGIN_ON_OFF_SERVER #define EMBER_AF_PLUGIN_ON_OFF -// Use this macro to check if the server side of the Operational Credentials cluster is included +// Use this macro to check if the server side of the Operational Credentials +// cluster is included #define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS -// Use this macro to check if the server side of the Software Diagnostics cluster is included -#define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS - -// Use this macro to check if the server side of the Thread Network Diagnostics cluster is included -#define ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS - -// Use this macro to check if the server side of the User Label cluster is included -#define ZCL_USING_USER_LABEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_USER_LABEL_SERVER -#define EMBER_AF_PLUGIN_USER_LABEL - -// Use this macro to check if the server side of the WiFi Network Diagnostics cluster is included -#define ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS +// Use this macro to check if the server side of the Scenes cluster is included +#define ZCL_USING_SCENES_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_SCENES_SERVER +#define EMBER_AF_PLUGIN_SCENES +// User options for server plugin Scenes +#define EMBER_AF_PLUGIN_SCENES_TABLE_SIZE 3 diff --git a/examples/light/main/zap-generated/gen_tokens.h b/examples/light/main/zap-generated/gen_tokens.h index 860bf575d..9579330d7 100644 --- a/examples/light/main/zap-generated/gen_tokens.h +++ b/examples/light/main/zap-generated/gen_tokens.h @@ -33,13 +33,11 @@ #endif // DEFINETOKENS // Macro snippet that loads all the attributes from tokens -#define GENERATED_TOKEN_LOADER(endpoint) \ - do \ - { \ - } while (false) +#define GENERATED_TOKEN_LOADER(endpoint) \ + do { \ + } while (false) // Macro snippet that saves the attribute to token -#define GENERATED_TOKEN_SAVER \ - do \ - { \ - } while (false) +#define GENERATED_TOKEN_SAVER \ + do { \ + } while (false) diff --git a/examples/light/sdkconfig.defaults.esp32s2 b/examples/light/sdkconfig.defaults.esp32s2 new file mode 100644 index 000000000..ee16269ac --- /dev/null +++ b/examples/light/sdkconfig.defaults.esp32s2 @@ -0,0 +1,24 @@ +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Disable BLE +CONFIG_ENABLE_CHIPOBLE=n diff --git a/examples/rainmaker_light/CMakeLists.txt b/examples/rainmaker_light/CMakeLists.txt index c704587b2..072bcb105 100644 --- a/examples/rainmaker_light/CMakeLists.txt +++ b/examples/rainmaker_light/CMakeLists.txt @@ -11,6 +11,8 @@ if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32_devkit_c) elseif("${IDF_TARGET}" STREQUAL "esp32c3") set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c3_devkit_m) + elseif("${IDF_TARGET}" STREQUAL "esp32s2") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32s2_devkit_c) else() message(FATAL_ERROR "Unsupported IDF_TARGET") endif() @@ -18,6 +20,7 @@ endif(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH}) set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip) +set(ZAP_GENERATED_PATH ${ESP_MATTER_PATH}/examples/rainmaker_light/main/zap-generated) if(NOT DEFINED ENV{ESP_RMAKER_PATH}) message(FATAL_ERROR "Please set ESP_RMAKER_PATH to the path of esp-rainmaker repo") diff --git a/examples/rainmaker_light/README.md b/examples/rainmaker_light/README.md index 9421b99da..1a5b721a6 100644 --- a/examples/rainmaker_light/README.md +++ b/examples/rainmaker_light/README.md @@ -57,4 +57,7 @@ This will print the console command to be run on the device: add-user ``` -Copy-paste this command on the device console. +Use these details in the below command on the device console. +``` +matter esp rainmaker add-user +``` diff --git a/examples/rainmaker_light/main/CMakeLists.txt b/examples/rainmaker_light/main/CMakeLists.txt index cb83b045f..0053b6e87 100644 --- a/examples/rainmaker_light/main/CMakeLists.txt +++ b/examples/rainmaker_light/main/CMakeLists.txt @@ -1,39 +1,8 @@ -set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_CURRENT_LIST_DIR}/zap-generated" - "${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes" - "${MATTER_SDK_PATH}/src/app/server" - "${MATTER_SDK_PATH}/src/app/util" - "${MATTER_SDK_PATH}/src/app/reporting" - "${MATTER_SDK_PATH}/src/app/clusters/basic" - "${MATTER_SDK_PATH}/src/app/clusters/administrator-commissioning-server" - "${MATTER_SDK_PATH}/src/app/clusters/application-basic-server" - "${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server" - "${MATTER_SDK_PATH}/src/app/clusters/general-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/identify-server" - "${MATTER_SDK_PATH}/src/app/clusters/user-label-server" - "${MATTER_SDK_PATH}/src/app/clusters/fixed-label-server" - "${MATTER_SDK_PATH}/src/app/clusters/ota-requestor" - "${MATTER_SDK_PATH}/src/app/clusters/general-commissioning-server" - "${MATTER_SDK_PATH}/src/app/clusters/network-commissioning" - "${MATTER_SDK_PATH}/src/app/clusters/diagnostic-logs-server" - "${MATTER_SDK_PATH}/src/app/clusters/software-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/thread-network-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/wifi-network-diagnostics-server" - "${MATTER_SDK_PATH}/src/app/clusters/on-off-server" - "${MATTER_SDK_PATH}/src/app/clusters/operational-credentials-server" - "${MATTER_SDK_PATH}/src/app/clusters/descriptor" - "${MATTER_SDK_PATH}/src/app/clusters/level-control" - "${MATTER_SDK_PATH}/src/app/clusters/color-control-server") +set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_openthread esp_rainmaker) -set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${MATTER_SDK_PATH}/src" - "${MATTER_SDK_PATH}/zzz_generated/app-common") - -set(PRIV_REQUIRES_LIST chip bt esp32_mbedtls esp_matter esp_matter_console app_driver app_qrcode esp_rainmaker route_hook) - -idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} - PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "." + PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/rainmaker_light/main/app_constants.h b/examples/rainmaker_light/main/app_constants.h deleted file mode 100644 index 95eb57391..000000000 --- a/examples/rainmaker_light/main/app_constants.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEFAULT_POWER true -#define DEFAULT_BRIGHTNESS 100 -#define DEFAULT_HUE 360 -#define DEFAULT_SATURATION 100 - -#ifdef __cplusplus -} -#endif diff --git a/examples/rainmaker_light/main/app_driver.cpp b/examples/rainmaker_light/main/app_driver.cpp new file mode 100644 index 000000000..62e7d8492 --- /dev/null +++ b/examples/rainmaker_light/main/app_driver.cpp @@ -0,0 +1,131 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include + +static const char *TAG = "app_driver"; + +#define STANDARD_BRIGHTNESS 100 +#define STANDARD_HUE 360 +#define STANDARD_SATURATION 100 +#define STANDARD_TEMPERATURE 100 + +#define MATTER_BRIGHTNESS 255 +#define MATTER_HUE 255 +#define MATTER_SATURATION 255 +#define MATTER_TEMPERATURE 255 + +static esp_err_t app_driver_console_handler(int argc, char **argv) +{ + if (argc == 5 && strncmp(argv[0], "set", sizeof("set")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + int value = atoi(argv[4]); + + esp_matter_attr_val_t val = esp_matter_int(value); + + /* Change val if bool */ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID && attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + val.type = ESP_MATTER_VAL_TYPE_BOOLEAN; + val.val.b = (bool)value; + } + esp_matter_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (argc == 4 && strncmp(argv[0], "get", sizeof("get")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + + esp_matter_node_t *node = esp_matter_node_get(); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get(node, endpoint_id); + esp_matter_cluster_t *cluster = esp_matter_cluster_get(endpoint, cluster_id); + esp_matter_attribute_t *attribute = esp_matter_attribute_get(cluster, attribute_id); + esp_matter_attr_val_t val = esp_matter_attribute_get_val(attribute); + esp_matter_attribute_val_print(endpoint_id, cluster_id, attribute_id, val); + } else { + ESP_LOGE(TAG, "Incorrect arguments"); + return ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +static void app_driver_register_commands() +{ + esp_matter_console_command_t command = { + .name = "driver", + .description = "This can be used to simulate on-device control. " + "Usage: matter esp driver [value]. " + "Example1: matter esp driver set 0x1001 0x0006 0x0000 1. " + "Example2: matter esp driver get 0x1001 0x0006 0x0000.", + .handler = app_driver_console_handler, + }; + esp_matter_console_add_command(&command); +} + +/* Do any conversions/remapping for the actual value here */ +static esp_err_t app_driver_light_set_power(esp_matter_attr_val_t val) +{ + return light_driver_set_power(val.val.b); +} + +static esp_err_t app_driver_light_set_brightness(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); + return light_driver_set_brightness(value); +} + +static esp_err_t app_driver_light_set_hue(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_HUE, STANDARD_HUE); + return light_driver_set_hue(value); +} + +static esp_err_t app_driver_light_set_saturation(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_SATURATION, STANDARD_SATURATION); + return light_driver_set_saturation(value); +} + +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + esp_err_t err = ESP_OK; + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + err = app_driver_light_set_power(val); + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + err = app_driver_light_set_brightness(val); + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + err = app_driver_light_set_hue(val); + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + err = app_driver_light_set_saturation(val); + } + } + } + return err; +} + +esp_err_t app_driver_init() +{ + device_init(); + app_driver_register_commands(); + return ESP_OK; +} diff --git a/examples/rainmaker_light/main/app_driver.h b/examples/rainmaker_light/main/app_driver.h new file mode 100644 index 000000000..e8656e837 --- /dev/null +++ b/examples/rainmaker_light/main/app_driver.h @@ -0,0 +1,31 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** Initialize the board and the drivers + * + * This initializes the selected board, which then initializes the respective drivers associated with it. + * + * @return ESP_OK on success. + * @return error in case of failure. + */ +esp_err_t app_driver_init(void); + +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); + +#ifdef __cplusplus +} +#endif diff --git a/examples/rainmaker_light/main/app_main.cpp b/examples/rainmaker_light/main/app_main.cpp index 285aa6778..16822ee85 100644 --- a/examples/rainmaker_light/main/app_main.cpp +++ b/examples/rainmaker_light/main/app_main.cpp @@ -6,84 +6,88 @@ CONDITIONS OF ANY KIND, either express or implied. */ -#include "app_constants.h" -#include "app_driver.h" -#include "app_matter.h" -#include "app_qrcode.h" -#include "app_rainmaker.h" -#include "esp_matter.h" -#include "esp_matter_console.h" -#include "esp_matter_standard.h" +#include +#include +#include -#include "esp_err.h" -#include "esp_log.h" -#include "nvs_flash.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "lib/shell/Engine.h" +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif +#include +#include +#include -#define APP_MAIN_NAME "Main" static const char *TAG = "app_main"; -static esp_err_t app_main_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) +static esp_matter_node_config_t node_config = NODE_CONFIG_DEFAULT(); +static esp_matter_endpoint_color_dimmable_light_config_t light_config = ENDPOINT_CONFIG_COLOR_DIMMABLE_LIGHT_DEFAULT(); + +static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg) { - /* Just adding this callback to notify the application */ - switch (val.type) { - case ESP_MATTER_VAL_TYPE_BOOLEAN: - ESP_LOGD(TAG, "%s's %s is %d", endpoint, attribute, val.val.b); - break; - - case ESP_MATTER_VAL_TYPE_INTEGER: - ESP_LOGD(TAG, "%s's %s is %d", endpoint, attribute, val.val.i); - break; - - case ESP_MATTER_VAL_TYPE_FLOAT: - ESP_LOGD(TAG, "%s's %s is %f", endpoint, attribute, val.val.f); - break; - - case ESP_MATTER_VAL_TYPE_STRING: - case ESP_MATTER_VAL_TYPE_OBJECT: - case ESP_MATTER_VAL_TYPE_ARRAY: - ESP_LOGD(TAG, "%s's %s is %s", endpoint, attribute, val.val.s); - break; - - default: - ESP_LOGD(TAG, "%s's %s is ", endpoint, attribute); - break; + if (event->Type == chip::DeviceLayer::DeviceEventType::PublicEventTypes::kInterfaceIpAddressChanged) { +#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD + chip::app::DnssdServer::Instance().StartServer(); + esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); +#endif } - return ESP_OK; + ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +static esp_err_t app_attribute_update_cb(esp_matter_callback_type_t type, int endpoint_id, int cluster_id, + int attribute_id, esp_matter_attr_val_t val, void *priv_data) +{ + esp_err_t err = ESP_OK; + + if (type == ESP_MATTER_CALLBACK_TYPE_PRE_ATTRIBUTE) { + /* Driver update */ + err = app_driver_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (type == ESP_MATTER_CALLBACK_TYPE_POST_ATTRIBUTE) { + /* Other ecosystems update */ + err = app_rainmaker_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } + + return err; } extern "C" void app_main() { - /* Initialize the ESP NVS layer */ - ESP_ERROR_CHECK(nvs_flash_init()); + esp_err_t err = ESP_OK; - /* Initialize esp_matter */ - esp_matter_init(); - esp_matter_attribute_callback_add(APP_MAIN_NAME, app_main_attribute_update, NULL); + /* Initialize the ESP NVS layer */ + nvs_flash_init(); + + /* Create matter device */ + esp_matter_node_t *node = esp_matter_node_create(&node_config, app_attribute_update_cb, NULL); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_create_color_dimmable_light(node, &light_config); + /** + These node and endpoint handles can be used to create and add other endpoints and other clusters to the endpoints. + */ + if (!node || !endpoint) { + ESP_LOGE(TAG, "Matter device creation failed"); + } /* Initialize driver */ app_driver_init(); - /* Initialize chip */ - ESP_ERROR_CHECK(app_matter_init()); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + /* Initialize OpenThread */ + app_openthread_launch_task(); +#endif + + /* Matter start */ + err = esp_matter_start(app_event_cb); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Matter start failed: %d", err); + } app_qrcode_print(); /* Initialize rainmaker */ app_rainmaker_init(); - /* Set the default attribute values */ - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_POWER, - esp_matter_bool(DEFAULT_POWER)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_BRIGHTNESS, - esp_matter_int(DEFAULT_BRIGHTNESS)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_HUE, - esp_matter_int(DEFAULT_HUE)); - esp_matter_attribute_notify(APP_MAIN_NAME, ESP_MATTER_ENDPOINT_LIGHT, ESP_MATTER_ATTR_SATURATION, - esp_matter_int(DEFAULT_SATURATION)); - #if CONFIG_ENABLE_CHIP_SHELL esp_matter_console_diagnostics_register_commands(); esp_matter_console_init(); diff --git a/examples/rainmaker_light/main/app_matter.cpp b/examples/rainmaker_light/main/app_matter.cpp deleted file mode 100644 index 7fc20e534..000000000 --- a/examples/rainmaker_light/main/app_matter.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include "app_matter.h" -#include "app_constants.h" -#include "esp_matter.h" -#include "esp_matter_standard.h" - -#include "esp_heap_caps.h" -#include "esp_log.h" -#include "esp_route_hook.h" - -#include -#include "app-common/zap-generated/att-storage.h" -#include "app-common/zap-generated/attribute-id.h" -#include "app-common/zap-generated/attribute-type.h" -#include "app-common/zap-generated/cluster-id.h" -#include "app/server/Dnssd.h" -#include "app/server/Server.h" -#include "app/util/af.h" -#include "app/util/basic-types.h" -#include "core/CHIPError.h" -#include "credentials/DeviceAttestationCredsProvider.h" -#include "credentials/examples/DeviceAttestationCredsExample.h" -#include "lib/shell/Engine.h" -#include "lib/support/CHIPMem.h" -#include "platform/CHIPDeviceLayer.h" - -using chip::AttributeId; -using chip::ClusterId; -using chip::EndpointId; -using chip::Credentials::SetDeviceAttestationCredentialsProvider; -using chip::Credentials::Examples::GetExampleDACProvider; -using chip::DeviceLayer::ChipDeviceEvent; -using chip::DeviceLayer::ConnectivityMgr; -using chip::DeviceLayer::PlatformMgr; -using chip::DeviceLayer::DeviceEventType::PublicEventTypes; - -typedef enum { - REMAP_MATTER_TO_STANDARD, - REMAP_STANDARD_TO_MATTER, -} app_matter_remap_t; - -#define STANDARD_BRIGHTNESS 100 -#define STANDARD_HUE 360 -#define STANDARD_SATURATION 100 -#define STANDARD_TEMPERATURE 100 - -#define MATTER_BRIGHTNESS 255 -#define MATTER_HUE 255 -#define MATTER_SATURATION 255 -#define MATTER_TEMPERATURE 255 - -#define APP_MATTER_NAME "Matter" -static const char *TAG = "app_matter"; - -int app_matter_remap(char *attribute, int value, app_matter_remap_t remap) -{ - if (remap == REMAP_MATTER_TO_STANDARD) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return value; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return REMAP_TO_RANGE(value, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return REMAP_TO_RANGE(value, MATTER_HUE, STANDARD_HUE); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return REMAP_TO_RANGE(value, MATTER_SATURATION, STANDARD_SATURATION); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return REMAP_TO_RANGE(value, MATTER_TEMPERATURE, STANDARD_TEMPERATURE); - } - } else if (remap == REMAP_STANDARD_TO_MATTER) { - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return value; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_BRIGHTNESS, MATTER_BRIGHTNESS); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_HUE, MATTER_HUE); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_SATURATION, MATTER_SATURATION); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return REMAP_TO_RANGE(value, STANDARD_TEMPERATURE, MATTER_TEMPERATURE); - } - } - return value; -} - -static EndpointId app_matter_get_endpoint_id(const char *endpoint) -{ - if (strncmp(endpoint, ESP_MATTER_ENDPOINT_LIGHT, sizeof(ESP_MATTER_ENDPOINT_LIGHT)) == 0) { - return 1; - } - return 0; -} - -static const char *app_matter_get_endpoint_name(EndpointId endpoint) -{ - if (endpoint == 1) { - return ESP_MATTER_ENDPOINT_LIGHT; - } - return NULL; -} - -static ClusterId app_matter_get_cluster_id(const char *attribute) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return ZCL_ON_OFF_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return ZCL_LEVEL_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return ZCL_COLOR_CONTROL_CLUSTER_ID; - } - return 0; -} - -static AttributeId app_matter_get_attribute_id(const char *attribute) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return ZCL_ON_OFF_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return ZCL_CURRENT_LEVEL_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID; - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID; - } - return 0; -} - -static const char *app_matter_get_attribute_name(ClusterId cluster, AttributeId attribute) -{ - if (cluster == ZCL_ON_OFF_CLUSTER_ID) { - return ESP_MATTER_ATTR_POWER; - } else if (cluster == ZCL_LEVEL_CONTROL_CLUSTER_ID) { - return ESP_MATTER_ATTR_BRIGHTNESS; - } else if (cluster == ZCL_COLOR_CONTROL_CLUSTER_ID) { - if (attribute == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_HUE; - } else if (attribute == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_SATURATION; - } else if (attribute == ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID) { - return ESP_MATTER_ATTR_TEMPERATURE; - } - } - return NULL; -} - -static EmberAfAttributeType app_matter_get_attribute_type(esp_matter_attr_val_t val) -{ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - return ZCL_BOOLEAN_ATTRIBUTE_TYPE; - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - return ZCL_INT8U_ATTRIBUTE_TYPE; - } - return 0; -} - -static int app_matter_get_attribute_value(esp_matter_attr_val_t val) -{ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - return (int)val.val.b; - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - return val.val.i; - } - return 0; -} - -static esp_matter_attr_val_t app_matter_get_attribute_val(char *attribute, int value) -{ - if (strncmp(attribute, ESP_MATTER_ATTR_POWER, sizeof(ESP_MATTER_ATTR_POWER)) == 0) { - return esp_matter_bool((bool)value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_BRIGHTNESS, sizeof(ESP_MATTER_ATTR_BRIGHTNESS)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_HUE, sizeof(ESP_MATTER_ATTR_HUE)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_SATURATION, sizeof(ESP_MATTER_ATTR_SATURATION)) == 0) { - return esp_matter_int(value); - } else if (strncmp(attribute, ESP_MATTER_ATTR_TEMPERATURE, sizeof(ESP_MATTER_ATTR_TEMPERATURE)) == 0) { - return esp_matter_int(value); - } - return esp_matter_int(value); -} - -static esp_err_t app_matter_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) -{ - EndpointId endpoint_id = app_matter_get_endpoint_id(endpoint); - ClusterId cluster_id = app_matter_get_cluster_id(attribute); - AttributeId attribute_id = app_matter_get_attribute_id(attribute); - EmberAfAttributeType attribute_type = app_matter_get_attribute_type(val); - int value = app_matter_get_attribute_value(val); - uint8_t value_remap = (uint8_t)app_matter_remap((char *)attribute, value, REMAP_STANDARD_TO_MATTER); - ESP_LOGD(TAG, "Changing %s from standard: %d, to matter: %d\n", attribute, value, value_remap); - - EmberAfStatus status = emberAfWriteAttribute(endpoint_id, cluster_id, attribute_id, CLUSTER_MASK_SERVER, - (uint8_t *)&value_remap, attribute_type); - if (status != EMBER_ZCL_STATUS_SUCCESS) { - ESP_LOGE(TAG, "Error updating attribute to matter"); - return ESP_FAIL; - } - return ESP_OK; -} - -void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &path, uint8_t mask, uint8_t type, - uint16_t size, uint8_t *value) -{ - char *endpoint_name = (char *)app_matter_get_endpoint_name(path.mEndpointId); - char *attribute_name = (char *)app_matter_get_attribute_name(path.mClusterId, path.mAttributeId); - if (endpoint_name == NULL || attribute_name == NULL) { - return; - } - int value_remap = app_matter_remap(attribute_name, (int)*value, REMAP_MATTER_TO_STANDARD); - esp_matter_attr_val_t val = app_matter_get_attribute_val(attribute_name, value_remap); - ESP_LOGD(TAG, "Changing %s from matter: %d, to standard: %d\n", attribute_name, *value, value_remap); - - esp_matter_attribute_notify(APP_MATTER_NAME, endpoint_name, attribute_name, val); -} - -esp_err_t app_matter_attribute_set(const char *endpoint, const char *attribute, esp_matter_attr_val_t val) -{ - app_matter_attribute_update(endpoint, attribute, val, NULL); - esp_matter_attribute_notify(APP_MATTER_NAME, endpoint, attribute, val); - return ESP_OK; -} - -static void on_device_event(const ChipDeviceEvent *event, intptr_t arg) -{ - if (event->Type == PublicEventTypes::kInterfaceIpAddressChanged) { - chip::app::DnssdServer::Instance().StartServer(); - esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); - } - ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); -} - -static void matter_init_task(intptr_t context) -{ - xTaskHandle task_to_notify = reinterpret_cast(context); - chip::Server::GetInstance().Init(); - SetDeviceAttestationCredentialsProvider(GetExampleDACProvider()); - xTaskNotifyGive(task_to_notify); -} - -esp_err_t app_matter_init() -{ - if (PlatformMgr().InitChipStack() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to initialize CHIP stack"); - return ESP_FAIL; - } - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - if (chip::Platform::MemoryInit() != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "Failed to initialize CHIP memory pool"); - return ESP_ERR_NO_MEM; - } - if (PlatformMgr().StartEventLoopTask() != CHIP_NO_ERROR) { - chip::Platform::MemoryShutdown(); - ESP_LOGE(TAG, "Failed to launch Matter main task"); - return ESP_FAIL; - } - PlatformMgr().AddEventHandler(on_device_event, static_cast(NULL)); - - PlatformMgr().ScheduleWork(matter_init_task, reinterpret_cast(xTaskGetCurrentTaskHandle())); - // Wait for the matter stack to be initialized - xTaskNotifyWait(0, 0, NULL, portMAX_DELAY); - - esp_matter_attribute_callback_add(APP_MATTER_NAME, app_matter_attribute_update, NULL); - return ESP_OK; -} diff --git a/examples/rainmaker_light/main/app_matter.h b/examples/rainmaker_light/main/app_matter.h deleted file mode 100644 index 8f822664b..000000000 --- a/examples/rainmaker_light/main/app_matter.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#pragma once - -#include "esp_err.h" - -/** Initialize the matter stack - * - * @return ESP_OK on success. - * @return error in case of failure. - */ -esp_err_t app_matter_init(void); diff --git a/examples/rainmaker_light/main/app_rainmaker.c b/examples/rainmaker_light/main/app_rainmaker.c deleted file mode 100644 index 75cd174bc..000000000 --- a/examples/rainmaker_light/main/app_rainmaker.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "app_constants.h" -#include -#include -#include -#include - -#define APP_RAINMAKER_NAME "RainMaker" -static const char *TAG = "app_rainmaker"; - -esp_rmaker_device_t *light_device; - -static esp_err_t app_rainmaker_console_handler(int argc, char **argv) -{ - if (argc == 3 && strncmp(argv[0], "add-user", sizeof("add-user")) == 0) { - printf("%s: Starting user-node mapping\n", TAG); - if (esp_rmaker_start_user_node_mapping(argv[1], argv[2]) != ESP_OK) { - return -1; - } - } else { - printf("%s: Invalid Usage.\n", TAG); - return -1; - } - return 0; -} - -static void app_rainmaker_register_commands() -{ - esp_matter_console_command_t command = { - .name = "rainmaker", - .description = "Initiate ESP RainMaker User-Node mapping from the node. Usage: chip esp rainmaker add-user " - " ", - .handler = app_rainmaker_console_handler, - }; - esp_matter_console_add_command(&command); -} - -static esp_rmaker_param_val_t esp_rmaker_get_rmaker_val(esp_matter_attr_val_t val) -{ - if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { - return esp_rmaker_bool(val.val.b); - } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { - return esp_rmaker_int(val.val.i); - } else if (val.type == ESP_MATTER_VAL_TYPE_FLOAT) { - return esp_rmaker_float(val.val.f); - } else if (val.type == ESP_MATTER_VAL_TYPE_STRING) { - return esp_rmaker_str(val.val.s); - } else if (val.type == ESP_MATTER_VAL_TYPE_OBJECT) { - return esp_rmaker_obj(val.val.s); - } else if (val.type == ESP_MATTER_VAL_TYPE_ARRAY) { - return esp_rmaker_array(val.val.s); - } else { - ESP_LOGE(TAG, "Invalid val type: %d", val.type); - } - return esp_rmaker_int(0); -} - -static esp_matter_attr_val_t esp_rmaker_get_matter_val(esp_rmaker_param_val_t val) -{ - if (val.type == RMAKER_VAL_TYPE_BOOLEAN) { - return esp_matter_bool(val.val.b); - } else if (val.type == RMAKER_VAL_TYPE_INTEGER) { - return esp_matter_int(val.val.i); - } else if (val.type == RMAKER_VAL_TYPE_FLOAT) { - return esp_matter_float(val.val.f); - } else if (val.type == RMAKER_VAL_TYPE_STRING) { - return esp_matter_str(val.val.s); - } else if (val.type == RMAKER_VAL_TYPE_OBJECT) { - return esp_matter_obj(val.val.s); - } else if (val.type == RMAKER_VAL_TYPE_ARRAY) { - return esp_matter_array(val.val.s); - } else { - ESP_LOGE(TAG, "Invalid val type: %d", val.type); - } - return esp_matter_int(0); -} - -/* Callback to handle changes received from other sources */ -static esp_err_t app_rainmaker_attribute_update(const char *endpoint, const char *attribute, esp_matter_attr_val_t val, - void *priv_data) -{ - const esp_rmaker_node_t *node = esp_rmaker_get_node(); - esp_rmaker_device_t *device = esp_rmaker_node_get_device_by_name(node, endpoint); - esp_rmaker_param_t *param = esp_rmaker_device_get_param_by_name(device, attribute); - if (!device || !param) { - ESP_LOGE(TAG, "Incorrect endpoint or attribute. endpoint: %s, attribute: %s", endpoint, attribute); - return ESP_ERR_INVALID_ARG; - } - esp_rmaker_param_val_t rmaker_val = esp_rmaker_get_rmaker_val(val); - - esp_rmaker_param_update_and_report(param, rmaker_val); - return ESP_OK; -} - -/* Callback to handle commands received from the RainMaker cloud */ -static esp_err_t write_cb(const esp_rmaker_device_t *device, const esp_rmaker_param_t *param, - const esp_rmaker_param_val_t val, void *priv_data, esp_rmaker_write_ctx_t *ctx) -{ - if (ctx) { - ESP_LOGI(TAG, "Received write request via : %s", esp_rmaker_device_cb_src_to_str(ctx->src)); - } - const char *device_name = esp_rmaker_device_get_name(device); - const char *param_name = esp_rmaker_param_get_name(param); - if (!device_name || !param_name) { - ESP_LOGE(TAG, "Incorrect device_name or param_name"); - return ESP_ERR_INVALID_ARG; - } - esp_matter_attr_val_t matter_val = esp_rmaker_get_matter_val(val); - - esp_matter_attribute_notify(APP_RAINMAKER_NAME, device_name, param_name, matter_val); - esp_rmaker_param_update_and_report(param, val); - return ESP_OK; -} - -esp_err_t app_rainmaker_init() -{ - /* Initialize the ESP RainMaker Agent. - * Note that this should be called after app_wifi_init() but before app_wifi_start() - * */ - esp_rmaker_config_t rainmaker_cfg = { - .enable_time_sync = false, - }; - esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP RainMaker Device", "Lightbulb"); - if (!node) { - ESP_LOGE(TAG, "Could not initialise node."); - vTaskDelay(5000 / portTICK_PERIOD_MS); - return ESP_FAIL; - } - - /* Create a device and add the relevant parameters to it */ - light_device = esp_rmaker_lightbulb_device_create(ESP_MATTER_ENDPOINT_LIGHT, NULL, DEFAULT_POWER); - esp_rmaker_device_add_cb(light_device, write_cb, NULL); - - esp_rmaker_device_add_param(light_device, - esp_rmaker_brightness_param_create(ESP_MATTER_ATTR_BRIGHTNESS, DEFAULT_BRIGHTNESS)); - - esp_rmaker_device_add_param(light_device, esp_rmaker_hue_param_create(ESP_MATTER_ATTR_HUE, DEFAULT_HUE)); - - esp_rmaker_device_add_param(light_device, - esp_rmaker_saturation_param_create(ESP_MATTER_ATTR_SATURATION, DEFAULT_SATURATION)); - - esp_rmaker_node_add_device(node, light_device); - - /* Enable OTA */ - esp_rmaker_ota_config_t ota_config = { - .server_cert = ESP_RMAKER_OTA_DEFAULT_SERVER_CERT, - }; - esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS); - - /* Enable timezone service which will be require for setting appropriate timezone - * from the phone apps for scheduling to work correctly. - * For more information on the various ways of setting timezone, please check - * https://rainmaker.espressif.com/docs/time-service.html. - */ - esp_rmaker_timezone_service_enable(); - - /* Enable scheduling. */ - esp_rmaker_schedule_enable(); - - /* Start the ESP RainMaker Agent */ - esp_rmaker_start(); - - esp_matter_attribute_callback_add(APP_RAINMAKER_NAME, app_rainmaker_attribute_update, NULL); - app_rainmaker_register_commands(); - return ESP_OK; -} diff --git a/examples/rainmaker_light/main/app_rainmaker.cpp b/examples/rainmaker_light/main/app_rainmaker.cpp new file mode 100644 index 000000000..709ec8af3 --- /dev/null +++ b/examples/rainmaker_light/main/app_rainmaker.cpp @@ -0,0 +1,379 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static const char *TAG = "app_rainmaker"; + +#define DEFAULT_LIGHT_NAME "Light" + +static esp_err_t app_rainmaker_console_handler(int argc, char **argv) +{ + if (argc == 3 && strncmp(argv[0], "add-user", sizeof("add-user")) == 0) { + printf("%s: Starting user-node mapping\n", TAG); + if (esp_rmaker_start_user_node_mapping(argv[1], argv[2]) != ESP_OK) { + return ESP_FAIL; + } + } else { + printf("%s: Invalid Usage.\n", TAG); + return ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +static void app_rainmaker_register_commands() +{ + esp_matter_console_command_t command = { + .name = "rainmaker", + .description = "Initiate ESP RainMaker User-Node mapping from the node. " + "Usage: matter esp rainmaker add-user ", + .handler = app_rainmaker_console_handler, + }; + esp_matter_console_add_command(&command); +} + +static const char *app_rainmaker_get_device_name_from_id(int endpoint_id) +{ + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + return DEFAULT_LIGHT_NAME; + } + return NULL; +} + +static const char *app_rainmaker_get_device_type_from_id(int endpoint_id) +{ + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + return ESP_RMAKER_DEVICE_LIGHTBULB; + } + return NULL; +} + +static int app_rainmaker_get_endpoint_id_from_name(const char *device_name) +{ + if (strcmp(device_name, DEFAULT_LIGHT_NAME) == 0) { + return ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID; + } + return 0; +} + +static const char *app_rainmaker_get_param_name_from_id(int cluster_id, int attribute_id) +{ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + return ESP_RMAKER_DEF_POWER_NAME; + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + return ESP_RMAKER_DEF_BRIGHTNESS_NAME; + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + return ESP_RMAKER_DEF_HUE_NAME; + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + return ESP_RMAKER_DEF_SATURATION_NAME; + } + } + return NULL; +} + +static const char *app_rainmaker_get_param_type_from_id(int cluster_id, int attribute_id) +{ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + return ESP_RMAKER_PARAM_POWER; + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + return ESP_RMAKER_PARAM_BRIGHTNESS; + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + return ESP_RMAKER_PARAM_HUE; + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + return ESP_RMAKER_PARAM_SATURATION; + } + } + return NULL; +} + +static const char *app_rainmaker_get_param_ui_type_from_id(int cluster_id, int attribute_id) +{ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + return ESP_RMAKER_UI_TOGGLE; + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + return ESP_RMAKER_UI_SLIDER; + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + return ESP_RMAKER_UI_SLIDER; + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + return ESP_RMAKER_UI_SLIDER; + } + } + return NULL; +} + +static bool app_rainmaker_get_param_bounds_from_id(int cluster_id, int attribute_id, int *min, int *max, int *step) +{ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + return false; + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + *min = 0; + *max = 255; + *step = 1; + return true; + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + *min = 0; + *max = 255; + *step = 1; + return true; + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + *min = 0; + *max = 255; + *step = 1; + return true; + } + } + return false; +} + +static int app_rainmaker_get_cluster_id_from_name(const char *param_name) +{ + if (strcmp(param_name, ESP_RMAKER_DEF_POWER_NAME) == 0) { + return ZCL_ON_OFF_CLUSTER_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_BRIGHTNESS_NAME) == 0) { + return ZCL_LEVEL_CONTROL_CLUSTER_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_HUE_NAME) == 0) { + return ZCL_COLOR_CONTROL_CLUSTER_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_SATURATION_NAME) == 0) { + return ZCL_COLOR_CONTROL_CLUSTER_ID; + } + return 0; +} + +static int app_rainmaker_get_attribute_id_from_name(const char *param_name) +{ + if (strcmp(param_name, ESP_RMAKER_DEF_POWER_NAME) == 0) { + return ZCL_ON_OFF_ATTRIBUTE_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_BRIGHTNESS_NAME) == 0) { + return ZCL_CURRENT_LEVEL_ATTRIBUTE_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_HUE_NAME) == 0) { + return ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID; + } else if (strcmp(param_name, ESP_RMAKER_DEF_SATURATION_NAME) == 0) { + return ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID; + } + return 0; +} + +static esp_rmaker_param_val_t app_rainmaker_get_rmaker_val(esp_matter_attr_val_t val) +{ + if (val.type == ESP_MATTER_VAL_TYPE_BOOLEAN) { + return esp_rmaker_bool(val.val.b); + } else if (val.type == ESP_MATTER_VAL_TYPE_INTEGER) { + return esp_rmaker_int(val.val.i); + } else if (val.type == ESP_MATTER_VAL_TYPE_FLOAT) { + return esp_rmaker_float(val.val.f); + } else if (val.type == ESP_MATTER_VAL_TYPE_STRING) { + return esp_rmaker_str(val.val.s); + } else if (val.type == ESP_MATTER_VAL_TYPE_JSON_OBJECT) { + return esp_rmaker_obj(val.val.s); + } else if (val.type == ESP_MATTER_VAL_TYPE_JSON_ARRAY) { + return esp_rmaker_array(val.val.s); + } else if (val.type == ESP_MATTER_VAL_TYPE_UINT8) { + return esp_rmaker_int(val.val.u8); + } else if (val.type == ESP_MATTER_VAL_TYPE_UINT16) { + return esp_rmaker_int(val.val.u16); + } else { + ESP_LOGE(TAG, "Invalid val type: %d", val.type); + } + return esp_rmaker_int(0); +} + +static esp_matter_attr_val_t app_rainmaker_get_matter_val(esp_rmaker_param_val_t val) +{ + if (val.type == RMAKER_VAL_TYPE_BOOLEAN) { + return esp_matter_bool(val.val.b); + } else if (val.type == RMAKER_VAL_TYPE_INTEGER) { + return esp_matter_int(val.val.i); + } else if (val.type == RMAKER_VAL_TYPE_FLOAT) { + return esp_matter_float(val.val.f); + } else if (val.type == RMAKER_VAL_TYPE_STRING) { + return esp_matter_str(val.val.s); + } else if (val.type == RMAKER_VAL_TYPE_OBJECT) { + return esp_matter_json_obj(val.val.s); + } else if (val.type == RMAKER_VAL_TYPE_ARRAY) { + return esp_matter_json_array(val.val.s); + } else { + ESP_LOGE(TAG, "Invalid val type: %d", val.type); + } + return esp_matter_int(0); +} + +esp_err_t app_rainmaker_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + const char *device_name = app_rainmaker_get_device_name_from_id(endpoint_id); + const char *param_name = app_rainmaker_get_param_name_from_id(cluster_id, attribute_id); + if (!device_name || !param_name) { + ESP_LOGD(TAG, "Device name or param name not handled"); + return ESP_FAIL; + } + + const esp_rmaker_node_t *node = esp_rmaker_get_node(); + esp_rmaker_device_t *device = esp_rmaker_node_get_device_by_name(node, device_name); + esp_rmaker_param_t *param = esp_rmaker_device_get_param_by_name(device, param_name); + esp_rmaker_param_val_t rmaker_val = app_rainmaker_get_rmaker_val(val); + if (!param) { + ESP_LOGE(TAG, "Param not found"); + return ESP_FAIL; + } + + return esp_rmaker_param_update_and_report(param, rmaker_val); +} + +/* Callback to handle commands received from the RainMaker cloud */ +static esp_err_t write_cb(const esp_rmaker_device_t *device, const esp_rmaker_param_t *param, + const esp_rmaker_param_val_t val, void *priv_data, esp_rmaker_write_ctx_t *ctx) +{ + if (ctx) { + ESP_LOGI(TAG, "Received write request via : %s", esp_rmaker_device_cb_src_to_str(ctx->src)); + } + + const char *device_name = esp_rmaker_device_get_name(device); + const char *param_name = esp_rmaker_param_get_name(param); + + int endpoint_id = app_rainmaker_get_endpoint_id_from_name(device_name); + int cluster_id = app_rainmaker_get_cluster_id_from_name(param_name); + int attribute_id = app_rainmaker_get_attribute_id_from_name(param_name); + esp_matter_attr_val_t matter_val = app_rainmaker_get_matter_val(val); + + return esp_matter_attribute_update(endpoint_id, cluster_id, attribute_id, matter_val); +} + +static void app_rainmaker_device_create() +{ + const esp_rmaker_node_t *node = esp_rmaker_get_node(); + esp_matter_node_t *matter_node = esp_matter_node_get(); + esp_matter_endpoint_t *endpoint = esp_matter_endpoint_get_first(matter_node); + + /* Parse all endpoints */ + while (endpoint) { + int endpoint_id = esp_matter_endpoint_get_id(endpoint); + const char *device_name = app_rainmaker_get_device_name_from_id(endpoint_id); + + /* Proceed only if endpoint_id has been handled */ + if (device_name) { + const char *device_type = app_rainmaker_get_device_type_from_id(endpoint_id); + esp_rmaker_device_t *device = esp_rmaker_device_create(device_name, device_type, NULL); + esp_rmaker_device_add_cb(device, write_cb, NULL); + esp_rmaker_node_add_device(node, device); + + esp_matter_cluster_t *cluster = esp_matter_cluster_get_first(endpoint); + /* Parse all clusters */ + while (cluster) { + int cluster_id = esp_matter_cluster_get_id(cluster); + esp_matter_attribute_t *attribute = esp_matter_attribute_get_first(cluster); + /* Parse all attributes */ + while (attribute) { + int attribute_id = esp_matter_attribute_get_id(attribute); + const char *param_name = app_rainmaker_get_param_name_from_id(cluster_id, attribute_id); + /* Proceed only if attribute_id corresponding to the cluster_id is handled */ + if (param_name) { + const char *param_type = app_rainmaker_get_param_type_from_id(cluster_id, attribute_id); + const char *ui_type = app_rainmaker_get_param_ui_type_from_id(cluster_id, attribute_id); + int min = 0, max = 0, step = 0; + bool add_bounds = app_rainmaker_get_param_bounds_from_id(cluster_id, attribute_id, &min, &max, + &step); + + esp_matter_attr_val_t val = esp_matter_attribute_get_val(attribute); + esp_rmaker_param_val_t rmaker_val = app_rainmaker_get_rmaker_val(val); + esp_rmaker_param_t *param = esp_rmaker_param_create(param_name, param_type, rmaker_val, + PROP_FLAG_READ | PROP_FLAG_WRITE); + + /* Add additional param details */ + if (ui_type) { + esp_rmaker_param_add_ui_type(param, ui_type); + } + if (add_bounds) { + esp_rmaker_param_add_bounds(param, esp_rmaker_int(min), esp_rmaker_int(max), + esp_rmaker_int(step)); + } + esp_rmaker_device_add_param(device, param); + } + attribute = esp_matter_attribute_get_next(attribute); + } + cluster = esp_matter_cluster_get_next(cluster); + } + } + endpoint = esp_matter_endpoint_get_next(endpoint); + } +} + +esp_err_t app_rainmaker_init() +{ + /* Initialize the ESP RainMaker Agent. + * Note that this should be called after app_wifi_init() but before app_wifi_start() + * */ + esp_rmaker_config_t rainmaker_cfg = { + .enable_time_sync = false, + }; + esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP RainMaker Device", "Lightbulb"); + if (!node) { + ESP_LOGE(TAG, "Could not initialise node."); + vTaskDelay(5000 / portTICK_PERIOD_MS); + return ESP_FAIL; + } + + /* Create a device and add the relevant parameters to it */ + app_rainmaker_device_create(); + + /* Enable OTA */ + esp_rmaker_ota_config_t ota_config = { + .server_cert = ESP_RMAKER_OTA_DEFAULT_SERVER_CERT, + }; + esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS); + + /* Enable timezone service which will be require for setting appropriate timezone + * from the phone apps for scheduling to work correctly. + * For more information on the various ways of setting timezone, please check + * https://rainmaker.espressif.com/docs/time-service.html. + */ + esp_rmaker_timezone_service_enable(); + + /* Enable scheduling. */ + esp_rmaker_schedule_enable(); + + /* Start the ESP RainMaker Agent */ + esp_rmaker_start(); + + app_rainmaker_register_commands(); + return ESP_OK; +} diff --git a/examples/rainmaker_light/main/app_rainmaker.h b/examples/rainmaker_light/main/app_rainmaker.h index cc1d8237a..cf9644196 100644 --- a/examples/rainmaker_light/main/app_rainmaker.h +++ b/examples/rainmaker_light/main/app_rainmaker.h @@ -9,6 +9,7 @@ #pragma once #include +#include #ifdef __cplusplus extern "C" { @@ -24,6 +25,8 @@ extern "C" { */ esp_err_t app_rainmaker_init(void); +esp_err_t app_rainmaker_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); + #ifdef __cplusplus } #endif diff --git a/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.cpp b/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.cpp index 19dd77a3a..2e9d8d2ba 100644 --- a/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.cpp +++ b/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.cpp @@ -131,6 +131,2620 @@ namespace { // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); +void AccessControlClusterAclListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccessControlClusterExtensionListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccessControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccountLoginClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AdministratorCommissioningClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ApplicationLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AudioOutputClusterAudioOutputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AudioOutputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BarrierControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BinaryInputBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BindingClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BooleanStateClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterActionListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterEndpointListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedActionsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void BridgedDeviceBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ContentLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterDeviceListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterServerListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterClientListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterPartsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DescriptorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DiagnosticLogsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void DoorLockClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ElectricalMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void EthernetNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FixedLabelClusterLabelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FixedLabelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void FlowMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralCommissioningClusterBasicCommissioningInfoListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralCommissioningClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterNetworkInterfacesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveHardwareFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveRadioFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterActiveNetworkFaultsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GeneralDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupKeyManagementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void GroupsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void IdentifyClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void IlluminanceMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void KeypadInputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void LevelControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void LowPowerClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaInputClusterMediaInputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaInputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaPlaybackClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ModeSelectClusterSupportedModesListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ModeSelectClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void NetworkCommissioningClusterNetworksListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OccupancySensingClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OnOffClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceConfigurationClusterSourcesListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PowerSourceConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PressureMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void PumpConfigurationAndControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void RelativeHumidityMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ScenesClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SoftwareDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void SwitchClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TargetNavigatorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TemperatureMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListInt8uListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListStructOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListNullablesAndOptionalsStructListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterListLongOctetStringListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TestClusterClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThermostatClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThermostatUserInterfaceConfigurationClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable( + onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterNeighborTableListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterRouteTableListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterSecurityPolicyListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterOperationalDatasetComponentsListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable( + onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterActiveNetworkFaultsListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ThreadNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void UserLabelClusterLabelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WakeOnLanClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WiFiNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void WindowCoveringClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +bool emberAfAccountLoginClusterGetSetupPINResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::CharSpan setupPIN) +{ + ChipLogProgress(Zcl, "GetSetupPINResponse:"); + ChipLogProgress(Zcl, " setupPIN: %.*s", static_cast(setupPIN.size()), setupPIN.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("AccountLoginClusterGetSetupPINResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, setupPIN); + return true; +} + +bool emberAfApplicationLauncherClusterHideAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) +{ + ChipLogProgress(Zcl, "HideAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterHideAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterLaunchAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfApplicationLauncherClusterStopAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) +{ + ChipLogProgress(Zcl, "StopAppResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterStopAppResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfChannelClusterChangeChannelResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch, uint8_t errorType) +{ + ChipLogProgress(Zcl, "ChangeChannelResponse:"); + ChipLogProgress(Zcl, " channelMatch: Not sure how to log struct ChannelInfo"); + ChipLogProgress(Zcl, " errorType: %" PRIu8 "", errorType); + + GET_CLUSTER_RESPONSE_CALLBACKS("ChannelClusterChangeChannelResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, ChannelInfo(), errorType); + return true; +} + +bool emberAfContentLauncherClusterLaunchContentResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t contentLaunchStatus, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchContentResponse:"); + ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchContentResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, contentLaunchStatus, data); + return true; +} + +bool emberAfContentLauncherClusterLaunchURLResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t contentLaunchStatus, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "LaunchURLResponse:"); + ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchURLResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, contentLaunchStatus, data); + return true; +} + +bool emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::ByteSpan content, uint32_t timeStamp, uint32_t timeSinceBoot) +{ + ChipLogProgress(Zcl, "RetrieveLogsResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " content: %zu", content.size()); + ChipLogProgress(Zcl, " timeStamp: %" PRIu32 "", timeStamp); + ChipLogProgress(Zcl, " timeSinceBoot: %" PRIu32 "", timeSinceBoot); + + GET_CLUSTER_RESPONSE_CALLBACKS("DiagnosticLogsClusterRetrieveLogsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, content, timeStamp, timeSinceBoot); + return true; +} + +bool emberAfDoorLockClusterGetCredentialStatusResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + bool credentialExists, uint16_t userIndex, + uint16_t nextCredentialIndex) +{ + ChipLogProgress(Zcl, "GetCredentialStatusResponse:"); + ChipLogProgress(Zcl, " credentialExists: %d", credentialExists); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " nextCredentialIndex: %" PRIu16 "", nextCredentialIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterGetCredentialStatusResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, credentialExists, userIndex, nextCredentialIndex); + return true; +} + +bool emberAfDoorLockClusterGetUserResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint16_t userIndex, + chip::CharSpan userName, uint32_t userUniqueId, uint8_t userStatus, + uint8_t userType, uint8_t credentialRule, + /* TYPE WARNING: array array defaults to */ uint8_t * credentials, + chip::FabricIndex creatorFabricIndex, chip::FabricIndex lastModifiedFabricIndex, + uint16_t nextUserIndex) +{ + ChipLogProgress(Zcl, "GetUserResponse:"); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " userName: %.*s", static_cast(userName.size()), userName.data()); + ChipLogProgress(Zcl, " userUniqueId: %" PRIu32 "", userUniqueId); + ChipLogProgress(Zcl, " userStatus: %" PRIu8 "", userStatus); + ChipLogProgress(Zcl, " userType: %" PRIu8 "", userType); + ChipLogProgress(Zcl, " credentialRule: %" PRIu8 "", credentialRule); + ChipLogProgress(Zcl, " credentials: %p", credentials); + ChipLogProgress(Zcl, " creatorFabricIndex: %" PRIu8 "", creatorFabricIndex); + ChipLogProgress(Zcl, " lastModifiedFabricIndex: %" PRIu8 "", lastModifiedFabricIndex); + ChipLogProgress(Zcl, " nextUserIndex: %" PRIu16 "", nextUserIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterGetUserResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, userIndex, userName, userUniqueId, userStatus, userType, credentialRule, credentials, + creatorFabricIndex, lastModifiedFabricIndex, nextUserIndex); + return true; +} + +bool emberAfDoorLockClusterSetCredentialResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t userIndex, uint16_t nextCredentialIndex) +{ + ChipLogProgress(Zcl, "SetCredentialResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " userIndex: %" PRIu16 "", userIndex); + ChipLogProgress(Zcl, " nextCredentialIndex: %" PRIu16 "", nextCredentialIndex); + + GET_CLUSTER_RESPONSE_CALLBACKS("DoorLockClusterSetCredentialResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, userIndex, nextCredentialIndex); + return true; +} + +bool emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "ArmFailSafeResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterArmFailSafeResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "CommissioningCompleteResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterCommissioningCompleteResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t errorCode, chip::CharSpan debugText) +{ + ChipLogProgress(Zcl, "SetRegulatoryConfigResponse:"); + ChipLogProgress(Zcl, " errorCode: %" PRIu8 "", errorCode); + ChipLogProgress(Zcl, " debugText: %.*s", static_cast(debugText.size()), debugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GeneralCommissioningClusterSetRegulatoryConfigResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, errorCode, debugText); + return true; +} + +bool emberAfGroupsClusterAddGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "AddGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterAddGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfGroupsClusterGetGroupMembershipResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t capacity, + /* TYPE WARNING: array array defaults to */ uint8_t * groupList) +{ + ChipLogProgress(Zcl, "GetGroupMembershipResponse:"); + ChipLogProgress(Zcl, " capacity: %" PRIu8 "", capacity); + ChipLogProgress(Zcl, " groupList: %p", groupList); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterGetGroupMembershipResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, capacity, groupList); + return true; +} + +bool emberAfGroupsClusterRemoveGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "RemoveGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterRemoveGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfGroupsClusterViewGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, chip::CharSpan groupName) +{ + ChipLogProgress(Zcl, "ViewGroupResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " groupName: %.*s", static_cast(groupName.size()), groupName.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupsClusterViewGroupResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, groupName); + return true; +} + +bool emberAfIdentifyClusterIdentifyQueryResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint16_t timeout) +{ + ChipLogProgress(Zcl, "IdentifyQueryResponse:"); + ChipLogProgress(Zcl, " timeout: %" PRIu16 "", timeout); + + GET_CLUSTER_RESPONSE_CALLBACKS("IdentifyClusterIdentifyQueryResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, timeout); + return true; +} + +bool emberAfKeypadInputClusterSendKeyResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status) +{ + ChipLogProgress(Zcl, "SendKeyResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + + GET_CLUSTER_RESPONSE_CALLBACKS("KeypadInputClusterSendKeyResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status); + return true; +} + +bool emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaFastForwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaFastForwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaNextResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaNextResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaNextResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPauseResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPauseResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPauseResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPlayResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPlayResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPlayResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaPreviousResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPreviousResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaRewindResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaRewindResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSeekResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSeekResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSkipBackwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipBackwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSkipForwardResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipForwardResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaStartOverResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStartOverResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfMediaPlaybackClusterMediaStopResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaStopResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStopResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + +bool emberAfNetworkCommissioningClusterConnectNetworkResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t NetworkingStatus, chip::CharSpan DebugText, + int32_t ErrorValue) +{ + ChipLogProgress(Zcl, "ConnectNetworkResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + ChipLogProgress(Zcl, " ErrorValue: %" PRId32 "", ErrorValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterConnectNetworkResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText, ErrorValue); + return true; +} + +bool emberAfNetworkCommissioningClusterNetworkConfigResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t NetworkingStatus, chip::CharSpan DebugText) +{ + ChipLogProgress(Zcl, "NetworkConfigResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterNetworkConfigResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText); + return true; +} + +bool emberAfNetworkCommissioningClusterScanNetworksResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, uint8_t NetworkingStatus, chip::CharSpan DebugText, + /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults, + /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults) +{ + ChipLogProgress(Zcl, "ScanNetworksResponse:"); + ChipLogProgress(Zcl, " NetworkingStatus: %" PRIu8 "", NetworkingStatus); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + ChipLogProgress(Zcl, " WiFiScanResults: %p", WiFiScanResults); + ChipLogProgress(Zcl, " ThreadScanResults: %p", ThreadScanResults); + + GET_CLUSTER_RESPONSE_CALLBACKS("NetworkCommissioningClusterScanNetworksResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NetworkingStatus, DebugText, WiFiScanResults, ThreadScanResults); + return true; +} + bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t action, uint32_t delayedActionTime) { @@ -172,3 +2786,324 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(EndpointI userConsentNeeded, metadataForRequestor); return true; } + +bool emberAfOperationalCredentialsClusterAttestationResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan AttestationElements, chip::ByteSpan Signature) +{ + ChipLogProgress(Zcl, "AttestationResponse:"); + ChipLogProgress(Zcl, " AttestationElements: %zu", AttestationElements.size()); + ChipLogProgress(Zcl, " Signature: %zu", Signature.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterAttestationResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, AttestationElements, Signature); + return true; +} + +bool emberAfOperationalCredentialsClusterCertificateChainResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan Certificate) +{ + ChipLogProgress(Zcl, "CertificateChainResponse:"); + ChipLogProgress(Zcl, " Certificate: %zu", Certificate.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterCertificateChainResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, Certificate); + return true; +} + +bool emberAfOperationalCredentialsClusterNOCResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText) +{ + ChipLogProgress(Zcl, "NOCResponse:"); + ChipLogProgress(Zcl, " StatusCode: %" PRIu8 "", StatusCode); + ChipLogProgress(Zcl, " FabricIndex: %" PRIu8 "", FabricIndex); + ChipLogProgress(Zcl, " DebugText: %.*s", static_cast(DebugText.size()), DebugText.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterNOCResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, StatusCode, FabricIndex, DebugText); + return true; +} + +bool emberAfOperationalCredentialsClusterOpCSRResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + chip::ByteSpan NOCSRElements, chip::ByteSpan AttestationSignature) +{ + ChipLogProgress(Zcl, "OpCSRResponse:"); + ChipLogProgress(Zcl, " NOCSRElements: %zu", NOCSRElements.size()); + ChipLogProgress(Zcl, " AttestationSignature: %zu", AttestationSignature.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS("OperationalCredentialsClusterOpCSRResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, NOCSRElements, AttestationSignature); + return true; +} + +bool emberAfScenesClusterAddSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "AddSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterAddSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterGetSceneMembershipResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint8_t capacity, uint16_t groupId, uint8_t sceneCount, + /* TYPE WARNING: array array defaults to */ uint8_t * sceneList) +{ + ChipLogProgress(Zcl, "GetSceneMembershipResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " capacity: %" PRIu8 "", capacity); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneCount: %" PRIu8 "", sceneCount); + ChipLogProgress(Zcl, " sceneList: %p", sceneList); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterGetSceneMembershipResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, capacity, groupId, sceneCount, sceneList); + return true; +} + +bool emberAfScenesClusterRemoveAllScenesResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId) +{ + ChipLogProgress(Zcl, "RemoveAllScenesResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterRemoveAllScenesResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId); + return true; +} + +bool emberAfScenesClusterRemoveSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "RemoveSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterRemoveSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterStoreSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId) +{ + ChipLogProgress(Zcl, "StoreSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterStoreSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId); + return true; +} + +bool emberAfScenesClusterViewSceneResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, + chip::CharSpan sceneName, + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets) +{ + ChipLogProgress(Zcl, "ViewSceneResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " groupId: %" PRIu16 "", groupId); + ChipLogProgress(Zcl, " sceneId: %" PRIu8 "", sceneId); + ChipLogProgress(Zcl, " transitionTime: %" PRIu16 "", transitionTime); + ChipLogProgress(Zcl, " sceneName: %.*s", static_cast(sceneName.size()), sceneName.data()); + ChipLogProgress(Zcl, " extensionFieldSets: %p", extensionFieldSets); + + GET_CLUSTER_RESPONSE_CALLBACKS("ScenesClusterViewSceneResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, groupId, sceneId, transitionTime, sceneName, extensionFieldSets); + return true; +} + +bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data) +{ + ChipLogProgress(Zcl, "NavigateTargetResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + + GET_CLUSTER_RESPONSE_CALLBACKS("TargetNavigatorClusterNavigateTargetResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, data); + return true; +} + +bool emberAfTestClusterClusterBooleanResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, bool value) +{ + ChipLogProgress(Zcl, "BooleanResponse:"); + ChipLogProgress(Zcl, " value: %d", value); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterBooleanResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, value); + return true; +} + +bool emberAfTestClusterClusterSimpleStructResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType arg1) +{ + ChipLogProgress(Zcl, "SimpleStructResponse:"); + ChipLogProgress(Zcl, " arg1: Not sure how to log struct SimpleStruct"); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterSimpleStructResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, SimpleStruct()); + return true; +} + +bool emberAfTestClusterClusterTestAddArgumentsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestAddArgumentsResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestAddArgumentsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + +bool emberAfTestClusterClusterTestEnumsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, chip::VendorId arg1, + uint8_t arg2) +{ + ChipLogProgress(Zcl, "TestEnumsResponse:"); + ChipLogProgress(Zcl, " arg1: %" PRIu16 "", arg1); + ChipLogProgress(Zcl, " arg2: %" PRIu8 "", arg2); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestEnumsResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, arg1, arg2); + return true; +} + +bool emberAfTestClusterClusterTestListInt8UReverseResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + /* TYPE WARNING: array array defaults to */ uint8_t * arg1) +{ + ChipLogProgress(Zcl, "TestListInt8UReverseResponse:"); + ChipLogProgress(Zcl, " arg1: %p", arg1); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestListInt8UReverseResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, arg1); + return true; +} + +bool emberAfTestClusterClusterTestNullableOptionalResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + bool wasPresent, bool wasNull, uint8_t value, + uint8_t originalValue) +{ + ChipLogProgress(Zcl, "TestNullableOptionalResponse:"); + ChipLogProgress(Zcl, " wasPresent: %d", wasPresent); + ChipLogProgress(Zcl, " wasNull: %d", wasNull); + ChipLogProgress(Zcl, " value: %" PRIu8 "", value); + ChipLogProgress(Zcl, " originalValue: %" PRIu8 "", originalValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestNullableOptionalResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, wasPresent, wasNull, value, originalValue); + return true; +} + +bool emberAfTestClusterClusterTestSpecificResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestSpecificResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestSpecificResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + +bool emberAfThermostatClusterGetRelayStatusLogResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint16_t timeOfDay, uint16_t relayStatus, int16_t localTemperature, + uint8_t humidityInPercentage, int16_t setpoint, + uint16_t unreadEntries) +{ + ChipLogProgress(Zcl, "GetRelayStatusLogResponse:"); + ChipLogProgress(Zcl, " timeOfDay: %" PRIu16 "", timeOfDay); + ChipLogProgress(Zcl, " relayStatus: %" PRIu16 "", relayStatus); + ChipLogProgress(Zcl, " localTemperature: %" PRId16 "", localTemperature); + ChipLogProgress(Zcl, " humidityInPercentage: %" PRIu8 "", humidityInPercentage); + ChipLogProgress(Zcl, " setpoint: %" PRId16 "", setpoint); + ChipLogProgress(Zcl, " unreadEntries: %" PRIu16 "", unreadEntries); + + GET_CLUSTER_RESPONSE_CALLBACKS("ThermostatClusterGetRelayStatusLogResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, timeOfDay, relayStatus, localTemperature, humidityInPercentage, setpoint, unreadEntries); + return true; +} + +bool emberAfThermostatClusterGetWeeklyScheduleResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, + uint8_t modeForSequence, + /* TYPE WARNING: array array defaults to */ uint8_t * payload) +{ + ChipLogProgress(Zcl, "GetWeeklyScheduleResponse:"); + ChipLogProgress(Zcl, " numberOfTransitionsForSequence: %" PRIu8 "", numberOfTransitionsForSequence); + ChipLogProgress(Zcl, " dayOfWeekForSequence: %" PRIu8 "", dayOfWeekForSequence); + ChipLogProgress(Zcl, " modeForSequence: %" PRIu8 "", modeForSequence); + ChipLogProgress(Zcl, " payload: %p", payload); + + GET_CLUSTER_RESPONSE_CALLBACKS("ThermostatClusterGetWeeklyScheduleResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload); + return true; +} diff --git a/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.h b/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.h index 9e7856a02..c7620fc2e 100644 --- a/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.h +++ b/examples/rainmaker_light/main/zap-generated/CHIPClientCallbacks.h @@ -35,10 +35,589 @@ // #6308 should handle IM error code on the application side, either modify this function or remove this. // Cluster Specific Response Callbacks +typedef void (*AccountLoginClusterGetSetupPINResponseCallback)(void * context, chip::CharSpan setupPIN); +typedef void (*ApplicationLauncherClusterHideAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ApplicationLauncherClusterLaunchAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ApplicationLauncherClusterStopAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ChannelClusterChangeChannelResponseCallback)(void * context, ChannelInfo channelMatch, uint8_t errorType); +typedef void (*ContentLauncherClusterLaunchContentResponseCallback)(void * context, uint8_t contentLaunchStatus, + chip::CharSpan data); +typedef void (*ContentLauncherClusterLaunchURLResponseCallback)(void * context, uint8_t contentLaunchStatus, chip::CharSpan data); +typedef void (*DiagnosticLogsClusterRetrieveLogsResponseCallback)(void * context, uint8_t status, chip::ByteSpan content, + uint32_t timeStamp, uint32_t timeSinceBoot); +typedef void (*DoorLockClusterGetCredentialStatusResponseCallback)(void * context, bool credentialExists, uint16_t userIndex, + uint16_t nextCredentialIndex); +typedef void (*DoorLockClusterGetUserResponseCallback)(void * context, uint16_t userIndex, chip::CharSpan userName, + uint32_t userUniqueId, uint8_t userStatus, uint8_t userType, + uint8_t credentialRule, + /* TYPE WARNING: array array defaults to */ uint8_t * credentials, + chip::FabricIndex creatorFabricIndex, + chip::FabricIndex lastModifiedFabricIndex, uint16_t nextUserIndex); +typedef void (*DoorLockClusterSetCredentialResponseCallback)(void * context, uint8_t status, uint16_t userIndex, + uint16_t nextCredentialIndex); +typedef void (*GeneralCommissioningClusterArmFailSafeResponseCallback)(void * context, uint8_t errorCode, chip::CharSpan debugText); +typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallback)(void * context, uint8_t errorCode, + chip::CharSpan debugText); +typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallback)(void * context, uint8_t errorCode, + chip::CharSpan debugText); +typedef void (*GroupsClusterAddGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*GroupsClusterGetGroupMembershipResponseCallback)(void * context, uint8_t capacity, + /* TYPE WARNING: array array defaults to */ uint8_t * groupList); +typedef void (*GroupsClusterRemoveGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*GroupsClusterViewGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId, chip::CharSpan groupName); +typedef void (*IdentifyClusterIdentifyQueryResponseCallback)(void * context, uint16_t timeout); +typedef void (*KeypadInputClusterSendKeyResponseCallback)(void * context, uint8_t status); +typedef void (*MediaPlaybackClusterMediaFastForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaNextResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPauseResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPlayResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaPreviousResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaRewindResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSeekResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSkipBackwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSkipForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaStartOverResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaStopResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*NetworkCommissioningClusterConnectNetworkResponseCallback)(void * context, uint8_t NetworkingStatus, + chip::CharSpan DebugText, int32_t ErrorValue); +typedef void (*NetworkCommissioningClusterNetworkConfigResponseCallback)(void * context, uint8_t NetworkingStatus, + chip::CharSpan DebugText); +typedef void (*NetworkCommissioningClusterScanNetworksResponseCallback)( + void * context, uint8_t NetworkingStatus, chip::CharSpan DebugText, + /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults, + /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults); typedef void (*OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback)(void * context, uint8_t action, uint32_t delayedActionTime); typedef void (*OtaSoftwareUpdateProviderClusterQueryImageResponseCallback)( void * context, uint8_t status, uint32_t delayedActionTime, chip::CharSpan imageURI, uint32_t softwareVersion, chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, bool userConsentNeeded, chip::ByteSpan metadataForRequestor); +typedef void (*OperationalCredentialsClusterAttestationResponseCallback)(void * context, chip::ByteSpan AttestationElements, + chip::ByteSpan Signature); +typedef void (*OperationalCredentialsClusterCertificateChainResponseCallback)(void * context, chip::ByteSpan Certificate); +typedef void (*OperationalCredentialsClusterNOCResponseCallback)(void * context, uint8_t StatusCode, uint8_t FabricIndex, + chip::CharSpan DebugText); +typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan NOCSRElements, + chip::ByteSpan AttestationSignature); +typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t status, uint8_t capacity, uint16_t groupId, + uint8_t sceneCount, + /* TYPE WARNING: array array defaults to */ uint8_t * sceneList); +typedef void (*ScenesClusterRemoveAllScenesResponseCallback)(void * context, uint8_t status, uint16_t groupId); +typedef void (*ScenesClusterRemoveSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterStoreSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); +typedef void (*ScenesClusterViewSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId, + uint16_t transitionTime, chip::CharSpan sceneName, + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); +typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*TestClusterClusterBooleanResponseCallback)(void * context, bool value); +typedef void (*TestClusterClusterSimpleStructResponseCallback)(void * context, SimpleStruct arg1); +typedef void (*TestClusterClusterTestAddArgumentsResponseCallback)(void * context, uint8_t returnValue); +typedef void (*TestClusterClusterTestEnumsResponseCallback)(void * context, chip::VendorId arg1, uint8_t arg2); +typedef void (*TestClusterClusterTestListInt8UReverseResponseCallback)(void * context, + /* TYPE WARNING: array array defaults to */ uint8_t * arg1); +typedef void (*TestClusterClusterTestNullableOptionalResponseCallback)(void * context, bool wasPresent, bool wasNull, uint8_t value, + uint8_t originalValue); +typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); +typedef void (*ThermostatClusterGetRelayStatusLogResponseCallback)(void * context, uint16_t timeOfDay, uint16_t relayStatus, + int16_t localTemperature, uint8_t humidityInPercentage, + int16_t setpoint, uint16_t unreadEntries); +typedef void (*ThermostatClusterGetWeeklyScheduleResponseCallback)(void * context, uint8_t numberOfTransitionsForSequence, + uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + /* TYPE WARNING: array array defaults to */ uint8_t * payload); // List specific responses +void AccessControlClusterAclListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlAclListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void AccessControlClusterExtensionListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlExtensionListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void AccessControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void AccountLoginClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccountLoginAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void AdministratorCommissioningClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AdministratorCommissioningAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationLauncherApplicationLauncherListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationLauncherAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void AudioOutputClusterAudioOutputListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AudioOutputAudioOutputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void AudioOutputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AudioOutputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BarrierControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BarrierControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BasicAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BinaryInputBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BinaryInputBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BindingClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BooleanStateClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BooleanStateAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void BridgedActionsClusterActionListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsActionListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void BridgedActionsClusterEndpointListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsEndpointListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void BridgedActionsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedActionsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void BridgedDeviceBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BridgedDeviceBasicAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ChannelClusterChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelChannelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ChannelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ColorControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAcceptHeaderListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void DescriptorClusterDeviceListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorDeviceListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterServerListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorServerListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterClientListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorClientListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterPartsListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorPartsListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DescriptorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DescriptorAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void DiagnosticLogsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DiagnosticLogsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void DoorLockClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*DoorLockAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ElectricalMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ElectricalMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void EthernetNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*EthernetNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void FixedLabelClusterLabelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FixedLabelLabelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void FixedLabelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FixedLabelAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void FlowMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*FlowMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralCommissioningClusterBasicCommissioningInfoListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralCommissioningBasicCommissioningInfoListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & data); +void GeneralCommissioningClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralCommissioningAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterNetworkInterfacesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsNetworkInterfacesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & data); +void GeneralDiagnosticsClusterActiveHardwareFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveHardwareFaultsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterActiveRadioFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveRadioFaultsListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterActiveNetworkFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsActiveNetworkFaultsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GeneralDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GeneralDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupKeysListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GroupsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupsAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void IdentifyClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*IdentifyAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void IlluminanceMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*IlluminanceMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void KeypadInputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*KeypadInputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void LevelControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*LevelControlAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void LowPowerClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*LowPowerAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void MediaInputClusterMediaInputListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaInputMediaInputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void MediaInputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaInputAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void MediaPlaybackClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaPlaybackAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ModeSelectClusterSupportedModesListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ModeSelectSupportedModesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ModeSelectClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void NetworkCommissioningClusterNetworksListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*NetworkCommissioningNetworksListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OtaSoftwareUpdateProviderAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OtaSoftwareUpdateRequestorAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OccupancySensingClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OccupancySensingAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OnOffClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OnOffAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void OnOffSwitchConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OnOffSwitchConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsTrustedRootCertificatesListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void OperationalCredentialsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceActiveBatteryFaultsListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceConfigurationClusterSourcesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceConfigurationSourcesListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void PowerSourceConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PressureMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PressureMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void PumpConfigurationAndControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PumpConfigurationAndControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void RelativeHumidityMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*RelativeHumidityMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ScenesClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ScenesAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SoftwareDiagnosticsThreadMetricsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void SoftwareDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SoftwareDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void SwitchClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SwitchAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TargetNavigatorTargetNavigatorListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & data); +void TargetNavigatorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TargetNavigatorAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TemperatureMeasurementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TemperatureMeasurementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListInt8uListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListOctetStringListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void TestClusterClusterListStructOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListStructOctetStringListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void TestClusterClusterListNullablesAndOptionalsStructListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListNullablesAndOptionalsStructListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & data); +void TestClusterClusterListLongOctetStringListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterListLongOctetStringListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void TestClusterClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TestClusterAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ThermostatClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThermostatAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void ThermostatUserInterfaceConfigurationClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThermostatUserInterfaceConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ThreadNetworkDiagnosticsClusterNeighborTableListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterRouteTableListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsRouteTableListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void ThreadNetworkDiagnosticsClusterSecurityPolicyListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterOperationalDatasetComponentsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> & data); +void ThreadNetworkDiagnosticsClusterActiveNetworkFaultsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void ThreadNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ThreadNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void UserLabelClusterLabelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*UserLabelLabelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void WakeOnLanClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WakeOnLanAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +void WiFiNetworkDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WiFiNetworkDiagnosticsAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void WindowCoveringClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*WindowCoveringAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/examples/rainmaker_light/main/zap-generated/CHIPClusters.cpp b/examples/rainmaker_light/main/zap-generated/CHIPClusters.cpp index 610435b71..2d5931206 100644 --- a/examples/rainmaker_light/main/zap-generated/CHIPClusters.cpp +++ b/examples/rainmaker_light/main/zap-generated/CHIPClusters.cpp @@ -31,157 +31,182 @@ using namespace Encoding::LittleEndian; namespace Controller { // TODO(#4502): onCompletion is not used by IM for now. -// TODO(#4503): length should be passed to commands when byte string is in argument list. +// TODO(#4503): length should be passed to commands when byte string is in +// argument list. // TODO(#4503): Commands should take group id as an argument. // OtaSoftwareUpdateProvider Cluster Commands -CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t newVersion) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t newVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // newVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // newVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t softwareVersion) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t softwareVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::VendorId vendorId, - uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, - uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; +CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::VendorId vendorId, + uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, + chip::ByteSpan metadataForProvider) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::QueryImage::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + (app::CommandPathFlags::kEndpointIdValid)}; - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // vendorId: vendorId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - // productId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); - // protocolsSupported: OTADownloadProtocol - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); - // hardwareVersion: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); - // location: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); - // requestorCanConsent: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); - // metadataForProvider: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // vendorId: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); + // productId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + // protocolsSupported: OTADownloadProtocol + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); + // hardwareVersion: int16u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); + // location: charString + SuccessOrExit( + err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); + // requestorCanConsent: boolean + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); + // metadataForProvider: octetString + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); - SuccessOrExit(err = sender->FinishCommand()); + SuccessOrExit(err = sender->FinishCommand()); - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); - SuccessOrExit(err = mDevice->SendCommands(sender.get())); + SuccessOrExit(err = mDevice->SendCommands(sender.get())); - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); exit: - return err; + return err; } } // namespace Controller diff --git a/examples/rainmaker_light/main/zap-generated/CHIPClusters.h b/examples/rainmaker_light/main/zap-generated/CHIPClusters.h index 908506def..baebb9cf4 100644 --- a/examples/rainmaker_light/main/zap-generated/CHIPClusters.h +++ b/examples/rainmaker_light/main/zap-generated/CHIPClusters.h @@ -30,21 +30,28 @@ namespace chip { namespace Controller { -class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase -{ +class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { public: - OtaSoftwareUpdateProviderCluster() : ClusterBase(app::Clusters::OtaSoftwareUpdateProvider::Id) {} - ~OtaSoftwareUpdateProviderCluster() {} + OtaSoftwareUpdateProviderCluster() + : ClusterBase(app::Clusters::OtaSoftwareUpdateProvider::Id) {} + ~OtaSoftwareUpdateProviderCluster() {} - // Cluster Commands - CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t newVersion); - CHIP_ERROR NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t softwareVersion); - CHIP_ERROR QueryImage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::VendorId vendorId, uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, - uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider); + // Cluster Commands + CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t newVersion); + CHIP_ERROR NotifyUpdateApplied(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t softwareVersion); + CHIP_ERROR QueryImage(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::VendorId vendorId, uint16_t productId, + uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, + bool requestorCanConsent, + chip::ByteSpan metadataForProvider); }; } // namespace Controller diff --git a/examples/rainmaker_light/main/zap-generated/IMClusterCommandHandler.cpp b/examples/rainmaker_light/main/zap-generated/IMClusterCommandHandler.cpp deleted file mode 100644 index f33546975..000000000 --- a/examples/rainmaker_light/main/zap-generated/IMClusterCommandHandler.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Currently we need some work to keep compatible with ember lib. -#include - -namespace chip { -namespace app { - -// Cluster specific command parsing - -namespace Clusters { - -namespace AdministratorCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::OpenBasicCommissioningWindow::Id: { - Commands::OpenBasicCommissioningWindow::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( - apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OpenCommissioningWindow::Id: { - Commands::OpenCommissioningWindow::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback(apCommandObj, aCommandPath, - commandData); - } - break; - } - case Commands::RevokeCommissioning::Id: { - Commands::RevokeCommissioning::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace AdministratorCommissioning - -namespace ColorControl { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ColorLoopSet::Id: { - Commands::ColorLoopSet::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterColorLoopSetCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveHue::Id: { - Commands::EnhancedMoveHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedMoveHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveToHue::Id: { - Commands::EnhancedMoveToHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedMoveToHueAndSaturation::Id: { - Commands::EnhancedMoveToHueAndSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::EnhancedStepHue::Id: { - Commands::EnhancedStepHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveColor::Id: { - Commands::MoveColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveColorTemperature::Id: { - Commands::MoveColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveHue::Id: { - Commands::MoveHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveSaturation::Id: { - Commands::MoveSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToColor::Id: { - Commands::MoveToColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToColorTemperature::Id: { - Commands::MoveToColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToHue::Id: { - Commands::MoveToHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToHueAndSaturation::Id: { - Commands::MoveToHueAndSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToSaturation::Id: { - Commands::MoveToSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepColor::Id: { - Commands::StepColor::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepColorTemperature::Id: { - Commands::StepColorTemperature::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepColorTemperatureCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepHue::Id: { - Commands::StepHue::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepSaturation::Id: { - Commands::StepSaturation::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StopMoveStep::Id: { - Commands::StopMoveStep::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace ColorControl - -namespace DiagnosticLogs { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::RetrieveLogsRequest::Id: { - Commands::RetrieveLogsRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace DiagnosticLogs - -namespace GeneralCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ArmFailSafe::Id: { - Commands::ArmFailSafe::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::CommissioningComplete::Id: { - Commands::CommissioningComplete::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::SetRegulatoryConfig::Id: { - Commands::SetRegulatoryConfig::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace GeneralCommissioning - -namespace Identify { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Identify::Id: { - Commands::Identify::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterIdentifyCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::IdentifyQuery::Id: { - Commands::IdentifyQuery::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterIdentifyQueryCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::TriggerEffect::Id: { - Commands::TriggerEffect::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfIdentifyClusterTriggerEffectCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace Identify - -namespace LevelControl { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Move::Id: { - Commands::Move::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToLevel::Id: { - Commands::MoveToLevel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveToLevelWithOnOff::Id: { - Commands::MoveToLevelWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::MoveWithOnOff::Id: { - Commands::MoveWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Step::Id: { - Commands::Step::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StepWithOnOff::Id: { - Commands::StepWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Stop::Id: { - Commands::Stop::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::StopWithOnOff::Id: { - Commands::StopWithOnOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace LevelControl - -namespace NetworkCommissioning { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddOrUpdateThreadNetwork::Id: { - Commands::AddOrUpdateThreadNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfNetworkCommissioningClusterAddOrUpdateThreadNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AddOrUpdateWiFiNetwork::Id: { - Commands::AddOrUpdateWiFiNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfNetworkCommissioningClusterAddOrUpdateWiFiNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ConnectNetwork::Id: { - Commands::ConnectNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterConnectNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveNetwork::Id: { - Commands::RemoveNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ReorderNetwork::Id: { - Commands::ReorderNetwork::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterReorderNetworkCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ScanNetworks::Id: { - Commands::ScanNetworks::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace NetworkCommissioning - -namespace OtaSoftwareUpdateProvider { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ApplyUpdateResponse::Id: { - expectArgumentCount = 2; - uint8_t action; - uint32_t delayedActionTime; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(action); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( - aCommandPath.mEndpointId, apCommandObj, action, delayedActionTime); - } - break; - } - case Commands::QueryImageResponse::Id: { - expectArgumentCount = 8; - uint8_t status; - uint32_t delayedActionTime; - chip::CharSpan imageURI; - uint32_t softwareVersion; - chip::CharSpan softwareVersionString; - chip::ByteSpan updateToken; - bool userConsentNeeded; - chip::ByteSpan metadataForRequestor; - bool argExists[8]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 8) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - case 2: - TLVUnpackError = aDataTlv.Get(imageURI); - break; - case 3: - TLVUnpackError = aDataTlv.Get(softwareVersion); - break; - case 4: - TLVUnpackError = aDataTlv.Get(softwareVersionString); - break; - case 5: - TLVUnpackError = aDataTlv.Get(updateToken); - break; - case 6: - TLVUnpackError = aDataTlv.Get(userConsentNeeded); - break; - case 7: - TLVUnpackError = aDataTlv.Get(metadataForRequestor); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( - aCommandPath.mEndpointId, apCommandObj, status, delayedActionTime, imageURI, softwareVersion, - softwareVersionString, updateToken, userConsentNeeded, metadataForRequestor); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace OtaSoftwareUpdateProvider - -namespace OtaSoftwareUpdateRequestor { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AnnounceOtaProvider::Id: { - Commands::AnnounceOtaProvider::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OtaSoftwareUpdateRequestor - -namespace OnOff { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Off::Id: { - Commands::Off::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OffWithEffect::Id: { - Commands::OffWithEffect::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOffWithEffectCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::On::Id: { - Commands::On::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OnWithRecallGlobalScene::Id: { - Commands::OnWithRecallGlobalScene::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnWithRecallGlobalSceneCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OnWithTimedOff::Id: { - Commands::OnWithTimedOff::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterOnWithTimedOffCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Toggle::Id: { - Commands::Toggle::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OnOff - -namespace OperationalCredentials { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddNOC::Id: { - Commands::AddNOC::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AddTrustedRootCertificate::Id: { - Commands::AddTrustedRootCertificate::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::AttestationRequest::Id: { - Commands::AttestationRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::CertificateChainRequest::Id: { - Commands::CertificateChainRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::OpCSRRequest::Id: { - Commands::OpCSRRequest::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveFabric::Id: { - Commands::RemoveFabric::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::RemoveTrustedRootCertificate::Id: { - Commands::RemoveTrustedRootCertificate::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(apCommandObj, aCommandPath, - commandData); - } - break; - } - case Commands::UpdateFabricLabel::Id: { - Commands::UpdateFabricLabel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::UpdateNOC::Id: { - Commands::UpdateNOC::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace OperationalCredentials - -namespace SoftwareDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetWatermarks::Id: { - Commands::ResetWatermarks::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace SoftwareDiagnostics - -namespace ThreadNetworkDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetCounts::Id: { - Commands::ResetCounts::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace ThreadNetworkDiagnostics - -namespace WiFiNetworkDiagnostics { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ResetCounts::Id: { - Commands::ResetCounts::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace WiFiNetworkDiagnostics - -} // namespace Clusters - -void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) -{ - Compatibility::SetupEmberAfCommandHandler(apCommandObj, aCommandPath); - - switch (aCommandPath.mClusterId) - { - case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OtaSoftwareUpdateRequestor::Id: - Clusters::OtaSoftwareUpdateRequestor::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; - default: - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCluster); - break; - } - - Compatibility::ResetEmberAfObjects(); -} - -void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, - CommandSender * apCommandObj) -{ - Compatibility::SetupEmberAfCommandSender(apCommandObj, aCommandPath); - - TLV::TLVType dataTlvType; - SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aCommandPath.mClusterId) - { - case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandPath, aReader); - break; - default: - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); - break; - } - -exit: - aReader.ExitContainer(dataTlvType); - Compatibility::ResetEmberAfObjects(); -} - -} // namespace app -} // namespace chip diff --git a/examples/rainmaker_light/main/zap-generated/PluginApplicationCallbacks.h b/examples/rainmaker_light/main/zap-generated/PluginApplicationCallbacks.h index 219beb967..fc04c756a 100644 --- a/examples/rainmaker_light/main/zap-generated/PluginApplicationCallbacks.h +++ b/examples/rainmaker_light/main/zap-generated/PluginApplicationCallbacks.h @@ -21,23 +21,20 @@ #include -#define MATTER_PLUGINS_INIT \ - MatterAdministratorCommissioningPluginServerInitCallback(); \ - MatterBasicPluginServerInitCallback(); \ - MatterColorControlPluginServerInitCallback(); \ - MatterDescriptorPluginServerInitCallback(); \ - MatterDiagnosticLogsPluginServerInitCallback(); \ - MatterFixedLabelPluginServerInitCallback(); \ - MatterGeneralCommissioningPluginServerInitCallback(); \ - MatterGeneralDiagnosticsPluginServerInitCallback(); \ - MatterIdentifyPluginServerInitCallback(); \ - MatterLevelControlPluginServerInitCallback(); \ - MatterNetworkCommissioningPluginServerInitCallback(); \ - MatterOtaSoftwareUpdateProviderPluginClientInitCallback(); \ - MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ - MatterOnOffPluginServerInitCallback(); \ - MatterOperationalCredentialsPluginServerInitCallback(); \ - MatterSoftwareDiagnosticsPluginServerInitCallback(); \ - MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ - MatterUserLabelPluginServerInitCallback(); \ - MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); +#define MATTER_PLUGINS_INIT \ + MatterAdministratorCommissioningPluginServerInitCallback(); \ + MatterBasicPluginServerInitCallback(); \ + MatterColorControlPluginServerInitCallback(); \ + MatterDescriptorPluginServerInitCallback(); \ + MatterGeneralCommissioningPluginServerInitCallback(); \ + MatterGeneralDiagnosticsPluginServerInitCallback(); \ + MatterGroupKeyManagementPluginServerInitCallback(); \ + MatterGroupsPluginServerInitCallback(); \ + MatterIdentifyPluginServerInitCallback(); \ + MatterLevelControlPluginServerInitCallback(); \ + MatterNetworkCommissioningPluginServerInitCallback(); \ + MatterOtaSoftwareUpdateProviderPluginClientInitCallback(); \ + MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ + MatterOnOffPluginServerInitCallback(); \ + MatterOperationalCredentialsPluginServerInitCallback(); \ + MatterScenesPluginServerInitCallback(); diff --git a/examples/rainmaker_light/main/zap-generated/callback-stub.cpp b/examples/rainmaker_light/main/zap-generated/callback-stub.cpp index 8285b4676..659182e0d 100644 --- a/examples/rainmaker_light/main/zap-generated/callback-stub.cpp +++ b/examples/rainmaker_light/main/zap-generated/callback-stub.cpp @@ -25,257 +25,242 @@ using namespace chip; // Cluster Init Functions -void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) -{ - switch (clusterId) - { - case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: - emberAfAdministratorCommissioningClusterInitCallback(endpoint); - break; - case ZCL_BASIC_CLUSTER_ID: - emberAfBasicClusterInitCallback(endpoint); - break; - case ZCL_COLOR_CONTROL_CLUSTER_ID: - emberAfColorControlClusterInitCallback(endpoint); - break; - case ZCL_DESCRIPTOR_CLUSTER_ID: - emberAfDescriptorClusterInitCallback(endpoint); - break; - case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID: - emberAfDiagnosticLogsClusterInitCallback(endpoint); - break; - case ZCL_FIXED_LABEL_CLUSTER_ID: - emberAfFixedLabelClusterInitCallback(endpoint); - break; - case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: - emberAfGeneralCommissioningClusterInitCallback(endpoint); - break; - case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: - emberAfGeneralDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_IDENTIFY_CLUSTER_ID: - emberAfIdentifyClusterInitCallback(endpoint); - break; - case ZCL_LEVEL_CONTROL_CLUSTER_ID: - emberAfLevelControlClusterInitCallback(endpoint); - break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: - emberAfNetworkCommissioningClusterInitCallback(endpoint); - break; - case ZCL_OTA_PROVIDER_CLUSTER_ID: - emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); - break; - case ZCL_OTA_REQUESTOR_CLUSTER_ID: - emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); - break; - case ZCL_ON_OFF_CLUSTER_ID: - emberAfOnOffClusterInitCallback(endpoint); - break; - case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: - emberAfOperationalCredentialsClusterInitCallback(endpoint); - break; - case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: - emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); - break; - case ZCL_USER_LABEL_CLUSTER_ID: - emberAfUserLabelClusterInitCallback(endpoint); - break; - case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); - break; - default: - // Unrecognized cluster ID - break; - } +void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { + switch (clusterId) { + case ZCL_ACCESS_CONTROL_CLUSTER_ID: + emberAfAccessControlClusterInitCallback(endpoint); + break; + case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: + emberAfAdministratorCommissioningClusterInitCallback(endpoint); + break; + case ZCL_BASIC_CLUSTER_ID: + emberAfBasicClusterInitCallback(endpoint); + break; + case ZCL_COLOR_CONTROL_CLUSTER_ID: + emberAfColorControlClusterInitCallback(endpoint); + break; + case ZCL_DESCRIPTOR_CLUSTER_ID: + emberAfDescriptorClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: + emberAfGeneralCommissioningClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + emberAfGeneralDiagnosticsClusterInitCallback(endpoint); + break; + case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: + emberAfGroupKeyManagementClusterInitCallback(endpoint); + break; + case ZCL_GROUPS_CLUSTER_ID: + emberAfGroupsClusterInitCallback(endpoint); + break; + case ZCL_IDENTIFY_CLUSTER_ID: + emberAfIdentifyClusterInitCallback(endpoint); + break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + emberAfLevelControlClusterInitCallback(endpoint); + break; + case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: + emberAfNetworkCommissioningClusterInitCallback(endpoint); + break; + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); + break; + case ZCL_OTA_REQUESTOR_CLUSTER_ID: + emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); + break; + case ZCL_ON_OFF_CLUSTER_ID: + emberAfOnOffClusterInitCallback(endpoint); + break; + case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: + emberAfOperationalCredentialsClusterInitCallback(endpoint); + break; + case ZCL_SCENES_CLUSTER_ID: + emberAfScenesClusterInitCallback(endpoint); + break; + default: + // Unrecognized cluster ID + break; + } } -void __attribute__((weak)) emberAfAdministratorCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfAccessControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfBasicClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfAdministratorCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfBasicClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfDescriptorClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfColorControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfDiagnosticLogsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfDescriptorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfFixedLabelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGroupKeyManagementClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfGroupsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfLevelControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfIdentifyClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfLevelControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateRequestorClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOtaSoftwareUpdateRequestorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOnOffClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } -void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} -void __attribute__((weak)) emberAfUserLabelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} -void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; +void __attribute__((weak)) +emberAfScenesClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; } // // Non-Cluster Related Callbacks // -void __attribute__((weak)) emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} +void __attribute__((weak)) +emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} -void __attribute__((weak)) emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} +void __attribute__((weak)) +emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} EmberAfAttributeWritePermission __attribute__((weak)) -emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t * value, uint8_t type) -{ - return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default +emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, + ClusterId clusterId, + AttributeId attributeId, uint8_t mask, + uint16_t manufacturerCode, + uint8_t *value, uint8_t type) { + return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default } bool __attribute__((weak)) -emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId) -{ - return true; +emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; } bool __attribute__((weak)) -emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, uint16_t manufacturerCode, AttributeId attributeId) -{ - return true; -} - -bool __attribute__((weak)) emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status) -{ - return false; -} - -bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status) -{ - return false; -} - -bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) -{ - return false; -} - -EmberAfStatus __attribute__((weak)) -emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata, - uint16_t manufacturerCode, uint8_t * buffer, uint16_t maxReadLength) -{ - return EMBER_ZCL_STATUS_FAILURE; -} - -EmberAfStatus __attribute__((weak)) -emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * attributeMetadata, - uint16_t manufacturerCode, uint8_t * buffer) -{ - return EMBER_ZCL_STATUS_FAILURE; -} - -uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() -{ - return 0; +emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; } bool __attribute__((weak)) -emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo) -{ - return false; +emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, + EmberAfStatus status) { + return false; +} + +bool __attribute__((weak)) +emberAfPreMessageSendCallback(EmberAfMessageStruct *messageStruct, + EmberStatus *status) { + return false; +} + +bool __attribute__((weak)) +emberAfMessageSentCallback(const MessageSendDestination &destination, + EmberApsFrame *apsFrame, uint16_t msgLen, + uint8_t *message, EmberStatus status) { + return false; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer, uint16_t maxReadLength) { + return EMBER_ZCL_STATUS_FAILURE; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer) { + return EMBER_ZCL_STATUS_FAILURE; +} + +uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() { return 0; } + +bool __attribute__((weak)) +emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t *returnNetworkIndex, + EmberAfEndpointInfoStruct *returnEndpointInfo) { + return false; } void __attribute__((weak)) emberAfRegistrationAbortCallback() {} EmberStatus __attribute__((weak)) -emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message) -{ - return EMBER_LIBRARY_NOT_PRESENT; +emberAfInterpanSendMessageCallback(EmberAfInterpanHeader *header, + uint16_t messageLength, uint8_t *message) { + return EMBER_LIBRARY_NOT_PRESENT; } -bool __attribute__((weak)) emberAfStartMoveCallback() -{ - return false; -} +bool __attribute__((weak)) emberAfStartMoveCallback() { return false; } chip::Protocols::InteractionModel::Status __attribute__((weak)) -MatterPreAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, uint16_t size, - uint8_t * value) -{ - return chip::Protocols::InteractionModel::Status::Success; +MatterPreAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) { + return chip::Protocols::InteractionModel::Status::Success; } -void __attribute__((weak)) MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, - uint8_t type, uint16_t size, uint8_t * value) -{} +void __attribute__((weak)) MatterPostAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) {} diff --git a/examples/rainmaker_light/main/zap-generated/endpoint_config.h b/examples/rainmaker_light/main/zap-generated/endpoint_config.h index a5cfcb7c5..cfe8b48f3 100644 --- a/examples/rainmaker_light/main/zap-generated/endpoint_config.h +++ b/examples/rainmaker_light/main/zap-generated/endpoint_config.h @@ -20,930 +20,49 @@ // Prevent multiple inclusion #pragma once -// Default values for the attributes longer than a pointer, -// in a form of a binary blob -// Separate block is generated for big-endian and little-endian cases. -#if BIGENDIAN_CPU -#define GENERATED_DEFAULTS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server), big-endian */ \ - \ - /* 0 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ - \ - /* 4 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 12 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 266 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x06, \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ - \ - /* 270 - Networks, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 282 - LastConnectErrorValue, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 286 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ - \ - /* 290 - UpTime, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 298 - TotalOperationalHours, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ - \ - /* 302 - CurrentHeapFree, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 310 - CurrentHeapUsed, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 318 - CurrentHeapHighWatermark, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 326 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ - \ - /* 330 - NetworkName, */ \ - 0x00, 0x00, \ - \ - /* 332 - ExtendedPanId, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 340 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 348 - PartitionId, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 352 - TxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 356 - TxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 360 - TxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 364 - TxAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 368 - TxAckedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 372 - TxNoAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 376 - TxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 380 - TxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 384 - TxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 388 - TxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 392 - TxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 396 - TxRetryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 400 - TxDirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 404 - TxIndirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 408 - TxErrCcaCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 412 - TxErrAbortCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 416 - TxErrBusyChannelCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 420 - RxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 424 - RxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 428 - RxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 432 - RxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 436 - RxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 440 - RxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 444 - RxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 448 - RxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 452 - RxAddressFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 456 - RxDestAddrFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 460 - RxDuplicatedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 464 - RxErrNoFrameCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 468 - RxErrUnknownNeighborCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 472 - RxErrInvalidSrcAddrCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 476 - RxErrSecCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 480 - RxErrFcsCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 484 - RxErrOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 488 - ActiveTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 496 - PendingTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 504 - delay, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 508 - ChannelMask, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 515 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x0F, \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x03, \ - \ - /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ - \ - /* 563 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - } +#define GENERATED_ATTRIBUTES \ + {} -#else // !BIGENDIAN_CPU -#define GENERATED_DEFAULTS \ - { \ - \ - /* Endpoint: 0, Cluster: Basic (server), little-endian */ \ - \ - /* 0 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ - \ - /* 4 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 12 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 266 - FeatureMap, */ \ - 0x06, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ - \ - /* 270 - Networks, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 282 - LastConnectErrorValue, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 286 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ - \ - /* 290 - UpTime, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 298 - TotalOperationalHours, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ - \ - /* 302 - CurrentHeapFree, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 310 - CurrentHeapUsed, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 318 - CurrentHeapHighWatermark, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 326 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ - \ - /* 330 - NetworkName, */ \ - 0x00, 0x00, \ - \ - /* 332 - ExtendedPanId, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 340 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 348 - PartitionId, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 352 - TxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 356 - TxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 360 - TxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 364 - TxAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 368 - TxAckedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 372 - TxNoAckRequestedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 376 - TxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 380 - TxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 384 - TxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 388 - TxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 392 - TxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 396 - TxRetryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 400 - TxDirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 404 - TxIndirectMaxRetryExpiryCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 408 - TxErrCcaCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 412 - TxErrAbortCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 416 - TxErrBusyChannelCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 420 - RxTotalCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 424 - RxUnicastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 428 - RxBroadcastCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 432 - RxDataCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 436 - RxDataPollCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 440 - RxBeaconCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 444 - RxBeaconRequestCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 448 - RxOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 452 - RxAddressFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 456 - RxDestAddrFilteredCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 460 - RxDuplicatedCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 464 - RxErrNoFrameCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 468 - RxErrUnknownNeighborCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 472 - RxErrInvalidSrcAddrCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 476 - RxErrSecCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 480 - RxErrFcsCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 484 - RxErrOtherCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 488 - ActiveTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 496 - PendingTimestamp, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 504 - delay, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 508 - ChannelMask, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 515 - FeatureMap, */ \ - 0x0F, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x03, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ - \ - /* 563 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - } +#define GENERATED_CLUSTERS \ + {} -#endif // BIGENDIAN_CPU - -#define GENERATED_DEFAULTS_COUNT (66) - -#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE -#define ZAP_LONG_DEFAULTS_INDEX(index) \ - { \ - &generatedDefaults[index] \ - } -#define ZAP_MIN_MAX_DEFAULTS_INDEX(index) \ - { \ - &minMaxDefaults[index] \ - } -#define ZAP_EMPTY_DEFAULT() \ - { \ - (uint16_t) 0 \ - } -#define ZAP_SIMPLE_DEFAULT(x) \ - { \ - (uint16_t) x \ - } - -// This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 3 -#define GENERATED_MIN_MAX_DEFAULTS \ - { \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFE }, /* identify time */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* options */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { \ - (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF \ - } /* start up color temperature mireds */ \ - } - -#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask -// This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 205 -#define GENERATED_ATTRIBUTES \ - { \ - \ - /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x0002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x0003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* InteractionModelVersion */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductName */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductID */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* NodeLabel */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 3, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* Location */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ - { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(0) }, /* SoftwareVersion */ \ - { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ - { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SerialNumber */ \ - { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ - { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ - { 0x0012, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* UniqueID */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* default ota provider */ \ - { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(12) }, /* BasicCommissioningInfoList */ \ - { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ - { 0x0003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(266) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x0001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(270) }, /* Networks */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ - { 0x0004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ - { 0x0006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* LastConnectErrorValue */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(290) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(298) }, /* TotalOperationalHours */ \ - { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ - { 0x0005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ - { 0x0006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ - { 0x0007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaults */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(302) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(310) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(318) }, /* CurrentHeapHighWatermark */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(326) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(330) }, /* NetworkName */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* PartitionId */ \ - { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ - { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ - { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ - { 0x000D, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LeaderRouterId */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* DetachedRoleCount */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChildRoleCount */ \ - { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RouterRoleCount */ \ - { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* LeaderRoleCount */ \ - { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* AttachAttemptCount */ \ - { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ - { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ - { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(368) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(376) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(384) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(388) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(392) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(396) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(400) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(404) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(408) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(420) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(424) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(428) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(432) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(436) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(440) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(444) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(448) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(452) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(456) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(460) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(464) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(468) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(472) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(476) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(480) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(484) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(488) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(496) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(504) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(508) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(515) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_EMPTY_DEFAULT() }, /* bssid */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ - { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ - { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(519) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(523) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(527) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(531) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(539) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(543) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(551) }, /* OverrunCount */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(559) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ - { 0x0001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x0002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ - { 0x0004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* TrustedRootCertificates */ \ - { 0x0005, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* CurrentFabricIndex */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(0) }, /* identify time */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* identify type */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ - { 0x4000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* GlobalSceneControl */ \ - { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ - { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ - { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Level Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ - { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* max level */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ - { 0x0005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ - { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ - { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* options */ \ - { 0x0010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ - { 0x0011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_SIMPLE_DEFAULT(0xFE) }, /* on level */ \ - { 0x0012, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* on transition time */ \ - { 0x0013, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* off transition time */ \ - { 0x0014, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_EMPTY_DEFAULT() }, /* default move rate */ \ - { 0x4000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* start up current level */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x0002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x0003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ - \ - /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current hue */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current saturation */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ - { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ - { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ - { 0x0010, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* number of primaries */ \ - { 0x4000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* enhanced current hue */ \ - { 0x4001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* enhanced color mode */ \ - { 0x4002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop active */ \ - { 0x4003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop direction */ \ - { 0x4004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0019) }, /* color loop time */ \ - { 0x4005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x2300) }, /* color loop start enhanced hue */ \ - { 0x4006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color loop stored enhanced hue */ \ - { 0x400A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color capabilities */ \ - { 0x400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color temp physical min */ \ - { 0x400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* color temp physical max */ \ - { 0x400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* couple color temp to level min-mireds */ \ - { 0x4010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* start up color temperature mireds */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ - } - -// This is an array of EmberAfCluster structures. -#define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index])) - -// Cluster function static arrays -#define GENERATED_FUNCTION_ARRAYS \ - const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \ - (EmberAfGenericClusterFunction) emberAfBasicClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayIdentifyServer[] = { \ - (EmberAfGenericClusterFunction) emberAfIdentifyClusterServerInitCallback, \ - (EmberAfGenericClusterFunction) MatterIdentifyClusterServerAttributeChangedCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ - (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ - (EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ - (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ - }; - -#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 20 -#define GENERATED_CLUSTERS \ - { \ - { 0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(5), \ - 20, \ - 687, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x0029, ZAP_ATTRIBUTE_INDEX(25), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ - { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(25), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(28), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(34), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(44), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(44), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(53), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(59), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(124), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(139), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(143), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(149), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(151), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(153), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(156), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(163), \ - 15, \ - 23, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(178), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(183), \ - 22, \ - 36, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ - } - -#define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) - -// This is an array of EmberAfEndpointType structures. -#define GENERATED_ENDPOINT_TYPES \ - { \ - { ZAP_CLUSTER_INDEX(0), 15, 1399 }, { ZAP_CLUSTER_INDEX(15), 5, 77 }, \ - } +#define GENERATED_ENDPOINT_TYPES \ + {} // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (401) -// Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (687) - // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1476) +#define ATTRIBUTE_MAX_SIZE (0) // Number of fixed endpoints -#define FIXED_ENDPOINT_COUNT (2) +#define FIXED_ENDPOINT_COUNT (0) +#ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#endif +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) // Array of endpoints that are supported, the data inside // the array is the endpoint number. -#define FIXED_ENDPOINT_ARRAY \ - { \ - 0x0000, 0x0001 \ - } +#define FIXED_ENDPOINT_ARRAY \ + {0} // Array of profile ids -#define FIXED_PROFILE_IDS \ - { \ - 0x0103, 0x0103 \ - } +#define FIXED_PROFILE_IDS \ + {0} // Array of device ids -#define FIXED_DEVICE_IDS \ - { \ - 22, 257 \ - } +#define FIXED_DEVICE_IDS \ + {0} // Array of device versions -#define FIXED_DEVICE_VERSIONS \ - { \ - 1, 1 \ - } +#define FIXED_DEVICE_VERSIONS \ + {0} // Array of endpoint types supported on each endpoint -#define FIXED_ENDPOINT_TYPES \ - { \ - 0, 1 \ - } +#define FIXED_ENDPOINT_TYPES \ + {0} // Array of networks supported on each endpoint -#define FIXED_NETWORKS \ - { \ - 0, 0 \ - } +#define FIXED_NETWORKS \ + {0} diff --git a/examples/rainmaker_light/main/zap-generated/gen_config.h b/examples/rainmaker_light/main/zap-generated/gen_config.h index 3344d49cf..de53fb975 100644 --- a/examples/rainmaker_light/main/zap-generated/gen_config.h +++ b/examples/rainmaker_light/main/zap-generated/gen_config.h @@ -29,29 +29,35 @@ #define EMBER_APS_UNICAST_MESSAGE_COUNT 10 /**** Cluster endpoint counts ****/ +#define EMBER_AF_ACCESS_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define EMBER_AF_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_FIXED_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_USER_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ -// Use this macro to check if the server side of the AdministratorCommissioning cluster is included +// Use this macro to check if the server side of the Access Control cluster is +// included +#define ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL + +// Use this macro to check if the server side of the AdministratorCommissioning +// cluster is included #define ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING @@ -61,7 +67,8 @@ #define EMBER_AF_PLUGIN_BASIC_SERVER #define EMBER_AF_PLUGIN_BASIC -// Use this macro to check if the server side of the Color Control cluster is included +// Use this macro to check if the server side of the Color Control cluster is +// included #define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL @@ -70,37 +77,43 @@ #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV -// Use this macro to check if the server side of the Descriptor cluster is included +// Use this macro to check if the server side of the Descriptor cluster is +// included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_DESCRIPTOR_SERVER #define EMBER_AF_PLUGIN_DESCRIPTOR -// Use this macro to check if the server side of the Diagnostic Logs cluster is included -#define ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS_SERVER -#define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS - -// Use this macro to check if the server side of the Fixed Label cluster is included -#define ZCL_USING_FIXED_LABEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_FIXED_LABEL_SERVER -#define EMBER_AF_PLUGIN_FIXED_LABEL - -// Use this macro to check if the server side of the General Commissioning cluster is included +// Use this macro to check if the server side of the General Commissioning +// cluster is included #define ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING -// Use this macro to check if the server side of the General Diagnostics cluster is included +// Use this macro to check if the server side of the General Diagnostics cluster +// is included #define ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS -// Use this macro to check if the server side of the Identify cluster is included +// Use this macro to check if the server side of the Group Key Management +// cluster is included +#define ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT + +// Use this macro to check if the server side of the Groups cluster is included +#define ZCL_USING_GROUPS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUPS_SERVER +#define EMBER_AF_PLUGIN_GROUPS + +// Use this macro to check if the server side of the Identify cluster is +// included #define ZCL_USING_IDENTIFY_CLUSTER_SERVER #define EMBER_AF_PLUGIN_IDENTIFY_SERVER #define EMBER_AF_PLUGIN_IDENTIFY -// Use this macro to check if the server side of the Level Control cluster is included +// Use this macro to check if the server side of the Level Control cluster is +// included #define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER #define EMBER_AF_PLUGIN_LEVEL_CONTROL @@ -109,16 +122,19 @@ #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 +// 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 client side of the OTA Software Update Provider cluster is included +// Use this macro to check if the client side of the OTA Software Update +// Provider cluster is included #define ZCL_USING_OTA_PROVIDER_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_CLIENT -// Use this macro to check if the server side of the OTA Software Update Requestor cluster is included +// Use this macro to check if the server side of the OTA Software Update +// Requestor cluster is included #define ZCL_USING_OTA_REQUESTOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR_SERVER #define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR @@ -128,27 +144,15 @@ #define EMBER_AF_PLUGIN_ON_OFF_SERVER #define EMBER_AF_PLUGIN_ON_OFF -// Use this macro to check if the server side of the Operational Credentials cluster is included +// Use this macro to check if the server side of the Operational Credentials +// cluster is included #define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS -// Use this macro to check if the server side of the Software Diagnostics cluster is included -#define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS - -// Use this macro to check if the server side of the Thread Network Diagnostics cluster is included -#define ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS - -// Use this macro to check if the server side of the User Label cluster is included -#define ZCL_USING_USER_LABEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_USER_LABEL_SERVER -#define EMBER_AF_PLUGIN_USER_LABEL - -// Use this macro to check if the server side of the WiFi Network Diagnostics cluster is included -#define ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS +// Use this macro to check if the server side of the Scenes cluster is included +#define ZCL_USING_SCENES_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_SCENES_SERVER +#define EMBER_AF_PLUGIN_SCENES +// User options for server plugin Scenes +#define EMBER_AF_PLUGIN_SCENES_TABLE_SIZE 3 diff --git a/examples/rainmaker_light/main/zap-generated/gen_tokens.h b/examples/rainmaker_light/main/zap-generated/gen_tokens.h index 860bf575d..9579330d7 100644 --- a/examples/rainmaker_light/main/zap-generated/gen_tokens.h +++ b/examples/rainmaker_light/main/zap-generated/gen_tokens.h @@ -33,13 +33,11 @@ #endif // DEFINETOKENS // Macro snippet that loads all the attributes from tokens -#define GENERATED_TOKEN_LOADER(endpoint) \ - do \ - { \ - } while (false) +#define GENERATED_TOKEN_LOADER(endpoint) \ + do { \ + } while (false) // Macro snippet that saves the attribute to token -#define GENERATED_TOKEN_SAVER \ - do \ - { \ - } while (false) +#define GENERATED_TOKEN_SAVER \ + do { \ + } while (false) diff --git a/examples/rainmaker_light/sdkconfig.defaults.esp32s2 b/examples/rainmaker_light/sdkconfig.defaults.esp32s2 new file mode 100644 index 000000000..10be192a6 --- /dev/null +++ b/examples/rainmaker_light/sdkconfig.defaults.esp32s2 @@ -0,0 +1,34 @@ +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +# mbedtls +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# Temporary Fix for Timer Overflows +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120 + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Disable BLE +CONFIG_ENABLE_CHIPOBLE=n diff --git a/examples/zap_light/CMakeLists.txt b/examples/zap_light/CMakeLists.txt new file mode 100644 index 000000000..b9f8d18d1 --- /dev/null +++ b/examples/zap_light/CMakeLists.txt @@ -0,0 +1,42 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +if(NOT DEFINED ENV{ESP_MATTER_PATH}) + message(FATAL_ERROR "Please set ESP_MATTER_PATH to the path of esp-matter repo") +endif(NOT DEFINED ENV{ESP_MATTER_PATH}) + +if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) + if("${IDF_TARGET}" STREQUAL "esp32" OR "${IDF_TARGET}" STREQUAL "") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32_devkit_c) + elseif("${IDF_TARGET}" STREQUAL "esp32c3") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c3_devkit_m) + elseif("${IDF_TARGET}" STREQUAL "esp32h2") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32h2_devkit_c) + elseif("${IDF_TARGET}" STREQUAL "esp32s2") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32s2_devkit_c) + else() + message(FATAL_ERROR "Unsupported IDF_TARGET") + endif() +endif(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) + +set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH}) +set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip) +set(ZAP_GENERATED_PATH ${ESP_MATTER_PATH}/examples/zap_light/main/zap-generated) + +# This should be done before using the IDF_TARGET variable. +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) + +set(EXTRA_COMPONENT_DIRS + "../common" + "${IDF_PATH}/examples/common_components" + "${MATTER_SDK_PATH}/config/esp32/components" + "${ESP_MATTER_PATH}/components" + "${ESP_MATTER_PATH}/device_hal/device" + ${extra_components_dirs_append}) + +project(zap_light) + +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/zap_light/README.md b/examples/zap_light/README.md new file mode 100644 index 000000000..cd638aafa --- /dev/null +++ b/examples/zap_light/README.md @@ -0,0 +1,62 @@ +# Light Example + +## Building and Flashing the Firmware + +See the [README.md](../../README.md) file for more information about building and flashing the firmware. + + +## What to expect in this example? + +The example provides a minimal implementation to build a Matter light device on ESP32 series SoCs. + +Supported features: + - Matter Commissioning + - On/Off, Brightness and Color (on ESP32-C3 for now) control + - (Optional) Interactive shell + +### Useful shell commands + +- BLE commands + +``` +> matter ble +``` + +Set and get the BLE advertisement state. + +- Wi-Fi commands + +``` +> matter wifi mode [disable|ap|sta] +``` + +Set and get the Wi-Fi mode. + +``` +> matter wifi connect +``` + +Connect to Wi-Fi network. + +- Device configuration + +``` +> matter config +``` + +Dump the device static configuration + + +- Facotry reset + +``` +> matter device factoryreset +``` + +- On-boarding codes + +``` +> matter onboardingcodes +``` + +Dump the on-boarding pairing code payloads. diff --git a/examples/zap_light/main/CMakeLists.txt b/examples/zap_light/main/CMakeLists.txt new file mode 100644 index 000000000..eb7cb7079 --- /dev/null +++ b/examples/zap_light/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_openthread) + +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "." + PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/zap_light/main/app_driver.cpp b/examples/zap_light/main/app_driver.cpp new file mode 100644 index 000000000..080eaf3d3 --- /dev/null +++ b/examples/zap_light/main/app_driver.cpp @@ -0,0 +1,160 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include + +static const char *TAG = "app_driver"; + +#define STANDARD_BRIGHTNESS 100 +#define STANDARD_HUE 360 +#define STANDARD_SATURATION 100 +#define STANDARD_TEMPERATURE 100 + +#define MATTER_BRIGHTNESS 255 +#define MATTER_HUE 255 +#define MATTER_SATURATION 255 +#define MATTER_TEMPERATURE 255 + +static uint32_t app_driver_light_get_attribute(int endpoint_id, int cluster_id, int attribute_id) +{ + uint32_t value = 0; + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + value = (uint32_t)light_driver_get_power(); + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + value = (uint32_t)light_driver_get_brightness(); + value = REMAP_TO_RANGE(value, STANDARD_BRIGHTNESS, MATTER_BRIGHTNESS); + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + value = (uint32_t)light_driver_get_hue(); + value = REMAP_TO_RANGE(value, STANDARD_HUE, MATTER_HUE); + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + value = (uint32_t)light_driver_get_saturation(); + value = REMAP_TO_RANGE(value, STANDARD_SATURATION, MATTER_SATURATION); + } + } + } + return value; +} + +static esp_err_t app_driver_console_handler(int argc, char **argv) +{ + if (argc == 5 && strncmp(argv[0], "set", sizeof("set")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + int value = atoi(argv[4]); + + esp_matter_attr_val_t val = esp_matter_int(value); + + /* Change val if bool */ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID && attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + val.type = ESP_MATTER_VAL_TYPE_BOOLEAN; + val.val.b = (bool)value; + } + esp_matter_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (argc == 4 && strncmp(argv[0], "get", sizeof("get")) == 0) { + int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); + int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); + int attribute_id = strtol((const char *)&argv[3][2], NULL, 16); + int value = app_driver_light_get_attribute(endpoint_id, cluster_id, attribute_id); + + esp_matter_attr_val_t val = esp_matter_int(value); + + /* Change val if bool */ + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID && attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + val.type = ESP_MATTER_VAL_TYPE_BOOLEAN; + val.val.b = (bool)value; + } + esp_matter_attribute_val_print(endpoint_id, cluster_id, attribute_id, val); + } else { + ESP_LOGE(TAG, "Incorrect arguments"); + return ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +static void app_driver_register_commands() +{ + esp_matter_console_command_t command = { + .name = "driver", + .description = "This can be used to simulate on-device control. " + "Usage: matter esp driver [value]. " + "Example1: matter esp driver set 0x1001 0x0006 0x0000 1. " + "Example2: matter esp driver get 0x1001 0x0006 0x0000.", + .handler = app_driver_console_handler, + }; + esp_matter_console_add_command(&command); +} + +/* Do any conversions/remapping for the actual value here */ +static esp_err_t app_driver_light_set_power(esp_matter_attr_val_t val) +{ + return light_driver_set_power(val.val.b); +} + +static esp_err_t app_driver_light_set_brightness(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); + return light_driver_set_brightness(value); +} + +static esp_err_t app_driver_light_set_hue(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_HUE, STANDARD_HUE); + return light_driver_set_hue(value); +} + +static esp_err_t app_driver_light_set_saturation(esp_matter_attr_val_t val) +{ + int value = REMAP_TO_RANGE(val.val.i, MATTER_SATURATION, STANDARD_SATURATION); + return light_driver_set_saturation(value); +} + +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val) +{ + esp_err_t err = ESP_OK; + if (endpoint_id == ESP_MATTER_COLOR_DIMMABLE_LIGHT_ENDPOINT_ID) { + if (cluster_id == ZCL_ON_OFF_CLUSTER_ID) { + if (attribute_id == ZCL_ON_OFF_ATTRIBUTE_ID) { + err = app_driver_light_set_power(val); + } + } else if (cluster_id == ZCL_LEVEL_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { + err = app_driver_light_set_brightness(val); + } + } else if (cluster_id == ZCL_COLOR_CONTROL_CLUSTER_ID) { + if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { + err = app_driver_light_set_hue(val); + } else if (attribute_id == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { + err = app_driver_light_set_saturation(val); + } + } + } + return err; +} + +esp_err_t app_driver_init() +{ + device_init(); + app_driver_register_commands(); + return ESP_OK; +} diff --git a/examples/zap_light/main/app_driver.h b/examples/zap_light/main/app_driver.h new file mode 100644 index 000000000..e8656e837 --- /dev/null +++ b/examples/zap_light/main/app_driver.h @@ -0,0 +1,31 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** Initialize the board and the drivers + * + * This initializes the selected board, which then initializes the respective drivers associated with it. + * + * @return ESP_OK on success. + * @return error in case of failure. + */ +esp_err_t app_driver_init(void); + +esp_err_t app_driver_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t val); + +#ifdef __cplusplus +} +#endif diff --git a/examples/zap_light/main/app_main.cpp b/examples/zap_light/main/app_main.cpp new file mode 100644 index 000000000..3d764c70f --- /dev/null +++ b/examples/zap_light/main/app_main.cpp @@ -0,0 +1,80 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include + +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif +#include +#include + +static const char *TAG = "app_main"; + +static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg) +{ + if (event->Type == chip::DeviceLayer::DeviceEventType::PublicEventTypes::kInterfaceIpAddressChanged) { +#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD + chip::app::DnssdServer::Instance().StartServer(); + esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); +#endif + } + ESP_LOGI(TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +static esp_err_t app_attribute_update_cb(esp_matter_callback_type_t type, int endpoint_id, int cluster_id, + int attribute_id, esp_matter_attr_val_t val, void *priv_data) +{ + esp_err_t err = ESP_OK; + + if (type == ESP_MATTER_CALLBACK_TYPE_PRE_ATTRIBUTE) { + /* Driver update */ + err = app_driver_attribute_update(endpoint_id, cluster_id, attribute_id, val); + } else if (type == ESP_MATTER_CALLBACK_TYPE_POST_ATTRIBUTE) { + /* Other ecosystems update */ + } + + return err; +} + +extern "C" void app_main() +{ + esp_err_t err = ESP_OK; + + /* Initialize the ESP NVS layer */ + nvs_flash_init(); + + /* Initialize matter callback */ + esp_matter_attribute_callback_set(app_attribute_update_cb, NULL); + + /* Initialize driver */ + app_driver_init(); + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + /* Initialize OpenThread */ + app_openthread_launch_task(); +#endif + + /* Matter start */ + err = esp_matter_start(app_event_cb); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Matter start failed: %d", err); + } + app_qrcode_print(); + +#if CONFIG_ENABLE_CHIP_SHELL + esp_matter_console_diagnostics_register_commands(); + esp_matter_console_init(); +#endif +} diff --git a/examples/light/main/light.zap b/examples/zap_light/main/light.zap similarity index 68% rename from examples/light/main/light.zap rename to examples/zap_light/main/light.zap index e86c3cefa..8453e47b4 100644 --- a/examples/light/main/light.zap +++ b/examples/zap_light/main/light.zap @@ -18,499 +18,24 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip/connectedhomeip/src/app/zap-templates/zcl/zcl.json", + "path": "../../../gitlab/esp-matter/connectedhomeip/connectedhomeip/src/app/zap-templates/zcl/zcl.json", "version": "ZCL Test Data", "type": "zcl-properties" }, { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip/connectedhomeip/src/app/zap-templates/app-templates.json", + "path": "../../../gitlab/esp-matter/connectedhomeip/connectedhomeip/src/app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" } ], "endpointTypes": [ { - "name": "MA-rootdevice", + "name": "Anonymous Endpoint Type", "deviceTypeName": "MA-rootdevice", "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "IdentifyQuery", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "IdentifyQueryResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "identify time", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddGroup", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewGroup", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetGroupMembership", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveGroup", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllGroups", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "AddGroupIfIdentifying", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "AddGroupResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewGroupResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetGroupMembershipResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveGroupResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "name support", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "AddSceneResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ViewSceneResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "scene count", - "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": "current scene", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current group", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "scene valid", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "name support", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -520,6 +45,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -552,7 +92,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -567,7 +107,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -582,7 +122,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -597,7 +137,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -606,13 +146,110 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -632,6 +269,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -641,10 +293,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -667,10 +319,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -684,8 +336,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -699,8 +351,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -714,8 +366,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -729,8 +381,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -744,8 +396,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -759,8 +411,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -772,10 +424,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -789,8 +441,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -802,10 +454,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -819,8 +471,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -828,14 +480,14 @@ "code": 11, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -843,14 +495,14 @@ "code": 12, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -858,14 +510,14 @@ "code": 13, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -873,14 +525,14 @@ "code": 14, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -894,8 +546,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -903,14 +555,14 @@ "code": 16, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -918,14 +570,14 @@ "code": 17, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -933,14 +585,29 @@ "code": 18, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -952,10 +619,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -994,12 +661,27 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, "mfgCode": null, "side": "client", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -1055,23 +737,7 @@ "outgoing": 0 } ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "attributes": [] }, { "name": "OTA Software Update Requestor", @@ -1083,7 +749,22 @@ "commands": [], "attributes": [ { - "name": "default ota provider", + "name": "DefaultOtaProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", "code": 1, "mfgCode": null, "side": "server", @@ -1091,15 +772,15 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", - "reportable": 1, + "defaultValue": "true", + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "update possible", - "code": 2, + "name": "UpdateStateProgress", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -1107,7 +788,22 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1122,7 +818,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "1", - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1143,7 +839,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "SetRegulatoryConfig", @@ -1159,10 +855,25 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1172,10 +883,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -1193,7 +904,7 @@ "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { @@ -1209,7 +920,7 @@ "code": 5, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 } ], @@ -1225,8 +936,8 @@ "bounded": 0, "defaultValue": "0x0000000000000000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -1240,8 +951,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -1253,8 +964,8 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1268,7 +979,22 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", "reportable": 0, "minInterval": 1, "maxInterval": 65534, @@ -1279,12 +1005,12 @@ "code": 65532, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "6", - "reportable": 0, + "defaultValue": "0", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1298,10 +1024,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -1320,7 +1046,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "AddOrUpdateWiFiNetwork", @@ -1364,6 +1090,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1373,10 +1114,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -1394,7 +1135,7 @@ "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { @@ -1425,7 +1166,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1440,7 +1181,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1455,7 +1196,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1470,7 +1211,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1485,7 +1226,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1500,7 +1241,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1515,7 +1256,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1530,7 +1271,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1544,8 +1285,8 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", - "reportable": 0, + "defaultValue": "0", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1559,33 +1300,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] }, - { - "name": "Diagnostic Logs", - "code": 50, - "mfgCode": null, - "define": "DIAGNOSTIC_LOGS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "RetrieveLogsRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [] - }, { "name": "General Diagnostics", "code": 51, @@ -1595,6 +1317,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1604,10 +1341,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -1627,13 +1364,13 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -1647,8 +1384,8 @@ "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -1656,7 +1393,7 @@ "code": 2, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -1671,7 +1408,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -1686,7 +1423,7 @@ "code": 4, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -1701,8 +1438,8 @@ "code": 5, "mfgCode": null, "side": "server", - "included": 1, - "storageOption": "External", + "included": 0, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1716,8 +1453,8 @@ "code": 6, "mfgCode": null, "side": "server", - "included": 1, - "storageOption": "External", + "included": 0, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1731,8 +1468,8 @@ "code": 7, "mfgCode": null, "side": "server", - "included": 1, - "storageOption": "External", + "included": 0, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1741,1448 +1478,35 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetWatermarks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "ThreadMetrics", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapFree", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapUsed", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapHighWatermark", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "FeatureMap", "code": 65532, "mfgCode": null, "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "1", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Thread Network Diagnostics", - "code": 53, - "mfgCode": null, - "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "channel", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RoutingRole", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NetworkName", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PanId", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ExtendedPanId", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "MeshLocalPrefix", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OverrunCount", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NeighborTableList", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RouteTableList", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartitionId", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "weighting", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DataVersion", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "StableDataVersion", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LeaderRouterId", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DetachedRoleCount", - "code": 14, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChildRoleCount", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RouterRoleCount", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LeaderRoleCount", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "AttachAttemptCount", - "code": 18, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartitionIdChangeCount", - "code": 19, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "BetterPartitionAttachAttemptCount", - "code": 20, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ParentChangeCount", - "code": 21, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxTotalCount", - "code": 22, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxUnicastCount", - "code": 23, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBroadcastCount", - "code": 24, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxAckRequestedCount", - "code": 25, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxAckedCount", - "code": 26, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxNoAckRequestedCount", - "code": 27, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDataCount", - "code": 28, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDataPollCount", - "code": 29, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBeaconCount", - "code": 30, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxBeaconRequestCount", - "code": 31, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxOtherCount", - "code": 32, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxRetryCount", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxDirectMaxRetryExpiryCount", - "code": 34, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxIndirectMaxRetryExpiryCount", - "code": 35, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrCcaCount", - "code": 36, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrAbortCount", - "code": 37, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "TxErrBusyChannelCount", - "code": 38, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxTotalCount", - "code": 39, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxUnicastCount", - "code": 40, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBroadcastCount", - "code": 41, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDataCount", - "code": 42, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDataPollCount", - "code": 43, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBeaconCount", - "code": 44, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxBeaconRequestCount", - "code": 45, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxOtherCount", - "code": 46, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxAddressFilteredCount", - "code": 47, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDestAddrFilteredCount", - "code": 48, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxDuplicatedCount", - "code": 49, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrNoFrameCount", - "code": 50, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrUnknownNeighborCount", - "code": 51, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrInvalidSrcAddrCount", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrSecCount", - "code": 53, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrFcsCount", - "code": 54, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RxErrOtherCount", - "code": 55, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ActiveTimestamp", - "code": 56, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 - }, - { - "name": "PendingTimestamp", - "code": 57, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "delay", - "code": 58, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SecurityPolicy", - "code": 59, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChannelMask", - "code": 60, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OperationalDatasetComponents", - "code": 61, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ActiveNetworkFaultsList", - "code": 62, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000F", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "WiFi Network Diagnostics", - "code": 54, - "mfgCode": null, - "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "WiFi Network Diagnostics", - "code": 54, - "mfgCode": null, - "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "bssid", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SecurityType", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "WiFiVersion", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ChannelNumber", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Rssi", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "BeaconLostCount", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "BeaconRxCount", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketMulticastRxCount", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketMulticastTxCount", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketUnicastRxCount", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "PacketUnicastTxCount", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentMaxRate", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OverrunCount", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000000000000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 } ] }, @@ -3200,7 +1524,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "OpenBasicCommissioningWindow", @@ -3208,7 +1532,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "RevokeCommissioning", @@ -3216,10 +1540,25 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3229,10 +1568,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3252,11 +1591,11 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -3267,11 +1606,11 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -3282,11 +1621,26 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -3300,10 +1654,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3322,7 +1676,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "CertificateChainRequest", @@ -3330,7 +1684,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "OpCSRRequest", @@ -3338,7 +1692,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "AddNOC", @@ -3346,7 +1700,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "UpdateNOC", @@ -3362,7 +1716,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "RemoveFabric", @@ -3370,7 +1724,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "AddTrustedRootCertificate", @@ -3378,7 +1732,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "RemoveTrustedRootCertificate", @@ -3390,6 +1744,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3399,10 +1768,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3420,7 +1789,7 @@ "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { @@ -3428,7 +1797,7 @@ "code": 3, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { @@ -3436,7 +1805,7 @@ "code": 5, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { @@ -3444,7 +1813,7 @@ "code": 8, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 } ], @@ -3455,13 +1824,13 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3475,8 +1844,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3490,8 +1859,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3500,13 +1869,13 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3515,7 +1884,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3524,6 +1893,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3533,44 +1917,185 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] }, { - "name": "Fixed Label", - "code": 64, + "name": "Group Key Management", + "code": 63, "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 0, - "commands": [], - "attributes": [] - }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { - "name": "label list", + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "groupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -3585,58 +2110,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "1", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "label list", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -3646,10 +2120,10 @@ ] }, { - "name": "MA-dimmablelight", - "deviceTypeName": "MA-dimmablelight", - "deviceTypeCode": 257, - "deviceTypeProfileId": 259, + "name": "Anonymous Endpoint Type", + "deviceTypeName": "HA-colordimmablelight", + "deviceTypeCode": 258, + "deviceTypeProfileId": 260, "clusters": [ { "name": "Identify", @@ -3674,17 +2148,24 @@ "source": "client", "incoming": 1, "outgoing": 0 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3696,8 +2177,8 @@ "bounded": 0, "defaultValue": "2", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3729,10 +2210,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0x0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3750,6 +2231,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3761,8 +2257,8 @@ "bounded": 0, "defaultValue": "2", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3825,6 +2321,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -3836,8 +2347,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3848,7 +2359,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddGroupResponse", @@ -3895,8 +2406,23 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3910,8 +2436,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -3979,33 +2505,24 @@ "source": "client", "incoming": 1, "outgoing": 0 - }, - { - "name": "EnhancedAddScene", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedViewScene", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "CopyScene", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4017,8 +2534,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4029,7 +2546,7 @@ "mfgCode": null, "define": "SCENES_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddSceneResponse", @@ -4092,8 +2609,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4107,8 +2624,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4122,8 +2639,8 @@ "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4137,8 +2654,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4152,8 +2669,38 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "last configured by", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4167,8 +2714,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4204,33 +2751,24 @@ "source": "client", "incoming": 1, "outgoing": 0 - }, - { - "name": "OffWithEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "OnWithRecallGlobalScene", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "OnWithTimedOff", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4240,10 +2778,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "4", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4266,10 +2804,10 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4277,14 +2815,14 @@ "code": 16384, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4292,14 +2830,14 @@ "code": 16385, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4307,14 +2845,14 @@ "code": 16386, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4322,14 +2860,14 @@ "code": 16387, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4337,7 +2875,7 @@ "code": 65532, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4358,8 +2896,8 @@ "bounded": 0, "defaultValue": "4", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4438,6 +2976,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4449,8 +3002,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4475,8 +3028,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4484,14 +3037,14 @@ "code": 1, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4499,7 +3052,7 @@ "code": 2, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4514,7 +3067,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4529,7 +3082,7 @@ "code": 4, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4544,7 +3097,7 @@ "code": 5, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4559,7 +3112,7 @@ "code": 6, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4574,14 +3127,14 @@ "code": 15, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4589,7 +3142,7 @@ "code": 16, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4604,7 +3157,7 @@ "code": 17, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4619,7 +3172,7 @@ "code": 18, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4634,7 +3187,7 @@ "code": 19, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4649,7 +3202,7 @@ "code": 20, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4664,14 +3217,29 @@ "code": 16384, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4685,118 +3253,6 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Descriptor", - "code": 29, - "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "device list", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "server list", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "client list", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "parts list", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4812,6 +3268,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4821,10 +3292,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -4835,7 +3306,7 @@ "mfgCode": null, "define": "BASIC_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [], "attributes": [ { @@ -4847,10 +3318,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4864,8 +3335,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4879,8 +3350,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4894,8 +3365,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4909,8 +3380,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4924,8 +3395,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4939,8 +3410,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4952,10 +3423,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4969,8 +3440,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4982,10 +3453,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -4999,8 +3470,158 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5012,36 +3633,10 @@ "storageOption": "RAM", "singleton": 1, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Bridged Device Basic", - "code": 57, - "mfgCode": null, - "define": "BRIDGED_DEVICE_BASIC_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -5116,7 +3711,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "MoveColor", @@ -5124,7 +3719,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { "name": "StepColor", @@ -5132,54 +3727,6 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToColorTemperature", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveToHue", - "code": 64, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveHue", - "code": 65, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedStepHue", - "code": 66, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "EnhancedMoveToHueAndSaturation", - "code": 67, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "ColorLoopSet", - "code": 68, - "mfgCode": null, - "source": "client", - "incoming": 1, "outgoing": 0 }, { @@ -5189,25 +3736,24 @@ "source": "client", "incoming": 1, "outgoing": 0 - }, - { - "name": "MoveColorTemperature", - "code": 75, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepColorTemperature", - "code": 76, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -5219,8 +3765,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -5245,8 +3791,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5260,8 +3806,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5275,8 +3821,8 @@ "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5290,8 +3836,8 @@ "bounded": 0, "defaultValue": "0x616B", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5305,8 +3851,8 @@ "bounded": 0, "defaultValue": "0x607D", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5320,8 +3866,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5335,8 +3881,8 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5344,14 +3890,14 @@ "code": 7, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x00FA", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5365,8 +3911,8 @@ "bounded": 0, "defaultValue": "0x01", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5380,8 +3926,8 @@ "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5395,8 +3941,443 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 1 x", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 1 y", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 1 intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 2 x", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 2 y", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 2 intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 3 x", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 3 y", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 3 intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 4 x", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 4 y", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 4 intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 5 x", + "code": 36, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 5 y", + "code": 37, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 5 intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 6 x", + "code": 40, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 6 y", + "code": 41, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "primary 6 intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "white point x", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "white point y", + "code": 49, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point r x", + "code": 50, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point r y", + "code": 51, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point r intensity", + "code": 52, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point g x", + "code": 54, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point g y", + "code": 55, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point g intensity", + "code": 56, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point b x", + "code": 58, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point b y", + "code": 59, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color point b intensity", + "code": 60, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5404,14 +4385,14 @@ "code": 16384, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5425,8 +4406,8 @@ "bounded": 0, "defaultValue": "0x01", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5434,14 +4415,14 @@ "code": 16386, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5449,14 +4430,14 @@ "code": 16387, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5464,14 +4445,14 @@ "code": 16388, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0019", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5479,14 +4460,14 @@ "code": 16389, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x2300", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5494,14 +4475,14 @@ "code": 16390, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5515,8 +4496,8 @@ "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5524,14 +4505,14 @@ "code": 16395, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5539,14 +4520,14 @@ "code": 16396, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0xFEFF", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5554,14 +4535,14 @@ "code": 16397, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5569,14 +4550,29 @@ "code": 16400, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -5590,8 +4586,8 @@ "bounded": 0, "defaultValue": "3", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -5601,7 +4597,7 @@ ], "endpoints": [ { - "endpointTypeName": "MA-rootdevice", + "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 0, "profileId": 259, "endpointId": 0, @@ -5610,14 +4606,14 @@ "deviceIdentifier": 22 }, { - "endpointTypeName": "MA-dimmablelight", + "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 1, - "profileId": 259, + "profileId": 260, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 257 + "deviceIdentifier": 258 } ], "log": [] -} +} \ No newline at end of file diff --git a/examples/zap_light/main/zap-generated/CHIPClientCallbacks.cpp b/examples/zap_light/main/zap-generated/CHIPClientCallbacks.cpp new file mode 100644 index 000000000..15950c848 --- /dev/null +++ b/examples/zap_light/main/zap-generated/CHIPClientCallbacks.cpp @@ -0,0 +1,185 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::DataModel; + +namespace { +[[maybe_unused]] constexpr uint16_t kByteSpanSizeLengthInBytes = 2; +} // namespace + +#define CHECK_STATUS_WITH_RETVAL(error, retval) \ + if (CHIP_NO_ERROR != error) { \ + ChipLogError(Zcl, "CHECK_STATUS %s", ErrorStr(error)); \ + if (onFailureCallback != nullptr) { \ + Callback::Callback *cb = \ + Callback::Callback::FromCancelable( \ + onFailureCallback); \ + cb->mCall(cb->mContext, \ + static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } + +#define CHECK_STATUS(error) CHECK_STATUS_WITH_RETVAL(error, true) +#define CHECK_STATUS_VOID(error) CHECK_STATUS_WITH_RETVAL(error, ) + +#define CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, retval) \ + if (!CanCastTo(value)) { \ + ChipLogError( \ + Zcl, "CHECK_MESSAGE_LENGTH expects a uint16_t value, got: %d", value); \ + if (onFailureCallback != nullptr) { \ + Callback::Callback *cb = \ + Callback::Callback::FromCancelable( \ + onFailureCallback); \ + cb->mCall(cb->mContext, \ + static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } \ + \ + if (messageLen < value) { \ + ChipLogError(Zcl, "Unexpected response length: %d", messageLen); \ + if (onFailureCallback != nullptr) { \ + Callback::Callback *cb = \ + Callback::Callback::FromCancelable( \ + onFailureCallback); \ + cb->mCall(cb->mContext, \ + static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } \ + \ + messageLen = static_cast(messageLen - static_cast(value)); + +#define CHECK_MESSAGE_LENGTH(value) \ + CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, true) +#define CHECK_MESSAGE_LENGTH_VOID(value) \ + CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, ) + +#define GET_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable *onSuccessCallback = nullptr; \ + Callback::Cancelable *onFailureCallback = nullptr; \ + NodeId sourceId = emberAfCurrentCommand()->SourceNodeId(); \ + uint8_t sequenceNumber = emberAfCurrentCommand()->seqNum; \ + CHIP_ERROR err = gCallbacks.GetResponseCallback( \ + sourceId, sequenceNumber, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) { \ + if (onSuccessCallback == nullptr) { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +#define GET_CLUSTER_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable *onSuccessCallback = nullptr; \ + Callback::Cancelable *onFailureCallback = nullptr; \ + NodeId sourceIdentifier = reinterpret_cast(commandObj); \ + /* #6559: Currently, we only have one commands for the IMInvokeCommands and \ + * to a device, so the seqNum is always set to 0. */ \ + CHIP_ERROR err = gCallbacks.GetResponseCallback( \ + sourceIdentifier, 0, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) { \ + if (onSuccessCallback == nullptr) { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +// Singleton instance of the callbacks manager +app::CHIPDeviceCallbacksMgr &gCallbacks = + app::CHIPDeviceCallbacksMgr::GetInstance(); + +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( + EndpointId endpoint, app::CommandSender *commandObj, uint8_t action, + uint32_t delayedActionTime) { + ChipLogProgress(Zcl, "ApplyUpdateResponse:"); + ChipLogProgress(Zcl, " action: %" PRIu8 "", action); + ChipLogProgress(Zcl, " delayedActionTime: %" PRIu32 "", delayedActionTime); + + GET_CLUSTER_RESPONSE_CALLBACKS( + "OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback"); + + Callback::Callback< + OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback> *cb = + Callback::Callback< + OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback>:: + FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, action, delayedActionTime); + return true; +} + +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( + EndpointId endpoint, app::CommandSender *commandObj, uint8_t status, + uint32_t delayedActionTime, chip::CharSpan imageURI, + uint32_t softwareVersion, chip::CharSpan softwareVersionString, + chip::ByteSpan updateToken, bool userConsentNeeded, + chip::ByteSpan metadataForRequestor) { + ChipLogProgress(Zcl, "QueryImageResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); + ChipLogProgress(Zcl, " delayedActionTime: %" PRIu32 "", delayedActionTime); + ChipLogProgress(Zcl, " imageURI: %.*s", static_cast(imageURI.size()), + imageURI.data()); + ChipLogProgress(Zcl, " softwareVersion: %" PRIu32 "", softwareVersion); + ChipLogProgress(Zcl, " softwareVersionString: %.*s", + static_cast(softwareVersionString.size()), + softwareVersionString.data()); + ChipLogProgress(Zcl, " updateToken: %zu", updateToken.size()); + ChipLogProgress(Zcl, " userConsentNeeded: %d", userConsentNeeded); + ChipLogProgress(Zcl, " metadataForRequestor: %zu", + metadataForRequestor.size()); + + GET_CLUSTER_RESPONSE_CALLBACKS( + "OtaSoftwareUpdateProviderClusterQueryImageResponseCallback"); + + Callback::Callback + *cb = Callback::Callback< + OtaSoftwareUpdateProviderClusterQueryImageResponseCallback>:: + FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status, delayedActionTime, imageURI, softwareVersion, + softwareVersionString, updateToken, userConsentNeeded, + metadataForRequestor); + return true; +} diff --git a/examples/zap_light/main/zap-generated/CHIPClientCallbacks.h b/examples/zap_light/main/zap-generated/CHIPClientCallbacks.h new file mode 100644 index 000000000..73bca1397 --- /dev/null +++ b/examples/zap_light/main/zap-generated/CHIPClientCallbacks.h @@ -0,0 +1,47 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Note: The IMDefaultResponseCallback is a bridge to the old CallbackMgr before +// IM is landed, so it still accepts EmberAfStatus instead of IM status code. +// #6308 should handle IM error code on the application side, either modify this +// function or remove this. + +// Cluster Specific Response Callbacks +typedef void (*OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback)( + void *context, uint8_t action, uint32_t delayedActionTime); +typedef void (*OtaSoftwareUpdateProviderClusterQueryImageResponseCallback)( + void *context, uint8_t status, uint32_t delayedActionTime, + chip::CharSpan imageURI, uint32_t softwareVersion, + chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, + bool userConsentNeeded, chip::ByteSpan metadataForRequestor); + +// List specific responses diff --git a/examples/zap_light/main/zap-generated/CHIPClusters.cpp b/examples/zap_light/main/zap-generated/CHIPClusters.cpp new file mode 100644 index 000000000..2d5931206 --- /dev/null +++ b/examples/zap_light/main/zap-generated/CHIPClusters.cpp @@ -0,0 +1,213 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include "CHIPClusters.h" + +#include +#include + +namespace chip { + +using namespace app::Clusters; +using namespace System; +using namespace Encoding::LittleEndian; + +namespace Controller { + +// TODO(#4502): onCompletion is not used by IM for now. +// TODO(#4503): length should be passed to commands when byte string is in +// argument list. +// TODO(#4503): Commands should take group id as an argument. + +// OtaSoftwareUpdateProvider Cluster Commands +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t newVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + (app::CommandPathFlags::kEndpointIdValid)}; + + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // newVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::ByteSpan updateToken, + uint32_t softwareVersion) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, + (app::CommandPathFlags::kEndpointIdValid)}; + + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = + writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage( + Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, chip::VendorId vendorId, + uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, + chip::ByteSpan metadataForProvider) { + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter *writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding + // empty commands. + (void)writer; + (void)argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { + mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + (app::CommandPathFlags::kEndpointIdValid)}; + + CommandSenderHandle sender(Platform::New( + mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, + err = CHIP_ERROR_INCORRECT_STATE); + // vendorId: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); + // productId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); + // softwareVersion: int32u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + // protocolsSupported: OTADownloadProtocol + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); + // hardwareVersion: int16u + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); + // location: charString + SuccessOrExit( + err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); + // requestorCanConsent: boolean + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); + // metadataForProvider: octetString + SuccessOrExit( + err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on + // application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, + onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be + // responsible to free the object, release the object now. + sender.release(); +exit: + return err; +} + +} // namespace Controller +} // namespace chip diff --git a/examples/zap_light/main/zap-generated/CHIPClusters.h b/examples/zap_light/main/zap-generated/CHIPClusters.h new file mode 100644 index 000000000..baebb9cf4 --- /dev/null +++ b/examples/zap_light/main/zap-generated/CHIPClusters.h @@ -0,0 +1,58 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +#include +#include + +#include +#include +#include + +namespace chip { +namespace Controller { + +class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { +public: + OtaSoftwareUpdateProviderCluster() + : ClusterBase(app::Clusters::OtaSoftwareUpdateProvider::Id) {} + ~OtaSoftwareUpdateProviderCluster() {} + + // Cluster Commands + CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t newVersion); + CHIP_ERROR NotifyUpdateApplied(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::ByteSpan updateToken, + uint32_t softwareVersion); + CHIP_ERROR QueryImage(Callback::Cancelable *onSuccessCallback, + Callback::Cancelable *onFailureCallback, + chip::VendorId vendorId, uint16_t productId, + uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, + bool requestorCanConsent, + chip::ByteSpan metadataForProvider); +}; + +} // namespace Controller +} // namespace chip diff --git a/examples/zap_light/main/zap-generated/IMClusterCommandHandler.cpp b/examples/zap_light/main/zap-generated/IMClusterCommandHandler.cpp new file mode 100644 index 000000000..93978009a --- /dev/null +++ b/examples/zap_light/main/zap-generated/IMClusterCommandHandler.cpp @@ -0,0 +1,1300 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Currently we need some work to keep compatible with ember lib. +#include + +namespace chip { +namespace app { + +// Cluster specific command parsing + +namespace Clusters { + +namespace AdministratorCommissioning { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace AdministratorCommissioning + +namespace ColorControl { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::MoveColor::Id: { + Commands::MoveColor::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveColorCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveHue::Id: { + Commands::MoveHue::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveHueCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveSaturation::Id: { + Commands::MoveSaturation::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveSaturationCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToColor::Id: { + Commands::MoveToColor::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveToColorCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToHue::Id: { + Commands::MoveToHue::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveToHueCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToHueAndSaturation::Id: { + Commands::MoveToHueAndSaturation::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToSaturation::Id: { + Commands::MoveToSaturation::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterMoveToSaturationCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StepColor::Id: { + Commands::StepColor::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterStepColorCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StepHue::Id: { + Commands::StepHue::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterStepHueCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StepSaturation::Id: { + Commands::StepSaturation::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterStepSaturationCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StopMoveStep::Id: { + Commands::StopMoveStep::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfColorControlClusterStopMoveStepCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace ColorControl + +namespace GeneralCommissioning { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfGeneralCommissioningClusterCommissioningCompleteCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace GeneralCommissioning + +namespace Groups { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::AddGroup::Id: { + Commands::AddGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterAddGroupCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::AddGroupIfIdentifying::Id: { + Commands::AddGroupIfIdentifying::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::GetGroupMembership::Id: { + Commands::GetGroupMembership::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterGetGroupMembershipCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveAllGroups::Id: { + Commands::RemoveAllGroups::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterRemoveAllGroupsCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveGroup::Id: { + Commands::RemoveGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterRemoveGroupCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ViewGroup::Id: { + Commands::ViewGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfGroupsClusterViewGroupCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace Groups + +namespace Identify { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::Identify::Id: { + Commands::Identify::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfIdentifyClusterIdentifyCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::IdentifyQuery::Id: { + Commands::IdentifyQuery::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfIdentifyClusterIdentifyQueryCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace Identify + +namespace LevelControl { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::Move::Id: { + Commands::Move::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterMoveCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterMoveToLevelCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::Step::Id: { + Commands::Step::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterStepCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterStopCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfLevelControlClusterStopWithOnOffCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace LevelControl + +namespace NetworkCommissioning { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::AddOrUpdateThreadNetwork::Id: { + Commands::AddOrUpdateThreadNetwork::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfNetworkCommissioningClusterAddOrUpdateThreadNetworkCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::AddOrUpdateWiFiNetwork::Id: { + Commands::AddOrUpdateWiFiNetwork::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfNetworkCommissioningClusterAddOrUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ConnectNetwork::Id: { + Commands::ConnectNetwork::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfNetworkCommissioningClusterConnectNetworkCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ReorderNetwork::Id: { + Commands::ReorderNetwork::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfNetworkCommissioningClusterReorderNetworkCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace NetworkCommissioning + +namespace OtaSoftwareUpdateProvider { + +void DispatchClientCommand(CommandSender *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::ApplyUpdateResponse::Id: { + expectArgumentCount = 2; + uint8_t action; + uint32_t delayedActionTime; + bool argExists[2]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always + // points to an element. Skip this element if it is not a ContextTag, + // not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 2) { + if (argExists[currentDecodeTagId]) { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, + TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } else { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) { + case 0: + TLVUnpackError = aDataTlv.Get(action); + break; + case 1: + TLVUnpackError = aDataTlv.Get(delayedActionTime); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) { + // CHIP_END_OF_TLV means we have iterated all items in the structure, + // which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && + 2 == validArgumentCount) { + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( + aCommandPath.mEndpointId, apCommandObj, action, + delayedActionTime); + } + break; + } + case Commands::QueryImageResponse::Id: { + expectArgumentCount = 8; + uint8_t status; + uint32_t delayedActionTime; + chip::CharSpan imageURI; + uint32_t softwareVersion; + chip::CharSpan softwareVersionString; + chip::ByteSpan updateToken; + bool userConsentNeeded; + chip::ByteSpan metadataForRequestor; + bool argExists[8]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always + // points to an element. Skip this element if it is not a ContextTag, + // not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 8) { + if (argExists[currentDecodeTagId]) { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, + TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } else { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) { + case 0: + TLVUnpackError = aDataTlv.Get(status); + break; + case 1: + TLVUnpackError = aDataTlv.Get(delayedActionTime); + break; + case 2: + TLVUnpackError = aDataTlv.Get(imageURI); + break; + case 3: + TLVUnpackError = aDataTlv.Get(softwareVersion); + break; + case 4: + TLVUnpackError = aDataTlv.Get(softwareVersionString); + break; + case 5: + TLVUnpackError = aDataTlv.Get(updateToken); + break; + case 6: + TLVUnpackError = aDataTlv.Get(userConsentNeeded); + break; + case 7: + TLVUnpackError = aDataTlv.Get(metadataForRequestor); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) { + // CHIP_END_OF_TLV means we have iterated all items in the structure, + // which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && + 8 == validArgumentCount) { + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( + aCommandPath.mEndpointId, apCommandObj, status, + delayedActionTime, imageURI, softwareVersion, + softwareVersionString, updateToken, userConsentNeeded, + metadataForRequestor); + } + break; + } + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || + expectArgumentCount != validArgumentCount || !wasHandled) { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 + " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT + " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), + TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace OtaSoftwareUpdateProvider + +namespace OtaSoftwareUpdateRequestor { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::AnnounceOtaProvider::Id: { + Commands::AnnounceOtaProvider::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace OtaSoftwareUpdateRequestor + +namespace OnOff { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::Off::Id: { + Commands::Off::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, + commandData); + } + break; + } + case Commands::On::Id: { + Commands::On::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, + commandData); + } + break; + } + case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOnOffClusterToggleCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace OnOff + +namespace OperationalCredentials { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = + emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace OperationalCredentials + +namespace Scenes { + +void DispatchServerCommand(CommandHandler *apCommandObj, + const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aDataTlv) { + // We are using TLVUnpackError and TLVError here since both of them can be + // CHIP_END_OF_TLV When TLVError is CHIP_END_OF_TLV, it means we have iterated + // all of the items, which is not a real error. Any error value TLVUnpackError + // means we have received an illegal value. The following variables are used + // for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) { + case Commands::AddScene::Id: { + Commands::AddScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterAddSceneCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::GetSceneMembership::Id: { + Commands::GetSceneMembership::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterGetSceneMembershipCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RecallScene::Id: { + Commands::RecallScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterRecallSceneCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveAllScenes::Id: { + Commands::RemoveAllScenes::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterRemoveAllScenesCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveScene::Id: { + Commands::RemoveScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterRemoveSceneCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StoreScene::Id: { + Commands::StoreScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterStoreSceneCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ViewScene::Id: { + Commands::ViewScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) { + wasHandled = emberAfScenesClusterViewSceneCallback( + apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus( + aCommandPath, + Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, + "Unknown command " ChipLogFormatMEI + " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) { + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, + "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, + TLVError.Format()); + } +} + +} // namespace Scenes + +} // namespace Clusters + +void DispatchSingleClusterCommand(const ConcreteCommandPath &aCommandPath, + TLV::TLVReader &aReader, + CommandHandler *apCommandObj) { + Compatibility::SetupEmberAfCommandHandler(apCommandObj, aCommandPath); + + switch (aCommandPath.mClusterId) { + case Clusters::AdministratorCommissioning::Id: + Clusters::AdministratorCommissioning::DispatchServerCommand( + apCommandObj, aCommandPath, aReader); + break; + case Clusters::ColorControl::Id: + Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, + aReader); + break; + case Clusters::GeneralCommissioning::Id: + Clusters::GeneralCommissioning::DispatchServerCommand( + apCommandObj, aCommandPath, aReader); + break; + case Clusters::Groups::Id: + Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, + aReader); + break; + case Clusters::Identify::Id: + Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, + aReader); + break; + case Clusters::LevelControl::Id: + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, + aReader); + break; + case Clusters::NetworkCommissioning::Id: + Clusters::NetworkCommissioning::DispatchServerCommand( + apCommandObj, aCommandPath, aReader); + break; + case Clusters::OtaSoftwareUpdateRequestor::Id: + Clusters::OtaSoftwareUpdateRequestor::DispatchServerCommand( + apCommandObj, aCommandPath, aReader); + break; + case Clusters::OnOff::Id: + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; + case Clusters::OperationalCredentials::Id: + Clusters::OperationalCredentials::DispatchServerCommand( + apCommandObj, aCommandPath, aReader); + break; + case Clusters::Scenes::Id: + Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandPath, + aReader); + break; + default: + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatus( + aCommandPath, Protocols::InteractionModel::Status::UnsupportedCluster); + break; + } + + Compatibility::ResetEmberAfObjects(); +} + +void DispatchSingleClusterResponseCommand( + const ConcreteCommandPath &aCommandPath, TLV::TLVReader &aReader, + CommandSender *apCommandObj) { + Compatibility::SetupEmberAfCommandSender(apCommandObj, aCommandPath); + + TLV::TLVType dataTlvType; + SuccessOrExit(aReader.EnterContainer(dataTlvType)); + switch (aCommandPath.mClusterId) { + case Clusters::OtaSoftwareUpdateProvider::Id: + Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand( + apCommandObj, aCommandPath, aReader); + break; + default: + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mClusterId)); + break; + } + +exit: + aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); +} + +} // namespace app +} // namespace chip diff --git a/examples/zap_light/main/zap-generated/PluginApplicationCallbacks.h b/examples/zap_light/main/zap-generated/PluginApplicationCallbacks.h new file mode 100644 index 000000000..fc04c756a --- /dev/null +++ b/examples/zap_light/main/zap-generated/PluginApplicationCallbacks.h @@ -0,0 +1,40 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#pragma once + +#include + +#define MATTER_PLUGINS_INIT \ + MatterAdministratorCommissioningPluginServerInitCallback(); \ + MatterBasicPluginServerInitCallback(); \ + MatterColorControlPluginServerInitCallback(); \ + MatterDescriptorPluginServerInitCallback(); \ + MatterGeneralCommissioningPluginServerInitCallback(); \ + MatterGeneralDiagnosticsPluginServerInitCallback(); \ + MatterGroupKeyManagementPluginServerInitCallback(); \ + MatterGroupsPluginServerInitCallback(); \ + MatterIdentifyPluginServerInitCallback(); \ + MatterLevelControlPluginServerInitCallback(); \ + MatterNetworkCommissioningPluginServerInitCallback(); \ + MatterOtaSoftwareUpdateProviderPluginClientInitCallback(); \ + MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ + MatterOnOffPluginServerInitCallback(); \ + MatterOperationalCredentialsPluginServerInitCallback(); \ + MatterScenesPluginServerInitCallback(); diff --git a/examples/zap_light/main/zap-generated/af-gen-event.h b/examples/zap_light/main/zap-generated/af-gen-event.h new file mode 100644 index 000000000..6612569e6 --- /dev/null +++ b/examples/zap_light/main/zap-generated/af-gen-event.h @@ -0,0 +1,71 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * + * Copyright (c) 2020 Silicon Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// This file is generated by Simplicity Studio. Please do not edit manually. +// +// + +// Enclosing macro to prevent multiple inclusion +#ifndef __AF_GEN_EVENT__ +#define __AF_GEN_EVENT__ + +// Code used to configure the cluster event mechanism +#define EMBER_AF_GENERATED_EVENT_CODE \ + EmberEventControl emberAfLevelControlClusterServerTickCallbackControl1; \ + static void clusterTickWrapper(EmberEventControl * control, EmberAfTickFunction callback, uint8_t endpoint) \ + { \ + /* emberAfPushEndpointNetworkIndex(endpoint); */ \ + emberEventControlSetInactive(control); \ + (*callback)(endpoint); \ + /* emberAfPopNetworkIndex(); */ \ + } \ + void emberAfLevelControlClusterServerTickCallbackWrapperFunction1(void) \ + { \ + clusterTickWrapper(&emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallback, \ + 1); \ + } + +// EmberEventData structs used to populate the EmberEventData table +#define EMBER_AF_GENERATED_EVENTS \ + { &emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallbackWrapperFunction1 }, + +#define EMBER_AF_GENERATED_EVENT_STRINGS "Level Control Cluster Server EP 1", + +// The length of the event context table used to track and retrieve cluster events +#define EMBER_AF_EVENT_CONTEXT_LENGTH 1 + +// EmberAfEventContext structs used to populate the EmberAfEventContext table +#define EMBER_AF_GENERATED_EVENT_CONTEXT \ + { 0x1, 0x8, false, EMBER_AF_LONG_POLL, EMBER_AF_OK_TO_SLEEP, &emberAfLevelControlClusterServerTickCallbackControl1 }, + +#endif // __AF_GEN_EVENT__ diff --git a/examples/zap_light/main/zap-generated/callback-stub.cpp b/examples/zap_light/main/zap-generated/callback-stub.cpp new file mode 100644 index 000000000..659182e0d --- /dev/null +++ b/examples/zap_light/main/zap-generated/callback-stub.cpp @@ -0,0 +1,266 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include +#include +#include +#include + +using namespace chip; + +// Cluster Init Functions +void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { + switch (clusterId) { + case ZCL_ACCESS_CONTROL_CLUSTER_ID: + emberAfAccessControlClusterInitCallback(endpoint); + break; + case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: + emberAfAdministratorCommissioningClusterInitCallback(endpoint); + break; + case ZCL_BASIC_CLUSTER_ID: + emberAfBasicClusterInitCallback(endpoint); + break; + case ZCL_COLOR_CONTROL_CLUSTER_ID: + emberAfColorControlClusterInitCallback(endpoint); + break; + case ZCL_DESCRIPTOR_CLUSTER_ID: + emberAfDescriptorClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: + emberAfGeneralCommissioningClusterInitCallback(endpoint); + break; + case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + emberAfGeneralDiagnosticsClusterInitCallback(endpoint); + break; + case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: + emberAfGroupKeyManagementClusterInitCallback(endpoint); + break; + case ZCL_GROUPS_CLUSTER_ID: + emberAfGroupsClusterInitCallback(endpoint); + break; + case ZCL_IDENTIFY_CLUSTER_ID: + emberAfIdentifyClusterInitCallback(endpoint); + break; + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + emberAfLevelControlClusterInitCallback(endpoint); + break; + case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: + emberAfNetworkCommissioningClusterInitCallback(endpoint); + break; + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); + break; + case ZCL_OTA_REQUESTOR_CLUSTER_ID: + emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); + break; + case ZCL_ON_OFF_CLUSTER_ID: + emberAfOnOffClusterInitCallback(endpoint); + break; + case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: + emberAfOperationalCredentialsClusterInitCallback(endpoint); + break; + case ZCL_SCENES_CLUSTER_ID: + emberAfScenesClusterInitCallback(endpoint); + break; + default: + // Unrecognized cluster ID + break; + } +} + +void __attribute__((weak)) +emberAfAccessControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfAdministratorCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfBasicClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfColorControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfDescriptorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfGeneralDiagnosticsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfGroupKeyManagementClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfGroupsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfIdentifyClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfLevelControlClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfOtaSoftwareUpdateRequestorClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfOnOffClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} +void __attribute__((weak)) +emberAfScenesClusterInitCallback(EndpointId endpoint) { + // To prevent warning + (void)endpoint; +} + +// +// Non-Cluster Related Callbacks +// + +void __attribute__((weak)) +emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} + +void __attribute__((weak)) +emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} + +EmberAfAttributeWritePermission __attribute__((weak)) +emberAfAllowNetworkWriteAttributeCallback(EndpointId endpoint, + ClusterId clusterId, + AttributeId attributeId, uint8_t mask, + uint16_t manufacturerCode, + uint8_t *value, uint8_t type) { + return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default +} + +bool __attribute__((weak)) +emberAfAttributeReadAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; +} + +bool __attribute__((weak)) +emberAfAttributeWriteAccessCallback(EndpointId endpoint, ClusterId clusterId, + uint16_t manufacturerCode, + AttributeId attributeId) { + return true; +} + +bool __attribute__((weak)) +emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, + EmberAfStatus status) { + return false; +} + +bool __attribute__((weak)) +emberAfPreMessageSendCallback(EmberAfMessageStruct *messageStruct, + EmberStatus *status) { + return false; +} + +bool __attribute__((weak)) +emberAfMessageSentCallback(const MessageSendDestination &destination, + EmberApsFrame *apsFrame, uint16_t msgLen, + uint8_t *message, EmberStatus status) { + return false; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer, uint16_t maxReadLength) { + return EMBER_ZCL_STATUS_FAILURE; +} + +EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback( + EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata *attributeMetadata, uint16_t manufacturerCode, + uint8_t *buffer) { + return EMBER_ZCL_STATUS_FAILURE; +} + +uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() { return 0; } + +bool __attribute__((weak)) +emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t *returnNetworkIndex, + EmberAfEndpointInfoStruct *returnEndpointInfo) { + return false; +} + +void __attribute__((weak)) emberAfRegistrationAbortCallback() {} + +EmberStatus __attribute__((weak)) +emberAfInterpanSendMessageCallback(EmberAfInterpanHeader *header, + uint16_t messageLength, uint8_t *message) { + return EMBER_LIBRARY_NOT_PRESENT; +} + +bool __attribute__((weak)) emberAfStartMoveCallback() { return false; } + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +MatterPreAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) { + return chip::Protocols::InteractionModel::Status::Success; +} + +void __attribute__((weak)) MatterPostAttributeChangeCallback( + const chip::app::ConcreteAttributePath &attributePath, uint8_t mask, + uint8_t type, uint16_t size, uint8_t *value) {} diff --git a/examples/zap_light/main/zap-generated/endpoint_config.h b/examples/zap_light/main/zap-generated/endpoint_config.h new file mode 100644 index 000000000..f30a448d5 --- /dev/null +++ b/examples/zap_light/main/zap-generated/endpoint_config.h @@ -0,0 +1,1103 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +// Default values for the attributes longer than a pointer, +// in a form of a binary blob +// Separate block is generated for big-endian and little-endian cases. +#if BIGENDIAN_CPU +#define GENERATED_DEFAULTS \ + { \ + \ + /* Endpoint: 0, Cluster: Descriptor (server), big-endian */ \ + \ + /* 0 - device list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 254 - server list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 508 - client list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 762 - parts list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Basic (server), big-endian */ \ + \ + /* 1016 - SoftwareVersion, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: OTA Software Update Requestor (server), \ + big-endian */ \ + \ + /* 1020 - default ota provider, */ \ + 4, 't', 'r', 'u', 'e', \ + \ + /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ + \ + /* 1025 - Breadcrumb, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1033 - BasicCommissioningInfoList, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ + \ + /* 1287 - Networks, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 1299 - LastConnectErrorValue, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1303 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ + \ + /* 1307 - NetworkInterfaces, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Operational Credentials (server), big-endian \ + */ \ + \ + /* 1561 - fabrics list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 1881 - TrustedRootCertificates, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ + \ + /* 2281 - groups, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 2535 - group keys, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 1, Cluster: Basic (server), big-endian */ \ + \ + /* 2789 - SoftwareVersion, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Color Control (server), big-endian */ \ + \ + /* 2793 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + } + +#else // !BIGENDIAN_CPU +#define GENERATED_DEFAULTS \ + { \ + \ + /* Endpoint: 0, Cluster: Descriptor (server), little-endian */ \ + \ + /* 0 - device list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 254 - server list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 508 - client list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 762 - parts list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Basic (server), little-endian */ \ + \ + /* 1016 - SoftwareVersion, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: OTA Software Update Requestor (server), \ + little-endian */ \ + \ + /* 1020 - default ota provider, */ \ + 4, 't', 'r', 'u', 'e', \ + \ + /* Endpoint: 0, Cluster: General Commissioning (server), little-endian \ + */ \ + \ + /* 1025 - Breadcrumb, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1033 - BasicCommissioningInfoList, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian \ + */ \ + \ + /* 1287 - Networks, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 1299 - LastConnectErrorValue, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 1303 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian \ + */ \ + \ + /* 1307 - NetworkInterfaces, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 0, Cluster: Operational Credentials (server), \ + little-endian */ \ + \ + /* 1561 - fabrics list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 1881 - TrustedRootCertificates, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Group Key Management (server), little-endian \ + */ \ + \ + /* 2281 - groups, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* 2535 - group keys, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, \ + \ + /* Endpoint: 1, Cluster: Basic (server), little-endian */ \ + \ + /* 2789 - SoftwareVersion, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Color Control (server), little-endian */ \ + \ + /* 2793 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + } + +#endif // BIGENDIAN_CPU + +#define GENERATED_DEFAULTS_COUNT (18) + +#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE +#define ZAP_LONG_DEFAULTS_INDEX(index) \ + { &generatedDefaults[index] } +#define ZAP_MIN_MAX_DEFAULTS_INDEX(index) \ + { &minMaxDefaults[index] } +#define ZAP_EMPTY_DEFAULT() \ + { (uint16_t)0 } +#define ZAP_SIMPLE_DEFAULT(x) \ + { (uint16_t) x } + +// This is an array of EmberAfAttributeMinMaxValue structures. +#define GENERATED_MIN_MAX_DEFAULT_COUNT 1 +#define GENERATED_MIN_MAX_DEFAULTS \ + { \ + \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + { (uint16_t)0x0, (uint16_t)0x0, (uint16_t)0xFE } /* identify time */ \ + } + +#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask +// This is an array of EmberAfAttributeMetadata structures. +#define GENERATED_ATTRIBUTE_COUNT 93 +#define GENERATED_ATTRIBUTES \ + { \ + \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + {0x0000, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(0)}, /* device list */ \ + {0x0001, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(254)}, /* server list */ \ + {0x0002, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(508)}, /* client list */ \ + {0x0003, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(762)}, /* parts list */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Access Control (server) */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + {0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(1)}, /* InteractionModelVersion */ \ + {0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* VendorName */ \ + {0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* VendorID */ \ + {0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* ProductName */ \ + {0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* ProductID */ \ + {0x0005, ZAP_TYPE(CHAR_STRING), 33, \ + ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT()}, /* NodeLabel */ \ + {0x0006, ZAP_TYPE(CHAR_STRING), 3, \ + ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT()}, /* Location */ \ + {0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(0)}, /* HardwareVersion */ \ + {0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* HardwareVersionString */ \ + {0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(1016)}, /* SoftwareVersion */ \ + {0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* SoftwareVersionString */ \ + {0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* SerialNumber */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ + {0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_LONG_DEFAULTS_INDEX(1020)}, /* default ota provider */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + {0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_LONG_DEFAULTS_INDEX(1025)}, /* Breadcrumb */ \ + {0x0001, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1033)}, /* BasicCommissioningInfoList */ \ + {0x0002, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* RegulatoryConfig */ \ + {0x0003, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* LocationCapability */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + {0x0000, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* MaxNetworks */ \ + {0x0001, ZAP_TYPE(ARRAY), 12, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1287)}, /* Networks */ \ + {0x0002, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* ScanMaxTimeSeconds */ \ + {0x0003, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* ConnectMaxTimeSeconds */ \ + {0x0004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT()}, /* InterfaceEnabled */ \ + {0x0005, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* LastNetworkingStatus */ \ + {0x0006, ZAP_TYPE(OCTET_STRING), 33, 0, \ + ZAP_EMPTY_DEFAULT()}, /* LastNetworkID */ \ + {0x0007, ZAP_TYPE(INT32U), 4, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1299)}, /* LastConnectErrorValue */ \ + {0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1303)}, /* FeatureMap */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + {0x0000, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1307)}, /* NetworkInterfaces */ \ + {0x0001, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x0000)}, /* RebootCount */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + {0x0000, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* WindowStatus */ \ + {0x0001, ZAP_TYPE(FABRIC_IDX), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* AdminFabricIndex */ \ + {0x0002, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_EMPTY_DEFAULT()}, /* AdminVendorId */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + {0x0001, ZAP_TYPE(ARRAY), 320, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1561)}, /* fabrics list */ \ + {0x0002, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* SupportedFabrics */ \ + {0x0003, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* CommissionedFabrics */ \ + {0x0004, ZAP_TYPE(ARRAY), 400, 0, \ + ZAP_LONG_DEFAULTS_INDEX(1881)}, /* TrustedRootCertificates */ \ + {0x0005, ZAP_TYPE(FABRIC_IDX), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* CurrentFabricIndex */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + {0x0000, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(2281)}, /* groups */ \ + {0x0001, ZAP_TYPE(ARRAY), 254, 0, \ + ZAP_LONG_DEFAULTS_INDEX(2535)}, /* group keys */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + {0x0000, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(0)}, /* identify time */ \ + {0x0001, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x0)}, /* identify type */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(2)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + {0x0000, ZAP_TYPE(BITMAP8), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* name support */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(3)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Scenes (server) */ \ + {0x0000, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* scene count */ \ + {0x0001, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* current scene */ \ + {0x0002, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x0000)}, /* current group */ \ + {0x0003, ZAP_TYPE(BOOLEAN), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* scene valid */ \ + {0x0004, ZAP_TYPE(BITMAP8), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* name support */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(3)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + {0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0)}, /* OnOff */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(4)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + {0x0000, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* current level */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(3)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Basic (server) */ \ + {0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(1)}, /* InteractionModelVersion */ \ + {0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* VendorName */ \ + {0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* VendorID */ \ + {0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* ProductName */ \ + {0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* ProductID */ \ + {0x0005, ZAP_TYPE(CHAR_STRING), 33, \ + ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT()}, /* NodeLabel */ \ + {0x0006, ZAP_TYPE(CHAR_STRING), 3, \ + ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT()}, /* Location */ \ + {0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(0)}, /* HardwareVersion */ \ + {0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* HardwareVersionString */ \ + {0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(2789)}, /* SoftwareVersion */ \ + {0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* SoftwareVersionString */ \ + {0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT()}, /* SerialNumber */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_SIMPLE_DEFAULT(1)}, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Color Control (server) */ \ + {0x0000, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* current hue */ \ + {0x0001, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* current saturation */ \ + {0x0002, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x0000)}, /* remaining time */ \ + {0x0003, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x616B)}, /* current x */ \ + {0x0004, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x607D)}, /* current y */ \ + {0x0008, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x01)}, /* color mode */ \ + {0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x00)}, /* color control options */ \ + {0x0010, ZAP_TYPE(INT8U), 1, 0, \ + ZAP_EMPTY_DEFAULT()}, /* number of primaries */ \ + {0x4001, ZAP_TYPE(ENUM8), 1, 0, \ + ZAP_SIMPLE_DEFAULT(0x01)}, /* enhanced color mode */ \ + {0x400A, ZAP_TYPE(BITMAP16), 2, 0, \ + ZAP_SIMPLE_DEFAULT(0x0000)}, /* color capabilities */ \ + {0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, \ + ZAP_LONG_DEFAULTS_INDEX(2793)}, /* FeatureMap */ \ + {0xFFFD, ZAP_TYPE(INT16U), 2, 0, \ + ZAP_SIMPLE_DEFAULT(3)}, /* ClusterRevision */ \ + } + +// This is an array of EmberAfCluster structures. +#define ZAP_ATTRIBUTE_INDEX(index) \ + ((EmberAfAttributeMetadata *)(&generatedAttributes[index])) + +// Cluster function static arrays +#define GENERATED_FUNCTION_ARRAYS \ + const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \ + (EmberAfGenericClusterFunction)emberAfBasicClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayIdentifyServer[] = { \ + (EmberAfGenericClusterFunction)emberAfIdentifyClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) \ + MatterIdentifyClusterServerAttributeChangedCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayGroupsServer[] = { \ + (EmberAfGenericClusterFunction)emberAfGroupsClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayScenesServer[] = { \ + (EmberAfGenericClusterFunction)emberAfScenesClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ + (EmberAfGenericClusterFunction)emberAfOnOffClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ + (EmberAfGenericClusterFunction) \ + emberAfLevelControlClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ + (EmberAfGenericClusterFunction) \ + emberAfColorControlClusterServerInitCallback, \ + }; + +#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask +#define GENERATED_CLUSTER_COUNT 18 +#define GENERATED_CLUSTERS \ + { \ + {0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 1018, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: Descriptor (server) */ \ + {0x001F, ZAP_ATTRIBUTE_INDEX(5), 1, 2, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: Access Control (server) */ \ + {0x0028, \ + ZAP_ATTRIBUTE_INDEX(6), \ + 13, \ + 279, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayBasicServer}, /* Endpoint: 0, Cluster: Basic (server) */ \ + {0x0029, ZAP_ATTRIBUTE_INDEX(19), 1, 2, ZAP_CLUSTER_MASK(CLIENT), \ + NULL}, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) \ + */ \ + {0x002A, ZAP_ATTRIBUTE_INDEX(20), 2, 19, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: OTA Software Update Requestor \ + (server) */ \ + {0x0030, ZAP_ATTRIBUTE_INDEX(22), 5, 266, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + {0x0031, ZAP_ATTRIBUTE_INDEX(27), 10, 60, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + {0x0033, ZAP_ATTRIBUTE_INDEX(37), 3, 258, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + {0x003C, ZAP_ATTRIBUTE_INDEX(40), 4, 6, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) \ + */ \ + {0x003E, ZAP_ATTRIBUTE_INDEX(44), 6, 725, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + {0x003F, ZAP_ATTRIBUTE_INDEX(50), 3, 510, ZAP_CLUSTER_MASK(SERVER), \ + NULL}, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + {0x0003, \ + ZAP_ATTRIBUTE_INDEX(53), \ + 3, \ + 5, \ + 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(56), \ + 2, \ + 3, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayGroupsServer}, /* Endpoint: 1, Cluster: Groups (server) \ + */ \ + {0x0005, \ + ZAP_ATTRIBUTE_INDEX(58), \ + 6, \ + 8, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayScenesServer}, /* Endpoint: 1, Cluster: Scenes (server) \ + */ \ + {0x0006, \ + ZAP_ATTRIBUTE_INDEX(64), \ + 2, \ + 3, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayOnOffServer}, /* Endpoint: 1, Cluster: On/Off (server) \ + */ \ + {0x0008, \ + ZAP_ATTRIBUTE_INDEX(66), \ + 2, \ + 3, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayLevelControlServer}, /* Endpoint: 1, Cluster: Level \ + Control (server) */ \ + {0x0028, \ + ZAP_ATTRIBUTE_INDEX(68), \ + 13, \ + 279, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayBasicServer}, /* Endpoint: 1, Cluster: Basic (server) */ \ + {0x0300, \ + ZAP_ATTRIBUTE_INDEX(81), \ + 12, \ + 20, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + chipFuncArrayColorControlServer}, /* Endpoint: 1, Cluster: Color \ + Control (server) */ \ + } + +#define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *)(&generatedClusters[index])) + +// This is an array of EmberAfEndpointType structures. +#define GENERATED_ENDPOINT_TYPES \ + { {ZAP_CLUSTER_INDEX(0), 11, 3145}, {ZAP_CLUSTER_INDEX(11), 7, 321}, } + +// Largest attribute size is needed for various buffers +#define ATTRIBUTE_LARGEST (401) + +// Total size of singleton attributes +#define ATTRIBUTE_SINGLETONS_SIZE (558) + +// Total size of attribute storage +#define ATTRIBUTE_MAX_SIZE (3466) + +// Number of fixed endpoints +#define FIXED_ENDPOINT_COUNT (2) + +// Array of endpoints that are supported, the data inside +// the array is the endpoint number. +#define FIXED_ENDPOINT_ARRAY \ + { 0x0000, 0x0001 } + +// Array of profile ids +#define FIXED_PROFILE_IDS \ + { 0x0103, 0x0104 } + +// Array of device ids +#define FIXED_DEVICE_IDS \ + { 22, 258 } + +// Array of device versions +#define FIXED_DEVICE_VERSIONS \ + { 1, 1 } + +// Array of endpoint types supported on each endpoint +#define FIXED_ENDPOINT_TYPES \ + { 0, 1 } + +// Array of networks supported on each endpoint +#define FIXED_NETWORKS \ + { 0, 0 } diff --git a/examples/zap_light/main/zap-generated/gen_config.h b/examples/zap_light/main/zap-generated/gen_config.h new file mode 100644 index 000000000..de53fb975 --- /dev/null +++ b/examples/zap_light/main/zap-generated/gen_config.h @@ -0,0 +1,158 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +// User options for plugin Binding Table Library +#define EMBER_BINDING_TABLE_SIZE 10 + +/**** Network Section ****/ +#define EMBER_SUPPORTED_NETWORKS (1) + +#define EMBER_APS_UNICAST_MESSAGE_COUNT 10 + +/**** Cluster endpoint counts ****/ +#define EMBER_AF_ACCESS_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) + +/**** Cluster Plugins ****/ + +// Use this macro to check if the server side of the Access Control cluster is +// included +#define ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL + +// Use this macro to check if the server side of the AdministratorCommissioning +// cluster is included +#define ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING_SERVER +#define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING + +// Use this macro to check if the server side of the Basic cluster is included +#define ZCL_USING_BASIC_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_BASIC_SERVER +#define EMBER_AF_PLUGIN_BASIC + +// Use this macro to check if the server side of the Color Control cluster is +// included +#define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER +#define EMBER_AF_PLUGIN_COLOR_CONTROL +// User options for server plugin Color Control +#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY +#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP +#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + +// Use this macro to check if the server side of the Descriptor cluster is +// included +#define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_DESCRIPTOR_SERVER +#define EMBER_AF_PLUGIN_DESCRIPTOR + +// Use this macro to check if the server side of the General Commissioning +// cluster is included +#define ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING_SERVER +#define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING + +// Use this macro to check if the server side of the General Diagnostics cluster +// is included +#define ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS_SERVER +#define EMBER_AF_PLUGIN_GENERAL_DIAGNOSTICS + +// Use this macro to check if the server side of the Group Key Management +// cluster is included +#define ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT_SERVER +#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT + +// Use this macro to check if the server side of the Groups cluster is included +#define ZCL_USING_GROUPS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUPS_SERVER +#define EMBER_AF_PLUGIN_GROUPS + +// Use this macro to check if the server side of the Identify cluster is +// included +#define ZCL_USING_IDENTIFY_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_IDENTIFY_SERVER +#define EMBER_AF_PLUGIN_IDENTIFY + +// Use this macro to check if the server side of the Level Control cluster is +// included +#define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_SERVER +#define EMBER_AF_PLUGIN_LEVEL_CONTROL +// User options for server plugin Level Control +#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 255 +#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 client side of the OTA Software Update +// Provider cluster is included +#define ZCL_USING_OTA_PROVIDER_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_CLIENT + +// Use this macro to check if the server side of the OTA Software Update +// Requestor cluster is included +#define ZCL_USING_OTA_REQUESTOR_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_REQUESTOR + +// 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 +#define EMBER_AF_PLUGIN_ON_OFF + +// Use this macro to check if the server side of the Operational Credentials +// cluster is included +#define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER +#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS + +// Use this macro to check if the server side of the Scenes cluster is included +#define ZCL_USING_SCENES_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_SCENES_SERVER +#define EMBER_AF_PLUGIN_SCENES +// User options for server plugin Scenes +#define EMBER_AF_PLUGIN_SCENES_TABLE_SIZE 3 diff --git a/examples/zap_light/main/zap-generated/gen_tokens.h b/examples/zap_light/main/zap-generated/gen_tokens.h new file mode 100644 index 000000000..9579330d7 --- /dev/null +++ b/examples/zap_light/main/zap-generated/gen_tokens.h @@ -0,0 +1,43 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +// This file contains the tokens for attributes stored in flash + +// Identifier tags for tokens + +// Types for the tokens +#ifdef DEFINETYPES +#endif // DEFINETYPES + +// Actual token definitions +#ifdef DEFINETOKENS +#endif // DEFINETOKENS + +// Macro snippet that loads all the attributes from tokens +#define GENERATED_TOKEN_LOADER(endpoint) \ + do { \ + } while (false) + +// Macro snippet that saves the attribute to token +#define GENERATED_TOKEN_SAVER \ + do { \ + } while (false) diff --git a/examples/zap_light/partitions.csv b/examples/zap_light/partitions.csv new file mode 100644 index 000000000..f0215a98a --- /dev/null +++ b/examples/zap_light/partitions.csv @@ -0,0 +1,9 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +sec_cert, 0x3F, ,0xd000, 0x3000, , # Never mark this as an encrypted partition +nvs, data, nvs, 0x10000, 0x6000, +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, 0x20000, 0x1E0000, +ota_1, app, ota_1, 0x200000, 0x1E0000, +fctry, data, nvs, 0x3E0000, 0x6000 diff --git a/examples/zap_light/partitions_h2.csv b/examples/zap_light/partitions_h2.csv new file mode 100644 index 000000000..5fc6c06a9 --- /dev/null +++ b/examples/zap_light/partitions_h2.csv @@ -0,0 +1,10 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +sec_cert, 0x3F, ,0xd000, 0x3000, , # Never mark this as an encrypted partition +nvs, data, nvs, 0x10000, 0x6000, +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, 0x20000, 0x1E0000, +ota_1, app, ota_1, 0x200000, 0x1E0000, +fctry, data, nvs, 0x3E0000, 0x6000, +ot_storage,data, fat, , 0x6000, diff --git a/examples/zap_light/sdkconfig.defaults b/examples/zap_light/sdkconfig.defaults new file mode 100644 index 000000000..8e4871aca --- /dev/null +++ b/examples/zap_light/sdkconfig.defaults @@ -0,0 +1,25 @@ +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +#enable BT +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/zap_light/sdkconfig.defaults.esp32h2 b/examples/zap_light/sdkconfig.defaults.esp32h2 new file mode 100644 index 000000000..dc8f0e2c5 --- /dev/null +++ b/examples/zap_light/sdkconfig.defaults.esp32h2 @@ -0,0 +1,62 @@ +CONFIG_IDF_TARGET="esp32h2" + +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + + +# Enable NIMBLE which is mynewt_nimble component out of bt component +# It will be merge to bt component soon +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_NEWTOS_ENABLE=n +CONFIG_BLE_50_FEATURE_SUPPORT=y +CONFIG_BLE_HCI_UART_BAUD=921600 +CONFIG_BLE_EXT_ADV=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_h2.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# mbedTLS +CONFIG_MBEDTLS_HARDWARE_AES=n +CONFIG_MBEDTLS_HARDWARE_MPI=n +CONFIG_MBEDTLS_HARDWARE_SHA=n +CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN=n +CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY=n +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n + +# Disable Matter Shell +CONFIG_ENABLE_CHIP_SHELL=n + +# Increase stacks size +CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 +CONFIG_NIMBLE_CONTROLLER_TASK_STACK_SIZE=5120 +CONFIG_NIMBLE_HOST_TASK_STACK_SIZE=5120 + +# ESP32H2 BLE using a ext 32k crystal +CONFIG_ESP32H2_RTC_CLK_SRC_EXT_CRYS=y diff --git a/examples/zap_light/sdkconfig.defaults.esp32s2 b/examples/zap_light/sdkconfig.defaults.esp32s2 new file mode 100644 index 000000000..ee16269ac --- /dev/null +++ b/examples/zap_light/sdkconfig.defaults.esp32s2 @@ -0,0 +1,24 @@ +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Disable BLE +CONFIG_ENABLE_CHIPOBLE=n