mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'pr_1638' into 'main'
[GH_PR] Fix MeterIdentification cluster AttributeAccessInterface initialization (CON-1910) See merge request app-frameworks/esp-matter!1388
This commit is contained in:
@@ -4535,6 +4535,9 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
|
||||
if (flags & CLUSTER_FLAG_SERVER) {
|
||||
static const auto plugin_server_init_cb = CALL_ONCE(MatterMeterIdentificationPluginServerInitCallback);
|
||||
set_plugin_server_init_callback(cluster, plugin_server_init_cb);
|
||||
/* Not a delegate but an Initialization callback */
|
||||
static const auto delegate_init_cb = MeterIdentificationDelegateInitCB;
|
||||
set_delegate_and_init_callback(cluster, delegate_init_cb, nullptr);
|
||||
add_function_list(cluster, function_list, function_flags);
|
||||
|
||||
/* Attributes managed internally */
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include <app/clusters/commodity-tariff-server/commodity-tariff-server.h>
|
||||
#include <app/clusters/commodity-price-server/commodity-price-server.h>
|
||||
#include <app/clusters/electrical-grid-conditions-server/electrical-grid-conditions-server.h>
|
||||
#include <app/clusters/meter-identification-server/meter-identification-server.h>
|
||||
#include <unordered_map>
|
||||
|
||||
using namespace chip::app::Clusters;
|
||||
@@ -617,6 +618,14 @@ void ElectricalGridConditionsDelegateInitCB(void *delegate, uint16_t endpoint_id
|
||||
electrical_grid_conditions_instance->Init();
|
||||
}
|
||||
|
||||
/* Not a delegate but an Initialization callback */
|
||||
void MeterIdentificationDelegateInitCB(void *delegate, uint16_t endpoint_id)
|
||||
{
|
||||
uint32_t feature_map = get_feature_map_value(endpoint_id, MeterIdentification::Id);
|
||||
MeterIdentification::Instance *meter_identification_instance = new MeterIdentification::Instance(endpoint_id, chip::BitMask<MeterIdentification::Feature, uint32_t>(feature_map));
|
||||
meter_identification_instance->Init();
|
||||
}
|
||||
|
||||
} // namespace delegate_cb
|
||||
} // namespace cluster
|
||||
} // namespace esp_matter
|
||||
|
||||
@@ -62,6 +62,7 @@ void PushAvStreamTransportDelegateInitCB(void *delegate, uint16_t endpoint_id);
|
||||
void CommodityTariffDelegateInitCB(void *delegate, uint16_t endpoint_id);
|
||||
void CommodityPriceDelegateInitCB(void *delegate, uint16_t endpoint_id);
|
||||
void ElectricalGridConditionsDelegateInitCB(void *delegate, uint16_t endpoint_id);
|
||||
void MeterIdentificationDelegateInitCB(void *delegate, uint16_t endpoint_id);
|
||||
} // namespace delegate_cb
|
||||
|
||||
} // namespace cluster
|
||||
|
||||
Reference in New Issue
Block a user