You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param [in] ssid The network SSID of the access point to which we wish to connect.
154
154
* @param [in] password The password of the access point to which we wish to connect.
155
155
* @param [in] waitForConnection Block until the connection has an outcome.
156
-
* @return N/A.
156
+
* @returns ESP_OK if successfully connected to an access point. Otherwise returns wifi_err_reason_t - use GeneralUtils::wifiErrorToString(uint8_t errCode) to print the error.
// If the event we received indicates that we now have an IP address or that a connection was disconnected then unlock the mutex that
256
256
// indicates we are waiting for a connection complete.
257
257
if (event->event_id == SYSTEM_EVENT_STA_GOT_IP || event->event_id == SYSTEM_EVENT_STA_DISCONNECTED) {
258
-
if (event->event_id == SYSTEM_EVENT_STA_GOT_IP) { // If we connected and have an IP, change the flag.
259
-
pWiFi->m_apConnected = true;
258
+
259
+
if (event->event_id == SYSTEM_EVENT_STA_GOT_IP) { // If we connected and have an IP, change the status to ESP_OK. Otherwise, change it to the reason code.
0 commit comments