wifi working tested on hardware

This commit is contained in:
Adolfo Reyna
2025-12-10 08:09:38 -05:00
parent 47956bf64c
commit 65650a7b57
8 changed files with 305 additions and 25 deletions

44
wifi_manager.h Normal file
View 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