mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
components/esp_matter: set full-family composition for dynamic endpoints
emberAfSetDynamicEndpoint does not auto-detect device types to set the isFlatComposition flag, unlike static endpoints in emberAfInit. This causes Aggregator and Bridged Node endpoints registered dynamically to use kTree composition instead of kFullFamily, resulting in PartsList only listing direct children instead of all descendants. After registering a dynamic endpoint, check if its device type is Root Node, Aggregator, or Bridged Node and call SetFlatCompositionForEndpoint to match the static endpoint behavior. Closes https://github.com/espressif/esp-matter/issues/1741
This commit is contained in:
@@ -534,6 +534,17 @@ esp_err_t enable(endpoint_t *endpoint)
|
||||
}
|
||||
ESP_LOGI(TAG, "Dynamic endpoint %" PRIu16 " added", current_endpoint->endpoint_id);
|
||||
|
||||
/* Set composition pattern for dynamic endpoints. emberAfSetDynamicEndpoint does not auto-detect
|
||||
* device types to set the composition, unlike static endpoints. Root node, aggregator, and bridged
|
||||
* node device types need kFullFamily composition for correct PartsList computation. */
|
||||
for (uint8_t i = 0; i < current_endpoint->device_type_count; i++) {
|
||||
if (current_endpoint->device_type_ids[i] == ESP_MATTER_ROOT_NODE_DEVICE_TYPE_ID ||
|
||||
current_endpoint->device_type_ids[i] == ESP_MATTER_AGGREGATOR_DEVICE_TYPE_ID ||
|
||||
current_endpoint->device_type_ids[i] == ESP_MATTER_BRIDGED_NODE_DEVICE_TYPE_ID) {
|
||||
chip::app::SetFlatCompositionForEndpoint(current_endpoint->endpoint_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUPPORT_UNIT_LOCALIZATION_CLUSTER
|
||||
// set the temperature unit from unit localization cluster
|
||||
|
||||
Reference in New Issue
Block a user