feat(example): update iperf examples

This commit is contained in:
Chen Yudong
2025-12-30 18:13:30 +08:00
parent b4a37ebd9d
commit 4e032bf3e1
8 changed files with 20 additions and 21 deletions

View File

@@ -4,4 +4,4 @@ dependencies:
example_init:
path: ${IDF_PATH}/examples/bluetooth/esp_ble_mesh/common_components/example_init
espressif/iperf:
version: "~0.1.1"
version: "^1.0.2"

View File

@@ -114,7 +114,7 @@ void app_main(void)
/* Register commands */
register_system_common();
app_register_iperf_commands();
iperf_cmd_register_iperf();
register_ethernet_commands();
printf("\n =======================================================\n");

View File

@@ -2,6 +2,6 @@ dependencies:
cmd_system:
path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system
espressif/ethernet_init:
version: "~1.2.0"
version: "~1.3.0"
espressif/iperf-cmd:
version: "~0.1.1"
version: "~1.0.2"

View File

@@ -1,5 +1,5 @@
## IDF Component Manager Manifest File
dependencies:
espressif/iperf-cmd: "^1.0.0"
espressif/iperf-cmd: "^1.0.2"
cmd_system:
path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system

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:

View File

@@ -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();

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