Wi-Fi management interface. More...
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | hw_wifi_network_t |
Describes a discovered Wi‑Fi network (scan result). More... | |
Macros | |
#define | HW_WIFI_SSID_MAX_LENGTH 32 |
Typedefs | |
typedef struct hw_wifi_t | hw_wifi_t |
typedef void(* | hw_wifi_callback_t) (hw_wifi_t *wifi, hw_wifi_event_t event, const hw_wifi_network_t *network, void *user_data) |
Callback invoked for Wi‑Fi operation notifications. More... | |
Enumerations | |
enum | hw_wifi_auth_t { hw_wifi_auth_open = (1 << 0), hw_wifi_auth_wep = (1 << 1), hw_wifi_auth_wpa_tkip = (1 << 2), hw_wifi_auth_wpa_aes = (1 << 3), hw_wifi_auth_wpa2_tkip = (1 << 4), hw_wifi_auth_wpa2_aes = (1 << 5), hw_wifi_auth_wpa3_sae = (1 << 6), hw_wifi_auth_enterprise = (1 << 7) } |
Authentication and cipher modes for Wi‑Fi networks. More... | |
enum | hw_wifi_event_t { hw_wifi_event_scan = (1 << 0), hw_wifi_event_joining = (1 << 1), hw_wifi_event_connected = (1 << 2), hw_wifi_event_disconnected = (1 << 3), hw_wifi_event_badauth, hw_wifi_event_notfound = (1 << 5), hw_wifi_event_error = (1 << 6) } |
Callback events. More... | |
Functions | |
hw_wifi_t * | hw_wifi_init (const char *country_code, hw_wifi_callback_t callback, void *user_data) |
Initialize Wi-Fi management. More... | |
bool | hw_wifi_valid (hw_wifi_t *wifi) |
Determine if the Wi-Fi handle is initialized and usable. More... | |
void | hw_wifi_finalize (hw_wifi_t *wifi) |
Finalize and release any resources. More... | |
bool | hw_wifi_scan (hw_wifi_t *wifi) |
Begin an asynchronous scan for nearby Wi‑Fi networks. More... | |
bool | hw_wifi_connect (hw_wifi_t *wifi, const hw_wifi_network_t *network, const char *password) |
Begin an asynchronous connection to a Wi‑Fi network. More... | |
bool | hw_wifi_disconnect (hw_wifi_t *wifi) |
Disconnect from a previously-connected Wi‑Fi network. More... | |
Wi-Fi management interface.
Definition in file wifi.h.
typedef void(* hw_wifi_callback_t) (hw_wifi_t *wifi, hw_wifi_event_t event, const hw_wifi_network_t *network, void *user_data) |
Callback invoked for Wi‑Fi operation notifications.
wifi | The Wi‑Fi handle associated with the operation. |
event | The event type (see hw_wifi_event_t). |
network | When event is hw_wifi_event_scan, this contains a pointer to the current scan result, or NULL to indicate the scan operation has completed. |
user_data | Opaque user pointer supplied when the operation started. |
This callback is used when connecting or disconnecting from a network, and when scanning for networks.