mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'esp_matter/fix_bounds_type' into 'main'
esp_matter: fix duplicated add_bounds callback and remove add bounds callback for identify cluster See merge request app-frameworks/esp-matter!1323
This commit is contained in:
@@ -31,30 +31,6 @@ esp_err_t get_attribute_value(cluster_t *cluster, uint32_t attribute_id, esp_mat
|
||||
return attribute::get_val_internal(attribute::get(cluster, attribute_id), val);
|
||||
}
|
||||
|
||||
namespace identify {
|
||||
|
||||
void add_bounds_cb(cluster_t *cluster)
|
||||
{
|
||||
VerifyOrReturn(cluster != nullptr, ESP_LOGE(TAG, "Cluster is NULL. Add bounds Failed!!"));
|
||||
attribute_t *current_attribute = esp_matter::attribute::get_first(cluster);
|
||||
VerifyOrReturn(current_attribute != nullptr, ESP_LOGE(TAG, "Attribute is NULL."));
|
||||
while(current_attribute) {
|
||||
switch(esp_matter::attribute::get_id(current_attribute)) {
|
||||
|
||||
case Identify::Attributes::IdentifyType::Id: {
|
||||
uint8_t min = 0, max = 6;
|
||||
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint8(min), esp_matter_uint8(max));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
current_attribute = esp_matter::attribute::get_next(current_attribute);
|
||||
}
|
||||
}
|
||||
|
||||
} /* identify */
|
||||
|
||||
namespace scenes_management {
|
||||
|
||||
void add_bounds_cb(cluster_t *cluster)
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
namespace esp_matter {
|
||||
namespace cluster {
|
||||
|
||||
namespace identify {
|
||||
void add_bounds_cb(cluster_t *cluster);
|
||||
} /* identify */
|
||||
|
||||
namespace scenes_management {
|
||||
void add_bounds_cb(cluster_t *cluster);
|
||||
} /* scenes_management */
|
||||
|
||||
@@ -1056,7 +1056,6 @@ 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(MatterIdentifyPluginServerInitCallback);
|
||||
set_plugin_server_init_callback(cluster, plugin_server_init_cb);
|
||||
set_add_bounds_callback(cluster, identify::add_bounds_cb);
|
||||
add_function_list(cluster, function_list, function_flags);
|
||||
|
||||
/* Attributes managed internally */
|
||||
|
||||
@@ -326,11 +326,6 @@ static esp_err_t chip_init(event_callback_t callback, intptr_t callback_arg)
|
||||
}
|
||||
init_thread_stack_and_start_thread_task();
|
||||
#if CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER
|
||||
#ifdef CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
|
||||
// Add bounds to all attributes
|
||||
esp_matter::cluster::add_bounds_callback_common();
|
||||
#endif // CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
|
||||
|
||||
PlatformMgr().ScheduleWork(esp_matter_chip_init_task, reinterpret_cast<intptr_t>(xTaskGetCurrentTaskHandle()));
|
||||
// Wait for the matter stack to be initialized
|
||||
xTaskNotifyWait(0, 0, NULL, portMAX_DELAY);
|
||||
|
||||
Reference in New Issue
Block a user