mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(openthread): make esp_netif glue optional
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
This commit is contained in:
@@ -252,7 +252,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))));
|
||||
@@ -284,7 +284,7 @@ static void ot_task_worker(void *aContext)
|
||||
esp_openthread_cli_console_command_unregister();
|
||||
#endif // CONFIG_OPENTHREAD_CLI
|
||||
|
||||
#if CONFIG_OPENTHREAD_FTD || CONFIG_OPENTHREAD_MTD
|
||||
#if CONFIG_OPENTHREAD_PLATFORM_NETIF
|
||||
// Clean up
|
||||
esp_openthread_netif_glue_deinit();
|
||||
esp_netif_destroy(openthread_netif);
|
||||
|
||||
@@ -46,8 +46,6 @@ static esp_openthread_netif_glue_t s_openthread_netif_glue = {
|
||||
.event_fd = -1,
|
||||
};
|
||||
|
||||
ESP_EVENT_DEFINE_BASE(OPENTHREAD_EVENT);
|
||||
|
||||
static QueueHandle_t s_packet_queue;
|
||||
static esp_netif_t *s_openthread_netif;
|
||||
static const char *netif_glue_workflow = "netif_glue";
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#define TAG "OT_STATE"
|
||||
|
||||
ESP_EVENT_DEFINE_BASE(OPENTHREAD_EVENT);
|
||||
|
||||
#if CONFIG_OPENTHREAD_BORDER_ROUTER
|
||||
static void handle_ot_border_router_state_changed(otInstance* instance)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user