Merge branch 'feat/ot_make_esp_netif_glue_optional_v5.2' into 'release/v5.2'

feat(openthread): make esp_netif glue optional (v5.2)

See merge request espressif/esp-idf!47864
This commit is contained in:
Jiang Jiang Jian
2026-05-20 17:54:55 +08:00
12 changed files with 128 additions and 30 deletions
+3 -2
View File
@@ -182,6 +182,7 @@ esp_err_t esp_openthread_mainloop_exit(void)
esp_err_t esp_openthread_launch_mainloop(void)
{
ESP_LOGI(OT_PLAT_LOG_TAG, "OpenThread enter mainloop");
esp_openthread_mainloop_context_t mainloop;
otInstance *instance = esp_openthread_get_instance();
esp_err_t error = ESP_OK;
@@ -240,7 +241,7 @@ static void ot_task_worker(void *aContext)
// Initialize the OpenThread stack
ESP_ERROR_CHECK(esp_openthread_init(&(config->platform_config)));
#if CONFIG_OPENTHREAD_FTD || CONFIG_OPENTHREAD_MTD
#if CONFIG_OPENTHREAD_PLATFORM_NETIF
esp_netif_t *openthread_netif = esp_netif_new(&(config->netif_config));
assert(openthread_netif != NULL);
ESP_ERROR_CHECK(esp_netif_attach(openthread_netif, esp_openthread_netif_glue_init(&(config->platform_config))));
@@ -271,7 +272,7 @@ static void ot_task_worker(void *aContext)
// esp_openthread_cli_console_command_unregister is not provided on idf 5.2
#if CONFIG_OPENTHREAD_FTD || CONFIG_OPENTHREAD_MTD
#if CONFIG_OPENTHREAD_PLATFORM_NETIF
// Clean up
esp_openthread_netif_glue_deinit();
esp_netif_destroy(openthread_netif);