2021-10-20 04:48:09 -04:00
|
|
|
/*
|
2021-12-21 03:53:20 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
2021-10-20 04:48:09 -04:00
|
|
|
*
|
2021-12-21 03:53:20 -05:00
|
|
|
* SPDX-License-Identifier: CC0-1.0
|
2021-10-20 04:48:09 -04:00
|
|
|
*
|
|
|
|
* OpenThread Command Line Example
|
|
|
|
*
|
|
|
|
* This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, this
|
|
|
|
* software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
* CONDITIONS OF ANY KIND, either express or implied.
|
2021-07-30 03:55:37 -04:00
|
|
|
*/
|
2021-05-25 09:13:41 -04:00
|
|
|
|
|
|
|
#include "esp_openthread.h"
|
|
|
|
#include "esp_ot_cli_extension.h"
|
2021-07-30 03:55:37 -04:00
|
|
|
#include "esp_ot_iperf.h"
|
2021-05-25 09:13:41 -04:00
|
|
|
#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},
|
2021-12-21 03:53:20 -05:00
|
|
|
{"mcast", esp_ot_process_mcast_group},
|
2021-07-30 03:55:37 -04:00
|
|
|
{"iperf", esp_ot_process_iperf}
|
2021-05-25 09:13:41 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
void esp_cli_custom_command_init()
|
|
|
|
{
|
|
|
|
otInstance *instance = esp_openthread_get_instance();
|
|
|
|
otCliSetUserCommands(kCommands, (sizeof(kCommands) / sizeof(kCommands[0])), instance);
|
|
|
|
}
|