wifi working tested on hardware
This commit is contained in:
44
wifi_manager.h
Normal file
44
wifi_manager.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef WIFI_MANAGER_H
|
||||
#define WIFI_MANAGER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* Initializes the WiFi hardware.
|
||||
* Returns true on success.
|
||||
*/
|
||||
bool wifi_init();
|
||||
|
||||
/**
|
||||
* Scans for available WiFi networks and prints them to stdout.
|
||||
*/
|
||||
void wifi_scan();
|
||||
|
||||
/**
|
||||
* Connects to the specified WiFi network.
|
||||
* Returns true if connected successfully.
|
||||
*/
|
||||
bool wifi_connect(const char* ssid, const char* password);
|
||||
|
||||
/**
|
||||
* Saves the WiFi credentials to flash memory for auto-connect.
|
||||
*/
|
||||
void wifi_save_credentials(const char* ssid, const char* password);
|
||||
|
||||
/**
|
||||
* Attempts to connect using saved credentials.
|
||||
* Returns true if connected.
|
||||
*/
|
||||
bool wifi_try_auto_connect();
|
||||
|
||||
/**
|
||||
* Returns true if currently connected to WiFi.
|
||||
*/
|
||||
bool wifi_is_connected();
|
||||
|
||||
/**
|
||||
* Returns the current IP address as a string, or "Disconnected".
|
||||
*/
|
||||
const char* wifi_get_ip();
|
||||
|
||||
#endif // WIFI_MANAGER_H
|
||||
Reference in New Issue
Block a user