feat(example): update iperf examples

This commit is contained in:
Chen Yudong
2026-03-20 15:05:14 +08:00
committed by Chen Yu Dong
parent 30a3150702
commit 56065ee399
8 changed files with 20 additions and 21 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ dependencies:
cmd_system:
path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system
espressif/iperf-cmd:
version: "~0.1.3"
version: "~1.0.2"
esp-qa/wifi-cmd:
version: "~0.2.7"
esp-qa/ping-cmd:
@@ -39,29 +39,29 @@ extern int wifi_cmd_clr_rx_statistics(int argc, char **argv);
#include "esp_extconn.h"
#endif
void iperf_hook_show_wifi_stats(iperf_traffic_type_t type, iperf_status_t status)
void iperf_hook_show_wifi_stats(iperf_id_t instance_id, iperf_state_data_t *data, void *priv)
{
if (status == IPERF_STARTED) {
if (data->state == IPERF_STARTED) {
#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS
if (type != IPERF_UDP_SERVER) {
if (data->traffic_type != IPERF_UDP_SERVER) {
wifi_cmd_clr_tx_statistics(0, NULL);
}
#endif
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
if (type != IPERF_UDP_CLIENT) {
if (data->traffic_type != IPERF_UDP_CLIENT) {
wifi_cmd_clr_rx_statistics(0, NULL);
}
#endif
}
if (status == IPERF_STOPPED) {
if (data->state == IPERF_STOPPED) {
#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS
if (type != IPERF_UDP_SERVER) {
if (data->traffic_type != IPERF_UDP_SERVER) {
wifi_cmd_get_tx_statistics(0, NULL);
}
#endif
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
if (type != IPERF_UDP_CLIENT) {
if (data->traffic_type != IPERF_UDP_CLIENT) {
wifi_cmd_get_rx_statistics(0, NULL);
}
#endif
@@ -132,8 +132,8 @@ void app_main(void)
/* From wifi-cmd */
wifi_cmd_register_all();
/* From iperf-cmd */
app_register_iperf_commands();
app_register_iperf_hook_func(iperf_hook_show_wifi_stats);
iperf_cmd_register_iperf();
iperf_cmd_set_iperf_state_handler(iperf_hook_show_wifi_stats, NULL);
/* From ping-cmd */
ping_cmd_register_ping();
+1 -2
View File
@@ -7,10 +7,9 @@ CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
CONFIG_LWIP_TCPIP_TASK_PRIO=23
CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=23
CONFIG_IPERF_REPORT_TASK_PRIORITY=24
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y