141 bool beginWiFi(
const char* hostname,
const char* password,
142 const char* ssid,
const char* wifi_pass);
150 bool begin(
const char* hostname,
const char* password);
void onState(StateCallback callback)
Set state callback (called on state transitions)
bool begin(const char *hostname, const char *password)
Start OTA services only (network already configured)
void onError(ErrorCallback callback)
Set error callback (called on OTA errors)
u8 getFailedServices() const
Get bitmask of services that failed to initialize.
fl::function< void(const char *message)> ErrorCallback
Callback function type for OTA errors.
OTA() FL_NOEXCEPT
Default constructor (lazy initialization)
void poll()
Poll OTA handlers (must be called regularly in loop())
bool isConnected() const
Check if WiFi is connected.
fl::function< void(size_t written, size_t total)> ProgressCallback
Callback function type for OTA progress updates.
bool enableApFallback(const char *ap_ssid, const char *ap_pass=nullptr)
Enable AP (Access Point) fallback mode if Wi-Fi STA connection fails.
~OTA() FL_NOEXCEPT
Destructor - cleans up resources.
void onProgress(ProgressCallback callback)
Set progress callback (called during firmware upload)
bool beginWiFi(const char *hostname, const char *password, const char *ssid, const char *wifi_pass)
Start OTA with full Wi-Fi setup (station mode)
fl::shared_ptr< fl::platforms::IOTA > mImpl
void onBeforeReboot(void(*callback)())
Set callback to be called before device reboots after OTA update.
fl::function< void(u8 state)> StateCallback
Callback function type for OTA state changes.
Service
OTA service initialization status flags.
@ HTTP_FAILED
HTTP server failed to start (Web OTA unavailable)
@ MDNS_FAILED
mDNS initialization failed (device not discoverable at hostname.local)
@ ARDUINO_OTA_FAILED
ArduinoOTA initialization failed (IDE OTA unavailable)
Base definition for an LED controller.