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