/* * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 * * 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. */ #include "esp_check.h" #include "esp_log.h" #include "esp_ot_iperf.h" #include "iperf.h" #include "openthread/cli.h" #include #include #include #define TAG "ot-iperf" static char s_dest_ip6_addr[50]; void esp_ot_process_iperf(void *aContext, uint8_t aArgsLength, char *aArgs[]) { (void)(aContext); (void)(aArgsLength); iperf_cfg_t cfg; memset(&cfg, 0, sizeof(cfg)); // set iperf default flag: tcp server IPERF_FLAG_SET(cfg.flag, IPERF_FLAG_TCP); IPERF_FLAG_SET(cfg.flag, IPERF_FLAG_SERVER); cfg.time = IPERF_DEFAULT_TIME; cfg.type = IPERF_IP_TYPE_IPV4; if (aArgsLength == 0) { otCliOutputFormat("---iperf parameter---\n"); otCliOutputFormat("-V : use IPV6 address\n"); otCliOutputFormat("-s : server mode, only receive\n"); otCliOutputFormat("-u : upd mode\n"); otCliOutputFormat("-c : client mode, only transmit\n"); otCliOutputFormat("-i : seconds between periodic bandwidth reports\n"); otCliOutputFormat("-t