2023-04-06 08:28:01 +02:00
|
|
|
#ifndef CONFIG_H_
|
|
|
|
#define CONFIG_H_
|
|
|
|
|
|
|
|
#include "FS.h"
|
|
|
|
#include "LittleFS.h"
|
2023-04-11 07:35:27 +02:00
|
|
|
#include <ArduinoJson.h>
|
2023-04-06 08:28:01 +02:00
|
|
|
|
2023-04-11 07:35:27 +02:00
|
|
|
typedef struct {
|
2023-04-06 08:28:01 +02:00
|
|
|
const char *ssid;
|
|
|
|
const char *psk;
|
|
|
|
const char *mqtt_host;
|
|
|
|
const char *mqtt_user;
|
|
|
|
const char *mqtt_password;
|
|
|
|
const char *topic;
|
|
|
|
const char *device_id;
|
2023-04-11 07:35:27 +02:00
|
|
|
int mqtt_port;
|
2023-04-06 08:28:01 +02:00
|
|
|
long sleep_time;
|
|
|
|
int connection_attempts;
|
2023-04-11 07:35:27 +02:00
|
|
|
} Config;
|
|
|
|
|
|
|
|
void initialize_config(Config *config, StaticJsonDocument<512> json);
|
2023-04-06 08:28:01 +02:00
|
|
|
|
2023-04-11 07:35:27 +02:00
|
|
|
bool load_config_file(const char *file_path, Config *config);
|
2023-04-06 08:28:01 +02:00
|
|
|
|
|
|
|
long minutes_to_microseconds(int minutes);
|
|
|
|
|
|
|
|
#endif // CONFIG_H_
|