#include "aes67_health.h" #include "aes67_web.h" #include "esp_app_desc.h" #include "esp_heap_caps.h" #include "esp_timer.h" static void health_status(cJSON *st) { cJSON_AddStringToObject(st, "fw", esp_app_get_description()->version); cJSON_AddNumberToObject(st, "uptime_s", (double)(esp_timer_get_time() / 1000000)); cJSON_AddNumberToObject(st, "heap_free", heap_caps_get_free_size(MALLOC_CAP_INTERNAL)); cJSON_AddNumberToObject(st, "psram_free", heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); } esp_err_t aes67_health_init(void) { return status_register(health_status); }