Allocate necessary memory for struct members

This commit is contained in:
2023-04-11 07:35:27 +02:00
parent 92eeb0a638
commit 36c83f8dee
5 changed files with 45 additions and 57 deletions

View File

@@ -3,21 +3,24 @@
#include "FS.h"
#include "LittleFS.h"
#include <ArduinoJson.h>
struct Config {
typedef struct {
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;
int mqtt_port;
long sleep_time;
int connection_attempts;
};
} Config;
bool load_config_file(const char *file_path, struct Config &config);
void initialize_config(Config *config, StaticJsonDocument<512> json);
bool load_config_file(const char *file_path, Config *config);
long minutes_to_microseconds(int minutes);