49#define SOTA_VERSION_MAX 64u
51#define SOTA_HASH_HEX_LEN 64u
91 uint32_t new_part, uint32_t prev_part,
92 const char *deployment);
Delivery and polling policy for deferred status reports.
bool sota_state_set_identity(const sota_identity_t *id)
Write the live identity.
bool sota_state_set_image_id(const char *image_id)
Note the image the live identity runs on.
bool sota_state_end_trial(void)
The trial passed: sota_trial goes, and what is left reads as an update applied without a trial,...
bool sota_state_drop_trial(void)
Remove the trial record and its report context.
bool sota_state_accept_update(const sota_identity_t *next, const char *deployment)
An update applied without a trial (rollback disabled): the new identity goes live,...
bool sota_state_save_outbox(const sota_outbox_t *box)
Store the outbox, or remove it when empty.
bool sota_state_mark_rolled_back(const sota_state_t *st, const char *reason)
The trial is being rolled back: the previous identity goes live, and sota_trial becomes 2 with the re...
bool sota_state_unstage(void)
The boot slot now points at the new image: remove sota_staged.
#define SOTA_VERSION_MAX
Longest version label stored.
Definition sota_state.h:49
bool sota_state_mark_booted(void)
The new image has booted: its next reset ends the trial.
void sota_state_load(sota_state_t *st)
Load the state.
void sota_state_load_outbox(sota_outbox_t *box)
Load the outbox; an empty one when none is stored or it is not valid.
#define SOTA_HASH_HEX_LEN
sha256 in hex.
Definition sota_state.h:51
bool sota_state_stage_trial(const sota_identity_t *prev, const sota_identity_t *next, uint32_t new_part, uint32_t prev_part, const char *deployment)
Write the trial record before the boot slot switches, so a bootable new image always has one: sota_st...
What the device reports itself as running.
Definition sota_state.h:55
uint32_t build
SimpleOTA build number, 0 for none.
Definition sota_state.h:56
The outbox, oldest report first.
Definition sota_report.h:136
Everything persisted except the outbox, as loaded at boot.
Definition sota_state.h:62
uint8_t conf_pend
sota_conf_pend
Definition sota_state.h:71
uint32_t report_build
sota_fail_build
Definition sota_state.h:70
uint8_t trial
sota_trial, 0 when missing.
Definition sota_state.h:64
uint32_t new_part
sota_new_part: the update's slot.
Definition sota_state.h:66
sota_identity_t live
sota_build, sota_hash, sota_version: what runs.
Definition sota_state.h:63
uint8_t staged
sota_staged, 0 when missing.
Definition sota_state.h:65
sota_identity_t prev
sota_prev_*: the identity a rollback restores.
Definition sota_state.h:68
uint32_t prev_part
sota_prev_part: the previous image's slot.
Definition sota_state.h:67