Skip to content

Commit 9fae969

Browse files
committed
WiFi: Move wifiPrintState
1 parent ef9a9e7 commit 9fae969

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,34 @@ int wifiNetworkCount()
455455
return networkCount;
456456
}
457457

458+
//*********************************************************************
459+
// Given a status, return the associated state or error
460+
const char *wifiPrintState(wl_status_t wifiStatus)
461+
{
462+
switch (wifiStatus)
463+
{
464+
case WL_NO_SHIELD: // 255
465+
return ("WL_NO_SHIELD");
466+
case WL_STOPPED: // 254
467+
return ("WL_STOPPED");
468+
case WL_IDLE_STATUS: // 0
469+
return ("WL_IDLE_STATUS");
470+
case WL_NO_SSID_AVAIL: // 1
471+
return ("WL_NO_SSID_AVAIL");
472+
case WL_SCAN_COMPLETED: // 2
473+
return ("WL_SCAN_COMPLETED");
474+
case WL_CONNECTED: // 3
475+
return ("WL_CONNECTED");
476+
case WL_CONNECT_FAILED: // 4
477+
return ("WL_CONNECT_FAILED");
478+
case WL_CONNECTION_LOST: // 5
479+
return ("WL_CONNECTION_LOST");
480+
case WL_DISCONNECTED: // 6
481+
return ("WL_DISCONNECTED");
482+
}
483+
return ("WiFi Status Unknown");
484+
}
485+
458486
//*********************************************************************
459487
// Callback for all WiFi RX Packets
460488
// Get RSSI of all incoming management packets: https://esp32.com/viewtopic.php?t=13889
@@ -3021,35 +3049,6 @@ bool wifiIsRunning()
30213049
return false;
30223050
}
30233051

3024-
//----------------------------------------
3025-
// Given a status, return the associated state or error
3026-
//----------------------------------------
3027-
const char *wifiPrintState(wl_status_t wifiStatus)
3028-
{
3029-
switch (wifiStatus)
3030-
{
3031-
case WL_NO_SHIELD:
3032-
return ("WL_NO_SHIELD"); // 255
3033-
case WL_STOPPED:
3034-
return ("WL_STOPPED");
3035-
case WL_IDLE_STATUS: // 0
3036-
return ("WL_IDLE_STATUS");
3037-
case WL_NO_SSID_AVAIL: // 1
3038-
return ("WL_NO_SSID_AVAIL");
3039-
case WL_SCAN_COMPLETED: // 2
3040-
return ("WL_SCAN_COMPLETED");
3041-
case WL_CONNECTED: // 3
3042-
return ("WL_CONNECTED");
3043-
case WL_CONNECT_FAILED: // 4
3044-
return ("WL_CONNECT_FAILED");
3045-
case WL_CONNECTION_LOST: // 5
3046-
return ("WL_CONNECTION_LOST");
3047-
case WL_DISCONNECTED: // 6
3048-
return ("WL_DISCONNECTED");
3049-
}
3050-
return ("WiFi Status Unknown");
3051-
}
3052-
30533052
//----------------------------------------
30543053
// Starts the WiFi connection state machine (moves from WIFI_STATE_OFF to WIFI_STATE_CONNECTING)
30553054
// Sets the appropriate protocols (WiFi + ESP-Now)

0 commit comments

Comments
 (0)