19#ifndef PROTOCORE_OTA_ROLLBACK_H
20#define PROTOCORE_OTA_ROLLBACK_H
24#if PROTOCORE_ENABLE_OTA_ROLLBACK
30#define PROTOCORE_OTA_IMG_NEW 0
31#define PROTOCORE_OTA_IMG_PENDING_VERIFY 1
32#define PROTOCORE_OTA_IMG_VALID 2
33#define PROTOCORE_OTA_IMG_INVALID 3
34#define PROTOCORE_OTA_IMG_ABORTED 4
35#define PROTOCORE_OTA_IMG_UNDEFINED 0xFF
40 PROTOCORE_OTA_WAIT = 0,
41 PROTOCORE_OTA_COMMIT = 1,
42 PROTOCORE_OTA_ROLLBACK = 2,
43} protocore_ota_action;
54 uint32_t ms_since_boot;
78 OtaDecideArgs decide_args;
80 protocore_ota_action action;
85extern OtaRollbackVars OtaRollbackV;
90 void (*
const decide)(uint8_t *work);
91 void (*
const state)(uint8_t *work);
92 void (*
const commit)(uint8_t *work);
93 void (*
const rollback)(uint8_t *work);
94 void (*
const tick)(uint8_t *work);
99void protocore_ota_rollback_decide(uint8_t *work);
100void protocore_ota_rollback_state(uint8_t *work);
101void protocore_ota_rollback_commit(uint8_t *work);
102void protocore_ota_rollback_rollback(uint8_t *work);
103void protocore_ota_rollback_tick(uint8_t *work);
109static const OtaRollbackNs OtaRollback __attribute__((unused)) = {
110 .decide = protocore_ota_rollback_decide,
111 .state = protocore_ota_rollback_state,
112 .commit = protocore_ota_rollback_commit,
113 .rollback = protocore_ota_rollback_rollback,
114 .tick = protocore_ota_rollback_tick,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS