mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
components/esp_matter: Add delegate callbacks for clusters
- Actions - DiagnosticLogs - OTAProvider - Thermostat
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user