1 /* OpenThread Command Line Example
2
3 This example code is in the Public Domain (or CC0 licensed, at your option.)
4
5 Unless required by applicable law or agreed to in writing, this
6 software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
7 CONDITIONS OF ANY KIND, either express or implied.
8 */
9
10 #include "esp_openthread.h"
11 #include "esp_ot_cli_extension.h"
12 #include "esp_ot_iperf.h"
13 #include "esp_ot_tcp_socket.h"
14 #include "esp_ot_udp_socket.h"
15 #include "freertos/FreeRTOS.h"
16 #include "freertos/portmacro.h"
17 #include "freertos/task.h"
18 #include "openthread/cli.h"
19
20 static const otCliCommand kCommands[] = {
21 {"tcpsockserver", esp_ot_process_tcp_server},
22 {"tcpsockclient", esp_ot_process_tcp_client},
23 {"udpsockserver", esp_ot_process_udp_server},
24 {"udpsockclient", esp_ot_process_udp_client},
25 {"iperf", esp_ot_process_iperf}
26 };
27
esp_cli_custom_command_init()28 void esp_cli_custom_command_init()
29 {
30 otInstance *instance = esp_openthread_get_instance();
31 otCliSetUserCommands(kCommands, (sizeof(kCommands) / sizeof(kCommands[0])), instance);
32 }
33