|
|
@@ -1,8 +1,3 @@
|
|
|
-/*
|
|
|
- * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
|
|
- *
|
|
|
- * SPDX-License-Identifier: Apache-2.0
|
|
|
- */
|
|
|
/* OpenThread Command Line Example
|
|
|
|
|
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
@@ -21,6 +16,7 @@
|
|
|
#include "esp_netif.h"
|
|
|
#include "esp_netif_types.h"
|
|
|
#include "esp_openthread.h"
|
|
|
+#include "esp_openthread_cli.h"
|
|
|
#include "esp_openthread_lock.h"
|
|
|
#include "esp_openthread_netif_glue.h"
|
|
|
#include "esp_openthread_types.h"
|
|
|
@@ -42,8 +38,6 @@
|
|
|
|
|
|
#define TAG "ot_esp_cli"
|
|
|
|
|
|
-extern void otAppCliInit(otInstance *aInstance);
|
|
|
-
|
|
|
#if CONFIG_OPENTHREAD_CLI_ESP_EXTENSION
|
|
|
static esp_netif_t *init_openthread_netif(const esp_openthread_platform_config_t *config)
|
|
|
{
|
|
|
@@ -70,7 +64,7 @@ static void ot_task_worker(void *aContext)
|
|
|
// The OpenThread log level directly matches ESP log level
|
|
|
(void)otLoggingSetLevel(CONFIG_LOG_DEFAULT_LEVEL);
|
|
|
// Initialize the OpenThread cli
|
|
|
- otAppCliInit(esp_openthread_get_instance());
|
|
|
+ esp_openthread_cli_init();
|
|
|
|
|
|
#if CONFIG_OPENTHREAD_CLI_ESP_EXTENSION
|
|
|
esp_netif_t *openthread_netif;
|
|
|
@@ -81,6 +75,7 @@ static void ot_task_worker(void *aContext)
|
|
|
#endif // CONFIG_OPENTHREAD_CLI_ESP_EXTENSION
|
|
|
|
|
|
// Run the main loop
|
|
|
+ esp_openthread_cli_create_task();
|
|
|
esp_openthread_launch_mainloop();
|
|
|
|
|
|
// Clean up
|