From f9b1e2a6fa4a0932982b9dd34fb9df62db591fbb Mon Sep 17 00:00:00 2001 From: chendejin Date: Sat, 7 Oct 2023 11:23:25 +0800 Subject: [PATCH] add constant for otcli transmit task --- examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 | 2 +- .../esp32/shell_extension/openthread_cli_register.cpp | 2 +- src/platform/ESP32/OpenthreadLauncher.cpp | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 index 7a1b53cba9a474..11d5991c353b20 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 @@ -30,7 +30,7 @@ CONFIG_OPENTHREAD_ENABLED=y CONFIG_OPENTHREAD_SRP_CLIENT=y CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y -# CONFIG_OPENTHREAD_CLI=n +CONFIG_OPENTHREAD_CLI=n CONFIG_OPENTHREAD_DNS_CLIENT=y # Disable lwip ipv6 autoconfig diff --git a/examples/platform/esp32/shell_extension/openthread_cli_register.cpp b/examples/platform/esp32/shell_extension/openthread_cli_register.cpp index 146783b96b9886..bc8ccae7e2af00 100644 --- a/examples/platform/esp32/shell_extension/openthread_cli_register.cpp +++ b/examples/platform/esp32/shell_extension/openthread_cli_register.cpp @@ -30,7 +30,7 @@ namespace chip { static CHIP_ERROR OtcliHandler(int argc, char * argv[]) { - /* the beginning of command "matter esp ot cli" has already been removed */ + /* the beginning of command "matter otcli" has already been removed */ std::unique_ptr cli_str(new char[CLI_INPUT_BUFF_LENGTH]); memset(cli_str.get(), 0, CLI_INPUT_BUFF_LENGTH); uint8_t len = 0; diff --git a/src/platform/ESP32/OpenthreadLauncher.cpp b/src/platform/ESP32/OpenthreadLauncher.cpp index 45367f7ffef491..8c76c1db809082 100644 --- a/src/platform/ESP32/OpenthreadLauncher.cpp +++ b/src/platform/ESP32/OpenthreadLauncher.cpp @@ -38,6 +38,8 @@ static esp_netif_t * openthread_netif = NULL; static esp_openthread_platform_config_t * s_platform_config = NULL; static TaskHandle_t cli_transmit_task = NULL; static QueueHandle_t cli_transmit_task_queue = NULL; +static constexpr uint16_t OTCLI_TRANSMIT_TASK_STACK_SIZE = 1024; +static constexpr UBaseType_t OTCLI_TRANSMIT_TASK_PRIORITY = 5; CHIP_ERROR cli_transmit_task_post(std::unique_ptr && cli_str) { @@ -103,7 +105,8 @@ static void cli_transmit_worker(void * context) static esp_err_t cli_command_transmit_task(void) { - xTaskCreate(cli_transmit_worker, "ocli_trans", 3072, xTaskGetCurrentTaskHandle(), 5, &cli_transmit_task); + xTaskCreate(cli_transmit_worker, "otcli_trans", OTCLI_TRANSMIT_TASK_STACK_SIZE, xTaskGetCurrentTaskHandle(), + OTCLI_TRANSMIT_TASK_PRIORITY, &cli_transmit_task); return ESP_OK; }