Hosts a short-lived HTTP form for uploading firmware binaries.
More...
#include <ota_upload_server.h>
|
|
| 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.
|
| |
Hosts a short-lived HTTP form for uploading firmware binaries.
◆ 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
-
| firmwareName | Firmware product name shown in upload pages. |
| firmwareVersion | Firmware version shown in upload pages. |
| firmwareIdentityTag | Null-terminated firmware product marker that must exist inside uploaded images. |
| firmwareVersionTag | Null-terminated firmware version marker that must exist inside uploaded images. |
◆ cancel()
| void OtaUploadServer::cancel |
( |
Stream & |
out | ) |
|
Cancels any active OTA upload window.
- Parameters
-
| out | Stream used for status messages. |
◆ enable()
| bool OtaUploadServer::enable |
( |
uint32_t |
nowMs, |
|
|
Stream & |
out |
|
) |
| |
Opens the temporary OTA upload window.
- Parameters
-
| nowMs | Current monotonic timestamp in milliseconds. |
| out | Stream 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
-
◆ state()
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
-
| nowMs | Current monotonic timestamp in milliseconds. |
The documentation for this class was generated from the following files: