|
ESPectre SDK 2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
|
The firmware-update seam. More...
#include <ota_service.h>
Public Types | |
| using | StatusCallback = std::function<void(const EspectreOtaStatus &)> |
| Update progressed. | |
| using | PrepareForUpdateCallback = std::function<void()> |
| Last chance to quiesce before the download starts. | |
Public Member Functions | |
| virtual | ~IOtaService ()=default |
| virtual void | loop ()=0 |
| Advance service work from the frontend loop. | |
| virtual void | shutdown ()=0 |
| Abandon any operation in flight and release resources. | |
| virtual bool | start_check (const std::string ¤t_version)=0 |
| Ask whether a newer release exists, without downloading it. | |
| virtual bool | start_check (const std::string ¤t_version, const std::string &channel) |
| Same as start_check(current_version), with an optional release channel. | |
| virtual bool | start_update (const std::string ¤t_version)=0 |
| Download and apply an update, then schedule the reboot. | |
| virtual bool | start_update (const std::string ¤t_version, const std::string &channel) |
| Same as start_update(current_version), with an optional release channel. | |
| virtual EspectreOtaStatus | status () const =0 |
| Current status. | |
| virtual void | set_status_callback (StatusCallback callback)=0 |
| Install the progress handler. | |
| virtual void | set_prepare_for_update_callback (PrepareForUpdateCallback callback)=0 |
| Install the pre-download hook. | |
The firmware-update seam.
Implement it to drive updates through your own distribution channel, or use the shipped HttpsOtaService (ota_service_https.h), which resolves a release manifest over HTTPS and applies the image with esp_https_ota. Frontends expose the result over their operational transport and never talk to the underlying stack themselves. Native uses MQTT for this surface.
Definition at line 40 of file ota_service.h.
| using espectre::IOtaService::StatusCallback = std::function<void(const EspectreOtaStatus &)> |
Update progressed.
The argument is the new status, valid for the call.
Definition at line 43 of file ota_service.h.
| using espectre::IOtaService::PrepareForUpdateCallback = std::function<void()> |
Last chance to quiesce before the download starts.
See below.
Definition at line 45 of file ota_service.h.
|
virtualdefault |
|
pure virtual |
Advance service work from the frontend loop.
Implementations may do blocking work on a private task, but loop() owns callback delivery and other interaction with the frontend.
|
pure virtual |
Abandon any operation in flight and release resources.
Safe to repeat.
|
pure virtual |
Ask whether a newer release exists, without downloading it.
| current_version | Version to compare against, normally espectre_firmware_version(). Empty is reported as "unknown". |
|
inlinevirtual |
Same as start_check(current_version), with an optional release channel.
| current_version | Version to compare against, normally espectre_firmware_version(). Empty is reported as "unknown". |
| channel | release, preview, or develop. Empty keeps the implementation default. |
Definition at line 78 of file ota_service.h.
|
pure virtual |
Download and apply an update, then schedule the reboot.
Performs its own check first, so calling start_check() beforehand is optional. The prepare callback fires once the target is resolved and before the download begins: that is where you call RuntimeFrontendController::quiesce_for_ota() and stop your own traffic.
|
inlinevirtual |
Same as start_update(current_version), with an optional release channel.
| current_version | Version to compare against, normally espectre_firmware_version(). Empty is reported as "unknown". |
| channel | release, preview, or develop. Empty keeps the implementation default. |
Definition at line 106 of file ota_service.h.
|
pure virtual |
Current status.
Safe to call from any task, including while an update runs.
|
pure virtual |
Install the progress handler.
Set it before starting an operation.
|
pure virtual |
Install the pre-download hook.
Set it before calling start_update().