Skip the Network Commissioning cluster on the root node when
CONFIG_CUSTOM_NETWORK_CONFIG is enabled, per Matter spec condition
(!CustomNetworkConfig). This allows devices with out-of-band network
configuration (rich UI, manufacturer-specific means) to omit the
cluster as the spec permits.
- Add CONFIG_CUSTOM_NETWORK_CONFIG Kconfig option
- Conditionally skip network_commissioning in root_node config/add
- Exclude integration.cpp from build when custom config enabled
- Add weak stubs for Plugin callbacks as fallback
- Also guarded secondary network device type and all the
attributes and commands that are part of network commissioning
cluster
- Add is_integral_json_number() helper to verify JSON numbers represent
integral values before encoding.
- Add range validation for Int32 and UInt32 types to prevent overflow.
- Fix Int64 and UInt64 string parsing to properly validate input strings
and detect conversion errors.
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
Add tlv_to_json.cpp/h which converts CHIP TLV data model payload
to cJSON format for debugging and interoperability.
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
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