|
SimpleOTA client v1.1.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
|
Time, locking, the confirm timer and the chip watchdog. More...
Go to the source code of this file.
Macros | |
| #define | SOTA_DEVICE_ID_LEN 18 |
| Length of sota_sys_default_device_id()'s string, with its NUL. | |
Functions | |
| void | sota_sys_sleep_ms (uint32_t ms) |
| Block the calling task for ms milliseconds. | |
| uint32_t | sota_sys_now_ms (void) |
| Milliseconds since boot; wraps. | |
| 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_timer_stop (void **timer) |
| Stop and free the timer, if *timer holds one. | |
| 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.h). | |
| 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. | |
| uint32_t | sota_sys_random (void) |
| 32 random bits, to spread the fleet's check-ins. | |
| void | sota_sys_restart (void) |
| Restart the chip. | |
| 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", the same on both clients, so a device keeps its identity when it moves from one to the other. | |
| void | sota_sys_lock (void) |
| One lock for every engine. | |
| void | sota_sys_unlock (void) |
| One lock for every engine. | |
Time, locking, the confirm timer and the chip watchdog.
Implemented by the platform port (FreeRTOS, esp_timer and wdt_hal on ESP32) and the host tests' fake.
| void sota_sys_lock | ( | void | ) |
One lock for every engine.
Never held across a network call.
| void sota_sys_unlock | ( | void | ) |
One lock for every engine.
Never held across a network call.
| 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.
*timer holds the port's handle. False when it could not start.
| 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.h).
Returns true when the deadline was longer than the watchdog can wait and it was clamped.
| uint32_t sota_sys_random | ( | void | ) |
32 random bits, to spread the fleet's check-ins.
Not for secrets.