FastLED 3.10.8
Loading...
Searching...
No Matches
fl::net::OTA Class Reference

Detailed Description

OTA (Over-The-Air) update manager for ESP32 platforms.

Provides a unified interface for enabling OTA firmware updates via Arduino IDE (port 3232) and web browser (HTTP POST at "/"). Handles network setup (Wi-Fi), mDNS registration, and authentication automatically.

Definition at line 124 of file ota.h.

#include <ota.h>

+ Collaboration diagram for fl::net::OTA:

Public Types

using ErrorCallback = fl::function<void(const char* message)>
 Callback function type for OTA errors.
 
using ProgressCallback = fl::function<void(size_t written, size_t total)>
 Callback function type for OTA progress updates.
 
using StateCallback = fl::function<void(u8 state)>
 Callback function type for OTA state changes.
 

Public Member Functions

 OTA () FL_NO_EXCEPT
 Default constructor (lazy initialization)
 
 ~OTA () FL_NO_EXCEPT
 Destructor - cleans up resources.
 
bool begin (const char *hostname, const char *password) FL_NO_EXCEPT
 Start OTA services only (network already configured)
 
bool beginWiFi (const char *hostname, const char *password, const char *ssid, const char *wifi_pass) FL_NO_EXCEPT
 Start OTA with full Wi-Fi setup (station mode)
 
bool enableApFallback (const char *ap_ssid, const char *ap_pass=nullptr) FL_NO_EXCEPT
 Enable AP (Access Point) fallback mode if Wi-Fi STA connection fails.
 
u8 getFailedServices () const FL_NO_EXCEPT
 Get bitmask of services that failed to initialize.
 
bool isConnected () const FL_NO_EXCEPT
 Check if WiFi is connected.
 
void onBeforeReboot (void(*callback)()) FL_NO_EXCEPT
 Set callback to be called before device reboots after OTA update.
 
void onError (ErrorCallback callback) FL_NO_EXCEPT
 Set error callback (called on OTA errors)
 
void onProgress (ProgressCallback callback) FL_NO_EXCEPT
 Set progress callback (called during firmware upload)
 
void onState (StateCallback callback) FL_NO_EXCEPT
 Set state callback (called on state transitions)
 
void poll () FL_NO_EXCEPT
 Poll OTA handlers (must be called regularly in loop())
 

Private Attributes

fl::shared_ptr< fl::platforms::IOTA > mImpl
 

The documentation for this class was generated from the following files: