🪄 Formats SystemStatus

This commit is contained in:
Rune Harlyk
2024-07-09 20:00:28 +02:00
committed by Rune Harlyk
parent 0ba9ad75b0
commit 03e21beddd
2 changed files with 45 additions and 85 deletions
+22 -23
View File
@@ -24,27 +24,27 @@
#include <esp32-hal.h>
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32"
#endif
#include "esp32/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32"
#endif
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-S2"
#endif
#include "esp32/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-S2"
#endif
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-C3"
#endif
#include "esp32c3/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-C3"
#endif
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-S3"
#endif
#include "esp32s3/rom/rtc.h"
#ifndef ESP_PLATFORM
#define ESP_PLATFORM "ESP32-S3"
#endif
#else
#error Target CONFIG_IDF_TARGET is not supported
#error Target CONFIG_IDF_TARGET is not supported
#endif
#ifndef ARDUINO_VERSION
@@ -52,20 +52,19 @@
#define STRINGIZE(s) #s
#endif
#define ARDUINO_VERSION_STR(major, minor, patch) "v" STRINGIZE(major) "." STRINGIZE(minor) "." STRINGIZE(patch)
#define ARDUINO_VERSION ARDUINO_VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH)
#define ARDUINO_VERSION \
ARDUINO_VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH)
#endif
#define SYSTEM_STATUS_SERVICE_PATH "/api/systemStatus"
class SystemStatus
{
public:
class SystemStatus {
public:
SystemStatus(PsychicHttpServer *server, SecurityManager *securityManager);
void begin();
private:
private:
PsychicHttpServer *_server;
SecurityManager *_securityManager;
esp_err_t systemStatus(PsychicRequest *request);