Rishka
RISC-V virtual runtime in C/C++ made for ESP32-WROVER
|
Provides an interface for managing WiFi connections on the Rishka system. More...
#include <wifi.h>
Static Public Member Functions | |
static bool | connect (string ssid, string passkey, i32 channel=0, u8 *bssid=nullptr) |
Connects to a WiFi network. More... | |
static bool | reconnect () |
Reconnects to the last connected WiFi network. More... | |
static bool | disconnect (bool wifi_off, bool erase_ap) |
Disconnects from the current WiFi network. More... | |
static bool | erase_ap () |
Erases the saved access point data from memory. More... | |
static bool | is_connected () |
Checks if the device is currently connected to a WiFi network. More... | |
static bool | set_autoreconnect (bool auto_recon) |
Sets the auto-reconnect feature. More... | |
static bool | is_autoreconnect () |
Checks if the auto-reconnect feature is enabled. More... | |
static u8 | wait_for_result (u64 timeout) |
Waits for a WiFi connection result within the specified timeout period. More... | |
static void | set_min_security (u8 auth_mode) |
Sets the minimum security level for WiFi connections. More... | |
static void | set_scan_method (u8 scan_method) |
Sets the WiFi scanning method. More... | |
static void | set_sort_method (u8 sort_method) |
Sets the method for sorting access points in the scan list. More... | |
static u8 | status () |
Retrieves the current status of the WiFi module. More... | |
static string | ssid () |
Retrieves the SSID of the current WiFi network. More... | |
static string | psk () |
Retrieves the Pre-Shared Key (PSK) of the current WiFi network. More... | |
static string | bssid () |
Retrieves the BSSID of the current WiFi access point. More... | |
static i8 | rssi () |
Retrieves the Received Signal Strength Indicator (RSSI) of the current WiFi connection. More... | |
static bool | set_local_ip (string ip) |
Sets the local IP address for the WiFi connection. More... | |
static bool | set_gateway_ip (string ip) |
Sets the gateway IP address for the WiFi connection. More... | |
Provides an interface for managing WiFi connections on the Rishka system.
The WiFi class offers a set of static methods for connecting to access points, configuring WiFi parameters, managing connection states, and retrieving WiFi-related information.
|
static |
Connects to a WiFi network.
ssid | The SSID of the WiFi network. |
passkey | The password of the WiFi network. |
channel | The WiFi channel to connect to (optional; defaults to 0 for automatic channel selection). |
bssid | The BSSID of the access point (optional; defaults to nullptr). |
This method attempts to connect to the specified WiFi network using the provided SSID and passkey. Optionally, the channel and BSSID can be specified for more precise control over the connection.
|
static |
Disconnects from the current WiFi network.
wifi_off | If true, turns off the WiFi module after disconnecting. |
erase_ap | If true, erases the saved access point data after disconnecting. |
This method disconnects from the current WiFi network. Optionally, the WiFi module can be turned off and the saved access point data can be erased.
|
static |
Erases the saved access point data from memory.
This method erases the saved access point data from the device's memory.
|
static |
Checks if the auto-reconnect feature is enabled.
This method returns the status of the auto-reconnect feature.
|
static |
|
static |
|
static |
|
static |
|
static |
Sets the auto-reconnect feature.
auto_recon | If true, enables auto-reconnect; otherwise, disables it. |
This method enables or disables the auto-reconnect feature, which automatically attempts to reconnect to the WiFi network after a disconnection.
|
static |
|
static |
|
static |
|
static |
|
static |
Sets the method for sorting access points in the scan list.
sort_method | The sort method to use (e.g., by signal strength, by security). |
This method configures how the WiFi module sorts the access points found during a scan.
|
static |
|
static |
Waits for a WiFi connection result within the specified timeout period.
timeout | The timeout period in milliseconds. |
This method waits for the result of the WiFi connection attempt, blocking the thread for the specified timeout period. It returns the connection status after the wait period.