From 211658c88ecd2984c768de4dc7837a531bea9d7a Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Fri, 21 Nov 2025 12:30:57 +0800 Subject: [PATCH] upgrade connectedhomeip to latest release v1.5 branch --- .gitlab-ci.yml | 3 +- README.md | 2 +- .../data_model/esp_matter_cluster.cpp | 15 +- .../data_model/esp_matter_command.cpp | 26 +-- .../data_model/esp_matter_data_model.cpp | 24 +-- .../esp_matter_delegate_callbacks.cpp | 4 +- .../clusters/descriptor_integration.cpp | 127 +++++++++++++ .../clusters/diagnostic_logs_integration.cpp | 15 +- .../general_commissioning_integration.cpp | 30 ++- .../general_commissioning_integration.h | 23 +++ .../clusters/groupcast_integration.cpp | 58 ++++++ .../clusters/identify_integration.cpp | 177 ++++++++++++++++++ ...localization_configuration_integration.cpp | 64 +++++++ .../network_commissioning_integration.cpp | 18 +- .../clusters/user_label_integration.cpp | 55 ++++++ .../wifi_network_diagnostic_integration.cpp | 2 +- .../esp_matter_data_model_provider.cpp | 22 +-- .../esp_matter_data_model_provider.h | 5 +- .../esp_matter_ember_stubs.cpp | 40 +--- components/esp_matter/esp_matter_client.cpp | 16 +- components/esp_matter/esp_matter_identify.cpp | 9 +- .../utils/cluster_select/Kconfig.in | 4 + .../utils/cluster_select/cluster_dir.cmake | 3 + .../zap_common/app/ClusterCallbacks.h | 3 + .../app/PluginApplicationCallbacks.h | 1 + .../zap_common/zap-generated/access.h | 54 +++++- .../controller_data_model_provider.h | 9 +- connectedhomeip/connectedhomeip | 2 +- .../electrical_measurement.cpp | 2 +- export.sh | 3 + 30 files changed, 677 insertions(+), 139 deletions(-) create mode 100644 components/esp_matter/data_model_provider/clusters/descriptor_integration.cpp create mode 100644 components/esp_matter/data_model_provider/clusters/general_commissioning_integration.h create mode 100644 components/esp_matter/data_model_provider/clusters/groupcast_integration.cpp create mode 100644 components/esp_matter/data_model_provider/clusters/identify_integration.cpp create mode 100644 components/esp_matter/data_model_provider/clusters/localization_configuration_integration.cpp create mode 100644 components/esp_matter/data_model_provider/clusters/user_label_integration.cpp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6866b90c..395782291 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ variables: IDF_CHECKOUT_REF: "v5.4.1" # This variable represents the short hash of the connectedhomeip submodule. # Note: Do change this short hash on submodule update MRs. - CHIP_SHORT_HASH: "f902839abf" + CHIP_SHORT_HASH: "faf4d09ad1" DOCKER_IMAGE_NAME: "espressif/chip-idf" .add_gitlab_ssh_key: &add_gitlab_ssh_key | @@ -463,6 +463,7 @@ build_esp_matter_examples_idf_v4_4: extends: - .build_examples_template image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF} + allow_failure: true artifacts: paths: - "examples/**/build*/size.json" diff --git a/README.md b/README.md index 121ade6a0..4a2ce93dc 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ section in the ESP-Matter Programming Guide. ## Supported ESP-IDF and connectedhomeip versions -- This SDK currently works with commit [f902839abf] (https://github.com/project-chip/connectedhomeip/tree/f902839abf) of connectedhomeip. +- This SDK currently works with commit [faf4d09ad1] (https://github.com/project-chip/connectedhomeip/tree/faf4d09ad1) of connectedhomeip. - For Matter projects development with this SDK, it is recommended to utilize ESP-IDF [v5.4.1](https://github.com/espressif/esp-idf/tree/v5.4.1). - For ESP32C5 and ESP32C61, it is recommended to utilize ESP-IDF [v5.5.1](https://github.com/espressif/esp-idf/tree/v5.5.1). diff --git a/components/esp_matter/data_model/esp_matter_cluster.cpp b/components/esp_matter/data_model/esp_matter_cluster.cpp index f0a51722b..1a27a0002 100644 --- a/components/esp_matter/data_model/esp_matter_cluster.cpp +++ b/components/esp_matter/data_model/esp_matter_cluster.cpp @@ -208,6 +208,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) global::attribute::create_feature_map(cluster, 0); /* Attributes not managed internally */ global::attribute::create_cluster_revision(cluster, cluster_revision); + cluster::set_init_and_shutdown_callbacks(cluster, ESPMatterDescriptorClusterServerInitCallback, + ESPMatterDescriptorClusterServerShutdownCallback); } return cluster; @@ -1003,6 +1005,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ global::attribute::create_cluster_revision(cluster, cluster_revision); + cluster::set_init_and_shutdown_callbacks(cluster, ESPMatterUserLabelClusterServerInitCallback, + ESPMatterUserLabelClusterServerShutdownCallback); } return cluster; @@ -1039,11 +1043,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } /* fixed_label */ namespace identify { -const function_generic_t function_list[] = { - (function_generic_t)emberAfIdentifyClusterServerInitCallback, - (function_generic_t)MatterIdentifyClusterServerAttributeChangedCallback, -}; -const int function_flags = CLUSTER_FLAG_INIT_FUNCTION | CLUSTER_FLAG_ATTRIBUTE_CHANGED_FUNCTION; +const function_generic_t *function_list = NULL; +const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) { @@ -1067,6 +1068,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } + cluster::set_init_and_shutdown_callbacks(cluster, ESPMatterIdentifyClusterServerInitCallback, + ESPMatterIdentifyClusterServerShutdownCallback); } /* Commands */ @@ -2398,6 +2401,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } + cluster::set_init_and_shutdown_callbacks(cluster, ESPMatterLocalizationConfigurationClusterServerInitCallback, + ESPMatterLocalizationConfigurationClusterServerShutdownCallback); } return cluster; diff --git a/components/esp_matter/data_model/esp_matter_command.cpp b/components/esp_matter/data_model/esp_matter_command.cpp index 9bf147231..7e0f9ad13 100644 --- a/components/esp_matter/data_model/esp_matter_command.cpp +++ b/components/esp_matter/data_model/esp_matter_command.cpp @@ -82,28 +82,6 @@ static esp_err_t esp_matter_command_callback_announce_ota_provider(const Concret return ESP_OK; } -static esp_err_t esp_matter_command_callback_identify(const ConcreteCommandPath &command_path, TLVReader &tlv_data, - void *opaque_ptr) -{ - chip::app::Clusters::Identify::Commands::Identify::DecodableType command_data; - CHIP_ERROR error = Decode(tlv_data, command_data); - if (error == CHIP_NO_ERROR) { - emberAfIdentifyClusterIdentifyCallback((CommandHandler *)opaque_ptr, command_path, command_data); - } - return ESP_OK; -} - -static esp_err_t esp_matter_command_callback_trigger_effect(const ConcreteCommandPath &command_path, - TLVReader &tlv_data, void *opaque_ptr) -{ - chip::app::Clusters::Identify::Commands::TriggerEffect::DecodableType command_data; - CHIP_ERROR error = Decode(tlv_data, command_data); - if (error == CHIP_NO_ERROR) { - emberAfIdentifyClusterTriggerEffectCallback((CommandHandler *)opaque_ptr, command_path, command_data); - } - return ESP_OK; -} - static esp_err_t esp_matter_command_callback_add_group(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr) { @@ -1817,13 +1795,13 @@ namespace command { command_t *create_identify(cluster_t *cluster) { return esp_matter::command::create(cluster, Identify::Commands::Identify::Id, COMMAND_FLAG_ACCEPTED, - esp_matter_command_callback_identify); + nullptr); } command_t *create_trigger_effect(cluster_t *cluster) { return esp_matter::command::create(cluster, Identify::Commands::TriggerEffect::Id, COMMAND_FLAG_ACCEPTED, - esp_matter_command_callback_trigger_effect); + nullptr); } } /* command */ diff --git a/components/esp_matter/data_model/esp_matter_data_model.cpp b/components/esp_matter/data_model/esp_matter_data_model.cpp index 9e60e8bec..44e9859d9 100644 --- a/components/esp_matter/data_model/esp_matter_data_model.cpp +++ b/components/esp_matter/data_model/esp_matter_data_model.cpp @@ -212,22 +212,18 @@ esp_err_t disable(endpoint_t *endpoint) static esp_err_t init_identification(endpoint_t *endpoint) { VerifyOrReturnError(endpoint, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Endpoint cannot be NULL")); + cluster_t *identify_cluster = cluster::get(endpoint, chip::app::Clusters::Identify::Id); _endpoint_t *current_endpoint = (_endpoint_t *)endpoint; - _cluster_t *cluster = current_endpoint->cluster_list; - while (cluster) { - uint32_t cluster_id = cluster::get_id((cluster_t *)cluster); - /* Init identify if exists and not initialized */ - if (cluster_id == chip::app::Clusters::Identify::Id && current_endpoint->identify == NULL) { - _attribute_t *identify_type_attr = (_attribute_t *)attribute::get( - current_endpoint->endpoint_id, cluster_id, chip::app::Clusters::Identify::Attributes::IdentifyType::Id); - if (identify_type_attr) { - return identification::init(current_endpoint->endpoint_id, identify_type_attr->val.val.u8); - } else { - ESP_LOGE(TAG, "Can't get IdentifyType attribute in Identify cluster"); - return ESP_ERR_INVALID_STATE; - } + /* Init identify if exists and not initialized */ + if (identify_cluster != nullptr && current_endpoint->identify == NULL) { + _attribute_t *identify_type_attr = (_attribute_t *)attribute::get( + identify_cluster, chip::app::Clusters::Identify::Attributes::IdentifyType::Id); + if (identify_type_attr) { + return identification::init(current_endpoint->endpoint_id, identify_type_attr->val.val.u8); + } else { + ESP_LOGE(TAG, "Can't get IdentifyType attribute in Identify cluster"); + return ESP_ERR_INVALID_STATE; } - cluster = cluster->next; } // Return ESP_OK when identify cluster is not on the endpoint. return ESP_OK; diff --git a/components/esp_matter/data_model/esp_matter_delegate_callbacks.cpp b/components/esp_matter/data_model/esp_matter_delegate_callbacks.cpp index e76034dd6..9ca8c8e67 100644 --- a/components/esp_matter/data_model/esp_matter_delegate_callbacks.cpp +++ b/components/esp_matter/data_model/esp_matter_delegate_callbacks.cpp @@ -24,11 +24,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/components/esp_matter/data_model_provider/clusters/descriptor_integration.cpp b/components/esp_matter/data_model_provider/clusters/descriptor_integration.cpp new file mode 100644 index 000000000..5433aaabb --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/descriptor_integration.cpp @@ -0,0 +1,127 @@ +// Copyright 2025 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 namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Descriptor; + +namespace { +/** + * This is a DescriptorCluster class made specifically to fetch the tag list once through ember before one of either the + * Attributes() or ReadAttribute() functions are called. This can NOT be called before endpoint init and passed to the constructor + * of the regular DescriptorCluster class. This is because for fixed endpoints, we define endpoints in emberAfEndpointConfigure() + * and init them in emberAfInit() with back to back calls in InitDataModelHandler(). For dynamic endpoints, we init endpoints in + * emberAfSetDynamicEndpointWithEpUniqueId() by calling emberAfEndpointEnableDisable(), which calls initializeEndpoint(). The tag + * list is a fixed attribute, but to maintain backwards compatibility we get that information within the functions here. + */ +class ESPMatterDescriptorCluster : public DescriptorCluster +{ +public: + ESPMatterDescriptorCluster(EndpointId endpointId, DescriptorCluster::OptionalAttributesSet optionalAttributeSet) : + DescriptorCluster(endpointId, optionalAttributeSet, Span()) + {} + + CHIP_ERROR Attributes(const ConcreteClusterPath & path, ReadOnlyBufferBuilder & builder) override + { + if (!mFetchedSemanticTags) + { + ReturnErrorOnFailure(GetSemanticTag(path.mEndpointId, mSemanticTags)); + mFetchedSemanticTags = true; + } + return DescriptorCluster::Attributes(path, builder); + } + + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override + { + if (!mFetchedSemanticTags) + { + ReturnErrorOnFailure(GetSemanticTag(request.path.mEndpointId, mSemanticTags)); + mFetchedSemanticTags = true; + } + return DescriptorCluster::ReadAttribute(request, encoder); + } + +private: + + CHIP_ERROR GetSemanticTag(EndpointId endpoint, Span &tags) + { + esp_matter::endpoint_t *ep = esp_matter::endpoint::get(endpoint); + if (!ep) { + return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); + } + int tagCount = esp_matter::endpoint::get_semantic_tag_count(ep); + if (tagCount > 0) { + mTagBuffer.Alloc(tagCount); + if (!mTagBuffer.Get()) { + return CHIP_ERROR_NO_MEMORY; + } + for (int index = 0; index < tagCount; ++index) { + esp_matter::endpoint::get_semantic_tag_at_index(ep, index, mTagBuffer[index]); + } + tags = Span(mTagBuffer.Get(), tagCount); + } + return CHIP_NO_ERROR; + } + Platform::ScopedMemoryBuffer mTagBuffer; + bool mFetchedSemanticTags = false; +}; + +std::unordered_map> gServers; + +} // namespace + +void ESPMatterDescriptorClusterServerInitCallback(EndpointId endpointId) +{ + if (gServers[endpointId].IsConstructed()) { + return; + } + DescriptorCluster::OptionalAttributesSet optionalAttrSet; + if (esp_matter::endpoint::is_attribute_enabled(endpointId, Descriptor::Id, Descriptor::Attributes::EndpointUniqueID::Id)) { + optionalAttrSet.Set(); + } + + gServers[endpointId].Create(endpointId, optionalAttrSet); + CHIP_ERROR err = + esp_matter::data_model::provider::get_instance().registry().Register(gServers[endpointId].Registration()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to register Descriptor on endpoint %u - Error: %" CHIP_ERROR_FORMAT, endpointId, + err.Format()); + } +} + +void ESPMatterDescriptorClusterServerShutdownCallback(EndpointId endpointId) +{ + CHIP_ERROR err = + esp_matter::data_model::provider::get_instance().registry().Unregister(&gServers[endpointId].Cluster()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to unregister UserLabel on endpoint %u - Error: %" CHIP_ERROR_FORMAT, + endpointId, err.Format()); + } + gServers[endpointId].Destroy(); +} + +void MatterDescriptorPluginServerInitCallback() {} + +void MatterDescriptorPluginServerShutdownCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/diagnostic_logs_integration.cpp b/components/esp_matter/data_model_provider/clusters/diagnostic_logs_integration.cpp index 686791da0..3d33fe56f 100644 --- a/components/esp_matter/data_model_provider/clusters/diagnostic_logs_integration.cpp +++ b/components/esp_matter/data_model_provider/clusters/diagnostic_logs_integration.cpp @@ -14,19 +14,21 @@ #include #include +#include #include using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +LazyRegisteredServerCluster gServer; + void ESPMatterDiagnosticLogsClusterServerInitCallback(EndpointId endpoint) { // We implement the cluster as a singleton on the root endpoint. - VerifyOrReturn(endpoint == kRootEndpointId); - static ServerClusterRegistration sRegistration(DiagnosticLogsCluster::Instance()); - - CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(sRegistration); + VerifyOrReturn(endpoint == kRootEndpointId && !gServer.IsConstructed()); + gServer.Create(); + CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(gServer.Registration()); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Failed to register DiagnosticLogs on endpoint %u - Error: %" CHIP_ERROR_FORMAT, endpoint, err.Format()); @@ -36,13 +38,14 @@ void ESPMatterDiagnosticLogsClusterServerInitCallback(EndpointId endpoint) void ESPMatterDiagnosticLogsClusterServerShutdownCallback(EndpointId endpointId) { // We implement the cluster as a singleton on the root endpoint. - VerifyOrReturn(endpointId == kRootEndpointId); + VerifyOrReturn(endpointId == kRootEndpointId && gServer.IsConstructed()); CHIP_ERROR err = - esp_matter::data_model::provider::get_instance().registry().Unregister(&DiagnosticLogsCluster::Instance()); + esp_matter::data_model::provider::get_instance().registry().Unregister(&gServer.Cluster()); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Failed to unregister DiagnosticLogs on endpoint %u - Error: %" CHIP_ERROR_FORMAT, endpointId, err.Format()); } + gServer.Destroy(); } void MatterDiagnosticLogsPluginServerInitCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.cpp b/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.cpp index d297de481..17183f723 100644 --- a/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.cpp +++ b/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.cpp @@ -15,22 +15,44 @@ #include #include #include +#include +#include "app/server-cluster/ServerClusterInterfaceRegistry.h" +#include "core/DataModelTypes.h" +#include "support/CodeUtils.h" using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; namespace { -ServerClusterRegistration gRegistration(GeneralCommissioningCluster::Instance()); +LazyRegisteredServerCluster gServer; } +namespace chip::app::Clusters::GeneralCommissioning { + +GeneralCommissioningCluster * Instance() +{ + if (!gServer.IsConstructed()) { + gServer.Create(); + } + return &gServer.Cluster(); +} + +} // namespace chip::app::Clusters::GeneralCommissioning + void ESPMatterGeneralCommissioningClusterServerInitCallback(EndpointId endpointId) { if (endpointId != kRootEndpointId) { return; } + if (!gServer.IsConstructed()) { + gServer.Create(); + } + if (esp_matter::endpoint::is_attribute_enabled(endpointId, GeneralCommissioning::Id, GeneralCommissioning::Attributes::IsCommissioningWithoutPower::Id)) { + gServer.Cluster().GetOptionalAttributes().Set(); + } - CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(gRegistration); + CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(gServer.Registration()); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Failed to register GeneralCommissioning - Error: %" CHIP_ERROR_FORMAT, err.Format()); } @@ -38,11 +60,13 @@ void ESPMatterGeneralCommissioningClusterServerInitCallback(EndpointId endpointI void ESPMatterGeneralCommissioningClusterServerShutdownCallback(EndpointId endpointId) { + VerifyOrReturn(endpointId == kRootEndpointId && gServer.IsConstructed()); CHIP_ERROR err = - esp_matter::data_model::provider::get_instance().registry().Unregister(gRegistration.serverClusterInterface); + esp_matter::data_model::provider::get_instance().registry().Unregister(&gServer.Cluster()); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Failed to unregister GeneralCommissioning - Error: %" CHIP_ERROR_FORMAT, err.Format()); } + gServer.Destroy(); } void MatterGeneralCommissioningPluginServerInitCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.h b/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.h new file mode 100644 index 000000000..4748c346a --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/general_commissioning_integration.h @@ -0,0 +1,23 @@ +// Copyright 2025 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 + +namespace chip::app::Clusters::GeneralCommissioning { + +GeneralCommissioningCluster * Instance(); + +} // namespace chip::app::Clusters::GeneralCommissioning diff --git a/components/esp_matter/data_model_provider/clusters/groupcast_integration.cpp b/components/esp_matter/data_model_provider/clusters/groupcast_integration.cpp new file mode 100644 index 000000000..daad00af1 --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/groupcast_integration.cpp @@ -0,0 +1,58 @@ +// Copyright 2025 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 + +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Groupcast::Attributes; +using chip::Protocols::InteractionModel::Status; + +namespace { + +LazyRegisteredServerCluster gServer; + +} // namespace + +void ESPMatterGroupcastClusterServerInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == chip::kRootEndpointId); + + // Currently we don't support groupcast cluster in our data model, create the cluster with LN feature enabled. + // TODO: We should create the cluster according to the enabled features after we add the cluster. + chip::BitFlags feature; + feature.Set(Groupcast::Feature::kListener); + gServer.Create(feature); + CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(gServer.Registration()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to register Groupcast - Error %" CHIP_ERROR_FORMAT, err.Format()); + } +} + +void ESPMatterGroupcastClusterServerShutdownCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == chip::kRootEndpointId); + + CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Unregister(&gServer.Cluster()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to unregister Groupcast - Error %" CHIP_ERROR_FORMAT, err.Format()); + } + gServer.Destroy(); +} + +void MatterGroupcastPluginServerInitCallback() {} +void MatterGroupcastPluginServerShutdownCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/identify_integration.cpp b/components/esp_matter/data_model_provider/clusters/identify_integration.cpp new file mode 100644 index 000000000..200822318 --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/identify_integration.cpp @@ -0,0 +1,177 @@ +// Copyright 2025 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "support/logging/TextOnlyLogging.h" + +namespace { + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters::Identify; + +using chip::app::Clusters::IdentifyCluster; +using chip::app::Clusters::IdentifyDelegate; +using chip::Protocols::InteractionModel::Status; + +Identify *firstLegacyIdentify = nullptr; +DefaultTimerDelegate sDefaultTimerDelegate; + +Identify *GetLegacyIdentifyInstance(EndpointId endpoint) +{ + Identify *current = firstLegacyIdentify; + while (current != nullptr && current->mCluster.Cluster().GetPaths()[0].mEndpointId != endpoint) { + current = current->nextIdentify; + } + return current; +} + +class IdentifyLegacyDelegate : public IdentifyDelegate { +public: + void OnIdentifyStart(IdentifyCluster &cluster) override + { + Identify *identify = GetLegacyIdentifyInstance(cluster.GetPaths()[0].mEndpointId); + if (identify != nullptr) { + identify->mActive = true; + if (identify->mOnIdentifyStart) { + identify->mOnIdentifyStart(identify); + } + } + } + void OnIdentifyStop(IdentifyCluster &cluster) override + { + Identify *identify = GetLegacyIdentifyInstance(cluster.GetPaths()[0].mEndpointId); + if (identify != nullptr) { + identify->mActive = false; + if (identify->mOnIdentifyStop) { + identify->mOnIdentifyStop(identify); + } + } + } + void OnTriggerEffect(IdentifyCluster &cluster) override + { + Identify *identify = GetLegacyIdentifyInstance(cluster.GetPaths()[0].mEndpointId); + if (identify != nullptr) { + identify->mCurrentEffectIdentifier = cluster.GetEffectIdentifier(); + identify->mEffectVariant = cluster.GetEffectVariant(); + if (identify->mOnEffectIdentifier) { + identify->mOnEffectIdentifier(identify); + } + } + } + bool IsTriggerEffectEnabled() const override { return true; } +}; + +IdentifyLegacyDelegate gLegacyDelegate; + +inline void RegisterLegacyIdentify(Identify *inst) +{ + inst->nextIdentify = firstLegacyIdentify; + firstLegacyIdentify = inst; +} + +inline void UnregisterLegacyIdentify(Identify *inst) +{ + if (firstLegacyIdentify == inst) { + firstLegacyIdentify = firstLegacyIdentify->nextIdentify; + } else if (firstLegacyIdentify != nullptr) { + Identify *previous = firstLegacyIdentify; + Identify *current = firstLegacyIdentify->nextIdentify; + + while (current != nullptr && current != inst) { + previous = current; + current = current->nextIdentify; + } + + if (current != nullptr) { + previous->nextIdentify = current->nextIdentify; + } + } +} + +} // namespace + +IdentifyCluster *FindIdentifyClusterOnEndpoint(EndpointId endpointId) +{ + Identify *legacyInstance = GetLegacyIdentifyInstance(endpointId); + if (legacyInstance != nullptr) { + return &legacyInstance->mCluster.Cluster(); + } + return nullptr; +} + +Identify::Identify(EndpointId endpoint, onIdentifyStartCb onIdentifyStart, onIdentifyStopCb onIdentifyStop, + IdentifyTypeEnum identifyType, onEffectIdentifierCb onEffectIdentifier, + EffectIdentifierEnum effectIdentifier, EffectVariantEnum effectVariant, + chip::TimerDelegate *timerDelegate) + : + + mOnIdentifyStart(onIdentifyStart) + , mOnIdentifyStop(onIdentifyStop) + , mIdentifyType(identifyType) + , mOnEffectIdentifier(onEffectIdentifier) + , mCurrentEffectIdentifier(effectIdentifier) + , mEffectVariant(effectVariant) + , mCluster( + chip::app::Clusters::IdentifyCluster::Config(endpoint, timerDelegate ? *timerDelegate : sDefaultTimerDelegate) + .WithIdentifyType(identifyType) + .WithDelegate(&gLegacyDelegate) + .WithEffectIdentifier(effectIdentifier) + .WithEffectVariant(effectVariant)) +{ + RegisterLegacyIdentify(this); + + if (esp_matter::data_model::provider::get_instance().registry().Register(mCluster.Registration()) != + CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to registry Identify cluster registration for endpoint %u", endpoint); + } +}; + +Identify::~Identify() +{ + if (esp_matter::data_model::provider::get_instance().registry().Unregister(&(mCluster.Cluster())) != + CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to unregistry Identify cluster registration"); + } + UnregisterLegacyIdentify(this); +} + +void ESPMatterIdentifyClusterServerInitCallback(EndpointId endpointId) +{ + // Intentionally make this function empty as the identify cluster will be registered when enabling endpoint. +} + +void ESPMatterIdentifyClusterServerShutdownCallback(EndpointId endpointId) +{ + // Intentionally make this function empty as the identify cluster will be unregistered when disabling endpoint. +} + +// Legacy PluginServer callback stubs +void MatterIdentifyPluginServerInitCallback() {} +void MatterIdentifyPluginServerShutdownCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/localization_configuration_integration.cpp b/components/esp_matter/data_model_provider/clusters/localization_configuration_integration.cpp new file mode 100644 index 000000000..d65fec579 --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/localization_configuration_integration.cpp @@ -0,0 +1,64 @@ +// Copyright 2025 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 +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +namespace { +LazyRegisteredServerCluster gServer; +} + +void ESPMatterLocalizationConfigurationClusterServerInitCallback(EndpointId endpointId) +{ + if (endpointId != kRootEndpointId) { + return; + } + esp_matter::attribute_t *active_locale = esp_matter::attribute::get( + endpointId, LocalizationConfiguration::Id, LocalizationConfiguration::Attributes::ActiveLocale::Id); + esp_matter_attr_val_t attr_val; + if (active_locale && esp_matter::attribute::get_val(active_locale, &attr_val) == ESP_OK && + attr_val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING && + attr_val.val.a.s <= LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo::MaxLength()) { + ChipLogError(AppServer, "Failed to get active locale on endpoint %u", endpointId); + } + gServer.Create(*DeviceLayer::GetDeviceInfoProvider(), CharSpan((const char *)attr_val.val.a.b, attr_val.val.a.s)); + + CHIP_ERROR err = esp_matter::data_model::provider::get_instance().registry().Register(gServer.Registration()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to register LocalizationConfiguration - Error: %" CHIP_ERROR_FORMAT, err.Format()); + } +} + +void ESPMatterLocalizationConfigurationClusterServerShutdownCallback(EndpointId endpointId) +{ + if (endpointId != kRootEndpointId) { + return; + } + + CHIP_ERROR err = + esp_matter::data_model::provider::get_instance().registry().Unregister(&gServer.Cluster()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to unregister LocalizationConfiguration - Error: %" CHIP_ERROR_FORMAT, err.Format()); + } +} diff --git a/components/esp_matter/data_model_provider/clusters/network_commissioning_integration.cpp b/components/esp_matter/data_model_provider/clusters/network_commissioning_integration.cpp index 49b69f5e2..65916e64d 100644 --- a/components/esp_matter/data_model_provider/clusters/network_commissioning_integration.cpp +++ b/components/esp_matter/data_model_provider/clusters/network_commissioning_integration.cpp @@ -21,6 +21,7 @@ #include #include #include +#include "general_commissioning_integration.h" using namespace chip; using namespace chip::app; @@ -51,6 +52,17 @@ static_assert(kNetworkCommissioningClusterCount > 0, "NetworkCommissioningCluste LazyRegisteredServerCluster gServers[kNetworkCommissioningClusterCount]; +class ESPMatterGeneralCommissioningBreadcrumbTracker : public BreadCrumbTracker +{ +public: + void SetBreadCrumb(uint64_t value) override + { + chip::app::Clusters::GeneralCommissioning::Instance()->SetBreadCrumb(value); + } +}; + +ESPMatterGeneralCommissioningBreadcrumbTracker gBreadcrumbTracker; + uint16_t GetServerIndex(EndpointId endpointId) { esp_matter::endpoint_t *ep = esp_matter::endpoint::get(endpointId); @@ -81,21 +93,21 @@ void ESPMatterNetworkCommissioningClusterServerInitCallback(EndpointId endpointI #ifdef CONFIG_THREAD_NETWORK_COMMISSIONING_DRIVER if (endpointId == CONFIG_THREAD_NETWORK_ENDPOINT_ID) { static DeviceLayer::NetworkCommissioning::GenericThreadDriver sThreadDriver; - gServers[index].Create(endpointId, &sThreadDriver); + gServers[index].Create(endpointId, &sThreadDriver, gBreadcrumbTracker); gServers[index].Cluster().Init(); (void)esp_matter::data_model::provider::get_instance().registry().Register(gServers[index].Registration()); } #endif #ifdef CONFIG_WIFI_NETWORK_COMMISSIONING_DRIVER if (endpointId == CONFIG_WIFI_NETWORK_ENDPOINT_ID) { - gServers[index].Create(endpointId, &(DeviceLayer::NetworkCommissioning::ESPWiFiDriver::GetInstance())); + gServers[index].Create(endpointId, &(DeviceLayer::NetworkCommissioning::ESPWiFiDriver::GetInstance()), gBreadcrumbTracker); gServers[index].Cluster().Init(); (void)esp_matter::data_model::provider::get_instance().registry().Register(gServers[index].Registration()); } #endif #ifdef CONFIG_ETHERNET_NETWORK_COMMISSIONING_DRIVER if (endpointId == CONFIG_ETHERNET_NETWORK_ENDPOINT_ID) { - gServers[index].Create(endpointId, &(DeviceLayer::NetworkCommissioning::ESPEthernetDriver::GetInstance())); + gServers[index].Create(endpointId, &(DeviceLayer::NetworkCommissioning::ESPEthernetDriver::GetInstance()), gBreadcrumbTracker); gServers[index].Cluster().Init(); (void)esp_matter::data_model::provider::get_instance().registry().Register(gServers[index].Registration()); } diff --git a/components/esp_matter/data_model_provider/clusters/user_label_integration.cpp b/components/esp_matter/data_model_provider/clusters/user_label_integration.cpp new file mode 100644 index 000000000..f1093806b --- /dev/null +++ b/components/esp_matter/data_model_provider/clusters/user_label_integration.cpp @@ -0,0 +1,55 @@ +// Copyright 2025 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 + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +namespace { +std::unordered_map> gServers; + +} // namespace + +void ESPMatterUserLabelClusterServerInitCallback(EndpointId endpointId) +{ + if (gServers[endpointId].IsConstructed()) { + return; + } + + gServers[endpointId].Create(endpointId); + CHIP_ERROR err = + esp_matter::data_model::provider::get_instance().registry().Register(gServers[endpointId].Registration()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to register UserLabel on endpoint %u - Error: %" CHIP_ERROR_FORMAT, endpointId, + err.Format()); + } +} + +void ESPMatterUserLabelClusterServerShutdownCallback(EndpointId endpointId) +{ + CHIP_ERROR err = + esp_matter::data_model::provider::get_instance().registry().Unregister(&gServers[endpointId].Cluster()); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Failed to unregister UserLabel on endpoint %u - Error: %" CHIP_ERROR_FORMAT, + endpointId, err.Format()); + } + gServers[endpointId].Destroy(); +} + +void MatterUserLabelPluginServerInitCallback() {} diff --git a/components/esp_matter/data_model_provider/clusters/wifi_network_diagnostic_integration.cpp b/components/esp_matter/data_model_provider/clusters/wifi_network_diagnostic_integration.cpp index 728523015..014393bd0 100644 --- a/components/esp_matter/data_model_provider/clusters/wifi_network_diagnostic_integration.cpp +++ b/components/esp_matter/data_model_provider/clusters/wifi_network_diagnostic_integration.cpp @@ -58,7 +58,7 @@ void ESPMatterWiFiNetworkDiagnosticsClusterServerInitCallback(EndpointId endpoin if (!IsClusterEnabled(endpointId) && gServers[endpointId].IsConstructed()) { return; } - WiFiDiagnosticsServerLogic::OptionalAttributeSet attrSet; + WiFiDiagnosticsServerCluster::OptionalAttributeSet attrSet; if (IsAttributeEnabled(endpointId, WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id)) { attrSet.Set(); } diff --git a/components/esp_matter/data_model_provider/esp_matter_data_model_provider.cpp b/components/esp_matter/data_model_provider/esp_matter_data_model_provider.cpp index 5aa0bddab..42121cb09 100644 --- a/components/esp_matter/data_model_provider/esp_matter_data_model_provider.cpp +++ b/components/esp_matter/data_model_provider/esp_matter_data_model_provider.cpp @@ -341,10 +341,11 @@ ActionReturnStatus provider::WriteAttribute(const WriteAttributeRequest &request return Protocols::InteractionModel::Status::Success; } -void provider::ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType) +void provider::ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType, + FabricIndex accessFabric) { if (auto *cluster = mRegistry.Get(aPath); cluster != nullptr) { - return cluster->ListAttributeWriteNotification(aPath, opType); + return cluster->ListAttributeWriteNotification(aPath, opType, accessFabric); } AttributeAccessInterface *aai = AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId); @@ -410,23 +411,6 @@ CHIP_ERROR provider::Endpoints(ReadOnlyBufferBuilder &builder) return CHIP_NO_ERROR; } -CHIP_ERROR provider::SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder &builder) -{ - Status status = CheckDataModelPath(endpointId); - VerifyOrReturnValue(status == Protocols::InteractionModel::Status::Success, - CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status)); - endpoint_t *ep = endpoint::get(endpointId); - int count = endpoint::get_semantic_tag_count(ep); - ReturnErrorOnFailure(builder.EnsureAppendCapacity(count)); - for (size_t idx = 0; idx < count; idx++) { - DataModel::Provider::SemanticTag semanticTag; - VerifyOrReturnError(endpoint::get_semantic_tag_at_index(ep, idx, semanticTag) == ESP_OK, CHIP_ERROR_INTERNAL, - ESP_LOGE(TAG, "Failed to get SemanticTag at %d", idx)); - ReturnErrorOnFailure(builder.Append(semanticTag)); - } - return CHIP_NO_ERROR; -} - CHIP_ERROR provider::DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder &builder) { Status status = CheckDataModelPath(endpointId); diff --git a/components/esp_matter/data_model_provider/esp_matter_data_model_provider.h b/components/esp_matter/data_model_provider/esp_matter_data_model_provider.h index 35b821e5d..d3b81402f 100644 --- a/components/esp_matter/data_model_provider/esp_matter_data_model_provider.h +++ b/components/esp_matter/data_model_provider/esp_matter_data_model_provider.h @@ -39,6 +39,7 @@ namespace data_model { using chip::ClusterId; using chip::CommandId; using chip::EndpointId; +using chip::FabricIndex; using chip::MutableCharSpan; using chip::ReadOnlyBufferBuilder; using chip::app::AttributePathParams; @@ -76,13 +77,13 @@ public: ActionReturnStatus ReadAttribute(const ReadAttributeRequest &request, AttributeValueEncoder &encoder) override; ActionReturnStatus WriteAttribute(const WriteAttributeRequest &request, AttributeValueDecoder &decoder) override; - void ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType) override; + void ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType, + FabricIndex accessingFabric) override; std::optional InvokeCommand(const InvokeRequest &request, chip::TLV::TLVReader &input_arguments, CommandHandler *handler) override; /// attribute tree iteration CHIP_ERROR Endpoints(ReadOnlyBufferBuilder &out) override; - CHIP_ERROR SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override; CHIP_ERROR DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override; CHIP_ERROR ClientClusters(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override; CHIP_ERROR ServerClusters(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override; diff --git a/components/esp_matter/data_model_provider/esp_matter_ember_stubs.cpp b/components/esp_matter/data_model_provider/esp_matter_ember_stubs.cpp index 5b4a64dba..99bfc4f4a 100644 --- a/components/esp_matter/data_model_provider/esp_matter_ember_stubs.cpp +++ b/components/esp_matter/data_model_provider/esp_matter_ember_stubs.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -730,18 +729,6 @@ EmberAfDefaultAttributeValue get_default_attr_value_from_val(esp_matter_attr_val } return EmberAfDefaultAttributeValue(nullptr); } - -class GlobalInteractionModelEngineChangedpathListener : public chip::app::AttributesChangedListener { -public: - ~GlobalInteractionModelEngineChangedpathListener() = default; - - void MarkDirty(const chip::app::AttributePathParams &path) override - { - chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(path); - } -}; - -static GlobalInteractionModelEngineChangedpathListener gListener; } // namespace namespace chip { @@ -781,6 +768,7 @@ void EnabledEndpointsWithServerCluster::EnsureMatchingEndpoint() namespace Compatibility { namespace Internal { +// Remove AttributeBaseType() when scenes management cluster is decoupled from ember. EmberAfAttributeType AttributeBaseType(EmberAfAttributeType type) { switch (type) { @@ -1006,27 +994,6 @@ bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId cluster return esp_matter::attribute::get(endpoint, clusterId, attributeId); } -// TODO: Remove the emberAfContainsClient function when binding cluster is decoupled from ember -bool emberAfContainsClient(chip::EndpointId endpoint, chip::ClusterId clusterId) -{ - esp_matter::cluster_t *cluster = esp_matter::cluster::get(endpoint, clusterId); - if (cluster && (esp_matter::cluster::get_flags(cluster) & esp_matter::CLUSTER_FLAG_CLIENT)) { - return true; - } - return false; -} - -// TODO: Remove the GetSemanticTagForEndpointAtIndex function when descriptor cluster is decoupled from ember -CHIP_ERROR GetSemanticTagForEndpointAtIndex(chip::EndpointId endpoint, size_t index, - chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type &tag) -{ - esp_matter::endpoint_t *ep = esp_matter::endpoint::get(endpoint); - if (!ep || (esp_matter::endpoint::get_semantic_tag_at_index(ep, index, tag) != ESP_OK)) { - return CHIP_ERROR_NOT_FOUND; - } - return CHIP_NO_ERROR; -} - // TODO: Remove the emberAfRead/Write functions when all the clusters are decoupled from ember. chip::Protocols::InteractionModel::Status emberAfReadAttribute(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *dataPtr, @@ -1055,7 +1022,8 @@ Status emberAfWriteAttribute(chip::EndpointId endpointId, chip::ClusterId cluste uint8_t *value, EmberAfAttributeType dataType) { return emberAfWriteAttribute(chip::app::ConcreteAttributePath(endpointId, clusterId, attributeId), - EmberAfWriteDataInput(value, dataType).SetChangeListener(&gListener)); + EmberAfWriteDataInput(value, dataType).SetChangeListener( + &chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine())); } Status emberAfWriteAttribute(const chip::app::ConcreteAttributePath &path, const EmberAfWriteDataInput &input) @@ -1090,7 +1058,7 @@ Status emberAfWriteAttribute(const chip::app::ConcreteAttributePath &path, const input.changeListener->MarkDirty( chip::app::AttributePathParams(path.mEndpointId, path.mClusterId, path.mAttributeId)); } else { - gListener.MarkDirty( + chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().MarkDirty( chip::app::AttributePathParams(path.mEndpointId, path.mClusterId, path.mAttributeId)); } } diff --git a/components/esp_matter/esp_matter_client.cpp b/components/esp_matter/esp_matter_client.cpp index 6dd9e2507..c0c5682e8 100644 --- a/components/esp_matter/esp_matter_client.cpp +++ b/components/esp_matter/esp_matter_client.cpp @@ -112,12 +112,12 @@ esp_err_t group_request_send(uint8_t fabric_index, request_handle_t *req_handle) } #ifdef CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER -static void esp_matter_command_client_binding_callback(const EmberBindingTableEntry &binding, +static void esp_matter_command_client_binding_callback(const chip::app::Clusters::Binding::TableEntry &binding, OperationalDeviceProxy *peer_device, void *context) { request_handle_t *req_handle = static_cast(context); VerifyOrReturn(req_handle, ESP_LOGE(TAG, "Failed to call the binding callback since command handle is NULL")); - if (binding.type == MATTER_UNICAST_BINDING && peer_device) { + if (binding.type == chip::app::Clusters::Binding::MATTER_UNICAST_BINDING && peer_device) { if (client_request_callback) { if (req_handle->type == INVOKE_CMD) { req_handle->command_path.mFlags.Set(chip::app::CommandPathFlags::kEndpointIdValid); @@ -131,7 +131,7 @@ static void esp_matter_command_client_binding_callback(const EmberBindingTableEn } client_request_callback(peer_device, req_handle, request_callback_priv_data); } - } else if (binding.type == MATTER_MULTICAST_BINDING && !peer_device) { + } else if (binding.type == chip::app::Clusters::Binding::MATTER_MULTICAST_BINDING && !peer_device) { if (client_group_request_callback) { if (req_handle->type == INVOKE_CMD) { req_handle->command_path.mFlags.Set(chip::app::CommandPathFlags::kGroupIdValid); @@ -167,7 +167,7 @@ esp_err_t cluster_update(uint16_t local_endpoint_id, request_handle_t *req_handl } VerifyOrReturnError(notified_cluster_id != chip::kInvalidClusterId, ESP_ERR_INVALID_ARG); if (CHIP_NO_ERROR != - chip::BindingManager::GetInstance().NotifyBoundClusterChanged(local_endpoint_id, notified_cluster_id, + chip::app::Clusters::Binding::Manager::GetInstance().NotifyBoundClusterChanged(local_endpoint_id, notified_cluster_id, static_cast(context))) { chip::Platform::Delete(context); ESP_LOGE(TAG, "failed to notify the bound cluster changed"); @@ -180,15 +180,15 @@ esp_err_t cluster_update(uint16_t local_endpoint_id, request_handle_t *req_handl static void __binding_manager_init(intptr_t arg) { auto &server = chip::Server::GetInstance(); - struct chip::BindingManagerInitParams binding_init_params = { + struct chip::app::Clusters::Binding::ManagerInitParams binding_init_params = { .mFabricTable = &server.GetFabricTable(), .mCASESessionManager = server.GetCASESessionManager(), .mStorage = &server.GetPersistentStorage(), }; - chip::BindingManager::GetInstance().Init(binding_init_params); - chip::BindingManager::GetInstance().RegisterBoundDeviceChangedHandler(esp_matter_command_client_binding_callback); - chip::BindingManager::GetInstance().RegisterBoundDeviceContextReleaseHandler(esp_matter_binding_context_release); + chip::app::Clusters::Binding::Manager::GetInstance().Init(binding_init_params); + chip::app::Clusters::Binding::Manager::GetInstance().RegisterBoundDeviceChangedHandler(esp_matter_command_client_binding_callback); + chip::app::Clusters::Binding::Manager::GetInstance().RegisterBoundDeviceContextReleaseHandler(esp_matter_binding_context_release); } void binding_manager_init() diff --git a/components/esp_matter/esp_matter_identify.cpp b/components/esp_matter/esp_matter_identify.cpp index e22f055f4..8e366f3e1 100644 --- a/components/esp_matter/esp_matter_identify.cpp +++ b/components/esp_matter/esp_matter_identify.cpp @@ -64,21 +64,24 @@ static esp_err_t execute_callback(callback_type_t type, uint16_t endpoint_id, ui static void start_cb(Identify *identify) { ESP_LOGI(TAG, "Start callback"); - execute_callback(START, identify->mEndpoint, static_cast(identify->mCurrentEffectIdentifier), + execute_callback(START, identify->mCluster.Cluster().GetPaths()[0].mEndpointId, + static_cast(identify->mCurrentEffectIdentifier), static_cast(identify->mEffectVariant)); } static void stop_cb(Identify *identify) { ESP_LOGI(TAG, "Stop callback"); - execute_callback(STOP, identify->mEndpoint, static_cast(identify->mCurrentEffectIdentifier), + execute_callback(STOP, identify->mCluster.Cluster().GetPaths()[0].mEndpointId, + static_cast(identify->mCurrentEffectIdentifier), static_cast(identify->mEffectVariant)); } static void effect_cb(Identify *identify) { ESP_LOGI(TAG, "Effect callback"); - execute_callback(EFFECT, identify->mEndpoint, static_cast(identify->mCurrentEffectIdentifier), + execute_callback(EFFECT, identify->mCluster.Cluster().GetPaths()[0].mEndpointId, + static_cast(identify->mCurrentEffectIdentifier), static_cast(identify->mEffectVariant)); } diff --git a/components/esp_matter/utils/cluster_select/Kconfig.in b/components/esp_matter/utils/cluster_select/Kconfig.in index 4f4f687e7..d6030b506 100644 --- a/components/esp_matter/utils/cluster_select/Kconfig.in +++ b/components/esp_matter/utils/cluster_select/Kconfig.in @@ -149,6 +149,10 @@ config SUPPORT_ELECTRICAL_GRID_CONDITIONS_CLUSTER bool "Support ELECTRICAL_GRID_CONDITIONS_CLUSTER" default y +config SUPPORT_GROUPCAST_CLUSTER + bool "Support GROUPCAST_CLUSTER" + default y + config SUPPORT_METER_IDENTIFICATION_CLUSTER bool "Support METER_IDENTIFICATION_CLUSTER" default y diff --git a/components/esp_matter/utils/cluster_select/cluster_dir.cmake b/components/esp_matter/utils/cluster_select/cluster_dir.cmake index d47dd3b5e..640e8f9c1 100644 --- a/components/esp_matter/utils/cluster_select/cluster_dir.cmake +++ b/components/esp_matter/utils/cluster_select/cluster_dir.cmake @@ -114,6 +114,9 @@ function(get_supported_cluster_dirs source_dirs) if(CONFIG_SUPPORT_ELECTRICAL_GRID_CONDITIONS_CLUSTER) list(APPEND temp_list "${MATTER_SDK_PATH}/src/app/clusters/electrical-grid-conditions-server") endif() + if(CONFIG_SUPPORT_GROUPCAST_CLUSTER) + list(APPEND temp_list "${MATTER_SDK_PATH}/src/app/clusters/groupcast-server") + endif() if(CONFIG_SUPPORT_METER_IDENTIFICATION_CLUSTER) list(APPEND temp_list "${MATTER_SDK_PATH}/src/app/clusters/meter-identification-server") endif() diff --git a/components/esp_matter/zap_common/app/ClusterCallbacks.h b/components/esp_matter/zap_common/app/ClusterCallbacks.h index ec94daa23..9bf7bac18 100644 --- a/components/esp_matter/zap_common/app/ClusterCallbacks.h +++ b/components/esp_matter/zap_common/app/ClusterCallbacks.h @@ -406,6 +406,9 @@ void ESPMatterWaterHeaterManagementClusterServerShutdownCallback(EndpointId endp void ESPMatterWaterHeaterModeClusterServerInitCallback(EndpointId endpoint); void ESPMatterWaterHeaterModeClusterServerShutdownCallback(EndpointId endpoint); +void ESPMatterWaterTankLevelMonitoringClusterServerInitCallback(EndpointId endpoint); +void ESPMatterWaterTankLevelMonitoringClusterServerShutdownCallback(EndpointId endpoint); + void ESPMatterWebRTCTransportProviderClusterServerInitCallback(EndpointId endpoint); void ESPMatterWebRTCTransportProviderClusterServerShutdownCallback(EndpointId endpoint); diff --git a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h index 0b9c96554..883b88aee 100644 --- a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h +++ b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h @@ -133,6 +133,7 @@ void MatterValveConfigurationAndControlPluginServerInitCallback(); void MatterWakeOnLanPluginServerInitCallback(); void MatterWaterHeaterManagementPluginServerInitCallback(); void MatterWaterHeaterModePluginServerInitCallback(); +void MatterWaterTankLevelMonitoringPluginServerInitCallback(); void MatterWebRTCTransportProviderPluginServerInitCallback(); void MatterWebRTCTransportRequestorPluginServerInitCallback(); void MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); diff --git a/components/esp_matter/zap_common/zap-generated/access.h b/components/esp_matter/zap_common/zap-generated/access.h index 3c9e407e3..1f0664bd7 100644 --- a/components/esp_matter/zap_common/zap-generated/access.h +++ b/components/esp_matter/zap_common/zap-generated/access.h @@ -11,6 +11,7 @@ #define GENERATED_ACCESS_READ_ATTRIBUTE__CLUSTER { \ 0x0000001F, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ 0x0000001F, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ + 0x0000001F, /* Cluster: Access Control, Attribute: AuxiliaryACL, Privilege: administer */ \ 0x00000030, /* Cluster: General Commissioning, Attribute: TCAcceptedVersion, Privilege: administer */ \ 0x00000030, /* Cluster: General Commissioning, Attribute: TCMinRequiredVersion, Privilege: administer */ \ 0x00000030, /* Cluster: General Commissioning, Attribute: TCAcknowledgements, Privilege: administer */ \ @@ -82,6 +83,7 @@ #define GENERATED_ACCESS_READ_ATTRIBUTE__ATTRIBUTE { \ 0x00000000, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ 0x00000001, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ + 0x00000007, /* Cluster: Access Control, Attribute: AuxiliaryACL, Privilege: administer */ \ 0x00000005, /* Cluster: General Commissioning, Attribute: TCAcceptedVersion, Privilege: administer */ \ 0x00000006, /* Cluster: General Commissioning, Attribute: TCMinRequiredVersion, Privilege: administer */ \ 0x00000007, /* Cluster: General Commissioning, Attribute: TCAcknowledgements, Privilege: administer */ \ @@ -153,6 +155,7 @@ #define GENERATED_ACCESS_READ_ATTRIBUTE__PRIVILEGE { \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ + chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Attribute: AuxiliaryACL, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: General Commissioning, Attribute: TCAcceptedVersion, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: General Commissioning, Attribute: TCMinRequiredVersion, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: General Commissioning, Attribute: TCAcknowledgements, Privilege: administer */ \ @@ -619,7 +622,6 @@ 0x0000003F, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ 0x00000046, /* Cluster: ICD Management, Command: RegisterClient, Privilege: manage */ \ 0x00000046, /* Cluster: ICD Management, Command: UnregisterClient, Privilege: manage */ \ - 0x00000046, /* Cluster: ICD Management, Command: StayActiveRequest, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: AddScene, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000062, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ @@ -667,6 +669,21 @@ 0x0000050B, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ 0x0000050E, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ 0x0000050E, /* Cluster: Account Login, Command: Login, Privilege: administer */ \ + 0x0000050F, /* Cluster: Content Control, Command: UpdatePIN, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: ResetPIN, Privilege: administer */ \ + 0x0000050F, /* Cluster: Content Control, Command: Enable, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: Disable, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: SetScreenDailyTime, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: BlockUnratedContent, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: UnblockUnratedContent, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: SetOnDemandRatingThreshold, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: SetScheduledContentRatingThreshold, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: AddBlockChannels, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: RemoveBlockChannels, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: AddBlockApplications, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: RemoveBlockApplications, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: SetBlockContentTimeWindow, Privilege: manage */ \ + 0x0000050F, /* Cluster: Content Control, Command: RemoveBlockContentTimeWindow, Privilege: manage */ \ 0x00000550, /* Cluster: Zone Management, Command: CreateTwoDCartesianZone, Privilege: manage */ \ 0x00000550, /* Cluster: Zone Management, Command: UpdateTwoDCartesianZone, Privilege: manage */ \ 0x00000550, /* Cluster: Zone Management, Command: RemoveZone, Privilege: manage */ \ @@ -774,7 +791,6 @@ 0x00000004, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ 0x00000000, /* Cluster: ICD Management, Command: RegisterClient, Privilege: manage */ \ 0x00000002, /* Cluster: ICD Management, Command: UnregisterClient, Privilege: manage */ \ - 0x00000003, /* Cluster: ICD Management, Command: StayActiveRequest, Privilege: manage */ \ 0x00000000, /* Cluster: Scenes Management, Command: AddScene, Privilege: manage */ \ 0x00000002, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ 0x00000003, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ @@ -822,6 +838,21 @@ 0x00000001, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ 0x00000000, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ 0x00000002, /* Cluster: Account Login, Command: Login, Privilege: administer */ \ + 0x00000000, /* Cluster: Content Control, Command: UpdatePIN, Privilege: manage */ \ + 0x00000001, /* Cluster: Content Control, Command: ResetPIN, Privilege: administer */ \ + 0x00000003, /* Cluster: Content Control, Command: Enable, Privilege: manage */ \ + 0x00000004, /* Cluster: Content Control, Command: Disable, Privilege: manage */ \ + 0x00000006, /* Cluster: Content Control, Command: SetScreenDailyTime, Privilege: manage */ \ + 0x00000007, /* Cluster: Content Control, Command: BlockUnratedContent, Privilege: manage */ \ + 0x00000008, /* Cluster: Content Control, Command: UnblockUnratedContent, Privilege: manage */ \ + 0x00000009, /* Cluster: Content Control, Command: SetOnDemandRatingThreshold, Privilege: manage */ \ + 0x0000000A, /* Cluster: Content Control, Command: SetScheduledContentRatingThreshold, Privilege: manage */ \ + 0x0000000B, /* Cluster: Content Control, Command: AddBlockChannels, Privilege: manage */ \ + 0x0000000C, /* Cluster: Content Control, Command: RemoveBlockChannels, Privilege: manage */ \ + 0x0000000D, /* Cluster: Content Control, Command: AddBlockApplications, Privilege: manage */ \ + 0x0000000E, /* Cluster: Content Control, Command: RemoveBlockApplications, Privilege: manage */ \ + 0x0000000F, /* Cluster: Content Control, Command: SetBlockContentTimeWindow, Privilege: manage */ \ + 0x00000010, /* Cluster: Content Control, Command: RemoveBlockContentTimeWindow, Privilege: manage */ \ 0x00000000, /* Cluster: Zone Management, Command: CreateTwoDCartesianZone, Privilege: manage */ \ 0x00000002, /* Cluster: Zone Management, Command: UpdateTwoDCartesianZone, Privilege: manage */ \ 0x00000003, /* Cluster: Zone Management, Command: RemoveZone, Privilege: manage */ \ @@ -929,7 +960,6 @@ chip::Access::Privilege::kAdminister, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ chip::Access::Privilege::kManage, /* Cluster: ICD Management, Command: RegisterClient, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: ICD Management, Command: UnregisterClient, Privilege: manage */ \ - chip::Access::Privilege::kManage, /* Cluster: ICD Management, Command: StayActiveRequest, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: AddScene, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveScene, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Scenes Management, Command: RemoveAllScenes, Privilege: manage */ \ @@ -977,6 +1007,21 @@ chip::Access::Privilege::kManage, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ chip::Access::Privilege::kAdminister, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Account Login, Command: Login, Privilege: administer */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: UpdatePIN, Privilege: manage */ \ + chip::Access::Privilege::kAdminister, /* Cluster: Content Control, Command: ResetPIN, Privilege: administer */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: Enable, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: Disable, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: SetScreenDailyTime, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: BlockUnratedContent, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: UnblockUnratedContent, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: SetOnDemandRatingThreshold, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: SetScheduledContentRatingThreshold, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: AddBlockChannels, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: RemoveBlockChannels, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: AddBlockApplications, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: RemoveBlockApplications, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: SetBlockContentTimeWindow, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Content Control, Command: RemoveBlockContentTimeWindow, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Zone Management, Command: CreateTwoDCartesianZone, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Zone Management, Command: UpdateTwoDCartesianZone, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Zone Management, Command: RemoveZone, Privilege: manage */ \ @@ -1041,6 +1086,7 @@ 0x0000001F, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ 0x0000001F, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ 0x0000001F, /* Cluster: Access Control, Event: FabricRestrictionReviewUpdate, Privilege: administer */ \ + 0x0000001F, /* Cluster: Access Control, Event: AuxiliaryAccessUpdated, Privilege: administer */ \ 0x0000050E, /* Cluster: Account Login, Event: LoggedOut, Privilege: administer */ \ 0x00000751, /* Cluster: Commissioner Control, Event: CommissioningRequestResult, Privilege: manage */ \ } @@ -1050,6 +1096,7 @@ 0x00000000, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ 0x00000001, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ 0x00000002, /* Cluster: Access Control, Event: FabricRestrictionReviewUpdate, Privilege: administer */ \ + 0x00000003, /* Cluster: Access Control, Event: AuxiliaryAccessUpdated, Privilege: administer */ \ 0x00000000, /* Cluster: Account Login, Event: LoggedOut, Privilege: administer */ \ 0x00000000, /* Cluster: Commissioner Control, Event: CommissioningRequestResult, Privilege: manage */ \ } @@ -1059,6 +1106,7 @@ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: FabricRestrictionReviewUpdate, Privilege: administer */ \ + chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: AuxiliaryAccessUpdated, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Account Login, Event: LoggedOut, Privilege: administer */ \ chip::Access::Privilege::kManage, /* Cluster: Commissioner Control, Event: CommissioningRequestResult, Privilege: manage */ \ } diff --git a/components/esp_matter_controller/data_model_provider/controller_data_model_provider.h b/components/esp_matter_controller/data_model_provider/controller_data_model_provider.h index e165c4a06..493ade625 100644 --- a/components/esp_matter_controller/data_model_provider/controller_data_model_provider.h +++ b/components/esp_matter_controller/data_model_provider/controller_data_model_provider.h @@ -40,6 +40,7 @@ using chip::ClusterId; using chip::CommandId; using chip::EndpointId; +using chip::FabricIndex; using chip::ReadOnlyBufferBuilder; using chip::app::AttributePathParams; using chip::app::AttributeValueDecoder; @@ -107,7 +108,8 @@ public: #endif } - void ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType) override {} + void ListAttributeWriteNotification(const ConcreteAttributePath &aPath, ListWriteOperation opType, + FabricIndex accessFabric) override {} std::optional InvokeCommand(const InvokeRequest &request, TLVReader &input_arguments, CommandHandler *handler) override @@ -140,11 +142,6 @@ public: #endif } - CHIP_ERROR SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override - { - return CHIP_NO_ERROR; - } - CHIP_ERROR DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder &builder) override { return CHIP_NO_ERROR; diff --git a/connectedhomeip/connectedhomeip b/connectedhomeip/connectedhomeip index f902839ab..faf4d09ad 160000 --- a/connectedhomeip/connectedhomeip +++ b/connectedhomeip/connectedhomeip @@ -1 +1 @@ -Subproject commit f902839abf1de0d17956de34889b6ad997e2c5e4 +Subproject commit faf4d09ad13fc0c01be988c54ed819ff838567ee diff --git a/examples/all_device_types_app/main/electrical_measurement/electrical_measurement.cpp b/examples/all_device_types_app/main/electrical_measurement/electrical_measurement.cpp index 9e52a4c83..e270131e7 100644 --- a/examples/all_device_types_app/main/electrical_measurement/electrical_measurement.cpp +++ b/examples/all_device_types_app/main/electrical_measurement/electrical_measurement.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/export.sh b/export.sh index dc5766f9a..2a07c4709 100644 --- a/export.sh +++ b/export.sh @@ -55,6 +55,9 @@ esp_matter_export_main() { # export zap-cli path export ZAP_INSTALL_PATH=${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip/.environment/cipd/packages/zap + + # export PW environment path + export _PW_ACTUAL_ENVIRONMENT_ROOT=${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip/.environment } esp_matter_export_main