From 64c498a58418684c78a8ee49a7a8102923fdf5c7 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Fri, 16 Apr 2021 14:39:21 +0800 Subject: [PATCH] openthread: update openthread submodule Roll OpenThread submodule and rename OpenThread config macros and api calls accordingly. --- components/openthread/CMakeLists.txt | 7 ++- components/openthread/component.mk | 50 ++++++++++--------- .../include/openthread-core-esp32x-config.h | 6 +-- components/openthread/openthread | 2 +- .../openthread/port/esp_openthread_uart.c | 2 +- examples/openthread/ot_cli/main/ot_esp_cli.c | 4 +- 6 files changed, 41 insertions(+), 30 deletions(-) diff --git a/components/openthread/CMakeLists.txt b/components/openthread/CMakeLists.txt index 5776d0a2ec..9c74e06323 100644 --- a/components/openthread/CMakeLists.txt +++ b/components/openthread/CMakeLists.txt @@ -10,11 +10,14 @@ if(CONFIG_OPENTHREAD_ENABLED) "openthread/src/lib/hdlc" "openthread/src/lib/spinel" "openthread/src/ncp" + "openthread/examples/platforms/" "private_include") set(src_dirs + "openthread/examples/apps/cli" "openthread/src/cli" "openthread/src/core/api" + "openthread/src/core/backbone_router" "openthread/src/core/coap" "openthread/src/core/common" "openthread/src/core/crypto" @@ -30,7 +33,9 @@ if(CONFIG_OPENTHREAD_ENABLED) "openthread/src/lib/spinel" "port") - set(exclude_srcs "openthread/src/core/common/extension_example.cpp") + set(exclude_srcs + "openthread/examples/apps/cli/main.cpp" + "openthread/src/core/common/extension_example.cpp") if(CONFIG_OPENTHREAD_FTD) set(device_type "OPENTHREAD_FTD=1") diff --git a/components/openthread/component.mk b/components/openthread/component.mk index 2920a0b3e3..03be7277b2 100644 --- a/components/openthread/component.mk +++ b/components/openthread/component.mk @@ -5,6 +5,7 @@ COMPONENT_ADD_INCLUDEDIRS := \ include COMPONENT_PRIV_INCLUDEDIRS := \ + openthread/examples/platforms \ openthread/src \ openthread/src/core \ openthread/src/lib/hdlc \ @@ -12,27 +13,30 @@ COMPONENT_PRIV_INCLUDEDIRS := \ openthread/src/ncp \ private_include -COMPONENT_SRCDIRS := \ - openthread/src/cli \ - openthread/src/core \ - openthread/src/core/api \ - openthread/src/core/coap \ - openthread/src/core/common \ - openthread/src/core/crypto \ - openthread/src/core/diags \ - openthread/src/core/mac \ - openthread/src/core/meshcop \ - openthread/src/core/net \ - openthread/src/core/radio \ - openthread/src/core/thread \ - openthread/src/core/utils \ - openthread/src/lib/hdlc \ - openthread/src/lib/platform \ - openthread/src/lib/spinel \ +COMPONENT_SRCDIRS := \ + openthread/examples/apps/cli \ + openthread/src/cli \ + openthread/src/core \ + openthread/src/core/api \ + openthread/src/core/backbone_router \ + openthread/src/core/coap \ + openthread/src/core/common \ + openthread/src/core/crypto \ + openthread/src/core/diags \ + openthread/src/core/mac \ + openthread/src/core/meshcop \ + openthread/src/core/net \ + openthread/src/core/radio \ + openthread/src/core/thread \ + openthread/src/core/utils \ + openthread/src/lib/hdlc \ + openthread/src/lib/platform \ + openthread/src/lib/spinel \ port -COMPONENT_OBJEXCLUDE := \ - openthread/src/core/common/extension_example.o +COMPONENT_OBJEXCLUDE := \ + openthread/examples/apps/cli/main.o \ + openthread/src/core/common/extension_example.o \ IDF_VERSION_FOR_OPENTHREAD_PACKAGE := $(shell git -C $(COMPONENT_PATH) rev-parse --short HEAD) OPENTHREAD_VERSION := $(shell git -C $(COMPONENT_PATH)/openthread rev-parse --short HEAD) @@ -40,14 +44,14 @@ OPENTHREAD_PACKAGE_VERSION := $(IDF_VERSION_FOR_OPENTHREAD_PACKAGE)-$(OPENTHREAD COMMON_FLAGS := \ -DOPENTHREAD_CONFIG_FILE=\ \ - -DPACKAGE_VERSION=\"OPENTHREAD_PACKAGE_VERSION\" + -DPACKAGE_VERSION=\"OPENTHREAD_PACKAGE_VERSION\" ifdef CONFIG_OPENTHREAD_FTD - COMMON_FLAGS += -DOPENTHREAD_FTD=1 + COMMON_FLAGS += -DOPENTHREAD_FTD=1 else ifdef CONFIG_OPENTHREAD_MTD - COMMON_FLAGS += -DOPENTHREAD_MTD=1 + COMMON_FLAGS += -DOPENTHREAD_MTD=1 else ifdef CONFIG_OPENTHREAD_RADIO - COMMON_FLAGS += -DOPENTHREAD_RADIO=1 + COMMON_FLAGS += -DOPENTHREAD_RADIO=1 endif CFLAGS += $(COMMON_FLAGS) diff --git a/components/openthread/include/openthread-core-esp32x-config.h b/components/openthread/include/openthread-core-esp32x-config.h index 15ceae99e5..5e0f97d824 100644 --- a/components/openthread/include/openthread-core-esp32x-config.h +++ b/components/openthread/include/openthread-core-esp32x-config.h @@ -180,12 +180,12 @@ #define OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER 0 /** - * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE * - * Define to 1 to enable NCP UART support. + * Define to 1 to enable NCP HDLC support. * */ -#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 +#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1 /** * @def OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE diff --git a/components/openthread/openthread b/components/openthread/openthread index 93b6fea3aa..23bbde5c96 160000 --- a/components/openthread/openthread +++ b/components/openthread/openthread @@ -1 +1 @@ -Subproject commit 93b6fea3aa10e26f17ad2b877f002ca2cd81b745 +Subproject commit 23bbde5c96cba146351349c692c8ad3337bf7fac diff --git a/components/openthread/port/esp_openthread_uart.c b/components/openthread/port/esp_openthread_uart.c index 80e5e4988f..b91a5035b3 100644 --- a/components/openthread/port/esp_openthread_uart.c +++ b/components/openthread/port/esp_openthread_uart.c @@ -27,7 +27,7 @@ #include "esp_vfs_dev.h" #include "common/logging.hpp" #include "driver/uart.h" -#include "openthread/platform/uart.h" +#include "utils/uart.h" static int s_uart_port; static int s_uart_fd; diff --git a/examples/openthread/ot_cli/main/ot_esp_cli.c b/examples/openthread/ot_cli/main/ot_esp_cli.c index fdc3d21e9b..34a1bf9e58 100644 --- a/examples/openthread/ot_cli/main/ot_esp_cli.c +++ b/examples/openthread/ot_cli/main/ot_esp_cli.c @@ -33,6 +33,8 @@ #define TAG "ot_esp_cli" +extern void otAppCliInit(otInstance *instance); + static void ot_task_worker(void *aContext) { esp_openthread_platform_config_t config = { @@ -84,7 +86,7 @@ static void ot_task_worker(void *aContext) assert(instance != NULL); esp_openthread_lock_acquire(portMAX_DELAY); - otCliUartInit(instance); + otAppCliInit(instance); esp_openthread_lock_release(); while (true) {