SimpleOTA client v1.0.1
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_sys.h
Go to the documentation of this file.
1
8#ifndef SOTA_SYS_H
9#define SOTA_SYS_H
10
11#include <stdbool.h>
12#include <stdint.h>
13
14#include "sota_boot.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct sota_engine;
21
23void sota_sys_sleep_ms(uint32_t ms);
24
26uint32_t sota_sys_now_ms(void);
27
30void sota_sys_lock(void);
31void sota_sys_unlock(void);
38bool sota_sys_timer_start(void **timer, uint32_t seconds, struct sota_engine *e);
39
41void sota_sys_timer_stop(void **timer);
42
48bool sota_sys_wdt_arm(uint32_t confirm_s, uint32_t floor_s);
49
52
56
58uint32_t sota_sys_random(void);
59
62
64#define SOTA_DEVICE_ID_LEN 18
65
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* SOTA_SYS_H */
Which image runs and which boots next.
#define SOTA_NORETURN
Marks a function that does not return, in C and C++.
Definition sota_boot.h:23
void sota_sys_wdt_disarm(void)
Stop the watchdog if sota_sys_wdt_arm() started it.
void sota_sys_wdt_quiesce(void)
At boot, before a trial may arm it again: stop a watchdog a reset left running.
void sota_sys_timer_stop(void **timer)
Stop and free the timer, if *timer holds one.
void sota_sys_default_device_id(char out[18])
The device ID used when the application gives none: the Wi-Fi station MAC as "aa:bb:cc:dd:ee:ff",...
uint32_t sota_sys_random(void)
32 random bits, to spread the fleet's check-ins.
void sota_sys_restart(void)
Restart the chip.
uint32_t sota_sys_now_ms(void)
Milliseconds since boot; wraps.
bool sota_sys_wdt_arm(uint32_t confirm_s, uint32_t floor_s)
Arm the chip watchdog for confirm_s plus a margin of at least floor_s (sota_wdt_calc....
bool sota_sys_timer_start(void **timer, uint32_t seconds, struct sota_engine *e)
Start a one-shot timer that calls sota_engine_timeout_fired(e) after seconds.
void sota_sys_unlock(void)
One lock for every engine.
#define SOTA_DEVICE_ID_LEN
Length of sota_sys_default_device_id()'s string, with its NUL.
Definition sota_sys.h:64
void sota_sys_sleep_ms(uint32_t ms)
Block the calling task for ms milliseconds.
void sota_sys_lock(void)
One lock for every engine.