From 558ce70f405cfce6a855c6387d42874a62f24608 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Wed, 13 Jul 2022 17:14:29 +0800 Subject: [PATCH] openthread: use managed component for extension commands --- .../extension_command/CMakeLists.txt | 22 --- .../extension_command/Kconfig.projbuild | 44 ----- .../openthread/extension_command/README.md | 131 -------------- .../include/esp_ot_cli_extension.h | 28 --- .../extension_command/include/esp_ot_iperf.h | 28 --- .../include/esp_ot_tcp_socket.h | 35 ---- .../include/esp_ot_udp_socket.h | 43 ----- .../include/esp_ot_wifi_cmd.h | 36 ---- .../src/esp_ot_cli_extension.c | 48 ----- .../extension_command/src/esp_ot_iperf.c | 108 ----------- .../extension_command/src/esp_ot_tcp_socket.c | 162 ----------------- .../extension_command/src/esp_ot_udp_socket.c | 170 ------------------ .../extension_command/src/esp_ot_wifi_cmd.c | 151 ---------------- examples/openthread/ot_br/CMakeLists.txt | 3 +- examples/openthread/ot_br/main/esp_ot_br.c | 3 +- .../openthread/ot_br/main/idf_component.yml | 1 + examples/openthread/ot_cli/CMakeLists.txt | 4 +- .../openthread/ot_cli/main/idf_component.yml | 5 + 18 files changed, 9 insertions(+), 1013 deletions(-) delete mode 100644 examples/openthread/extension_command/CMakeLists.txt delete mode 100644 examples/openthread/extension_command/Kconfig.projbuild delete mode 100644 examples/openthread/extension_command/README.md delete mode 100644 examples/openthread/extension_command/include/esp_ot_cli_extension.h delete mode 100644 examples/openthread/extension_command/include/esp_ot_iperf.h delete mode 100644 examples/openthread/extension_command/include/esp_ot_tcp_socket.h delete mode 100644 examples/openthread/extension_command/include/esp_ot_udp_socket.h delete mode 100644 examples/openthread/extension_command/include/esp_ot_wifi_cmd.h delete mode 100644 examples/openthread/extension_command/src/esp_ot_cli_extension.c delete mode 100644 examples/openthread/extension_command/src/esp_ot_iperf.c delete mode 100644 examples/openthread/extension_command/src/esp_ot_tcp_socket.c delete mode 100644 examples/openthread/extension_command/src/esp_ot_udp_socket.c delete mode 100644 examples/openthread/extension_command/src/esp_ot_wifi_cmd.c create mode 100644 examples/openthread/ot_cli/main/idf_component.yml diff --git a/examples/openthread/extension_command/CMakeLists.txt b/examples/openthread/extension_command/CMakeLists.txt deleted file mode 100644 index d8b4a31ee9..0000000000 --- a/examples/openthread/extension_command/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(srcs "src/esp_ot_cli_extension.c") - -if(CONFIG_OPENTHREAD_CLI_IPERF) - list(APPEND srcs "src/esp_ot_iperf.c") -endif() - -if(CONFIG_OPENTHREAD_CLI_TCP_SOCKET) - list(APPEND srcs "src/esp_ot_tcp_socket.c") -endif() - -if(CONFIG_OPENTHREAD_CLI_UDP_SOCKET) - list(APPEND srcs "src/esp_ot_udp_socket.c") -endif() - -if(CONFIG_OPENTHREAD_CLI_WIFI) - list(APPEND srcs "src/esp_ot_wifi_cmd.c") -endif() - -set(include "include") -idf_component_register(SRCS "${srcs}" - INCLUDE_DIRS "${include}" - REQUIRES lwip openthread iperf) diff --git a/examples/openthread/extension_command/Kconfig.projbuild b/examples/openthread/extension_command/Kconfig.projbuild deleted file mode 100644 index 295d6bde1f..0000000000 --- a/examples/openthread/extension_command/Kconfig.projbuild +++ /dev/null @@ -1,44 +0,0 @@ -menu "OpenThread Extension CLI" - - menuconfig OPENTHREAD_CLI_ESP_EXTENSION - depends on OPENTHREAD_FTD || OPENTHREAD_MTD - bool "Enable Espressif's extended features" - default y - help - Enable Espressif's extended features. - - config OPENTHREAD_CLI_IPERF - bool "Enable iperf command" - depends on OPENTHREAD_CLI_ESP_EXTENSION - default y - - config OPENTHREAD_CLI_TCP_SOCKET - bool "Enable TCP socket command" - depends on OPENTHREAD_CLI_ESP_EXTENSION - default y - - config OPENTHREAD_CLI_TCP_SERVER_PORT - int "the port of TCP server" - default 12345 - depends on OPENTHREAD_CLI_TCP_SOCKET - help - Set the connect port of socket - - config OPENTHREAD_CLI_UDP_SOCKET - bool "Enable UDP socket command" - depends on OPENTHREAD_CLI_ESP_EXTENSION - default y - - config OPENTHREAD_CLI_UDP_SERVER_PORT - int "the port of UDP server" - default 54321 - depends on OPENTHREAD_CLI_UDP_SOCKET - help - Set the connect port of socket - - config OPENTHREAD_CLI_WIFI - bool "Enable wifi connection command" - depends on OPENTHREAD_CLI_ESP_EXTENSION && OPENTHREAD_BORDER_ROUTER - default y - -endmenu diff --git a/examples/openthread/extension_command/README.md b/examples/openthread/extension_command/README.md deleted file mode 100644 index 664a44bf0d..0000000000 --- a/examples/openthread/extension_command/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Openthread Extension Commands - -The ESP OpenThread examples provide a series of extension commands in addition to the standard [OpenThread CLI](https://github.com/openthread/openthread/blob/main/src/cli/README.md). -The extension commands are available in the following examples: -* [ot_cli](../ot_cli) -* [ot_br](../ot_br) - -## Enabling the extension commands - -To enable OpenThread extension commands, the following Kconfig option needs to be enabled: -`OpenThread Extension CLI` -> `Enable Espressif's extended features`. - -## Commands - -* [iperf](#iperf) -* [tcpsockclient](#tcpsockclient) -* [tcpsockserver](#tcpsockserver) -* [udpsockclient](#udpsockclient) -* [udpsockserver](#udpsockserver) -* [wifi](#wifi) - -### iperf - -Iperf is a tool for performing TCP or UDP throughput on the Thread network. - -For running iperf, you need to have two Thread devices on the same network. - -* General Options - -```bash -iperf ----iperf parameter--- --s : server mode, only receive --u : upd mode --V : use IPV6 address --c : client mode, only transmit --i : seconds between periodic bandwidth reports --t