upgrade connectedhomeip to latest release v1.5 branch

This commit is contained in:
WanqQixiang
2025-11-21 12:30:57 +08:00
parent 89fe5168f7
commit 211658c88e
30 changed files with 677 additions and 139 deletions
+2 -1
View File
@@ -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"
+1 -1
View File
@@ -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).
@@ -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;
@@ -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 */
@@ -212,14 +212,12 @@ 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) {
if (identify_cluster != nullptr && 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);
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 {
@@ -227,8 +225,6 @@ static esp_err_t init_identification(endpoint_t *endpoint)
return ESP_ERR_INVALID_STATE;
}
}
cluster = cluster->next;
}
// Return ESP_OK when identify cluster is not on the endpoint.
return ESP_OK;
}
@@ -24,11 +24,11 @@
#include <app/clusters/resource-monitoring-server/resource-monitoring-server.h>
#include <app/clusters/fan-control-server/fan-control-server.h>
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h>
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h>
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-cluster.h>
#include <app/clusters/device-energy-management-server/device-energy-management-server.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h>
#include <app/clusters/time-synchronization-server/time-synchronization-server.h>
#include <app/clusters/time-synchronization-server/time-synchronization-cluster.h>
#include <app/clusters/application-basic-server/application-basic-server.h>
#include <app/clusters/power-topology-server/power-topology-server.h>
#include <app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h>
@@ -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 <app/clusters/descriptor/descriptor-cluster.h>
#include <esp_matter_data_model.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
#include <lib/core/CHIPConfig.h>
#include <lib/core/CHIPError.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ScopedBuffer.h>
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<const SemanticTag>())
{}
CHIP_ERROR Attributes(const ConcreteClusterPath & path, ReadOnlyBufferBuilder<DataModel::AttributeEntry> & 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<const SemanticTag> &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<const SemanticTag>(mTagBuffer.Get(), tagCount);
}
return CHIP_NO_ERROR;
}
Platform::ScopedMemoryBuffer<SemanticTag> mTagBuffer;
bool mFetchedSemanticTags = false;
};
std::unordered_map<EndpointId, LazyRegisteredServerCluster<ESPMatterDescriptorCluster>> 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<Descriptor::Attributes::EndpointUniqueID::Id>();
}
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() {}
@@ -14,19 +14,21 @@
#include <app/ClusterCallbacks.h>
#include <app/clusters/diagnostic-logs-server/DiagnosticLogsCluster.h>
#include <app/server-cluster/ServerClusterInterfaceRegistry.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
LazyRegisteredServerCluster<DiagnosticLogsCluster> 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() {}
@@ -15,22 +15,44 @@
#include <app/ClusterCallbacks.h>
#include <app/clusters/general-commissioning-server/general-commissioning-cluster.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
#include <esp_matter_data_model.h>
#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<GeneralCommissioningCluster> 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<GeneralCommissioning::Attributes::IsCommissioningWithoutPower::Id>();
}
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() {}
@@ -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 <app/clusters/general-commissioning-server/general-commissioning-cluster.h>
namespace chip::app::Clusters::GeneralCommissioning {
GeneralCommissioningCluster * Instance();
} // namespace chip::app::Clusters::GeneralCommissioning
@@ -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 <app-common/zap-generated/attributes/Accessors.h>
#include <app/clusters/groupcast/GroupcastCluster.h>
#include <clusters/Groupcast/Enums.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::Groupcast::Attributes;
using chip::Protocols::InteractionModel::Status;
namespace {
LazyRegisteredServerCluster<GroupcastCluster> 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<Groupcast::Feature> 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() {}
@@ -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 <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app-common/zap-generated/ids/Commands.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/DefaultTimerDelegate.h>
#include <app/InteractionModelEngine.h>
#include <app/clusters/identify-server/IdentifyCluster.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/server-cluster/DefaultServerCluster.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/TimerDelegate.h>
#include <tracing/macros.h>
#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() {}
@@ -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 <app/clusters/localization-configuration-server/localization-configuration-cluster.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
#include <esp_matter_attribute_utils.h>
#include <esp_matter_data_model.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/Span.h>
#include <platform/DeviceInfoProvider.h>
#include <protocols/interaction_model/StatusCode.h>
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
namespace {
LazyRegisteredServerCluster<LocalizationConfigurationCluster> 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());
}
}
@@ -21,6 +21,7 @@
#include <lib/support/CodeUtils.h>
#include <platform/ESP32/NetworkCommissioningDriver.h>
#include <platform/OpenThread/GenericNetworkCommissioningThreadDriver.h>
#include "general_commissioning_integration.h"
using namespace chip;
using namespace chip::app;
@@ -51,6 +52,17 @@ static_assert(kNetworkCommissioningClusterCount > 0, "NetworkCommissioningCluste
LazyRegisteredServerCluster<NetworkCommissioningCluster> 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());
}
@@ -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 <app/ClusterCallbacks.h>
#include <app/clusters/user-label-server/user-label-cluster.h>
#include <data_model_provider/esp_matter_data_model_provider.h>
#include <unordered_map>
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
namespace {
std::unordered_map<EndpointId, LazyRegisteredServerCluster<UserLabelCluster>> 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() {}
@@ -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<WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id>();
}
@@ -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<EndpointEntry> &builder)
return CHIP_NO_ERROR;
}
CHIP_ERROR provider::SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder<SemanticTag> &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<DeviceTypeEntry> &builder)
{
Status status = CheckDataModelPath(endpointId);
@@ -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<ActionReturnStatus> InvokeCommand(const InvokeRequest &request, chip::TLV::TLVReader &input_arguments,
CommandHandler *handler) override;
/// attribute tree iteration
CHIP_ERROR Endpoints(ReadOnlyBufferBuilder<EndpointEntry> &out) override;
CHIP_ERROR SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder<SemanticTag> &builder) override;
CHIP_ERROR DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder<DeviceTypeEntry> &builder) override;
CHIP_ERROR ClientClusters(EndpointId endpointId, ReadOnlyBufferBuilder<ClusterId> &builder) override;
CHIP_ERROR ServerClusters(EndpointId endpointId, ReadOnlyBufferBuilder<ServerClusterEntry> &builder) override;
@@ -23,7 +23,6 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app/AttributePathParams.h>
#include <app/InteractionModelEngine.h>
#include <app/util/AttributesChangedListener.h>
#include <app/util/MarkAttributeDirty.h>
#include <app/util/attribute-storage.h>
#include <app/util/attribute-table.h>
@@ -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));
}
}
+8 -8
View File
@@ -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<request_handle_t *>(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<void *>(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()
@@ -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<uint8_t>(identify->mCurrentEffectIdentifier),
execute_callback(START, identify->mCluster.Cluster().GetPaths()[0].mEndpointId,
static_cast<uint8_t>(identify->mCurrentEffectIdentifier),
static_cast<uint8_t>(identify->mEffectVariant));
}
static void stop_cb(Identify *identify)
{
ESP_LOGI(TAG, "Stop callback");
execute_callback(STOP, identify->mEndpoint, static_cast<uint8_t>(identify->mCurrentEffectIdentifier),
execute_callback(STOP, identify->mCluster.Cluster().GetPaths()[0].mEndpointId,
static_cast<uint8_t>(identify->mCurrentEffectIdentifier),
static_cast<uint8_t>(identify->mEffectVariant));
}
static void effect_cb(Identify *identify)
{
ESP_LOGI(TAG, "Effect callback");
execute_callback(EFFECT, identify->mEndpoint, static_cast<uint8_t>(identify->mCurrentEffectIdentifier),
execute_callback(EFFECT, identify->mCluster.Cluster().GetPaths()[0].mEndpointId,
static_cast<uint8_t>(identify->mCurrentEffectIdentifier),
static_cast<uint8_t>(identify->mEffectVariant));
}
@@ -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
@@ -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()
@@ -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);
@@ -133,6 +133,7 @@ void MatterValveConfigurationAndControlPluginServerInitCallback();
void MatterWakeOnLanPluginServerInitCallback();
void MatterWaterHeaterManagementPluginServerInitCallback();
void MatterWaterHeaterModePluginServerInitCallback();
void MatterWaterTankLevelMonitoringPluginServerInitCallback();
void MatterWebRTCTransportProviderPluginServerInitCallback();
void MatterWebRTCTransportRequestorPluginServerInitCallback();
void MatterWiFiNetworkDiagnosticsPluginServerInitCallback();
@@ -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 */ \
}
@@ -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<ActionReturnStatus> InvokeCommand(const InvokeRequest &request, TLVReader &input_arguments,
CommandHandler *handler) override
@@ -140,11 +142,6 @@ public:
#endif
}
CHIP_ERROR SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder<SemanticTag> &builder) override
{
return CHIP_NO_ERROR;
}
CHIP_ERROR DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder<DeviceTypeEntry> &builder) override
{
return CHIP_NO_ERROR;
@@ -11,7 +11,7 @@
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app-common/zap-generated/ids/Events.h>
#include <app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.h>
#include <app/clusters/electrical-energy-measurement-server/ElectricalEnergyMeasurementCluster.h>
#include <app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h>
#include <app/reporting/reporting.h>
#include <app/data-model/Nullable.h>
+3
View File
@@ -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