esp_matter: Add configuration option to allow initializing Thread out of esp_matter::start()

This commit is contained in:
WanqQixiang
2024-10-21 19:05:14 +08:00
committed by Shu Chen
parent 1b7bdf3d58
commit 4065f55889
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -228,4 +228,14 @@ menu "ESP Matter"
If enabled, we will start Matter server when calling esp_matter::start()
If disabled, the Matter server will not be initialized in esp_matter::start()
config ESP_MATTER_ENABLE_OPENTHREAD
bool "Initialize Thread stack and start Thread task when starting ESP-Matter"
default y
help
Enabled this option to initialize Thread stack and start Thread task when calling
esp_matter::start()
Disable this option to initialize Thread stack and start Thread task with more
flexibility.
endmenu
@@ -961,6 +961,7 @@ static esp_err_t chip_init(event_callback_t callback, intptr_t callback_arg)
PlatformMgr().AddEventHandler(callback, callback_arg);
}
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
#ifdef CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
if (ThreadStackMgr().InitThreadStack() != CHIP_NO_ERROR) {
ESP_LOGE(TAG, "Failed to initialize Thread stack");
return ESP_FAIL;
@@ -986,6 +987,7 @@ static esp_err_t chip_init(event_callback_t callback, intptr_t callback_arg)
ESP_LOGE(TAG, "Failed to launch Thread task");
return ESP_FAIL;
}
#endif // CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
#if CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER