From 6a21e50811cdf78a5e45cc4a56c448c4554c418f Mon Sep 17 00:00:00 2001 From: chendejin Date: Thu, 29 Feb 2024 19:35:55 +0800 Subject: [PATCH 1/7] upload component files in submodule --- .github/workflows/upload_component.yml | 2 ++ CMakeLists.txt | 16 ++++++---------- generate-include-files.cmake | 7 +++++-- idf_component.yml | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/upload_component.yml b/.github/workflows/upload_component.yml index 83f7c481c..26b4b0b49 100644 --- a/.github/workflows/upload_component.yml +++ b/.github/workflows/upload_component.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'recursive' - name: Upload components to component service uses: espressif/upload-components-ci-action@v1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index c3315f962..37e48af0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,4 @@ -if(NOT MATTER_SDK_PATH) - get_filename_component(MATTER_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/connectedhomeip/connectedhomeip/ REALPATH) -endif() +get_filename_component(MATTER_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/connectedhomeip/connectedhomeip/ REALPATH) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/connectedhomeip/connectedhomeip/ REALPATH) include(${CMAKE_CURRENT_LIST_DIR}/connectedhomeip/connectedhomeip/config/esp32/components/chip/ota-image.cmake) @@ -29,7 +27,6 @@ endfunction() set(SRC_DIRS_LIST "${MATTER_SDK_PATH}/src/access" "${MATTER_SDK_PATH}/src/access/examples" "${MATTER_SDK_PATH}/src/app" - "${MATTER_SDK_PATH}/src/app/icd/" "${MATTER_SDK_PATH}/src/app/MessageDef" "${MATTER_SDK_PATH}/src/app/reporting" "${MATTER_SDK_PATH}/src/app/server" @@ -105,6 +102,7 @@ set(EXCLUDE_SRCS_LIST "${MATTER_SDK_PATH}/src/controller/ExamplePersistentStorag "${MATTER_SDK_PATH}/src/lib/dnssd/minimal_mdns/AddressPolicy_LibNlImpl.cpp" "${MATTER_SDK_PATH}/src/lib/dnssd/minimal_mdns/Logging.cpp" "${MATTER_SDK_PATH}/src/lib/support/UnitTestRegistration.cpp" + "${MATTER_SDK_PATH}/src/lib/support/UnitTest.cpp" "${MATTER_SDK_PATH}/src/lib/support/UnitTestUtils.cpp" "${MATTER_SDK_PATH}/src/lib/support/JniReferences.cpp" "${MATTER_SDK_PATH}/src/lib/support/CHIPMem-Simple.cpp" @@ -370,9 +368,8 @@ if (NOT CONFIG_ENABLE_CHIPOBLE) "${MATTER_SDK_PATH}/src/ble/BtpEngine.cpp") endif() -if(NOT CONFIG_ENABLE_ICD_SERVER) - list(APPEND EXCLUDE_SRCS_LIST "${MATTER_SDK_PATH}/src/app/icd/ICDManager.cpp" - "${MATTER_SDK_PATH}/src/app/icd/ICDNotifier.cpp") +if(CONFIG_ENABLE_ICD_SERVER) + list(APPEND SRC_DIRS_LIST "${MATTER_SDK_PATH}/src/app/icd/server/") endif() idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} @@ -441,10 +438,9 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group ${chip_libraries} -Wl,--end-group) -# Build OTA image need a python package, leading a file change and distorying the hash of managed_components. -# In next idf_component_manager release, this may be resolved by adding include/exclude for calculating component_hash. +# TODO: Build OTA image need a python package, leading a file change and distorying the hash of managed_components. # Build Matter OTA image -if (CONFIG_CHIP_OTA_IMAGE_BUILD) +if (false AND CONFIG_CHIP_OTA_IMAGE_BUILD) chip_ota_image(chip-ota-image INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin diff --git a/generate-include-files.cmake b/generate-include-files.cmake index 64d4a8fe0..2bbc696c3 100644 --- a/generate-include-files.cmake +++ b/generate-include-files.cmake @@ -46,8 +46,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/app/AppBuildConfig.h #endif ") -# Generating app/icd/ICDBuildConfig.h -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/app/icd/ICDBuildConfig.h +# Generating app/icd/server/ICDServerBuildConfig.h +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/app/icd/server/ICDServerBuildConfig.h "#pragma once\n #ifdef CONFIG_ENABLE_ICD_SERVER #define CHIP_CONFIG_ENABLE_ICD_SERVER 1 @@ -55,6 +55,9 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/app/icd/ICDBuildConfig.h #define CHIP_CONFIG_ENABLE_ICD_SERVER 0 #endif +#define CHIP_CONFIG_ENABLE_ICD_LIT 0 +#define CHIP_CONFIG_ENABLE_ICD_CIP 0 +#define CHIP_CONFIG_ENABLE_ICD_UAT 0 #define ICD_REPORT_ON_ENTER_ACTIVE_MODE 0 #define ICD_MAX_NOTIFICATION_SUBSCRIBERS 1 #define ICD_ENFORCE_SIT_SLOW_POLL_LIMIT 0 diff --git a/idf_component.yml b/idf_component.yml index ebad2a2b7..9c076c652 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,5 +1,5 @@ ## IDF Component Manager Manifest File -version: 0.0.1 +version: 0.0.2 description: Espressif's Matter SDK Component url: https://github.com/espressif/esp-matter files: @@ -29,7 +29,7 @@ files: - "./connectedhomeip/connectedhomeip/src/app/util/**/*" - "./connectedhomeip/connectedhomeip/src/ble/*.*" - "./connectedhomeip/connectedhomeip/src/controller/*.*" - - "./connectedhomeip/connectedhomeip/src/controller/python/chip/tlv/*.*" + - "./connectedhomeip/connectedhomeip/src/controller/python/chip/tlv/tlvlist.py" - "./connectedhomeip/connectedhomeip/src/credentials/*.*" - "./connectedhomeip/connectedhomeip/src/credentials/attestation_verifier/**/*" - "./connectedhomeip/connectedhomeip/src/credentials/examples/**/*" From bed4aa92e339f28a6419a9d438d3837b30bd51fa Mon Sep 17 00:00:00 2001 From: Vilem Zavodny Date: Tue, 20 Feb 2024 09:31:42 +0100 Subject: [PATCH 2/7] fix: Fixed boot GPIO number on ESP32C6, ESP32H2 and ESP32C3. --- examples/light/main/app_driver.cpp | 30 ++++++++++--------- examples/light/sdkconfig.defaults.esp32c3 | 21 +++++++++++++ examples/light/sdkconfig.defaults.esp32c6 | 2 +- examples/light/sdkconfig.defaults.esp32h2 | 2 +- examples/light/sdkconfig.defaults.ext_plat_ci | 9 ++++++ 5 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 examples/light/sdkconfig.defaults.esp32c3 diff --git a/examples/light/main/app_driver.cpp b/examples/light/main/app_driver.cpp index 8952710c7..cc356b06a 100644 --- a/examples/light/main/app_driver.cpp +++ b/examples/light/main/app_driver.cpp @@ -24,7 +24,7 @@ extern uint16_t light_endpoint_id; /* Do any conversions/remapping for the actual value here */ static esp_err_t app_driver_light_set_power(led_indicator_handle_t handle, esp_matter_attr_val_t *val) { -#if BSP_LED_NUM > 0 +#if CONFIG_BSP_LEDS_NUM > 0 esp_err_t err = ESP_OK; if (val->val.b) { err = led_indicator_start(handle, BSP_LED_ON); @@ -41,7 +41,7 @@ static esp_err_t app_driver_light_set_power(led_indicator_handle_t handle, esp_m static esp_err_t app_driver_light_set_brightness(led_indicator_handle_t handle, esp_matter_attr_val_t *val) { int value = REMAP_TO_RANGE(val->val.u8, MATTER_BRIGHTNESS, STANDARD_BRIGHTNESS); -#if BSP_LED_NUM > 0 +#if CONFIG_BSP_LEDS_NUM > 0 return led_indicator_set_brightness(handle, value); #else ESP_LOGI(TAG, "LED set brightness: %d", value); @@ -52,10 +52,11 @@ static esp_err_t app_driver_light_set_brightness(led_indicator_handle_t handle, static esp_err_t app_driver_light_set_hue(led_indicator_handle_t handle, esp_matter_attr_val_t *val) { int value = REMAP_TO_RANGE(val->val.u8, MATTER_HUE, STANDARD_HUE); -#if BSP_LED_NUM > 0 - uint32_t hsv = led_indicator_get_hsv(handle); - SET_HUE(hsv, value); - return led_indicator_set_hsv(handle, hsv); +#if CONFIG_BSP_LEDS_NUM > 0 + led_indicator_ihsv_t hsv; + hsv.value = led_indicator_get_hsv(handle); + hsv.h = value; + return led_indicator_set_hsv(handle, hsv.value); #else ESP_LOGI(TAG, "LED set hue: %d", value); return ESP_OK; @@ -65,10 +66,11 @@ static esp_err_t app_driver_light_set_hue(led_indicator_handle_t handle, esp_mat static esp_err_t app_driver_light_set_saturation(led_indicator_handle_t handle, esp_matter_attr_val_t *val) { int value = REMAP_TO_RANGE(val->val.u8, MATTER_SATURATION, STANDARD_SATURATION); -#if BSP_LED_NUM > 0 - uint32_t hsv = led_indicator_get_hsv(handle); - SET_SATURATION(hsv, value); - return led_indicator_set_hsv(handle, hsv); +#if CONFIG_BSP_LEDS_NUM > 0 + led_indicator_ihsv_t hsv; + hsv.value = led_indicator_get_hsv(handle); + hsv.s = value; + return led_indicator_set_hsv(handle, hsv.value); #else ESP_LOGI(TAG, "LED set saturation: %d", value); return ESP_OK; @@ -78,7 +80,7 @@ static esp_err_t app_driver_light_set_saturation(led_indicator_handle_t handle, static esp_err_t app_driver_light_set_temperature(led_indicator_handle_t handle, esp_matter_attr_val_t *val) { uint32_t value = REMAP_TO_RANGE_INVERSE(val->val.u16, STANDARD_TEMPERATURE_FACTOR); -#if BSP_LED_NUM > 0 +#if CONFIG_BSP_LEDS_NUM > 0 return led_indicator_set_color_temperature(handle, value); #else ESP_LOGI(TAG, "LED set temperature: %ld", value); @@ -181,10 +183,10 @@ esp_err_t app_driver_light_set_defaults(uint16_t endpoint_id) app_driver_handle_t app_driver_light_init() { -#if BSP_LED_NUM > 0 +#if CONFIG_BSP_LEDS_NUM > 0 /* Initialize led */ - led_indicator_handle_t leds[BSP_LED_NUM]; - ESP_ERROR_CHECK(bsp_led_indicator_create(leds, NULL, BSP_LED_NUM)); + led_indicator_handle_t leds[CONFIG_BSP_LEDS_NUM]; + ESP_ERROR_CHECK(bsp_led_indicator_create(leds, NULL, CONFIG_BSP_LEDS_NUM)); led_indicator_set_hsv(leds[0], SET_HSV(DEFAULT_HUE, DEFAULT_SATURATION, DEFAULT_BRIGHTNESS)); return (app_driver_handle_t)leds[0]; diff --git a/examples/light/sdkconfig.defaults.esp32c3 b/examples/light/sdkconfig.defaults.esp32c3 new file mode 100644 index 000000000..1c873a0cf --- /dev/null +++ b/examples/light/sdkconfig.defaults.esp32c3 @@ -0,0 +1,21 @@ +CONFIG_IDF_TARGET="esp32c3" + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y + +# Disable AP +CONFIG_ENABLE_WIFI_STATION=y +CONFIG_ENABLE_WIFI_AP=n + +# ESP32-C3-DevKitC-02 Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=9 +CONFIG_BSP_BUTTON_1_LEVEL=0 +# LEDs +CONFIG_BSP_LEDS_NUM=1 +CONFIG_BSP_LED_TYPE_RGB=y +CONFIG_BSP_LED_RGB_GPIO=8 +CONFIG_BSP_LED_RGB_BACKEND_RMT=y + diff --git a/examples/light/sdkconfig.defaults.esp32c6 b/examples/light/sdkconfig.defaults.esp32c6 index 87eb7b927..abc81be82 100644 --- a/examples/light/sdkconfig.defaults.esp32c6 +++ b/examples/light/sdkconfig.defaults.esp32c6 @@ -42,7 +42,7 @@ CONFIG_ENABLE_CHIP_SHELL=y # Buttons CONFIG_BSP_BUTTONS_NUM=1 CONFIG_BSP_BUTTON_1_TYPE_GPIO=y -CONFIG_BSP_BUTTON_1_GPIO=0 +CONFIG_BSP_BUTTON_1_GPIO=9 CONFIG_BSP_BUTTON_1_LEVEL=0 # LEDs CONFIG_BSP_LEDS_NUM=1 diff --git a/examples/light/sdkconfig.defaults.esp32h2 b/examples/light/sdkconfig.defaults.esp32h2 index eb037572a..8e60916dc 100644 --- a/examples/light/sdkconfig.defaults.esp32h2 +++ b/examples/light/sdkconfig.defaults.esp32h2 @@ -58,7 +58,7 @@ CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=y # Buttons CONFIG_BSP_BUTTONS_NUM=1 CONFIG_BSP_BUTTON_1_TYPE_GPIO=y -CONFIG_BSP_BUTTON_1_GPIO=0 +CONFIG_BSP_BUTTON_1_GPIO=9 CONFIG_BSP_BUTTON_1_LEVEL=0 # LEDs CONFIG_BSP_LEDS_NUM=1 diff --git a/examples/light/sdkconfig.defaults.ext_plat_ci b/examples/light/sdkconfig.defaults.ext_plat_ci index 7d75d598c..e03657152 100644 --- a/examples/light/sdkconfig.defaults.ext_plat_ci +++ b/examples/light/sdkconfig.defaults.ext_plat_ci @@ -50,3 +50,12 @@ CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# ESP32-DevKit Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=0 +CONFIG_BSP_BUTTON_1_LEVEL=0 +# LEDs +CONFIG_BSP_LEDS_NUM=0 \ No newline at end of file From 9bfc4293a1e5e644f24af7c8703e08be127b7aa2 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 8 Mar 2024 16:56:38 +0530 Subject: [PATCH 3/7] rmaker: Fix the size of char attributes and use the non deleted method for matching the concrete path --- .../esp_matter_rainmaker.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp index 5fc5ef897..d2efdaeae 100644 --- a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp +++ b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp @@ -377,18 +377,18 @@ static esp_err_t custom_cluster_create() /* Update the value of the attribute after esp_rmaker_node_init() is done */ char rmaker_node_id[ESP_MATTER_RAINMAKER_MAX_NODE_ID_LEN] = {0}; attribute::create(cluster, cluster::rainmaker::attribute::rmaker_node_id::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_char_str(rmaker_node_id, sizeof(rmaker_node_id))); + esp_matter_char_str(rmaker_node_id, strlen(rmaker_node_id)), sizeof(rmaker_node_id)); /* Create custom challenge_response attribute */ /* Update the value of the attribute after sign_data command is called */ char challenge_response[ESP_MATTER_RAINMAKER_MAX_CHALLENGE_RESPONSE_LEN] = {0}; attribute::create(cluster, cluster::rainmaker::attribute::challenge_response::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_char_str(challenge_response, sizeof(challenge_response))); + esp_matter_char_str(challenge_response, strlen(challenge_response)), sizeof(challenge_response)); /* Create custom challenge attribute */ char challenge[ESP_MATTER_RAINMAKER_MAX_CHALLENGE_LEN] = {0}; attribute::create(cluster, cluster::rainmaker::attribute::challenge::Id, ATTRIBUTE_FLAG_WRITABLE, - esp_matter_char_str(challenge, sizeof(challenge))); + esp_matter_char_str(challenge, strlen(challenge)), sizeof(challenge)); /* Create custom configuration command */ command::create(cluster, cluster::rainmaker::command::configuration::Id, @@ -415,7 +415,10 @@ public: CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override { - if (aPath == ConcreteDataAttributePath(cluster::rainmaker::endpoint_id, cluster::rainmaker::Id, cluster::rainmaker::attribute::challenge::Id)) + ConcreteDataAttributePath challengeAttrPath(cluster::rainmaker::endpoint_id, cluster::rainmaker::Id, + cluster::rainmaker::attribute::challenge::Id); + + if (challengeAttrPath.MatchesConcreteAttributePath(aPath)) { chip::CharSpan challenge; CHIP_ERROR c_err = aDecoder.Decode(challenge); @@ -427,10 +430,8 @@ public: return (ESP_OK == sign_and_update_challenge_response(challenge)) ? CHIP_NO_ERROR : CHIP_ERROR_INCORRECT_STATE; } - else - { - return CHIP_NO_ERROR; - } + + return CHIP_NO_ERROR; } }; From c58bc87b94f7004524f42a210fa70e9bfbdf40ef Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Sun, 10 Mar 2024 15:49:29 +0530 Subject: [PATCH 4/7] Fix battery replacement description and active locale attributes --- components/esp_matter/esp_matter_attribute.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index 89bb214ec..8316ba489 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -3330,9 +3330,13 @@ namespace attribute { attribute_t *create_active_locale(cluster_t *cluster, char *value, uint16_t length) { + if (length > k_max_active_locale_length) { + ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); + return NULL; + } return esp_matter::attribute::create(cluster, LocalizationConfiguration::Attributes::ActiveLocale::Id, ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE, - esp_matter_char_str(value, length)); + esp_matter_char_str(value, length), k_max_active_locale_length); } attribute_t *create_supported_locales(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count) @@ -3854,7 +3858,7 @@ attribute_t *create_active_bat_faults(cluster_t *cluster, uint8_t * value, uint1 attribute_t *create_bat_replacement_description(cluster_t *cluster, const char * value, uint16_t length) { - if (length > k_max_description_length) { + if (length > k_max_bat_replacement_description_length) { ESP_LOGE(TAG, "Could not create attribute, string size out of bound"); return NULL; } From df42dfda6b76f40141d4a2a2df12fa11961e1341 Mon Sep 17 00:00:00 2001 From: Will <126089010+Will-Panton@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:05:00 +0000 Subject: [PATCH 5/7] Make error message generic for other bridge device types BLE Mesh and ESP now examples also call app_bridge_create_bridged_device so log message shouldn't refer to any particular device type. --- examples/common/app_bridge/app_bridged_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/app_bridge/app_bridged_device.cpp b/examples/common/app_bridge/app_bridged_device.cpp index 7809a79df..083e11330 100644 --- a/examples/common/app_bridge/app_bridged_device.cpp +++ b/examples/common/app_bridge/app_bridged_device.cpp @@ -173,7 +173,7 @@ app_bridged_device_t *app_bridge_create_bridged_device(node_t *node, uint16_t pa void *priv_data) { if (g_current_bridged_device_count >= MAX_BRIDGED_DEVICE_COUNT) { - ESP_LOGE(TAG, "The device list is full, Could not add a zigbee bridged device"); + ESP_LOGE(TAG, "The device list is full, could not add bridged device"); return NULL; } app_bridged_device_t *new_dev = (app_bridged_device_t *)esp_matter_mem_calloc(1, sizeof(app_bridged_device_t)); From dbd259731941652cd7614e6ecd2eba89bba89c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 13 Mar 2024 13:11:58 +0100 Subject: [PATCH 6/7] Fix a typo in generic_switch example README.md --- examples/generic_switch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/generic_switch/README.md b/examples/generic_switch/README.md index 4fa187efa..204731e1b 100644 --- a/examples/generic_switch/README.md +++ b/examples/generic_switch/README.md @@ -3,7 +3,7 @@ This example creates a Generic Switch device using the ESP Matter data model. This example demonstrates the use of few optional data model elements like : -- Fixed Label Cluster : provides a feature for the device to tag an endpoint with zero or more read only labels.(demonnstrated through nvs) +- Fixed Label Cluster : provides a feature for the device to tag an endpoint with zero or more read only labels (demonstrated through nvs). - User Label Cluster : This cluster provides a feature to tag an endpoint with zero or more labels. - Taglist Feature of Descriptor Cluster : used to disambiguate sibling endpoints where two or more sibling endpoints have an overlap in the supported device types with each such endpoint having a unique TagList. From 4fb00b55631600fcf55b8b4b19938b322324e3ec Mon Sep 17 00:00:00 2001 From: Li Ya Shuai Date: Thu, 21 Mar 2024 09:47:23 +0800 Subject: [PATCH 7/7] update scene management cluster for matter1.3 --- components/esp_matter/esp_matter_client.cpp | 14 +++++++------- components/esp_matter/esp_matter_cluster.cpp | 8 +++++--- .../zap_common/zap-generated/CHIPClusters.h | 6 +++--- .../zap_common/zap-generated/gen_config.h | 5 +++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/components/esp_matter/esp_matter_client.cpp b/components/esp_matter/esp_matter_client.cpp index 11b4a21ea..f2fe3af5c 100644 --- a/components/esp_matter/esp_matter_client.cpp +++ b/components/esp_matter/esp_matter_client.cpp @@ -1182,7 +1182,7 @@ esp_err_t send_add_scene(peer_device_t *remote_device, uint16_t remote_endpoint_ command_data.sceneName = chip::CharSpan(scene_name, strnlen(scene_name, 16)); command_data.extensionFieldSets = efs; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, add_scene_cb, send_command_failure_callback); return ESP_OK; @@ -1195,7 +1195,7 @@ esp_err_t send_view_scene(peer_device_t *remote_device, uint16_t remote_endpoint command_data.groupID = group_id; command_data.sceneID = scene_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, view_scene_cb, send_command_failure_callback); return ESP_OK; @@ -1208,7 +1208,7 @@ esp_err_t send_remove_scene(peer_device_t *remote_device, uint16_t remote_endpoi command_data.groupID = group_id; command_data.sceneID = scene_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, remove_scene_cb, send_command_failure_callback); return ESP_OK; @@ -1220,7 +1220,7 @@ esp_err_t send_remove_all_scenes(peer_device_t *remote_device, uint16_t remote_e ScenesManagement::Commands::RemoveAllScenes::Type command_data; command_data.groupID = group_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, remove_all_scenes_cb, send_command_failure_callback); return ESP_OK; @@ -1233,7 +1233,7 @@ esp_err_t send_store_scene(peer_device_t *remote_device, uint16_t remote_endpoin command_data.groupID = group_id; command_data.sceneID = scene_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, store_scene_cb, send_command_failure_callback); return ESP_OK; @@ -1246,7 +1246,7 @@ esp_err_t send_recall_scene(peer_device_t *remote_device, uint16_t remote_endpoi command_data.groupID = group_id; command_data.sceneID = scene_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, send_command_success_callback, send_command_failure_callback); return ESP_OK; @@ -1258,7 +1258,7 @@ esp_err_t send_get_scene_membership(peer_device_t *remote_device, uint16_t remot ScenesManagement::Commands::GetSceneMembership::Type command_data; command_data.groupID = group_id; - chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), + chip::Controller::ScenesManagementCluster cluster(*remote_device->GetExchangeManager(), remote_device->GetSecureSession().Value(), remote_endpoint_id); cluster.InvokeCommand(command_data, NULL, get_scene_membership_cb, send_command_failure_callback); return ESP_OK; diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index c5f0e2242..4cbb7007e 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -1187,8 +1187,11 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } /* groups */ namespace scenes_management { -const function_generic_t *function_list = NULL; -const int function_flags = CLUSTER_FLAG_NONE; +const function_generic_t function_list[] = { + (function_generic_t)emberAfScenesManagementClusterServerInitCallback, + (function_generic_t)MatterScenesManagementClusterServerShutdownCallback, +}; +const int function_flags = CLUSTER_FLAG_INIT_FUNCTION | CLUSTER_FLAG_SHUTDOWN_FUNCTION; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) { @@ -1214,7 +1217,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); - attribute::create_last_configured_by(cluster, 0); attribute::create_scene_table_size(cluster, config->scene_table_size); attribute::create_fabric_scene_info(cluster, NULL, 0, 0); } else { diff --git a/components/esp_matter/zap_common/zap-generated/CHIPClusters.h b/components/esp_matter/zap_common/zap-generated/CHIPClusters.h index d176bd6dd..e17e1f20e 100644 --- a/components/esp_matter/zap_common/zap-generated/CHIPClusters.h +++ b/components/esp_matter/zap_common/zap-generated/CHIPClusters.h @@ -42,11 +42,11 @@ public: ~GroupsCluster() {} }; -class DLL_EXPORT ScenesCluster : public ClusterBase +class DLL_EXPORT ScenesManagementCluster : public ClusterBase { public: - ScenesCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) {} - ~ScenesCluster() {} + ScenesManagementCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) {} + ~ScenesManagementCluster() {} }; class DLL_EXPORT OnOffCluster : public ClusterBase diff --git a/components/esp_matter/zap_common/zap-generated/gen_config.h b/components/esp_matter/zap_common/zap-generated/gen_config.h index 900e4a387..5b54a806b 100644 --- a/components/esp_matter/zap_common/zap-generated/gen_config.h +++ b/components/esp_matter/zap_common/zap-generated/gen_config.h @@ -124,7 +124,7 @@ #define ZCL_USING_PUMP_CONFIG_CONTROL_CLUSTER_SERVER #define ZCL_USING_PWM_CLUSTER_SERVER #define ZCL_USING_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER -#define ZCL_USING_SCENES_CLUSTER_SERVER +#define ZCL_USING_SCENES_MANAGEMENT_CLUSTER_SERVER #define ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER #define ZCL_USING_SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER #define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER @@ -153,6 +153,7 @@ /* Cluster specific macros which are generic */ #define MATTER_DM_PLUGIN_ON_OFF // used in level control +#define MATTER_DM_PLUGIN_LEVEL_CONTROL #define MATTER_DM_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 254 // used in level control #define MATTER_DM_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 // used in level control #define MATTER_DM_PLUGIN_LEVEL_CONTROL_RATE 0 // used in level control @@ -163,7 +164,7 @@ #define MATTER_DM_PLUGIN_GROUPS_SERVER // used in scenes, util -#define MATTER_DM_PLUGIN_SCENES // used in groups, level control, on off +#define MATTER_DM_PLUGIN_SCENES_MANAGEMENT // used in groups, level control, on off #define MATTER_DM_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE 541 // used in ias zone server