5#include "platforms/ota.h"
26 mImpl = platforms::IOTA::create();
28 return mImpl->beginWiFi(hostname, password, ssid, wifi_pass);
33 mImpl = platforms::IOTA::create();
35 return mImpl->begin(hostname, password);
40 mImpl = platforms::IOTA::create();
42 return mImpl->enableApFallback(ap_ssid, ap_pass);
47 mImpl = platforms::IOTA::create();
49 mImpl->onProgress(callback);
54 mImpl = platforms::IOTA::create();
56 mImpl->onError(callback);
61 mImpl = platforms::IOTA::create();
63 mImpl->onState(callback);
68 mImpl = platforms::IOTA::create();
70 mImpl->onBeforeReboot(callback);
75 mImpl = platforms::IOTA::create();
84 return mImpl->isConnected();
91 return mImpl->getFailedServices();
void onProgress(ProgressCallback callback) FL_NO_EXCEPT
Set progress callback (called during firmware upload)
OTA() FL_NO_EXCEPT
Default constructor (lazy initialization)
u8 getFailedServices() const FL_NO_EXCEPT
Get bitmask of services that failed to initialize.
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.
void onState(StateCallback callback) FL_NO_EXCEPT
Set state callback (called on state transitions)
fl::function< void(const char *message)> ErrorCallback
Callback function type for OTA errors.
void onBeforeReboot(void(*callback)()) FL_NO_EXCEPT
Set callback to be called before device reboots after OTA update.
fl::function< void(size_t written, size_t total)> ProgressCallback
Callback function type for OTA progress updates.
~OTA() FL_NO_EXCEPT
Destructor - cleans up resources.
void poll() FL_NO_EXCEPT
Poll OTA handlers (must be called regularly in loop())
bool isConnected() const FL_NO_EXCEPT
Check if WiFi is connected.
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)
fl::shared_ptr< fl::platforms::IOTA > mImpl
void onError(ErrorCallback callback) FL_NO_EXCEPT
Set error callback (called on OTA errors)
fl::function< void(u8 state)> StateCallback
Callback function type for OTA state changes.
bool begin(const char *hostname, const char *password) FL_NO_EXCEPT
Start OTA services only (network already configured)
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Base definition for an LED controller.
Minimal, batteries-included OTA (Over-The-Air) update system for ESP32.