SimpleOTA client v1.2.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_runner.h
Go to the documentation of this file.
1
8#ifndef SOTA_RUNNER_H
9#define SOTA_RUNNER_H
10
11#include <stdbool.h>
12#include <stdint.h>
13
14#include "sota_engine.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
22typedef struct {
25 bool (*is_connected)(void *ctx);
26 void *ctx;
27 uint32_t stack_size;
28 unsigned priority;
29 void *volatile task;
30 volatile bool stop;
32
34bool sota_runner_start(sota_runner_t *r, const char *name);
35
42bool sota_runner_stop(sota_runner_t *r, uint32_t timeout_ms);
43
50
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* SOTA_RUNNER_H */
The update engine both clients run: boot validation, check-ins, applying an update,...
bool sota_runner_on_task(const sota_runner_t *r)
The calling code runs on the runner's task.
bool sota_runner_stop(sota_runner_t *r, uint32_t timeout_ms)
Ask the task to stop after its current step, so a download or flash write is never cut short,...
void sota_runner_wake(sota_runner_t *r)
For sota_app_wake(): wake the task to check now or handle the confirm timeout.
bool sota_runner_start(sota_runner_t *r, const char *name)
Start the task, if it is not running.
One engine's state.
Definition sota_engine.h:81
The managed task's settings and state.
Definition sota_runner.h:22
volatile bool stop
Private: asked to stop.
Definition sota_runner.h:30
unsigned priority
The task's priority.
Definition sota_runner.h:28
void *volatile task
Private: the running task, or NULL.
Definition sota_runner.h:29
uint32_t stack_size
Also for the rollback task without a runner.
Definition sota_runner.h:27
uint32_t initial_delay_ms
Before the first check, unless a confirm timeout is due.
Definition sota_runner.h:24
void * ctx
Passed to is_connected.
Definition sota_runner.h:26
sota_engine_t * engine
The engine it drives.
Definition sota_runner.h:23