Aquarium Cooling Controller
ESP32 firmware for aquarium cooling fan control, monitoring, telemetry, and fault handling.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OtaUploadServer Class Reference

Hosts a short-lived HTTP form for uploading firmware binaries. More...

#include <ota_upload_server.h>

Public Member Functions

 OtaUploadServer ()
 Creates a disabled OTA upload server.
 
void begin (const char *firmwareName, const char *firmwareVersion, const char *firmwareIdentityTag, const char *firmwareVersionTag)
 Configures HTTP routes and firmware identity strings.
 
void update (uint32_t nowMs)
 Handles HTTP clients and closes timed-out upload windows.
 
bool enable (uint32_t nowMs, Stream &out)
 Opens the temporary OTA upload window.
 
void cancel (Stream &out)
 Cancels any active OTA upload window.
 
void printStatus (Stream &out) const
 Prints OTA upload status to a stream.
 
bool active () const
 Indicates whether the upload server is accepting or handling uploads.
 
OtaUploadState state () const
 Returns the current OTA upload state.
 
const char * statusLabel () const
 Returns a stable text label for the current OTA upload state.
 
const char * lastMessage () const
 Returns the latest OTA status message.
 

Detailed Description

Hosts a short-lived HTTP form for uploading firmware binaries.

Member Function Documentation

◆ active()

bool OtaUploadServer::active ( ) const

Indicates whether the upload server is accepting or handling uploads.

Returns
True when the server is armed or uploading.

◆ begin()

void OtaUploadServer::begin ( const char *  firmwareName,
const char *  firmwareVersion,
const char *  firmwareIdentityTag,
const char *  firmwareVersionTag 
)

Configures HTTP routes and firmware identity strings.

Parameters
firmwareNameFirmware product name shown in upload pages.
firmwareVersionFirmware version shown in upload pages.
firmwareIdentityTagNull-terminated firmware product marker that must exist inside uploaded images.
firmwareVersionTagNull-terminated firmware version marker that must exist inside uploaded images.

◆ cancel()

void OtaUploadServer::cancel ( Stream &  out)

Cancels any active OTA upload window.

Parameters
outStream used for status messages.

◆ enable()

bool OtaUploadServer::enable ( uint32_t  nowMs,
Stream &  out 
)

Opens the temporary OTA upload window.

Parameters
nowMsCurrent monotonic timestamp in milliseconds.
outStream used for status messages.
Returns
True when the upload window is active.

◆ lastMessage()

const char * OtaUploadServer::lastMessage ( ) const

Returns the latest OTA status message.

Returns
Last OTA message string.

◆ printStatus()

void OtaUploadServer::printStatus ( Stream &  out) const

Prints OTA upload status to a stream.

Parameters
outDestination stream.

◆ state()

OtaUploadState OtaUploadServer::state ( ) const

Returns the current OTA upload state.

Returns
Current upload state.

◆ statusLabel()

const char * OtaUploadServer::statusLabel ( ) const

Returns a stable text label for the current OTA upload state.

Returns
Current upload state label.

◆ update()

void OtaUploadServer::update ( uint32_t  nowMs)

Handles HTTP clients and closes timed-out upload windows.

Parameters
nowMsCurrent monotonic timestamp in milliseconds.

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