esp-idf/examples/openthread/ot_cli/main/esp_ot_cli_extension.c

30 lines
856 B
C
Raw Normal View History

/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_openthread.h"
#include "esp_ot_cli_extension.h"
#include "esp_ot_iperf.h"
#include "esp_ot_tcp_socket.h"
#include "esp_ot_udp_socket.h"
#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h"
#include "freertos/task.h"
#include "openthread/cli.h"
static const otCliCommand kCommands[] = {
{"tcpsockserver", esp_ot_process_tcp_server},
{"tcpsockclient", esp_ot_process_tcp_client},
{"udpsockserver", esp_ot_process_udp_server},
{"udpsockclient", esp_ot_process_udp_client},
{"iperf", esp_ot_process_iperf}
};
void esp_cli_custom_command_init()
{
otInstance *instance = esp_openthread_get_instance();
otCliSetUserCommands(kCommands, (sizeof(kCommands) / sizeof(kCommands[0])), instance);
}