@@ -455,6 +455,34 @@ int wifiNetworkCount()
455
455
return networkCount;
456
456
}
457
457
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
+
458
486
// *********************************************************************
459
487
// Callback for all WiFi RX Packets
460
488
// Get RSSI of all incoming management packets: https://esp32.com/viewtopic.php?t=13889
@@ -3021,35 +3049,6 @@ bool wifiIsRunning()
3021
3049
return false ;
3022
3050
}
3023
3051
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
-
3053
3052
// ----------------------------------------
3054
3053
// Starts the WiFi connection state machine (moves from WIFI_STATE_OFF to WIFI_STATE_CONNECTING)
3055
3054
// Sets the appropriate protocols (WiFi + ESP-Now)
0 commit comments