Load credentials and settings from config file

This commit is contained in:
2023-04-06 08:28:01 +02:00
parent 37e249a503
commit 92eeb0a638
8 changed files with 109 additions and 29 deletions

24
include/config.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef CONFIG_H_
#define CONFIG_H_
#include "FS.h"
#include "LittleFS.h"
struct Config {
const char *ssid;
const char *psk;
const char *mqtt_host;
const char *mqtt_user;
const char *mqtt_password;
int mqtt_port;
const char *topic;
const char *device_id;
long sleep_time;
int connection_attempts;
};
bool load_config_file(const char *file_path, struct Config &config);
long minutes_to_microseconds(int minutes);
#endif // CONFIG_H_