mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
update: update wifi-cmd of iperf example
This commit is contained in:
@@ -2,9 +2,9 @@ dependencies:
|
|||||||
cmd_system:
|
cmd_system:
|
||||||
path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system
|
path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system
|
||||||
espressif/iperf-cmd:
|
espressif/iperf-cmd:
|
||||||
version: "~0.1.1"
|
version: "~0.1.3"
|
||||||
esp-qa/wifi-cmd:
|
esp-qa/wifi-cmd:
|
||||||
version: "~0.1.8"
|
version: "~0.2.0"
|
||||||
esp-qa/ping-cmd:
|
esp-qa/ping-cmd:
|
||||||
version: "~1.0.0"
|
version: "~1.0.0"
|
||||||
espressif/esp_wifi_remote:
|
espressif/esp_wifi_remote:
|
||||||
|
@@ -84,11 +84,21 @@ void app_main(void)
|
|||||||
}
|
}
|
||||||
ESP_ERROR_CHECK( ret );
|
ESP_ERROR_CHECK( ret );
|
||||||
|
|
||||||
/* initialise wifi */
|
/*
|
||||||
app_wifi_initialise_config_t config = APP_WIFI_CONFIG_DEFAULT();
|
NOTE(#15855): wifi_cmd_initialize_wifi is a basic function to start wifi, set handlers and set wifi-cmd status.
|
||||||
config.storage = WIFI_STORAGE_RAM;
|
For advanced usage, please refer to wifi_cmd.h or the document of wifi-cmd component: https://components.espressif.com/components/esp-qa/wifi-cmd
|
||||||
config.ps_type = WIFI_PS_NONE;
|
|
||||||
app_initialise_wifi(&config);
|
example:
|
||||||
|
wifi_cmd_wifi_init();
|
||||||
|
my_function(); // <---- more configs before wifi start
|
||||||
|
wifi_cmd_wifi_start();
|
||||||
|
|
||||||
|
Please note that some wifi commands such as "wifi start/restart" may not work as expected if "wifi_cmd_initialize_wifi" was not used.
|
||||||
|
*/
|
||||||
|
/* initialise wifi and set wifi-cmd status */
|
||||||
|
wifi_cmd_initialize_wifi(NULL);
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE));
|
||||||
|
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
|
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS
|
#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS
|
||||||
esp_wifi_enable_rx_statistics(true, true);
|
esp_wifi_enable_rx_statistics(true, true);
|
||||||
@@ -119,10 +129,13 @@ void app_main(void)
|
|||||||
|
|
||||||
/* Register commands */
|
/* Register commands */
|
||||||
register_system();
|
register_system();
|
||||||
app_register_all_wifi_commands();
|
/* From wifi-cmd */
|
||||||
|
wifi_cmd_register_all();
|
||||||
|
/* From iperf-cmd */
|
||||||
app_register_iperf_commands();
|
app_register_iperf_commands();
|
||||||
ping_cmd_register_ping();
|
|
||||||
app_register_iperf_hook_func(iperf_hook_show_wifi_stats);
|
app_register_iperf_hook_func(iperf_hook_show_wifi_stats);
|
||||||
|
/* From ping-cmd */
|
||||||
|
ping_cmd_register_ping();
|
||||||
|
|
||||||
|
|
||||||
printf("\n ==================================================\n");
|
printf("\n ==================================================\n");
|
||||||
|
Reference in New Issue
Block a user