#ifndef CONFIG_H
#define CONFIG_H

#include <Arduino.h>
#include <FS.h>
#include <ArduinoJson.h>


class LoraConfig {
public:
    long  frequency;
    int   spreadingFactor;
    long  signalBandwidth;
    int   codingRate4;
    int   power;
};

class Config {
    public:
        bool isConfigLoaded = false;
        LoraConfig loraConfig;
        Config();
        void writeData();
        
        void logConfigInfo(JsonDocument& configJson);
    private:
        void readFile(fs::FS &fs, const char *fileName);
        String _filePath;
};

#endif /* CONFIG_H */