components/esp_matter: Add delegate callbacks for clusters

- Actions
- DiagnosticLogs
- OTAProvider
- Thermostat
This commit is contained in:
mahesh
2025-05-22 13:05:37 +05:30
parent 78d3def625
commit d15b7ca504
5 changed files with 71 additions and 6 deletions
+2 -2
View File
@@ -54,6 +54,8 @@ extern "C" void app_main()
node_t *node = node::create(&node_config, NULL, NULL);
endpoint_t *root_node_endpoint = endpoint::get(node, 0);
cluster::ota_provider::config_t config;
EspOtaProvider::GetInstance().Init(true);
config.delegate = &EspOtaProvider::GetInstance();
cluster_t *ota_provider_cluster = cluster::ota_provider::create(root_node_endpoint, &config, CLUSTER_FLAG_SERVER);
if (!node || !root_node_endpoint || !ota_provider_cluster) {
ESP_LOGE(TAG, "Failed to create data model");
@@ -64,8 +66,6 @@ extern "C" void app_main()
if (err != ESP_OK) {
ESP_LOGE(TAG, "Matter start failed: %d", err);
}
EspOtaProvider::GetInstance().Init(true);
OTAProvider::SetDelegate(0, reinterpret_cast<OTAProviderDelegate *>(&EspOtaProvider::GetInstance()));
#if CONFIG_ENABLE_CHIP_SHELL
esp_matter::console::diagnostics_register_commands();
esp_matter::console::wifi_register_commands();