SimpleOTA client v1.2.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_boot.h
Go to the documentation of this file.
1
7#ifndef SOTA_BOOT_H
8#define SOTA_BOOT_H
9
10#include <stdbool.h>
11#include <stdint.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
18#if defined(__cplusplus) && __cplusplus >= 201103L
19#define SOTA_NORETURN [[noreturn]]
20#elif defined(__GNUC__)
21#define SOTA_NORETURN __attribute__((noreturn))
22#else
23#define SOTA_NORETURN
24#endif
25
27#define SOTA_IMAGE_ID_LEN 16u
28
30typedef struct {
34 char image_id[SOTA_IMAGE_ID_LEN + 1];
35 uint32_t running_part;
36 uint32_t boot_part;
38 bool pending;
40
43
45bool sota_boot_slot_invalid(uint32_t part);
46
48bool sota_boot_set(uint32_t part);
49
53
59SOTA_NORETURN void sota_boot_rollback(uint32_t prev_part);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif /* SOTA_BOOT_H */
bool sota_boot_set(uint32_t part)
Boot the slot at part from the next reset on.
#define SOTA_IMAGE_ID_LEN
Hex characters of an image fingerprint.
Definition sota_boot.h:27
bool sota_boot_slot_invalid(uint32_t part)
True when the bootloader has marked the slot at part invalid.
void sota_boot_rollback(uint32_t prev_part)
Leave the running image for the one at prev_part and restart: through the bootloader when it holds th...
void sota_boot_info(sota_boot_info_t *info)
Fill info with this boot's facts.
bool sota_boot_mark_valid(void)
Tell the bootloader the running image is good.
#define SOTA_NORETURN
Marks a function that does not return, in C and C++.
Definition sota_boot.h:23
This boot, as the bootloader left it.
Definition sota_boot.h:30
bool pending
The bootloader holds the running image on probation.
Definition sota_boot.h:38
uint32_t boot_part
The slot the next boot selects.
Definition sota_boot.h:36
uint32_t running_part
The running slot's flash address.
Definition sota_boot.h:35
int reset_reason
esp_reset_reason_t, see SOTA_RST_* in sota_trial.h.
Definition sota_boot.h:37