mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
CI: Improve common test methods
also fix ota test cases
This commit is contained in:
@@ -22,7 +22,7 @@ menu "Example Connection Configuration"
|
||||
default y
|
||||
help
|
||||
Provide wifi connect commands for esp_console.
|
||||
Please use `register_wifi_connect_commands` to register them.
|
||||
Please use `example_register_wifi_connect_commands` to register them.
|
||||
|
||||
config EXAMPLE_WIFI_SSID
|
||||
depends on !EXAMPLE_WIFI_SSID_PWD_FROM_STDIN
|
||||
@@ -305,7 +305,7 @@ menu "Example Connection Configuration"
|
||||
endif # EXAMPLE_CONNECT_ETHERNET
|
||||
|
||||
config EXAMPLE_CONNECT_IPV6
|
||||
depends on (EXAMPLE_CONNECT_WIFI || EXAMPLE_CONNECT_ETHERNET)
|
||||
depends on EXAMPLE_CONNECT_WIFI || EXAMPLE_CONNECT_ETHERNET
|
||||
bool "Obtain IPv6 address"
|
||||
default y
|
||||
select LWIP_IPV6
|
||||
|
@@ -58,7 +58,7 @@ static int cmd_do_wifi_disconnect(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void register_wifi_connect_commands(void)
|
||||
void example_register_wifi_connect_commands(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Registering WiFi connect commands.");
|
||||
example_wifi_start();
|
||||
|
@@ -81,9 +81,10 @@ esp_netif_t *get_example_netif_from_desc(const char *desc);
|
||||
/**
|
||||
* @brief Register wifi connect commands
|
||||
*
|
||||
* @note Provide wifi connect commands using esp_console.
|
||||
* Provide a simple wifi_connect command in esp_console.
|
||||
* This function can be used after esp_console is initialized.
|
||||
*/
|
||||
void register_wifi_connect_commands(void);
|
||||
void example_register_wifi_connect_commands(void);
|
||||
#endif
|
||||
|
||||
#if CONFIG_EXAMPLE_CONNECT_ETHERNET
|
||||
|
@@ -229,18 +229,20 @@ esp_err_t example_wifi_connect(void)
|
||||
};
|
||||
#if CONFIG_EXAMPLE_WIFI_SSID_PWD_FROM_STDIN
|
||||
example_configure_stdin_stdout();
|
||||
char buf[32+64+2] = {0};
|
||||
char buf[sizeof(wifi_config.sta.ssid)+sizeof(wifi_config.sta.password)+2] = {0};
|
||||
ESP_LOGI(TAG, "Please input ssid password:");
|
||||
fgets(buf, sizeof(buf), stdin);
|
||||
int len = strlen(buf);
|
||||
buf[len-1] = '\0';
|
||||
memset(wifi_config.sta.ssid, 0, 32);
|
||||
char *temp = strtok(buf, " ");
|
||||
strncpy((char*)wifi_config.sta.ssid, temp, 32);
|
||||
memset(wifi_config.sta.password, 0, 64);
|
||||
temp = strtok(NULL, " ");
|
||||
buf[len-1] = '\0'; /* removes '\n' */
|
||||
memset(wifi_config.sta.ssid, 0, sizeof(wifi_config.sta.ssid));
|
||||
|
||||
char *rest = NULL;
|
||||
char *temp = strtok_r(buf, " ", &rest);
|
||||
strncpy((char*)wifi_config.sta.ssid, temp, sizeof(wifi_config.sta.ssid));
|
||||
memset(wifi_config.sta.password, 0, sizeof(wifi_config.sta.password));
|
||||
temp = strtok_r(NULL, " ", &rest);
|
||||
if (temp) {
|
||||
strncpy((char*)wifi_config.sta.password, temp, 64);
|
||||
strncpy((char*)wifi_config.sta.password, temp, sizeof(wifi_config.sta.password));
|
||||
} else {
|
||||
wifi_config.sta.threshold.authmode = WIFI_AUTH_OPEN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user