439 * 3 scenarios here: connection is successful and TASK_WIFI_STA_CONNECTED will be posted |
439 * 3 scenarios here: connection is successful and TASK_WIFI_STA_CONNECTED will be posted |
440 * or it's a failure and we get a TASK_WIFI_STA_FAILED with a reason code. |
440 * or it's a failure and we get a TASK_WIFI_STA_FAILED with a reason code. |
441 * Or, option 3, the 5 seconds timeout is reached. This happens when the AP is not in range. |
441 * Or, option 3, the 5 seconds timeout is reached. This happens when the AP is not in range. |
442 * Note that the reason code is not exploited. For all intent and purposes a failure is a failure. |
442 * Note that the reason code is not exploited. For all intent and purposes a failure is a failure. |
443 */ |
443 */ |
444 // ESP_LOGI(TAG, "2 wait for %08x", TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED); |
|
445 uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED, pdFALSE, pdFALSE, 5000 / portTICK_PERIOD_MS); |
444 uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED, pdFALSE, pdFALSE, 5000 / portTICK_PERIOD_MS); |
446 // ESP_LOGI(TAG, "2 waitbits %08x", uxBits & (TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED)); |
|
447 |
445 |
448 if (uxBits & (TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED)) { |
446 if (uxBits & (TASK_WIFI_STA_CONNECTED | TASK_WIFI_STA_FAILED)) { |
449 /* |
447 /* |
450 * only save the config if the connection was successful! |
448 * only save the config if the connection was successful! |
451 */ |
449 */ |