diff --git a/examples/openthread/extension_command/CMakeLists.txt b/examples/openthread/extension_command/CMakeLists.txt new file mode 100644 index 0000000000..d8b4a31ee9 --- /dev/null +++ b/examples/openthread/extension_command/CMakeLists.txt @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000..295d6bde1f --- /dev/null +++ b/examples/openthread/extension_command/Kconfig.projbuild @@ -0,0 +1,44 @@ +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 new file mode 100644 index 0000000000..664a44bf0d --- /dev/null +++ b/examples/openthread/extension_command/README.md @@ -0,0 +1,131 @@ +# 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