#pragma once #include #include #include "key_value_store.h" namespace roro::system_info { // Why the chip last started: "power-on", "panic", "task watchdog", "brownout"... const char* resetReason(); // True if the last start was a crash or a watchdog, not a power-on or a deliberate restart. bool resetWasCrash(); // Firmware, uptime and memory, one fact per line. void printSystem(Print& out); // Both app slots: which one runs, which boots next, and each one's version and OTA state. Versions // come from NVS ("ver_"): the prebuilt framework stamps every image with its own version. void printSlots(Print& out, KeyValueStore& store); // Remembers which version the running slot holds (call at boot), or the slot an update just wrote. void recordSlotVersion(KeyValueStore& store, const esp_partition_t* slot, const char* version); // FreeRTOS tasks: state, priority, lowest free stack, CPU share since boot. void printTasks(Print& out); // Boots the firmware in the other app slot if it holds a valid image (a manual Rollback). // Returns an error message; on success it restarts and doesn't return. const char* bootOtherSlot(); } // namespace roro::system_info