| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /*
- * ConfigManager.h
- *
- * Created on: 21.06.2026
- * Author: FSmilari
- */
-
- #ifndef CONFIGMANAGER_H_
- #define CONFIGMANAGER_H_
-
- #include <Arduino.h>
- #include <EEPROM.h>
- #include "LEDModes.h"
-
- #define CONFIG_VERSION 1
-
- typedef struct __attribute__((packed)) {
- uint8_t r;
- uint8_t g;
- uint8_t b;
- uint8_t w;
- } RGBWColor;
-
- typedef struct __attribute__((packed)) {
- uint8_t version;
-
- char ssid[32];
- char pass[64];
- bool wifiValid;
- LEDModes mode;
- uint8_t brightness;
- RGBWColor color;
- } Config;
-
- class ConfigManager {
-
- public:
- ConfigManager();
- virtual ~ConfigManager();
-
- bool loadConfig();
- bool saveConfig(const Config &config);
- void resetConfig();
- Config& setToDefaultConfig();
- Config& getConfig();
-
- private:
- Config _config;
- };
-
- #endif /* CONFIGMANAGER_H_ */
|