esp_matter/data_model_provider: Add support to call ClusterPreAttributeChangeCallback from esp-matter data model provider.
See merge request app-frameworks/esp-matter!1420
cluster::destroy() freed the cluster memory and its children (attributes,
commands, events) but never removed the cluster from the parent endpoint's
linked list, leaving a dangling pointer. This caused use-after-free crashes
when creating a new cluster on the same endpoint after destroying one.
Fix: look up the parent endpoint via the endpoint_id stored in the cluster
struct and unlink before freeing, consistent with how attribute::destroy,
command::destroy and event::destroy handle their parent lists.
and refactoring
attribute::update and attribute::report were eating up the error code
returned by set_val and returning ESP_OK. This hide all the errors
reported by set_val.
attribute::update and attribute::report are identical with a simple
delta of whether to call the attribute callback or not. So, refactored
it into as helper function.
The three Thread-related clusters (Thread Network Diagnostics, Thread
Border Router Management, Thread Network Directory) default to enabled
regardless of whether OpenThread is present. On WiFi-only devices this
causes the clusters to be registered on the root node endpoint, but
read requests fail with CHIP_ERROR_NOT_IMPLEMENTED because
CHIP_DEVICE_CONFIG_ENABLE_THREAD is disabled, producing noisy DMG
errors like:
E chip[DMG]: Fail to retrieve data ... clusterId: 0x0000_0035 err = 2d
Add `depends on OPENTHREAD_ENABLED` so these clusters are only
available when the Thread stack is actually present.
When using the esp_matter data model (CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y),
attribute::get(endpoint_id, cluster_id, attribute_id) is called during endpoint
registration via emberAfExternalAttributeReadCallback. If the cluster doesn't
exist on the endpoint, the lookup returns NULL, which is then passed to the
two-argument get(cluster_t*, attribute_id) overload that logs at error level.
Add a NULL guard in the three-argument overload to return nullptr early,
consistent with how command::get(endpoint_id, cluster_id, command_id) already
handles this case.
Fixes#1692
MinSetpointDeadBand is defined as an int8_t, but the bounds were incorrectly created using int16_t. Updated bounds to use int8_t with the correct range (0–127).
Replace at most validation check with exact one for closure dimension
cluster
- removed at most validation macro
- add features for door lock, microwave oven, device energy management,
energy evse devices in all device type app to make them conformant
feat: add Meter Identification delegate initialization callback
feat: clarify initialization callback in Meter Identification delegate
feat: clarify initialization callback in Meter Identification delegate
feat: update initialization callback for Meter Identification delegate