mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
esp_matter: Add configuration option to allow initializing Thread out of esp_matter::start()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user