Static class providing Wi-Fi and network control on the Pico W. More...
#include <Network.h>
Collaboration diagram for Network:Static Public Member Functions | |
| static bool | initialize () |
| Start Wi-Fi with resilience, retrying connection if it fails. | |
| static bool | startWifiWithResilience () |
| Start Wi-Fi with resilience, retrying connection if it fails. | |
| static bool | checkAndReconnect () |
| Attempt to connect to Wi-Fi with retries. | |
| static bool | tryConnect (int attempts) |
| Try to connect to Wi-Fi network. | |
| static bool | restart_wifi () |
| Restart the Wi-Fi interface. | |
| static void | wifi_deinit () |
| Deinitialize the CYW43 Wi-Fi stack. | |
| static int | getLinkStatus (int lastStatus) |
| Get the current link status from the Wi-Fi interface. | |
| static bool | isConnected () |
| Check whether the device is connected to Wi-Fi. | |
| static char * | getIpAddress () |
| Get the IP address. | |
Static Private Attributes | |
| static bool | wifiConnected = false |
| Make the Wi-Fi connection in station mode Requires WIFI_SSID and WIFI_PASSWORD to be set in the environment. | |
| static bool | wifiInitialized = false |
|
static |
This method will try to connect to the Wi-Fi network defined by WIFI_SSID and WIFI_PASSWORD. It will retry up to a maximum number of attempts defined by WIFI_MAX_RETRIES.
| attempts | Number of connection attempts to make. |
Definition at line 84 of file Network.cpp.
References getLinkStatus(), isConnected(), and tryConnect().
Referenced by FrameworkManager::poll().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
|
static |
Get the current link status from the Wi-Fi interface.
Definition at line 173 of file Network.cpp.
Referenced by checkAndReconnect(), and tryConnect().
Here is the caller graph for this function:
|
static |
Uses a static method to handle retries and connection status.
Definition at line 41 of file Network.cpp.
References wifiInitialized.
Referenced by FrameworkManager::onStart(), and startWifiWithResilience().
Here is the caller graph for this function:
|
static |
Check whether the device is connected to Wi-Fi.
Definition at line 144 of file Network.cpp.
References wifiConnected.
Referenced by checkAndReconnect(), and PicoModel::restoreState().
Here is the caller graph for this function:
|
static |
This method will deinitialize and reinitialize the Wi-Fi stack.
Definition at line 149 of file Network.cpp.
References startWifiWithResilience(), and wifiConnected.
Referenced by FrameworkManager::poll().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Uses a static method to handle retries and connection status.
Definition at line 63 of file Network.cpp.
References initialize(), tryConnect(), WIFI_MAX_RETRIES, and wifiInitialized.
Referenced by FrameworkManager::onStart(), and restart_wifi().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
This method will attempt to connect to the Wi-Fi network defined by WIFI_SSID and WIFI_PASSWORD. It will retry up to a maximum number of attempts defined by WIFI_MAX_RETRIES.
| attempts | Number of connection attempts to make. |
Definition at line 97 of file Network.cpp.
References getLinkStatus(), WIFI_RETRY_TIMEOUT_MS, and wifiConnected.
Referenced by checkAndReconnect(), and startWifiWithResilience().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Deinitialize the CYW43 Wi-Fi stack.
Definition at line 160 of file Network.cpp.
|
staticprivate |
Make the Wi-Fi connection in station mode Requires WIFI_SSID and WIFI_PASSWORD to be set in the environment.
Definition at line 104 of file Network.h.
Referenced by isConnected(), restart_wifi(), and tryConnect().
|
staticprivate |
Definition at line 105 of file Network.h.
Referenced by initialize(), and startWifiWithResilience().